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
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.
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.
17 ****** Windows 2000/XP/2003/Vista/2008/Win7/2008-R2 Build Process ******
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
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)
38 The build process is controlled by a nmake file that generates the
39 necessary binaries and binds them into an install package.
41 The following steps describe how to configure the development environment:
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
50 H. Build NSIS Install Package
51 I. Install Wix 2.0.5325
52 J. Build Wix MSI Install Package
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:
60 Microsoft Visual Studio .NET
61 available via a MSDN subscription
63 Microsoft Visual Studio .NET 2003
64 available via a MSDN subscription
66 Microsoft Visual Studio .NET 2005
67 available via a MSDN subscription
68 (used for OpenAFS.org distribution)
70 Microsoft Visual Studio 2008
71 available via a MSDN subscription
73 One of the following Microsoft SDKs is required:
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
79 One of the following Microsoft DDK/WDK is required:
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
85 Microsoft Windows Driver Kit 6.0
86 Microsoft Windows Driver Kit 6.1
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:
93 Built on Windows XP SP3
95 Windows [Platform] SDK 6.0
101 Built on Windows Vista 64-bit SP2
103 Windows [Platform] SDK 6.0
108 These configurations are used because they are the last configurations
109 that still support building for Microsoft Windows 2000.
111 The Microsoft HTML Help Workshop is required:
113 http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
115 The Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 is required:
117 http://www.microsoft.com/downloads/details.aspx?FamilyId=AD6158D7-DDBA-416A-9109-07607425A815&displaylang=en
119 ActiveState Perl 5.10 is required for man-page generation
121 http://www.activestate.com/activeperl/
123 Cygwin is required for Docbook to HTML and Docbook to HTMLHelp conversion
125 http://cygwin.com/setup.exe
127 Doxygen is required for Developer Documentation generation
129 http://www.stack.nl/~dimitri/doxygen/
131 The NSIS installer requires about 14 MB of storage. The following
132 version is supported:
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)
138 The WiX installer requires about 18 MB of storage. The following
139 version is supported:
142 http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
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.
150 STEP A. Obtain a copy of the Open AFS Source Tree.
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.
156 For this example, download source for version 1.5.61 using the
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
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
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/)
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\
175 Copy the files 'NTMakefile' and 'ntbuild.bat' from the 'src'
176 subdirectory to the OpenAFS base directory (aka %AFSROOT%):
178 From a DOS command prompt window, enter the following copy commands:
180 cd c:\OpenAFS\OpenAFS-1.5.61
181 copy src\ntbuild.bat .
183 The OpenAFS base directory should look something like the following:
185 c:\OpenAFS\OpenAFS-1.5.61\
191 STEP B. Install compiler and development tools.
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.
197 (1) You can reduce the installation size by selecting "Custom" install
198 and remove all but the following Options:
203 (2) When asked, Select to Register Environment Variables.
206 STEP C. Install SDK header files.
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 components are known to be required:
215 * Windows Management Instrumentation
218 It is advised that you install the entire SDK. The SDK can be obtained
221 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
223 by using Internet Explorer 5.x or higher. (Active X controls are required)
225 The header files that are required from a Microsoft SDK/WDK are:
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)
232 These files come from the following Microsoft DDKs/SDKs:
235 Windows XP SP2 Platform SDK - include/
237 netcfgn.h, netcfgx.h:
238 Windows XP/2003 DDK - inc/wxp/
241 Microsoft IDN Mitigation APIs 1.1 - include/
243 STEP D. Configure NTBUILD.BAT.
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.
251 The following variables must be defined to match your configuration:
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
259 MSVCDIR: Set to the short name version of the directory into which
260 the visual C++ compiler was installed regardless of version
262 MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
264 MSSDKDIR: Set to the short name of the directory into which
265 the Platform SDK was installed
267 NTDDKDIR: Set to the short name of the INC\WNET DDK directory
269 NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
271 MSIDNNLS: Set the the name of the Microsoft IDN Mitigation APIs 1.1
274 AFSROOT: Set to the short name of the OpenAFS Base directory. This
275 cannot be set to a UNC path.
277 SYS_NAME: One of "i386_w2k" or "amd64_w2k"
279 APPVER: 0x500 for Windows 2000 and above; 0x502 for AMD64 systems
281 _WIN32_IE: Must match APPVER
283 MSVCVer: Set to 8.0 if using Visual Studio 8
285 CODESIGN_DESC: Product Name
287 CODESIGN_TIMESTAMP: Time Stamp Service for Code Signing Certificate
289 CODESIGN_URL: Support URL Displayed to End Users
291 CODESIGN_CROSS_CERT: Path to Microsoft Cross Signing Certificate
295 STEP E. Set version and installation options (optional)
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
300 http://grand.central.org/dl/cellservdb/CellServDB
301 then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
303 Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k or NTMakefile.amd64_w2k
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
315 For example: in the file %AFSROOT%\src\config\NTMakefile.i386_w2k you would
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
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).
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.
336 STEP F. Begin the build
338 (1) From Windows 2000/XP/2003 open up a DOS prompt window.
340 (2) Change to the %AFSROOT% directory
342 (3) Configure the environment variables:
344 For a release build (SMB version):
346 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
347 Visual Studio environment you installed.
349 (b) Execute the SETENV.BAT file with the parameters "/2000 /RETAIL"
351 (c) Execute the NTBUILD.BAT file with the parameter "free"
353 For a debug build (SMB version):
355 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
356 Visual Studio environment you installed.
358 (b) Execute the SETENV.BAT file with the parameters "/2000 /DEBUG"
360 (c) Execute the NTBUILD.BAT file with the parameter "checked"
362 (4) Build the complete Windows 2000/XP/2003 development environment.
364 nmake /f NTMakefile install
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.
372 (5) Before rebuilding you must clean the work area:
374 nmake /f NTMakefile clean
377 STEP G. Install NSIS 2.44 (optional).
379 Download the Nullsoft Scriptable Installation System (NSIS) 2.44 from
381 http://nsis.sourceforge.net/home/
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
390 Note: The NSIS installer can only be used to produce 32-bit installers.
392 STEP H. Build OpenAFS NSIS install package
394 From the %AFSROOT% directory execute:
396 nmake /f NTMakefile NSIS
399 STEP I. Install Wix MSI Installer
401 Download the Wix 2.0.5325.0 installer from
403 http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
406 STEP J. Build Wix MSI install package
408 From the %AFSROOT% directory execute:
410 nmake /f NTMakefile wix
412 Make sure the binaries installed to \src\wix\release\ship are
413 available in the PATH environment variable
416 STEP K. Final Results
418 The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
419 would look like the following:
421 %AFSROOT%\DEST\{checked,free}\
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
437 STEP L. Optional Items
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:
448 Below is a short explanation how to update the error table.
450 (1) Install flex and bison from a Unix based tool provider.
452 (2) Make changes to the source files.
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.
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.
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
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.
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.
478 (3) Generate new OpenAFS binaries