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