windows-smb-dead-vc-gc-on-head-20080801
[openafs.git] / README-NT
1 This software has been released under the terms of the IBM Public
2 License.  For details, see the LICENSE file in the top-level source
3 directory or on-line at http://www.openafs.org/dl/license10.html
4
5 The document now provides a step by step procedure that takes the user 
6 from a basic Windows 2000/XP/2003/Vista/2008 workstation to an OpenAFS 
7 development environment.   Details are provided so that a 'beginning' 
8 windows developer can build an OpenAFS installable package for Windows 
9 2000/XP/2003/Vista/2008.
10
11 NOTE 1:
12 As of the OpenAFS 1.3 release series, Windows platforms released
13 prior to Windows 2000 are no longer supported.  As of the OpenAFS 1.5
14 series, the Windows 9x components are being removed from the source tree.
15
16 ***********   Windows 2000/XP/2003/Vista/2008 Build Process *************
17
18 Building OpenAFS for Windows requires configuring a Windows
19 development system by installing compilation tools and header files.
20 Open AFS Software development can be done on Windows 2000, XP, 2003, 
21 or Vista.  The target system, where OpenAFS will be installed, can be 
22 one of:
23
24  * Windows 2000
25  * Windows XP
26  * Windows XP SP2
27  * Windows 2003 
28  * Windows 2003 SP1
29  * Windows XP 64
30  * Windows 2003 64
31  * Windows 2003 R2 (32 or 64)
32  * Windows Vista (32 or 64)
33  * Windows 2008 (32 or 64)
34
35 The build process is controlled by a nmake file that generates the 
36 necessary binaries and binds them into an install package.
37
38 The following steps describe how to configure Windows 2000/XP:
39
40    A. Obtain a copy of the OpenAFS Source Tree
41    B. Install Compiler and Development tools.
42    C. Install SDK header files
43    D. Configure NTBUILD.BAT
44    E. Set program version Level
45    F. Build the binaries
46    G. Install NSIS 2.30
47    H. Build NSIS Install Package
48    I. Install Wix 2.0.5325
49    J. Build Wix MSI Install Package
50    K. Final Results
51    L. Optional Items
52         
53 The Microsoft development tools require anywhere from 660 MB to 1.8GB
54 of storage depending on which compilers are selected.  The following 
55 versions are supported:
56
57     Microsoft Visual Studio .NET 
58       available via a MSDN subscription
59
60     Microsoft Visual Studio .NET 2003
61       available via a MSDN subscription
62
63     Microsoft Visual Studio .NET 2005
64       available via a MSDN subscription
65       (recommended - required for 64-bit builds)
66
67     Microsoft Visual Studio 2008 is not supported
68
69 The following Microsoft SDK is required:
70
71     Microsoft Platform SDK for Windows Server 2003 SP1 or Vista or 2008
72       http://www.microsoft.com/msdownload/platformsdk/sdkupdate/downlevel.htm [IE required]
73       http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
74
75 The following Microsoft DDK is required:
76
77     Microsoft Windows Server 2003 SP1 DDK
78       available via a MSDN subscription or via free CD
79       http://www.microsoft.com/whdc/devtools/ddk/orderddkcd.mspx
80
81 The Microsoft HTML Help Workshop is required:
82
83     http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
84
85 The Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 is required:
86
87     http://www.microsoft.com/downloads/details.aspx?FamilyId=AD6158D7-DDBA-416A-9109-07607425A815&displaylang=en
88
89 The NSIS installer requires about 14 MB of storage. The following 
90 version is supported:
91
92     Nullsoft Scriptable Installation System 2.30
93       http://nsis.sourceforge.net/home/
94
95 The WiX installer requires about 18 MB of storage.  The following 
96 version is supported:
97
98     Wix 2.0.5325.0
99       http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
100
101 The OpenAFS Source directory requires about 360 MB storage. The Source
102 directory size includes additional space for files that will be
103 generated during the build process.
104
105
106 STEP A. Obtain a copy of the Open AFS Source Tree.
107
108 Transfer OpenAFS source tree onto your hardrive.  The source can be
109 downloaded from the OpenAFS web site:
110         http://www.OpenAFS.org/release/snapindex.html.
111
112 For this example, download source for version 1.5.51 using the
113 following URL:
114 http://www.openafs.org/dl/openafs/1.5.51/openafs-1.5.51-src.tar
115
116 HINT: DailySnapShots are pre-release source trees and much more
117 likely to have compilation errors. If this is your first attempt, do
118 your build based on a release version of the source, e.g. 1.5.51. Once
119 you have completed a build process successfully, you can experiment with
120 other source trees.
121
122 You will need an unzip utility that can expand compressed tar files.
123 For example "Pkzip for Windows" from Pkware will uncompress tar files.
124 (http://www.pkware.com/)
125
126 Expand the downloaded tar file (openafs-1.5.51-src.tar) into target
127 directory (c:\OpenAFS), the unzip routine will expand the source into a
128 subdirectory tree:
129     c:\OpenAFS\OpenAFS-1.5.51\src
130
131 Copy the files 'NTMakefile' and 'ntbuild.bat' from 'src' to the OpenAFS 
132 base directory (aka %AFSROOT%):
133
134   From a DOS command prompt window, enter the following copy commands:
135
136     cd c:\OpenAFS\OpenAFS-1.5.51
137     copy src\NTMakefile .
138     copy src\ntbuild.bat .
139
140
141 The OpenAFS base directory should look something like the following:
142
143   c:\OpenAFS\OpenAFS-1.5.51\
144     NTMakefile
145     ntbuild.bat
146     src
147           
148
149 STEP B. Install compiler and development tools.
150
151 Install a copy of Microsoft Visual Studio .NET, Visual Studio .NET 2003, 
152 or Visual Studio .NET 2005.  Visual Studio 2008 has not been sufficiently
153 tested to be considered "supported".  The "Typical" install setting is 
154 sufficient.
155
156 (1) You can reduce the installation size by selecting "Custom" install
157 and remove all but the following Options:
158
159         Microsoft Visual C++
160         Data Access
161
162 (2) When asked, Select to Register Environment Variables.
163
164
165 STEP C. Install SDK header files.
166
167 Files from Microsoft's Platform SDK for Windows Server 2003 SP1 are
168 required to complete a build on Windows 2000/XP/2003.   At a minimum the
169 following componets are known to be required: 
170
171   * Core
172   * Data Access
173   * Installer
174   * Windows Management Instrumentation
175   * Web Workshop (IE)
176
177 It is advised that you install the entire SDK.  The SDK can be obtained
178 from:
179
180   http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
181
182 by using Internet Explorer 5.x or higher.  (Active X controls are required)
183
184 The header files that are required from a Microsoft SDK/DDK are:
185
186    npapi.h    (Windows 2000,XP,2003 builds)
187    netcfgx.h  (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
188    netcfgn.h  (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
189    normalization.h (AFS Cache Manager)
190
191 These files come from the following Microsoft DDKs/SDKs:
192
193    npapi.h:
194         Windows XP SP2 Platform SDK - include/
195
196    netcfgn.h, netcfgx.h:
197         Windows XP/2003 DDK - inc/wxp/
198
199    normalization.h:
200         Microsoft IDN Mitigation APIs 1.1 - include/
201
202 STEP D. Configure NTBUILD.BAT.
203
204 The NTBUILD.BAT file copied to the OpenAFS base directory must be 
205 customized for use on your development system.  The following variables
206 must be defined to match your configuration:
207
208   AFSVER_CL: Set to 1200 if using MS Visual C++ 6.0
209              Set to 1300 if using MS Visual Studio .NET
210              Set to 1310 if using MS Visual Studio .NET 2003
211              Set to 1400 if using MS Visual Studio .NET 2005
212              Set to 1500 if using MS Visual Studio 2008
213
214   MSVCDIR: Set to the short name version of the directory into which
215            the visual C++ compiler was installed regardless of version
216
217   MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
218
219   MSSDKDIR: Set to the short name of the directory into which
220             the Platform SDK was installed
221
222   NTDDKDIR: Set to the short name of the INC\WNET DDK directory
223
224   NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
225
226   AFSROOT: Set to the short name of the OpenAFS Base directory.  This
227            cannot be set to a UNC path.
228
229   SYS_NAME: One of "i386_w2k" or "amd64_w2k"
230
231   APPVER:   0x500 for Windows 2000 and above; 0x502 for AMD64 systems
232
233   _WIN32_IE: Must match APPVER
234
235   MSVCVer:  Set to 8.0 if using Visual Studio 8
236
237   CODESIGN_DESC: Product Name
238   
239   CODESIGN_TIMESTAMP: Time Stamp Service for Code Signing Certificate
240    
241   CODESIGN_URL: Support URL Displayed to End Users
242
243
244 STEP E. Set version and installation options (optional)
245
246 Add a CellServDB file to install area. CellServDB contains the entries
247 for the various cell names.  You can download a general purpose one
248 from:
249         http://grand.central.org/dl/cellservdb/CellServDB
250 then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
251
252 Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k
253     AFSPRODUCT_VER_MAJOR - Version Major Number
254     AFSPRODUCT_VER_MINOR - Version Minor Number
255     AFSPRODUCT_VER_PATCH - Version Patch Number
256     AFSPRODUCT_VER_BUILD - Version Build Number
257     CELLSERVDB_INSTALL   - The default file name for the CellServDB
258                            included in the install Package.
259     CELLNAME_DEFAULT     - The default home cell name.
260     CELLSERVDB_WEB       - The default web address to obtain CellServDB
261
262 For example: in the file %AFSROOT%\src\config\NTMakefile.i386_w2k you would
263 see the following:
264
265    AFSPRODUCT_VER_MAJOR=1
266    AFSPRODUCT_VER_MINOR=5
267    AFSPRODUCT_VER_PATCH=5100
268    AFSPRODUCT_VER_BUILD=0
269    CELLNAME_DEFAULT=openafs.org
270    CELLSERVDB_INSTALL=CellServDB.GrandCentral
271    CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
272
273 During the Open AFS installation process the user will be presented
274 with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and
275 one that can be downloaded from the web (CELLSERVDB_WEB).
276
277 STEP F. Begin the build
278
279 (1) From Windows 2000/XP/2003 open up a DOS prompt window.
280
281 (2) Change to the %AFSROOT% directory
282
283 (3) Configure the environment variables:
284
285     For a release build (SMB version):
286
287     (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
288         Visual Studio environment you installed.
289
290     (b) Execute the SETENV.BAT file with the parameters "/2000 /RETAIL"
291
292     (c) Execute the NTBUILD.BAT file with the parameter "free"
293
294     For a debug build (SMB version):
295
296     (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
297         Visual Studio environment you installed.
298
299     (b) Execute the SETENV.BAT file with the parameters "/2000 /DEBUG"
300
301     (c) Execute the NTBUILD.BAT file with the parameter "checked"
302
303 (4) Clean the work area:
304
305     nmake /f NTMakefile clean
306
307 (5) Build the complete Windows 2000/XP/2003 development environment.
308
309     nmake /f NTMakefile install
310
311 While the build is running you will see many compile warnings. This
312 behavior is normal; the build process is successful as long as the build
313 process doesn't terminate with an error ("nmake.exe return code 0x2")
314 and it displays 'Build Finished Successfully'.
315
316
317 STEP G. Install NSIS 2.30 (optional).
318
319 Download the Nullsoft Scriptable Installation System (NSIS) 2.30 from
320
321     http://nsis.sourceforge.net/home/
322
323 Run the nsis-2.30.exe installer and install to "C:\Program Files\NSIS".
324 Then download the large strings build zip file and replace the installed 
325 files with the versions from the zip file.  These versions increase 
326 the maximum string length from 1024 characters to 8192 characters.  
327 This is necessary for installation on systems with long PATH environment 
328 strings.
329
330 Note: The NSIS installer can only be used to produce 32-bit installers.
331
332 STEP H.  Build OpenAFS NSIS install package
333
334 From the %AFSROOT% directory execute:
335
336     nmake /f NTMakefile NSIS
337
338
339 STEP I.  Install Wix MSI Installer
340
341 Download the Wix 2.0.5325.0 installer from 
342
343     http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
344
345
346 STEP J.  Build Wix MSI install package
347
348 From the %AFSROOT% directory execute:
349
350     nmake /f NTMakefile wix
351
352 Make sure the binaries installed to \src\wix\release\ship are
353 available in the PATH environment variable
354
355
356 STEP K. Final Results
357
358 The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
359 would look like the following:
360
361 %AFSROOT%\DEST\{checked,free}\
362         bin
363         etc
364         include
365         lib
366         root.client
367         root.server
368         WinInstall
369
370     Bin - contains build utilities.
371     root.client - contains Open AFS binaries
372     root.server - contain Open AFS Server binaries
373     WinInstall\OpenAFSforWindows.exe - is the NSIS install package
374     WinInstall\openafs-en_US.msi - is the WiX MSI install package
375
376
377 STEP L. Optional Items
378
379 The build process has an error table that is compiled for many OpenAFS
380 applications.  This table is generated by Unix based tools.  It is not
381 normally necessary to modify this table so pre-generated source files
382 are included in the OpenAFS source.  If you need to make modifications
383 in these areas the Unix base tools that run on Windows can be found on
384 the web. For example:
385
386         http://cygwin.com/
387
388 Below is a short explanation how to update the error table.
389
390 (1) Install flex and bison from a Unix based tool provider.
391
392 (2) Make changes to the source files.
393
394 There are two files in the source tree that are processed with lex
395 and yacc on UNIX systems, src/comerr/et_lex.lex.l and
396 src/comerr/error_table.y, that when processed produce the files
397 et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.
398
399 Since NT does not include lex and yacc or any equivalent tools, we
400 have provided the output files that lex and yacc produce (using Win32
401 ports of flex and bison). This will allow builds to work for anyone
402 who does not need to change the .l and .y files.
403
404 If you do need to change et_lex.lex.l, then you will need to install
405 Win32 port of flex on your system. Put flex.exe in a directory on the
406 path and rebuild.
407
408 If you do need to change error_table.y, then you will need to install
409 a Win32 port of bison on your system. Put bison.exe in a directory on
410 the path, configure bison as explained in step 5, and rebuild.
411
412 You can also attempt to use other replacements for lex and yacc. This
413 will require modifying the LEX and YACC settings in
414 /config/NTMakefile.i386_nt40. If the replacements require different
415 command line options than flex and bison, then you may also need to
416 change src/comerr/NTMakefile.
417
418 (3) Generate new OpenAFS binaries