[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Update build instructions for the trunk on the Win32 platform.

From: Martin Tomes <lists_at_tomes.org>
Date: 2004-05-05 14:26:19 CEST

Update the instructions for building Subversion on the Win32 platform.

The new instructions are split into sections which describe what is needed, how to prepare the files
(unpacking, environment etc.) and how to actually build the binaries with all available options
turned on.

    * INSTALL
      Update Win32 build instructions.

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'

Index: INSTALL
===================================================================
--- INSTALL (revision 9562)
+++ INSTALL (working copy)
@@ -578,144 +578,292 @@
   E. Building the Latest Source under Windows
       ----------------------------------------

- (These instructions assume you have already installed Subversion
- and checked out a Subversion working copy. See the section
- "Bootstrapping from a Zip or Installer File under Windows" above
- for more.)
+ E.1 Prerequisites

- There is some support for building Subversion on Win32
- platforms. The project files generated by gen-make.py are for
- Microsoft Visual C++ 6.x; earlier versions of the compiler are
- not supported. You'll also need a fairly recent version of the
- Microsoft Platform SDK; the header files that come with MSVC 6.x
- are too old.
+ * Visual Studio 6 and service pack. It can be built with Visual Studio
+ 7 but these instructions assume VS6.
+ * A recent Windows SDK, the one provided with Visual Studio 6 is
+ too old. You only need the 'Core SDK'. You can get it from MSDN
+ if you have it or from
+ http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ if you
+ don't.
+ * Python 2.2 or higher, downloaded from http://www.python.org/ which is
+ used to generate the project files.
+ * Perl 5.8 or higher from http://www.activestate.com/
+ * Neon 0.24.5 or higher, downloaded from
+ http://www.webdav.org/neon/neon-0.24.5.tar.gz which is required
+ for building the client components.
+ * Berkeley DB is required for support for local server components,
+ version 4.2.52 is available from
+ http://subversion.tigris.org/servlets/ProjectDocumentList as
+ db-4.2.52-win32.zip. For more information see Section I.5.
+ * Apache 2 source, downloaded from
+ http://httpd.apache.org/download.cgi, these instructions assume
+ version 2.0.49.
+ * Apache 2 msi install file, also from
+ http://httpd.apache.org/download.cgi (required for running the
+ tests)
+ * ZLib 1.1.4 or higher (version 1.1.x) binaries
+ http://www.winimage.com/zLibDll/zlib114dll.zip.
+ * Openssl 0.9.7d or higher obtained from
+ http://www.openssl.org/source/openssl-0.9.7d.tar.gz
+ * An assembler, e.g., nasm which is avaliable from
+ http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
+ * For localization gnu gettext is needed. Get
+ gettext-runtime-0.12.1.bin.woe32.zip,
+ gettext-tools-0.12.1.bin.woe32.zip, and
+ libiconv-1.9.1.bin.woe32.zip from
+ http://mirrors.kernel.org/gnu/gettext
+ * The latest version of apr-util (see Section I.1) must be told
+ where to find the Berkeley DB include files and libraries. You
+ can do this with the w32locatedb.pl script (located in the
+ "build" directory in the apr-util sources), which modifies
+ apr-util's header and DSP files. The instructions at the top of
+ the script file explain how to use the script.

- To generate the project files, you will need Python 2.2 for Windows
- installed. Installing Python will also allow you to run the test
- suite after you build the source.
+ If your copy of apr-util does not contain build\w32locatedb.pl,
+ you can download a recent version from here:

- To build the client components, you'll need a copy of neon
- 0.24.5. See section I.4 for details on where to get one and
- what to do with it when you get it.
+ http://subversion.tigris.org/files/documents/15/8705/w32locatedb.pl

- [NOTE: The neon library supports secure connections with OpenSSL
- and on-the-wire compression with zlib. If you want to use
- those features, you should pass the options "--with-zlib" and
- "--with-openssl" to the gen-make.py script. See Section I.10
- for more details.]
+ You will need Perl 5.8 to run this script.
+ * A Subversion client binary from http://subversion.tigris.org/ to
+ do the initial checkout of the Subversion source. See the section
+ "Bootstrapping from a Zip or Installer File under Windows" above
+ for more.
+ * A means of unpacking the files. Native Win32 versions of gunzip,
+ tar and unzip can be found at http://unxutils.sourceforge.net/ or
+ http://gnuwin32.sourceforge.net/.
+ If you have WinZip that will also unpack the files.

+ E.2 Notes
+
+ The neon library supports secure connections with OpenSSL and
+ on-the-wire compression with zlib. If you want to use those
+ features, you should pass the options "--with-zlib" and
+ "--with-openssl" to the gen-make.py script. See Section I.10 for
+ more details.
+
       If you are installing under Win9x, NT4, or WinME, and svn.exe
       doesn't run, try installing shfolder.dll from here:

           http://download.microsoft.com/download/platformsdk/Redist/5.50.4027.300/W9XNT4/EN-US/shfinst.EXE

- If you want to build the (local) server components, you'll also
- need a copy of Berkeley DB, version 4.0.14 or newer (version 4.2.52
- is preferred). Details are in Section I.5. For your convenience,
- there is also a binary distribution on the Subversion downloads
- page
+ E.3 Preparation

- http://subversion.tigris.org/servlets/ProjectDocumentList
+ This section descibes how to unpack the files to make a build tree.

- The file there is named
+ * Make a directory SVN and cd into it.
+ * Checkout Subversion:

- db-4.2.52-win32.zip
+ svn co http://svn.collab.net/repos/svn/trunk/ src-trunk

- Unpack the distribution into the root directory of the Subversion
- source tree as <SVN>\db4-win32. It's a good idea to add
- <SVN>\db4-win32\bin to your PATH, so that Subversion can find the
- Berkeley DB DLLs.
+ * Install Visual Studio 6. You either have to tell the installer to
+ register environment variables or run VCVARS32.BAT before building
+ anything.
+ * Install a recent Windows Core SDK
+ * Register the SDK with Visual Studio 6. This is a quote from the
+ Microsoft February 2003 SDK documentation:

- [NOTE: This binary package of Berkeley DB is provided for
- convenience only. Please don't address questions about
- Berkeley DB that aren't directly related to using Subversion
- to the project mailing list.]
+ "To register the SDK bin, include, and library directories with
+ Microsoft Visual StudioŽ version 6.0 and Visual Studio .NET,
+ click Start, point to All Programs, point to Microsoft Platform
+ SDK February 2003, point to Visual Studio Registration, and then
+ click Register PSDK Directories with Visual Studio. This
+ registration process places the SDK bin, include, and library
+ directories at the beginning of the search paths, which ensures
+ that the latest headers and libraries are used when building
+ applications in the IDE. Note that for Visual Studio 6.0
+ integration to succeed, Visual Studio 6.0 must run at least once
+ before you select Register PSDK Directories with Visual
+ Studio. Also note that when this option is run, the IDEs should
+ not be running."

- If you build Berkeley DB from the source, you will have to copy
- the file db-4.2.52\build_win32\db.h to <SVN>\db4-win32\include,
- and all the import libraries to <SVN>\db4-win32\lib. Again, the
- DLLs should be somewhere in your path.
+ * Install Python and add it to your path
+ * Install Perl
+ * Install Apache 2 using the msi file
+ * Extract neon into SVN\src-trunk\neon
+ * Extract the Berkeley DB files into SVN\src-trunk\db4-win32. It's a
+ good idea to add SVN\src-trunk\db4-win32\bin to your PATH, so that
+ Subversion can find the Berkeley DB DLLs.

- The latest version of apr-util (see Section I.1) must be told
- where to find the Berkeley DB include files and libraries. You
- can do this with the w32locatedb.pl script (located in the "build"
- directory in the apr-util sources), which modifies apr-util's
- header and DSP files. The instructions at the top of the script
- file explain how to use the script.
+ [NOTE: This binary package of Berkeley DB is provided for
+ convenience only. Please don't address questions about
+ Berkeley DB that aren't directly related to using Subversion
+ to the project mailing list.]

- If your copy of apr-util does not contain build\w32locatedb.pl,
- you can download a recent version from here:
+ If you build Berkeley DB from the source, you will have to copy
+ the file db-4.2.52\build_win32\db.h to
+ SVN\src-trunk\db4-win32\include, and all the import libraries to
+ SVN\src-trunk\db4-win32\lib. Again, the DLLs should be somewhere in
+ your path.

- http://subversion.tigris.org/files/documents/15/8705/w32locatedb.pl
+ * Extract Apache source into SVN\http-2.0.49
+ * Extract the pre-built zlib into SVN\zlib and copy
+ SVN\zlib\static32\zlibstat.lib into SVN\zlib
+ * Extract openssl into SVN\openssl-0.9.7d
+ * Extract nasm into SVN\nasm and put it in your path
+ * Put the w32locatedb.pl script in
+ httpd-2.0.49\srclib\apr-util\build\w32locatedb.pl if it isn't already
+ there.
+ * Make a directory SVN\gettext and unpack
+ gettext-runtime-0.12.1.bin.woe32.zip,
+ gettext-tools-0.12.1.bin.woe32.zip, and
+ libiconv-1.9.1.bin.woe32.zip into it. Add SVN\gettext\bin to your
+ path, SVN\gettext\include to your INCLUDE path and
+ SVN\gettext\lib to your LIB path environment variables. You can
+ add these on the command line as shown below.

- You will need Perl 5.8 to run this script.
+ E.4 Building the Binaries

- To build the Apache module, you will also need the Apache 2.0.49
- or later Win32 source. You can download it from here:
+ To build the binaries either follow the instructions here or run
+ build\win32\vc6-build.bat. There are some variables at the start of
+ vc6-build.bat which you may need to change before running it.

- http://httpd.apache.org/download.cgi
+ Start in the SVN directory you created.

- Finally, you will need to copy the Apache apr libraries into the
- root of the Subversion source tree.
+ Set up the environment.

- [NOTE: Subversion can use the gettext tools and library for localization
- support. Use the "--enable-nls" option to the gen-make.py script.
- You will need a working gettext development installation with it's
- 'bin' directory in your system's PATH and it's 'include' and 'lib'
- directories in your system's INCLUDE and LIB paths. The runtime
- packages from http://mirrors.kernel.org/gnu
- (gettext-runtime-0.12.1.bin.woe32.zip,
- gettext-tools-0.12.1.bin.woe32.zip, and libiconv-1.9.1.bin.woe32.zip)
- have been tested and are known to work.]
+ C:>set VER=trunk
+ C:>set DIR=trunk
+ C:>set DRIVE=C
+ C:>set PYTHONDIR=C:\Python22
+ C:>set SDKINC=C:\Program Files\Microsoft SDK\include
+ C:>set SDKLIB=C:\Program Files\Microsoft SDK\lib
+ C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2
+ C:>set GETTEXTINC=C:\SVN\gettext\include
+ C:>set GETTEXTLIB=C:\SVN\gettext\lib
+ C:>set GETTEXTBIN=C:\SVN\gettext\bin
+ C:>PATH=%PATH%;%DRIVE%:\SVN\src-%DIR%\db4-win32;%DRIVE%:\SVN\nasm;%PYTHONDIR%;%GETTEXTBIN%
+ C:>set INCLUDE=%SDKINC%;%INCLUDE%;%GETTEXTINC%
+ C:>set LIB=%SDKLIB%;%LIB%;%GETTEXTLIB%

- Walkthrough:
+ OpenSSL

- Unzip the Apache source, copy the w32locatedb.pl script to the
- srclib\apr-util\build directory, and run it to prepare the
- apr-util sources.
+ C:>cd openssl-0.9.7d
+ C:>perl Configure VC-WIN32
+ C:>call ms\do_nasm
+ C:>nmake -f ms\ntdll.mak
+ C:>cd out32dll
+ C:>call ..\ms\test
+ C:>cd ..\..

- Open the Apache.dsw file and build the Apache source. If you
- don't compile Apache, mod_dav_svn will not build.
+ Apache 2

- Run "python gen-make.py -t dsp --with-httpd=<path-to-httpd>"
- to generate the Visual C++ 6.x project files. If you don't
- want to build mod_dav_svn, omit the --with-httpd option. In
- this case, you will have to tell the generator where to find
- the APR libraries; the options are --with-apr, --with-apr-util
- and --with-apr-iconv.
- Run "python gen-make.py -help" to see other options.
+ C:>perl httpd-2.0.49\srclib\apr-util\build\w32locatedb.pl dll src-%DIR%\db4-win32\include src-%DIR%\db4-win32\lib
+ C:>msdev httpd-2.0.49\apache.dsw /MAKE "BuildBin - Win32 Release"

- Open the subversion_msvc.dsw file gen-make creates in the
- top-level directory. Compile the __ALL__ target to compile
- everything, __ALL_TESTS__ to also build the test programs.
+ Subversion

- The following is a sample script.
- gunzip, tar, and unzip are native win32 apps taken from
+ Things to note:

- http://unxutils.sourceforge.net/
+ * If you don't want to build mod_dav_svn, omit the --with-httpd
+ option. In this case, you will have to tell the generator where
+ to find the APR libraries; the options are --with-apr,
+ --with-apr-util and --with-apr-iconv.
+ * If you would like a debug build substitute Debug for Release in
+ the msdev commands.
+ * There have been rumors that Subversion on Win32 can be built
+ using the latest cygwin. ymmv.
+ * The /USEENV switch to msdev makes it take notice of the INCLUDE and
+ LIB environment variables, it also makes it ignore it's own lib and
+ include settings so you need to have the Windows SDK lib and include
+ directories in the LIB and INCLUDE environment variables. Do *not*
+ use this switch when starting up the msdev Visual environment. If you
+ wish to build in the Visual environment the SDK lib and include
+ directories must be in the Tools/Options/Directories settings (if you
+ followed the 'Register the SDK with Visual Studio 6' instructions
+ above this has been done for you).
+ * If you are using Visual Studio .NET add -t vcproj to the gen-make.py
+ command, you will also have to distribute the C runtime dll with the
+ binaries.
+ * Apache must not be running or the copy of the modules will fail.

- C:\SVN> svn co http://svn.collab.net/repos/svn/trunk src
- C:\SVN> gunzip neon-0.24.5.tar.gz
- C:\SVN> cd src
- C:\SVN\src> tar -xvf ..\neon-0.24.5.tar
- C:\SVN\src> ren neon-0.24.5 neon
- C:\SVN\src> unzip ..\db-4.2.52-win32.zip
- C:\SVN\src> cd ..
- C:\SVN> unzip httpd_2.0.49-win32-src.zip
- C:\SVN> copy w32locatedb.pl httpd-2.0.49\srclib\apr-util\build
- C:\SVN> perl httpd-2.0.49\srclib\apr-util\build\w32locatedb.pl dll src\db4-win32\include src\db4-win32\lib
- C:\SVN> msdev httpd-2.0.49\apache.dsw /MAKE "BuildBin - Win32 Debug"
- C:\SVN> cd src
- C:\SVN\src> python gen-make.py -t dsp --with-httpd=..\httpd-2.0.49
- C:\SVN\src> msdev subversion_msvc.dsw /MAKE "__ALL__ - Win32 Debug"
+ C:>cd src-%DIR%
+ C:>python gen-make.py -t dsp --with-httpd=..\httpd-2.0.49 --with-berkeley-db=db4-win32 --with-openssl=..\openssl-0.9.7d --with-zlib=..\zlib --enable-nls
+ C:>msdev subversion_msvc.dsw /USEENV /MAKE "__ALL_TESTS__ - Win32 Release"
+ C:>cd ..

- [NOTE: Substitute "Release" for "Debug" in the "msdev" command lines
- above if you want binaries optimized for release.]
+ The binaries have now been built.

- [ALSO NOTE: There have been rumors that Subversion on Win32 can be built
- using the latest cygwin. ymmv.]
+ E.5 Packaging the binaries

+ You now need to copy the binaries ready to make the release zip
+ file. You also need to do this to run the tests as the new binaries
+ need to be in your path.

+ From within the SVN directory copy these files:
+
+ C:>mkdir svn-win32-%VER%
+ C:>mkdir svn-win32-%VER%\bin
+ C:>mkdir svn-win32-%VER%\httpd
+ C:>mkdir svn-win32-%VER%\iconv
+ C:>copy src-%DIR%\db4-win32\bin\libdb42.dll svn-win32-%VER%\bin
+ C:>copy openssl-0.9.7d\out32dll\libeay32.dll svn-win32-%VER%\bin
+ C:>copy openssl-0.9.7d\out32dll\ssleay32.dll svn-win32-%VER%\bin
+ C:>copy httpd-2.0.49\srclib\apr\Release\libapr.dll svn-win32-%VER%\bin
+ C:>copy httpd-2.0.49\srclib\apr-iconv\Release\libapriconv.dll svn-win32-%VER%\bin
+ C:>copy httpd-2.0.49\srclib\apr-util\Release\libaprutil.dll svn-win32-%VER%\bin
+ C:>copy gettext\bin\intl.dll svn-win32-%VER%\bin
+ C:>copy gettext\bin\iconv.dll svn-win32-%VER%\bin
+ C:>copy src-%DIR%\Release\subversion\clients\cmdline\svn.exe svn-win32-%VER%\bin
+ C:>copy src-%DIR%\Release\subversion\svnadmin\svnadmin.exe svn-win32-%VER%\bin
+ C:>copy src-%DIR%\Release\subversion\svndumpfilter\svndumpfilter.exe svn-win32-%VER%\bin
+ C:>copy src-%DIR%\Release\subversion\svnlook\svnlook.exe svn-win32-%VER%\bin
+ C:>copy src-%DIR%\Release\subversion\svnserve\svnserve.exe svn-win32-%VER%\bin
+ C:>copy src-%DIR%\Release\subversion\svnversion\svnversion.exe svn-win32-%VER%\bin
+
+ E.6 Testing the Binaries
+
+ The build process creates the binary test programs but it does not
+ copy the client tests into the release test area.
+
+ C:>cd src-%DIR%
+ C:>mkdir Release\subversion\tests\clients
+ C:>xcopy /S /Y subversion\tests\clients Release\subversion\tests\clients
+
+ Copy the dso files into the Apache modules directory.
+
+ C:>copy Release\subversion\mod_dav_svn\mod_dav_svn.so "%APACHEDIR%"\modules
+ C:>copy Release\subversion\mod_authz_svn\mod_authz_svn.so "%APACHEDIR%"\modules
+ C:>copy svn-win32-%VER%\bin\intl.dll "%APACHEDIR%\bin"
+ C:>copy svn-win32-%VER%\bin\iconv.dll "%APACHEDIR%\bin"
+ C:>copy svn-win32-%VER%\bin\libdb42.dll "%APACHEDIR%\bin"
+ C:>copy httpd-2.0.49\srclib\apr-iconv\Release\iconv\*.so svn-win32-%VER%\iconv
+ C:>cd ..
+
+ Put the svn-win32-trunk\bin directory at the start of your path so
+ you run the newly built binaries and not another version you might
+ have installed.
+
+ Configure Apache to use the mod_dav_svn and mod_authz_svn modules by
+ making sure these lines appear uncommented in httpd.conf:
+
+ LoadModule dav_module modules/mod_dav.so
+ LoadModule dav_fs_module modules/mod_dav_fs.so
+ LoadModule dav_svn_module modules/mod_dav_svn.so
+ LoadModule authz_svn_module modules/mod_authz_svn.so
+
+ And further down the file add location directives to point to the
+ test repositories. Change the paths to the SVN directory you created:
+
+ <Location /repositories>
+ DAV svn
+ SVNParentPath C:/SVN/src-trunk/Release/subversion/tests/clients/cmdline/repositories
+ </Location>
+
+ <Location /local_tmp/repos>
+ DAV svn
+ SVNPath c:/SVN/src-trunk/Release/subversion/tests/clients/cmdline/local_tmp/repos
+ </Location>
+
+ Then restart Apache and run the tests:
+
+ C:>PATH=%DRIVE%:\SVN\svn-win32-%VER%\bin;%PATH%
+ C:>cd src-%DIR%
+ C:>python win-tests.py -c -r -v
+ C:>python win-tests.py -c -r -v --url="http://localhost"
+ C:>cd ..
 
 III. BUILDING A SUBVERSION SERVER
       ============================

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 5 14:27:15 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.