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