Copyright 2000, International Business Machines Corporation and others. All Rights Reserved. This software has been released under the terms of the IBM Public License. For details, see the LICENSE file in the top-level source directory or on-line at http://www.openafs.org/dl/license10.html Building OpenAFS on Windows NT ------------------------------ There are several steps that must be performed before a successful build of AFS on Windows NT can be completed. These steps are as follows: A. Install a compiler B. Add missing header files C. Optional: Install Installshield 5.x D. Optional: Install flex and bison E. Configure the OpenAFS build environment F. Begin the build Each step is explained in detail below: A. Install a compiler You must install a copy of Microsoft Visual C++ 5.0 or 6.0. The "Typical" install setting is sufficient. It may be possible to use other compilers, but the source code as provided will work with MS VC++ 5.0/6.0. B. Add missing header files Files from Microsoft's Device Driver Development kits for NT and Windows 9x are required to complete a build on NT. They are copyrighted by Microsoft and so cannot be included with the OpenAFS source tree. These files are: netmpr.h netspi.h npapi.h These files come from Microsoft DDKs as follows: January 1997 Windows NT Workstation DDK - /ddk/frc/network/inc/npapi.h July 1998 Windows 95 DDK - net/inc/netmpr.h and net/inc/netspi.h The may also be available on more recent releases of the DDKs. These files must live on the include path. C. Optional: Install Installshield 5.x There are two ways to build OpenAFS on NT: 1. Build of the product, or 2. build of the product plus an installer package In order to do the build that includes the installer package, a copy of Installshield 5.x must be installed. NOTE: Installshield versions 6 and higher WILL NOT WORK. Optional DLL's missing for Install Script Two Microsoft DLL's must be included at DEST\WinInstall\Config\. SHLWAPI.DLL WININET.DLL These files are only used for the Install, they will not be left on the target machine. D. Optional: Install flex and bison There are two files in the source tree that are processed with lex and yacc on UNIX systems, src/comerr/et_lex.lex.l and src/comerr/error_table.y, that when processed produce the files et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h. Since NT does not include lex and yacc or any equivalent tools, we have provided the output files that lex and yacc produce (using Win32 ports of flex and bison). This will allow builds to work for anyone who does not need to change the .l and .y files. If you do need to change et_lex.lex.l, then you will need to install Win32 port of flex on your system. Put flex.exe in a directory on the path and rebuild. If you do need to change error_table.y, then you will need to install a Win32 port of bison on your system. Put bison.exe in a directory on the path, configure bison as explained in step 5, and rebuild. You can also attempt to use other replacements for lex and yacc. This will require modifying the LEX and YACC settings in src/config/NTMakefile.i386_nt40. If the replacements require different command line options than flex and bison, then you may also need to change src/comerr/NTMakefile. E. Configure the OpenAFS build environment A set of environment variables used by the OpenAFS makefiles must be properly set for a build to successfully complete. The file src/ntbuild.bat is a DOS-style batch file that will configure these settings for you. Within this file there are the following lines that must be set to match your system settings: * set SYS_NAME= * set MSVCDIR= Ex: set MSVCDIR=c:\progra~1\DevStudio\vc This is the path to the compiler directory of the Microsoft Visual C++ installation. * set AFSDEV_INCLUDE= Ex: set AFSDEV_INCLUDE=%MSVCDIR%\include;%MSVCDIR%\mfc\include This contains a semicolon separated list of directories that contain compiler provided include files. You should not need to edit this other than to point to the DDK includes not provided with the distribution * set AFSROOT= Ex: set AFSROOT=d:\OpenAFS This is the root directory of OpenAFS, which is the parent directory of the src directory. * set IS5ROOT= Ex: set IS5ROOT=d:\progra~1\instal~1\instal~1.1pr This is the path to the Installshield5 program directory. You should only define this if you have Installshield installed on your computer and want to create the install script as part of the build. NOTES: There are other settings in ntbuild.bat, but the ones listed above must be set correctly for the build to succeed. As can be seen in the examples above, all paths in ntbuild.bat must be in the old MSDOS 8.3 format. F. Set version and installation options Modify .\src\config\NTMakefile.i386_nt40 AFSPRODUCT_VERSION - Product version CELLNAME_DEFAULT - The default AFS cell name CELLSERVDB_INSTALL - The default name for the CellServDB included in the install script CELLSERVDB_WEB - The default web address to obtain CellServDB For Example: .\src\config\NTMakefile.i386_nt40 AFSPRODUCT_VERSION=1.1.1a CELLNAME_DEFAULT=openafs.org CELLSERVDB_INSTALL=CellServDB.GrandCentral CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB NOTE: If CELLNAME_DEFAULT has a '.' in cell name, then the name is assumed to be a valid cell name and when the user installs AFS the AFS Control Center will default to NOT installed! Version level may be specified in different formats, for example the following forms all have the same version level; however will be displayed differently: AFSPRODUCT_VERSION=1.1.1a AFSPRODUCT_VERSION=1.1.1 a AFSPRODUCT_VERSION=1.1.1.1 AFSPRODUCT_VERSION=1.1.101 Add CellServDB file to install area. For the previous example you would add file: DEST\Winistall\Config\CellServDB.GrandCentral G. Begin the build 1. Make sure you are running the default NT command shell, cmd.exe. Other shells may work, but many do not. 2. Run the ntbuild.bat file that was configured in step 5. You can include the word "checked" on the command line to create binaries that include debug information, or the word "free" to create binaries that do not include debug information. For a debug build, run: ntbuild checked For a release build, run: ntbuild free 3. Copy the file src/NTMakefile to the parent of the src directory. You only need to do this once. 4. If you have not created a separate object build directory, edit NTMakefile and OBJ=obj to OBJ=src. 5. Begin the build. You can choose to build just the product bits, or, if Installshield is installed, the product bits and the install package. To build just the product bits, run: nmake /f NTMakefile install To build the product bits and the install package, run: nmake /f NTMakefile media