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 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
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.
16 *********** Windows 2000/XP/2003/Vista/2008 Build Process *************
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
31 * Windows 2003 R2 (32 or 64)
32 * Windows Vista (32 or 64)
33 * Windows 2008 (32 or 64)
35 The build process is controlled by a nmake file that generates the
36 necessary binaries and binds them into an install package.
38 The following steps describe how to configure Windows 2000/XP:
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
47 H. Build NSIS Install Package
48 I. Install Wix 2.0.5325
49 J. Build Wix MSI Install Package
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:
57 Microsoft Visual Studio .NET
58 available via a MSDN subscription
60 Microsoft Visual Studio .NET 2003
61 available via a MSDN subscription
63 Microsoft Visual Studio .NET 2005 (required for AMD64 builds)
64 available via a MSDN subscription
65 (recommended - required for 64-bit builds)
67 The following Microsoft SDK is required:
69 Microsoft Platform SDK for Windows XP SP2 or Server 2003 SP1 or Vista or 2008
70 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/downlevel.htm [IE required]
71 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
73 The following Microsoft DDK is required:
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
79 The Microsoft HTML Help Workshop is required:
81 http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
83 The NSIS installer requires about 14 MB of storage. The following
86 Nullsoft Scriptable Installation System 2.30
87 http://nsis.sourceforge.net/home/
89 The WiX installer requires about 18 MB of storage. The following
93 http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
95 The InstallShield scripts (although not supported) require version 5.5
96 of InstallShiled. Version 6.0 or higher of InstallShield are not
99 The OpenAFS Source directory requires about 360 MB storage. The Source
100 directory size includes additional space for files that will be
101 generated during the build process.
104 STEP A. Obtain a copy of the Open AFS Source Tree.
106 Transfer OpenAFS source tree onto your hardrive. The source can be
107 downloaded from the OpenAFS web site:
108 http://www.OpenAFS.org/release/snapindex.html.
110 For this example, download source for version 1.3.74 using the
112 http://www.openafs.org/dl/openafs/1.3.74/openafs-1.3.74-src.tar
114 HINT: DailySnapShots are pre-release source trees and much more
115 likely to have compilation errors. If this is your first attempt, do
116 your build based on a release version of the source, e.g. 1.3.74. Once
117 you have completed a build process successfully, you can experiment with
120 You will need an unzip utility that can expand compressed tar files.
121 For example "Pkzip for Windows" from Pkware will uncompress tar files.
122 (http://www.pkware.com/)
124 Expand the downloaded tar file (openafs-1.3.74-src.tar) into target
125 directory (c:\OpenAFS), the unzip routine will expand the source into a
127 c:\OpenAFS\OpenAFS-1.3.74\src
129 Copy the files 'NTMakefile' and 'ntbuild.bat' from 'src' to the OpenAFS
130 base directory (aka %AFSROOT%):
132 From a DOS command prompt window, enter the following copy commands:
134 cd c:\OpenAFS\OpenAFS-1.3.74
135 copy src\NTMakefile .
136 copy src\ntbuild.bat .
139 The OpenAFS base directory should look something like the following:
141 c:\OpenAFS\OpenAFS-1.3.74\
147 STEP B. Install compiler and development tools.
149 Install a copy of Microsoft Visual Studio .NET, Visual Studio .NET 2003,
150 or Visual Studio .NET 2005. The "Typical" install setting is sufficient.
152 (1) You can reduce the installation size by selecting "Custom" install
153 and remove all but the following Options:
158 (2) When asked, Select to Register Environment Variables.
161 STEP C. Install SDK header files.
163 Files from Microsoft's Platform SDK for Windows XP SP2 or Server 2003 are
164 required to complete a build on Windows 2000/XP/2003. You can install
165 the "Core, Data Access and Installer SDKs" from
167 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
169 by using Internet Explorer 5.x or higher. (Active X controls are required)
170 If you do not which to use IE a complete SDK package is available from
172 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
174 The header files that are required from a Microsoft SDK/DDK are:
176 npapi.h (Windows 2000,XP,2003 builds)
177 netcfgx.h (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
178 netcfgn.h (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
180 These files come from the following Microsoft DDKs/SDKs:
183 Windows XP SP2 Platform SDK - include/
185 netcfgn.h, netcfgx.h:
186 Windows XP/2003 DDK - inc/wxp/
189 STEP D. Configure NTBUILD.BAT.
191 The NTBUILD.BAT file copied to the OpenAFS base directory must be
192 customized for use on your development system. The following variables
193 must be defined to match your configuration:
195 AFSVER_CL: Set to 1200 if using MS Visual C++ 6.0
196 Set to 1300 if using MS Visual Studio .NET
197 Set to 1310 if using MS Visual Studio .NET 2003
198 Set to 1400 if using MS Visual Studio .NET 2005
200 MSVCDIR: Set to the short name version of the directory into which
201 the visual C++ compiler was installed regardless of version
203 MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
205 MSSDKDIR: Set to the short name of the directory into which
206 the Platform SDK was installed
208 NTDDKDIR: Set to the short name of the INC\WNET DDK directory
210 NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
212 AFSROOT: Set to the short name of the OpenAFS Base directory. This
213 cannot be set to a UNC path.
215 SYS_NAME: One of "i386_w2k" or "amd64_w2k"
217 APPVER: 0x500 for Windows 2000 and above; 0x502 for AMD64 systems
219 _WIN32_IE: Must match APPVER
221 MSVCVer: Set to 8.0 if using Visual Studio 8
224 STEP E. Set version and installation options (optional)
226 Add a CellServDB file to install area. CellServDB contains the entries
227 for the various cell names. You can download a general purpose one
229 http://grand.central.org/dl/cellservdb/CellServDB
230 then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
232 Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k
233 AFSPRODUCT_VER_MAJOR - Version Major Number
234 AFSPRODUCT_VER_MINOR - Version Minor Number
235 AFSPRODUCT_VER_PATCH - Version Patch Number
236 AFSPRODUCT_VER_BUILD - Version Build Number
237 CELLSERVDB_INSTALL - The default file name for the CellServDB
238 included in the install Package.
239 CELLNAME_DEFAULT - The default home cell name.
240 CELLSERVDB_WEB - The default web address to obtain CellServDB
242 For example: in the file %AFSROOT%\src\config\NTMakefile.i386_nt40 you would
245 AFSPRODUCT_VER_MAJOR=1
246 AFSPRODUCT_VER_MINOR=3
247 AFSPRODUCT_VER_PATCH=7400
248 AFSPRODUCT_VER_BUILD=0
249 CELLNAME_DEFAULT=openafs.org
250 CELLSERVDB_INSTALL=CellServDB.GrandCentral
251 CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
253 During the Open AFS installation process the user will be presented
254 with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and
255 one that can be downloaded from the web (CELLSERVDB_WEB).
257 STEP F. Begin the build
259 (1) From Windows 2000/XP/2003 open up a DOS prompt window.
261 (2) Change to the %AFSROOT% directory
263 (3) Configure the environment variables:
265 For a release build (SMB version):
267 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
268 Visual Studio environment you installed.
270 (b) Execute the SETENV.BAT file with the parameters "/2000 /RETAIL"
272 (c) Execute the NTBUILD.BAT file with the parameter "free"
274 For a debug build (SMB version):
276 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
277 Visual Studio environment you installed.
279 (b) Execute the SETENV.BAT file with the parameters "/2000 /DEBUG"
281 (c) Execute the NTBUILD.BAT file with the parameter "checked"
283 (4) Clean the work area:
285 nmake /f NTMakefile clean
287 (5) Build the complete Windows 2000/XP/2003 development environment.
289 nmake /f NTMakefile install
291 While the build is running you will see many compile warnings. This
292 behavior is normal; the build process is successful as long as the build
293 process doesn't terminate with an error ("nmake.exe return code 0x2")
294 and it displays 'Build Finished Successfully'.
297 STEP G. Install NSIS 2.30 (optional).
299 Download the Nullsoft Scriptable Installation System (NSIS) 2.30 from
301 http://nsis.sourceforge.net/home/
303 Run the nsis-2.30.exe installer and install to "C:\Program Files\NSIS".
304 Then download the large strings build zip file and replace the installed
305 files with the versions from the zip file. These versions increase
306 the maximum string length from 1024 characters to 8192 characters.
307 This is necessary for installation on systems with long PATH environment
310 Note: The NSIS installer can only be used to produce 32-bit installers.
312 STEP H. Build OpenAFS NSIS install package
314 From the %AFSROOT% directory execute:
316 nmake /f NTMakefile NSIS
319 STEP I. Install Wix MSI Installer
321 Download the Wix 2.0.5325.0 installer from
323 http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
326 STEP J. Build Wix MSI install package
328 From the %AFSROOT% directory execute:
330 nmake /f NTMakefile wix
332 Make sure the binaries installed to \src\wix\release\ship are
333 available in the PATH environment variable
336 STEP K. Final Results
338 The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
339 would look like the following:
341 %AFSROOT%\DEST\{checked,free}\
350 Bin - contains build utilities.
351 root.client - contains Open AFS binaries
352 root.server - contain Open AFS Server binaries
353 WinInstall\OpenAFSforWindows.exe - is the NSIS install package
354 WinInstall\openafs-en_US.msi - is the WiX MSI install package
357 STEP L. Optional Items
359 The build process has an error table that is compiled for many OpenAFS
360 applications. This table is generated by Unix based tools. It is not
361 normally necessary to modify this table so pre-generated source files
362 are included in the OpenAFS source. If you need to make modifications
363 in these areas the Unix base tools that run on Windows can be found on
364 the web. For example:
368 Below is a short explanation how to update the error table.
370 (1) Install flex and bison from a Unix based tool provider.
372 (2) Make changes to the source files.
374 There are two files in the source tree that are processed with lex
375 and yacc on UNIX systems, src/comerr/et_lex.lex.l and
376 src/comerr/error_table.y, that when processed produce the files
377 et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.
379 Since NT does not include lex and yacc or any equivalent tools, we
380 have provided the output files that lex and yacc produce (using Win32
381 ports of flex and bison). This will allow builds to work for anyone
382 who does not need to change the .l and .y files.
384 If you do need to change et_lex.lex.l, then you will need to install
385 Win32 port of flex on your system. Put flex.exe in a directory on the
388 If you do need to change error_table.y, then you will need to install
389 a Win32 port of bison on your system. Put bison.exe in a directory on
390 the path, configure bison as explained in step 5, and rebuild.
392 You can also attempt to use other replacements for lex and yacc. This
393 will require modifying the LEX and YACC settings in
394 /config/NTMakefile.i386_nt40. If the replacements require different
395 command line options than flex and bison, then you may also need to
396 change src/comerr/NTMakefile.
398 (3) Generate new OpenAFS binaries