Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / README-WINDOWS
CommitLineData
805e021f
CE
1This software has been released under the terms of the IBM Public
2License. For details, see the LICENSE file in the top-level source
3directory or on-line at http://www.openafs.org/dl/license10.html
4
5The document now provides a step by step procedure that takes the user
6from a basic Windows 2000/XP/2003/Vista/2008/Win7 workstation to an OpenAFS
7development environment. Details are provided so that a 'beginning'
8windows developer can build an OpenAFS installable package for Windows
92000/XP/2003/Vista/2008/Win7.
10
11NOTE 1:
12As of the OpenAFS 1.3 release series, Windows platforms released
13prior to Windows 2000 are no longer supported. As of the OpenAFS 1.5
14series, the Windows 9x components are being removed from the source tree.
15
16
17****** Windows XP/2003/Vista/2008/Win7/2008-R2 Build Process ******
18
19Building OpenAFS for Windows requires configuring a Windows
20development system by installing compilation tools and header files.
21OpenAFS Software development can be done on XP, 2003, Vista, Win7,
22or 2008 system. The target system, where OpenAFS will be installed,
23can be one of:
24
25 * Windows XP
26 * Windows XP SP2
27 * Windows 2003
28 * Windows 2003 SP1
29 * Windows XP 64
30 * Windows 2003 64
31 * Windows 2003 R2 (32 or 64)
32 * Windows Vista (32 or 64)
33 * Windows 2008 (64)
34 * Windows 7 (32 or 64)
35 * Windows 2008 R2 (64)
36
37The build process is controlled by a nmake file that generates the
38necessary binaries and binds them into an install package.
39
40The following steps describe how to configure the development environment:
41
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
47 F. Build the binaries
48 I. Install Wix 2.0.5805
49 J. Build Wix MSI Install Package
50 K. Final Results
51 L. Optional Items
52
53The Microsoft development tools require anywhere from 660 MB to 1.8GB
54of storage depending on which compilers are selected. The following
55versions are supported:
56
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
61
62 Microsoft Visual Studio 2008
63 available via a MSDN subscription
64
65Under some conditions, a conflict between Windows SDK headers and Windows DDK
66headers causes difficulties using Visual Studio 2008 as a development
67environment. Visual Studio 2005 does not suffer from this issue.
68
69One of the following Microsoft SDKs is required:
70
71 Microsoft SDK for Windows 6.1
72 Microsoft SDK for Windows 7.0
73
74One of the following Microsoft DDK/WDK is required:
75
76 Microsoft Windows Driver Kit 7600
77
78NOTE: Not all combinations of Visual Studio, SDK, and DDK/WDK are
79known to work. OpenAFS for Windows is packaged by Secure Endpoints Inc.
80using the following configurations:
81
82 32-bit Packages:
83 Built on Windows 7
84 Visual Studio 2008
85 Windows [Platform] SDK 6.0a
86 Windows DDK 7600
87 Target: i386_w2k
88 APPVER: 5.0
89
90 64-bit Packages:
91 Built on Windows 7
92 Visual Studio 2008
93 Windows [Platform] SDK 6.0a
94 Windows DDK 7600
95 Target: amd64_w2k
96 APPVER: 5.02
97
98The Microsoft HTML Help Workshop is required:
99
100 http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
101
102The Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 is required:
103
104 http://www.microsoft.com/en-us/download/details.aspx?id=734
105
106ActiveState Perl 5.10 is required for man-page generation
107
108 http://www.activestate.com/activeperl/
109
110Cygwin is required for Docbook to HTML and Docbook to HTMLHelp conversion
111
112 http://cygwin.com/setup.exe
113
114Doxygen is required for Developer Documentation generation
115
116 http://www.stack.nl/~dimitri/doxygen/
117
118The WiX installer requires about 18 MB of storage. The following
119version is supported:
120
121 WiX 2.0.5805.0
122 http://wix.codeplex.com/releases/view/44405
123
124Newer versions of WiX (e.g., the 3.x series) are not supported.
125
126The OpenAFS Source directory requires about 360 MB storage. The Source
127directory size includes additional space for files that will be
128generated during the build process. A full build of Free and Checked
129installers on 64-bit Windows will require up to 1GB of storage.
130
131
132STEP A. Obtain a copy of the Open AFS Source Tree.
133
134Transfer OpenAFS source tree onto your hardrive. The source can be
135downloaded from the OpenAFS web site:
136 http://www.OpenAFS.org/release/snapindex.html.
137
138For this example, download source for version 1.7.25 using the
139following URL:
140http://www.openafs.org/dl/openafs/1.7.25/openafs-1.7.25-src.tar
141http://www.openafs.org/dl/openafs/1.7.25/openafs-1.7.25-doc.tar
142
143HINT: DailySnapShots are pre-release source trees and much more
144likely to have compilation errors. If this is your first attempt, do
145your build based on a release version of the source, e.g. 1.7.25. Once
146you have completed a build process successfully, you can experiment with
147other source trees.
148
149You will need an unzip utility that can expand compressed tar files.
150For example "Pkzip for Windows" from Pkware will uncompress tar files.
151(http://www.pkware.com/)
152
153Expand the downloaded tar files into target directory (c:\OpenAFS),
154the unzip routine will expand the source into a subdirectory tree:
155 c:\OpenAFS\OpenAFS-1.7.25\
156
157Copy the file 'ntbuild.bat' from the 'src' subdirectory to the OpenAFS
158base directory (aka %AFSROOT%):
159
160 From a DOS command prompt window, enter the following copy commands:
161
162 cd c:\OpenAFS\OpenAFS-1.7.25
163 copy src\ntbuild.bat .
164
165The OpenAFS base directory should look something like the following:
166
167 c:\OpenAFS\OpenAFS-1.7.25\
168 NTMakefile
169 ntbuild.bat
170 src
171 doc
172
173STEP B. Install compiler and development tools.
174
175Install a copy of Microsoft Visual Studio .NET 2005. Visual Studio 2008
176can be used to produce builds but the resulting binaries cannot be used
177on Windows 2000.
178
179(1) You can reduce the installation size by selecting "Custom" install
180and remove all but the following Options:
181
182 Microsoft Visual C++
183 Data Access
184
185(2) When asked, Select to Register Environment Variables.
186
187
188STEP C. Install SDK header files.
189
190Files from Microsoft's Platform SDK for Windows Server 2003 SP1 are
191required to complete a build on Windows 2000/XP/2003. At a minimum the
192following components are known to be required:
193
194 * Core
195 * Data Access
196 * Installer
197 * Windows Management Instrumentation
198 * Web Workshop (IE)
199
200It is advised that you install the entire SDK. The SDK can be obtained
201from:
202
203 http://www.microsoft.com/en-us/download/details.aspx?id=6510
204
205The header files that are required from a Microsoft SDK/WDK are:
206
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)
211
212These files come from the following Microsoft DDKs/SDKs:
213
214 npapi.h:
215 Windows XP SP2 Platform SDK - include/
216
217 netcfgn.h, netcfgx.h:
218 Windows XP/2003 DDK - inc/wxp/
219
220 normalization.h:
221 Microsoft IDN Mitigation APIs 1.1 - include/
222
223The Windows DDK can be obtained from:
224
225 http://www.microsoft.com/en-us/download/details.aspx?id=11800
226
227STEP D. Configure NTBUILD.BAT.
228
229The NTBUILD.BAT file copied to the OpenAFS base directory must be
230customized for use on your development system. The provided NTBUILD.BAT
231was developed for use with Visual Studio 2005 and the Windows Server 2008
232Platform SDK. It requires significant modification to construct a build
233environment, due to differences between systems.
234
235The following variables must be defined to match your configuration:
236
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
244
245 MSVCDIR: Set to the short name version of the directory into which
246 the visual C++ compiler was installed regardless of version
247
248 MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
249
250 MSSDKDIR: Set to the short name of the directory into which
251 the Platform SDK was installed
252
253 NTDDKDIR: Set to the short name of the INC\WNET DDK directory
254
255 NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
256
257 MSIDNNLS: Set the the name of the Microsoft IDN Mitigation APIs 1.1
258 directory
259
260 AFSROOT: Set to the short name of the OpenAFS Base directory. This
261 cannot be set to a UNC path.
262
263 SYS_NAME: One of "i386_w2k" or "amd64_w2k"
264
265 APPVER: 5.0 for Windows 2000 and above; 5.1 for AMD64 systems
266
267 _WIN32_IE: 0x500 for Windows 2000 and above; 0x502 for AMD64 systems
268
269 CODESIGN_DESC: Product Name
270
271 CODESIGN_TIMESTAMP: Time Stamp Service for Code Signing Certificate
272
273 CODESIGN_URL: Support URL Displayed to End Users
274
275 CODESIGN_CROSS_CERT: Path to Microsoft Cross Signing Certificate
276 (if you have one)
277
278If no code signing tools are available, the resulting driver will not be
279usable on 64-bit Vista and Win7 and newer systems, unless the system is
280booted with the disable signing checks option from the F8 menu.
281
282
283STEP E. Set version and installation options (optional)
284
285Add a CellServDB file to install area. CellServDB contains the entries
286for the various cell names. You can download a general purpose one
287from:
288 http://grand.central.org/dl/cellservdb/CellServDB
289then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
290
291Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k or NTMakefile.amd64_w2k
292as appropriate:
293
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
302
303For example: in the file %AFSROOT%\src\config\NTMakefile.i386_w2k you would
304see the following:
305
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
313
314During the OpenAFS installation process the user will be presented
315with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and
316one that can be downloaded from the web (CELLSERVDB_WEB).
317
318IMPORTANT: When building your own binaries, you must set the AFSPRODUCT_VER_BUILD
319value to a number greater than 1023. All values 0 to 1023 are reserved for use
320by official OpenAFS.org releases. A failure to do so will result in Windows
321Crash Reports for your binaries being delivered to OpenAFS.org for analysis.
322
323
324STEP F. Begin the build
325
326(1) Open a Command Prompt window (cmd.exe)
327
328 Enable delayed variable expansion with "cmd /v"
329
330(2) Change to the %AFSROOT% directory
331
332(3) Configure the environment variables:
333
334 For a release build (SMB version):
335
336 (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
337 Visual Studio environment you installed.
338
339 (b) Execute the SETENV.CMD file from the Windows SDK with the parameters
340 "/2000 /RETAIL"
341
342 (c) Execute the NTBUILD.BAT file with the parameter "free"
343
344 For a debug 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.CMD file from the Windows SDK with the parameters
350 "/2000 /DEBUG"
351
352 (c) Execute the NTBUILD.BAT file with the parameter "checked"
353
354(4) Build the complete Windows 2000/XP/2003 development environment.
355
356 nmake /f NTMakefile install
357
358While the build is running you will see many compile warnings. This
359behavior is normal; the build process is successful as long as the build
360process doesn't terminate with an error ("nmake.exe return code 0x2")
361and it displays 'Build Finished Successfully'. Note that although the
362the build target is "install", it does not install OpenAFS.
363
364(5) Before rebuilding you must clean the work area:
365
366 nmake /f NTMakefile clean
367
368
369STEP G. NSIS is no longer used, it does not support 64-bit systems
370
371STEP I. Install Wix MSI Installer
372
373Download the WiX 2.0.5805.0 binaries from
374
375 http://wix.codeplex.com/releases/view/44405
376
377STEP J. Build Wix MSI install package
378
379From the %AFSROOT% directory execute:
380
381 nmake /f NTMakefile wix
382
383Make sure the binaries installed to \src\wix\release\ship are
384available in the PATH environment variable
385
386
387STEP K. Final Results
388
389The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
390would look like the following:
391
392%AFSROOT%\DEST\{checked,free}\
393 bin
394 etc
395 include
396 lib
397 root.client
398 root.server
399 WinInstall
400
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
406
407
408STEP L. Optional Items
409
410The build process has an error table that is compiled for many OpenAFS
411applications. This table is generated by Unix based tools. It is not
412normally necessary to modify this table so pre-generated source files
413are included in the OpenAFS source. If you need to make modifications
414in these areas the Unix base tools that run on Windows can be found on
415the web. For example:
416
417 http://cygwin.com/
418
419Below is a short explanation how to update the error table.
420
421(1) Install flex and bison from a Unix based tool provider.
422
423(2) Make changes to the source files.
424
425There are two files in the source tree that are processed with lex
426and yacc on UNIX systems, src/comerr/et_lex.lex.l and
427src/comerr/error_table.y, that when processed produce the files
428et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.
429
430Since NT does not include lex and yacc or any equivalent tools, we
431have provided the output files that lex and yacc produce (using Win32
432ports of flex and bison). This will allow builds to work for anyone
433who does not need to change the .l and .y files.
434
435If you do need to change et_lex.lex.l, then you will need to install
436Win32 port of flex on your system. Put flex.exe in a directory on the
437path and rebuild.
438
439If you do need to change error_table.y, then you will need to install
440a Win32 port of bison on your system. Put bison.exe in a directory on
441the path, configure bison as explained in step 5, and rebuild.
442
443You can also attempt to use other replacements for lex and yacc. This
444will require modifying the LEX and YACC settings in
445/config/NTMakefile.i386_nt40. If the replacements require different
446command line options than flex and bison, then you may also need to
447change src/comerr/NTMakefile.
448
449(3) Generate new OpenAFS binaries