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