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/Win7 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/Win7.
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 OpenAFS 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
48 I. Install Wix 2.0.5805
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 2005
58 available via a MSDN subscription
59 (used for OpenAFS.org distribution)
60 Visual Studio 2005 SP1 is required to use Win7 as a development environment
62 Microsoft Visual Studio 2008
63 available via a MSDN subscription
65 Under some conditions, a conflict between Windows SDK headers and Windows DDK
66 headers causes difficulties using Visual Studio 2008 as a development
67 environment. Visual Studio 2005 does not suffer from this issue.
69 One of the following Microsoft SDKs is required:
71 Microsoft SDK for Windows 6.1
72 Microsoft SDK for Windows 7.0
74 One of the following Microsoft DDK/WDK is required:
76 Microsoft Windows Driver Kit 7600
78 NOTE: Not all combinations of Visual Studio, SDK, and DDK/WDK are
79 known to work. OpenAFS for Windows is packaged by Secure Endpoints Inc.
80 using the following configurations:
85 Windows [Platform] SDK 6.0a
93 Windows [Platform] SDK 6.0a
98 The Microsoft HTML Help Workshop is required:
100 http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
102 The Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 is required:
104 http://www.microsoft.com/en-us/download/details.aspx?id=734
106 ActiveState Perl 5.10 is required for man-page generation
108 http://www.activestate.com/activeperl/
110 Cygwin is required for Docbook to HTML and Docbook to HTMLHelp conversion
112 http://cygwin.com/setup.exe
114 Doxygen is required for Developer Documentation generation
116 http://www.stack.nl/~dimitri/doxygen/
118 The WiX installer requires about 18 MB of storage. The following
119 version is supported:
122 http://wix.codeplex.com/releases/view/44405
124 Newer versions of WiX (e.g., the 3.x series) are not supported.
126 The OpenAFS Source directory requires about 360 MB storage. The Source
127 directory size includes additional space for files that will be
128 generated during the build process. A full build of Free and Checked
129 installers on 64-bit Windows will require up to 1GB of storage.
132 STEP A. Obtain a copy of the Open AFS Source Tree.
134 Transfer OpenAFS source tree onto your hardrive. The source can be
135 downloaded from the OpenAFS web site:
136 http://www.OpenAFS.org/release/snapindex.html.
138 For this example, download source for version 1.7.25 using the
140 http://www.openafs.org/dl/openafs/1.7.25/openafs-1.7.25-src.tar
141 http://www.openafs.org/dl/openafs/1.7.25/openafs-1.7.25-doc.tar
143 HINT: DailySnapShots are pre-release source trees and much more
144 likely to have compilation errors. If this is your first attempt, do
145 your build based on a release version of the source, e.g. 1.7.25. Once
146 you have completed a build process successfully, you can experiment with
149 You will need an unzip utility that can expand compressed tar files.
150 For example "Pkzip for Windows" from Pkware will uncompress tar files.
151 (http://www.pkware.com/)
153 Expand the downloaded tar files into target directory (c:\OpenAFS),
154 the unzip routine will expand the source into a subdirectory tree:
155 c:\OpenAFS\OpenAFS-1.7.25\
157 Copy the file 'ntbuild.bat' from the 'src' subdirectory to the OpenAFS
158 base directory (aka %AFSROOT%):
160 From a DOS command prompt window, enter the following copy commands:
162 cd c:\OpenAFS\OpenAFS-1.7.25
163 copy src\ntbuild.bat .
165 The OpenAFS base directory should look something like the following:
167 c:\OpenAFS\OpenAFS-1.7.25\
173 STEP B. Install compiler and development tools.
175 Install a copy of Microsoft Visual Studio .NET 2005. Visual Studio 2008
176 can be used to produce builds but the resulting binaries cannot be used
179 (1) You can reduce the installation size by selecting "Custom" install
180 and remove all but the following Options:
185 (2) When asked, Select to Register Environment Variables.
188 STEP C. Install SDK header files.
190 Files from Microsoft's Platform SDK for Windows Server 2003 SP1 are
191 required to complete a build on Windows 2000/XP/2003. At a minimum the
192 following components are known to be required:
197 * Windows Management Instrumentation
200 It is advised that you install the entire SDK. The SDK can be obtained
203 http://www.microsoft.com/en-us/download/details.aspx?id=6510
205 The header files that are required from a Microsoft SDK/WDK are:
207 npapi.h (Windows 2000,XP,2003 builds)
208 netcfgx.h (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
209 netcfgn.h (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
210 normalization.h (AFS Cache Manager)
212 These files come from the following Microsoft DDKs/SDKs:
215 Windows XP SP2 Platform SDK - include/
217 netcfgn.h, netcfgx.h:
218 Windows XP/2003 DDK - inc/wxp/
221 Microsoft IDN Mitigation APIs 1.1 - include/
223 The Windows DDK can be obtained from:
225 http://www.microsoft.com/en-us/download/details.aspx?id=11800
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 2005 and the Windows Server 2008
232 Platform SDK. It requires significant modification to construct a build
233 environment, due to differences between systems.
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
242 Set to 1600 if using MS Visual Studio 2010
243 Set to 1700 if using MS Visual Studio 2012
245 MSVCDIR: Set to the short name version of the directory into which
246 the visual C++ compiler was installed regardless of version
248 MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
250 MSSDKDIR: Set to the short name of the directory into which
251 the Platform SDK was installed
253 NTDDKDIR: Set to the short name of the INC\WNET DDK directory
255 NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
257 MSIDNNLS: Set the the name of the Microsoft IDN Mitigation APIs 1.1
260 AFSROOT: Set to the short name of the OpenAFS Base directory. This
261 cannot be set to a UNC path.
263 SYS_NAME: One of "i386_w2k" or "amd64_w2k"
265 APPVER: 5.0 for Windows 2000 and above; 5.1 for AMD64 systems
267 _WIN32_IE: 0x500 for Windows 2000 and above; 0x502 for AMD64 systems
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
278 If no code signing tools are available, the resulting driver will not be
279 usable on 64-bit Vista and Win7 and newer systems, unless the system is
280 booted with the disable signing checks option from the F8 menu.
283 STEP E. Set version and installation options (optional)
285 Add a CellServDB file to install area. CellServDB contains the entries
286 for the various cell names. You can download a general purpose one
288 http://grand.central.org/dl/cellservdb/CellServDB
289 then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
291 Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k or NTMakefile.amd64_w2k
294 AFSPRODUCT_VER_MAJOR - Version Major Number
295 AFSPRODUCT_VER_MINOR - Version Minor Number
296 AFSPRODUCT_VER_PATCH - Version Patch Number
297 AFSPRODUCT_VER_BUILD - Version Build Number
298 CELLSERVDB_INSTALL - The default file name for the CellServDB
299 included in the install Package.
300 CELLNAME_DEFAULT - The default home cell name.
301 CELLSERVDB_WEB - The default web address to obtain CellServDB
303 For example: in the file %AFSROOT%\src\config\NTMakefile.i386_w2k you would
306 AFSPRODUCT_VER_MAJOR=1
307 AFSPRODUCT_VER_MINOR=7
308 AFSPRODUCT_VER_PATCH=2500
309 AFSPRODUCT_VER_BUILD=0
310 CELLNAME_DEFAULT=openafs.org
311 CELLSERVDB_INSTALL=CellServDB.GrandCentral
312 CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
314 During the OpenAFS installation process the user will be presented
315 with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and
316 one that can be downloaded from the web (CELLSERVDB_WEB).
318 IMPORTANT: When building your own binaries, you must set the AFSPRODUCT_VER_BUILD
319 value to a number greater than 1023. All values 0 to 1023 are reserved for use
320 by official OpenAFS.org releases. A failure to do so will result in Windows
321 Crash Reports for your binaries being delivered to OpenAFS.org for analysis.
324 STEP F. Begin the build
326 (1) Open a Command Prompt window (cmd.exe)
328 Enable delayed variable expansion with "cmd /v"
330 (2) Change to the %AFSROOT% directory
332 (3) Configure the environment variables:
334 For a release build (SMB version):
336 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
337 Visual Studio environment you installed.
339 (b) Execute the SETENV.CMD file from the Windows SDK with the parameters
342 (c) Execute the NTBUILD.BAT file with the parameter "free"
344 For a debug 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.CMD file from the Windows SDK with the parameters
352 (c) Execute the NTBUILD.BAT file with the parameter "checked"
354 (4) Build the complete Windows 2000/XP/2003 development environment.
356 nmake /f NTMakefile install
358 While the build is running you will see many compile warnings. This
359 behavior is normal; the build process is successful as long as the build
360 process doesn't terminate with an error ("nmake.exe return code 0x2")
361 and it displays 'Build Finished Successfully'. Note that although the
362 the build target is "install", it does not install OpenAFS.
364 (5) Before rebuilding you must clean the work area:
366 nmake /f NTMakefile clean
369 STEP G. NSIS is no longer used, it does not support 64-bit systems
371 STEP I. Install Wix MSI Installer
373 Download the WiX 2.0.5805.0 binaries from
375 http://wix.codeplex.com/releases/view/44405
377 STEP J. Build Wix MSI install package
379 From the %AFSROOT% directory execute:
381 nmake /f NTMakefile wix
383 Make sure the binaries installed to \src\wix\release\ship are
384 available in the PATH environment variable
387 STEP K. Final Results
389 The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
390 would look like the following:
392 %AFSROOT%\DEST\{checked,free}\
401 Bin - contains build utilities.
402 root.client - contains Open AFS binaries
403 root.server - contain Open AFS Server binaries
404 WinInstall\OpenAFSforWindows.exe - is the NSIS install package
405 WinInstall\openafs-en_US.msi - is the WiX MSI install package
408 STEP L. Optional Items
410 The build process has an error table that is compiled for many OpenAFS
411 applications. This table is generated by Unix based tools. It is not
412 normally necessary to modify this table so pre-generated source files
413 are included in the OpenAFS source. If you need to make modifications
414 in these areas the Unix base tools that run on Windows can be found on
415 the web. For example:
419 Below is a short explanation how to update the error table.
421 (1) Install flex and bison from a Unix based tool provider.
423 (2) Make changes to the source files.
425 There are two files in the source tree that are processed with lex
426 and yacc on UNIX systems, src/comerr/et_lex.lex.l and
427 src/comerr/error_table.y, that when processed produce the files
428 et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.
430 Since NT does not include lex and yacc or any equivalent tools, we
431 have provided the output files that lex and yacc produce (using Win32
432 ports of flex and bison). This will allow builds to work for anyone
433 who does not need to change the .l and .y files.
435 If you do need to change et_lex.lex.l, then you will need to install
436 Win32 port of flex on your system. Put flex.exe in a directory on the
439 If you do need to change error_table.y, then you will need to install
440 a Win32 port of bison on your system. Put bison.exe in a directory on
441 the path, configure bison as explained in step 5, and rebuild.
443 You can also attempt to use other replacements for lex and yacc. This
444 will require modifying the LEX and YACC settings in
445 /config/NTMakefile.i386_nt40. If the replacements require different
446 command line options than flex and bison, then you may also need to
447 change src/comerr/NTMakefile.
449 (3) Generate new OpenAFS binaries