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 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 XP, 2003, Vista, Win7,
22 or 2008 system. The target system, where OpenAFS will be installed,
31 * Windows 2003 R2 (32 or 64)
32 * Windows Vista (32 or 64)
34 * Windows 7 (32 or 64)
35 * Windows 2008 R2 (64)
37 The build process is controlled by a nmake file that generates the
38 necessary binaries and binds them into an install package.
40 The following steps describe how to configure the development environment:
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
49 H. Build NSIS Install Package
50 I. Install Wix 2.0.5325
51 J. Build Wix MSI Install Package
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:
59 Microsoft Visual Studio .NET 2005
60 available via a MSDN subscription
61 (used for OpenAFS.org distribution)
63 Microsoft Visual Studio 2008
64 available via a MSDN subscription
66 One of the following Microsoft SDKs is required:
68 Microsoft SDK for Windows 6.1
69 Microsoft SDK for Windows 7.0
71 One of the following Microsoft DDK/WDK is required:
73 Microsoft Windows Driver Kit 7600
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:
82 Windows [Platform] SDK 6.0a
90 Windows [Platform] SDK 6.0a
95 The Microsoft HTML Help Workshop is required:
97 http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
99 The Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 is required:
101 http://www.microsoft.com/downloads/details.aspx?FamilyId=AD6158D7-DDBA-416A-9109-07607425A815&displaylang=en
103 ActiveState Perl 5.10 is required for man-page generation
105 http://www.activestate.com/activeperl/
107 Cygwin is required for Docbook to HTML and Docbook to HTMLHelp conversion
109 http://cygwin.com/setup.exe
111 Doxygen is required for Developer Documentation generation
113 http://www.stack.nl/~dimitri/doxygen/
115 The NSIS installer requires about 14 MB of storage. The following
116 version is supported:
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)
122 The WiX installer requires about 18 MB of storage. The following
123 version is supported:
126 http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
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.
134 STEP A. Obtain a copy of the Open AFS Source Tree.
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.
140 For this example, download source for version 1.5.61 using the
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
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
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/)
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\
159 Copy the files 'NTMakefile' and 'ntbuild.bat' from the 'src'
160 subdirectory to the OpenAFS base directory (aka %AFSROOT%):
162 From a DOS command prompt window, enter the following copy commands:
164 cd c:\OpenAFS\OpenAFS-1.5.61
165 copy src\ntbuild.bat .
167 The OpenAFS base directory should look something like the following:
169 c:\OpenAFS\OpenAFS-1.5.61\
175 STEP B. Install compiler and development tools.
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.
181 (1) You can reduce the installation size by selecting "Custom" install
182 and remove all but the following Options:
187 (2) When asked, Select to Register Environment Variables.
190 STEP C. Install SDK header files.
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:
199 * Windows Management Instrumentation
202 It is advised that you install the entire SDK. The SDK can be obtained
205 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
207 by using Internet Explorer 5.x or higher. (Active X controls are required)
209 The header files that are required from a Microsoft SDK/WDK are:
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)
216 These files come from the following Microsoft DDKs/SDKs:
219 Windows XP SP2 Platform SDK - include/
221 netcfgn.h, netcfgx.h:
222 Windows XP/2003 DDK - inc/wxp/
225 Microsoft IDN Mitigation APIs 1.1 - include/
227 STEP D. Configure NTBUILD.BAT.
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.
235 The following variables must be defined to match your configuration:
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
243 MSVCDIR: Set to the short name version of the directory into which
244 the visual C++ compiler was installed regardless of version
246 MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
248 MSSDKDIR: Set to the short name of the directory into which
249 the Platform SDK was installed
251 NTDDKDIR: Set to the short name of the INC\WNET DDK directory
253 NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
255 MSIDNNLS: Set the the name of the Microsoft IDN Mitigation APIs 1.1
258 AFSROOT: Set to the short name of the OpenAFS Base directory. This
259 cannot be set to a UNC path.
261 SYS_NAME: One of "i386_w2k" or "amd64_w2k"
263 APPVER: 0x500 for Windows 2000 and above; 0x502 for AMD64 systems
265 _WIN32_IE: Must match APPVER
267 MSVCVer: Set to 8.0 if using Visual Studio 8
269 CODESIGN_DESC: Product Name
271 CODESIGN_TIMESTAMP: Time Stamp Service for Code Signing Certificate
273 CODESIGN_URL: Support URL Displayed to End Users
275 CODESIGN_CROSS_CERT: Path to Microsoft Cross Signing Certificate
279 STEP E. Set version and installation options (optional)
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
284 http://grand.central.org/dl/cellservdb/CellServDB
285 then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
287 Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k or NTMakefile.amd64_w2k
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
299 For example: in the file %AFSROOT%\src\config\NTMakefile.i386_w2k you would
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
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).
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.
320 STEP F. Begin the build
322 (1) From Windows 2000/XP/2003 open up a DOS prompt window.
324 (2) Change to the %AFSROOT% directory
326 (3) Configure the environment variables:
328 For a release build (SMB version):
330 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
331 Visual Studio environment you installed.
333 (b) Execute the SETENV.BAT file with the parameters "/2000 /RETAIL"
335 (c) Execute the NTBUILD.BAT file with the parameter "free"
337 For a debug build (SMB version):
339 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
340 Visual Studio environment you installed.
342 (b) Execute the SETENV.BAT file with the parameters "/2000 /DEBUG"
344 (c) Execute the NTBUILD.BAT file with the parameter "checked"
346 (4) Build the complete Windows 2000/XP/2003 development environment.
348 nmake /f NTMakefile install
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.
356 (5) Before rebuilding you must clean the work area:
358 nmake /f NTMakefile clean
361 STEP G. Install NSIS 2.44 (optional).
363 Download the Nullsoft Scriptable Installation System (NSIS) 2.44 from
365 http://nsis.sourceforge.net/home/
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
374 Note: The NSIS installer can only be used to produce 32-bit installers.
376 STEP H. Build OpenAFS NSIS install package
378 From the %AFSROOT% directory execute:
380 nmake /f NTMakefile NSIS
383 STEP I. Install Wix MSI Installer
385 Download the Wix 2.0.5325.0 installer from
387 http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
390 STEP J. Build Wix MSI install package
392 From the %AFSROOT% directory execute:
394 nmake /f NTMakefile wix
396 Make sure the binaries installed to \src\wix\release\ship are
397 available in the PATH environment variable
400 STEP K. Final Results
402 The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
403 would look like the following:
405 %AFSROOT%\DEST\{checked,free}\
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
421 STEP L. Optional Items
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:
432 Below is a short explanation how to update the error table.
434 (1) Install flex and bison from a Unix based tool provider.
436 (2) Make changes to the source files.
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.
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.
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
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.
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.
462 (3) Generate new OpenAFS binaries