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

Building SVN (dependencies) on Windows

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Mon, 20 Apr 2020 15:36:00 +0200

Let's start a new thread with the bits of information I posted about
building on Windows in the "Release Notes: TODO regarding Py3 support"
thread [1].

Building SVN on Windows is pretty hard, especially the dependencies. A lot
of the dependencies have (Windows-specific) problems or quirks in their
build scripts.

Useful documents / tools in our own source tree (but they are a but rusty /
out-of-date):
- INSTALL: definitely needs a refresh / update.
- tools/dev/windows-build: contains a Makefile that can be useful on
Windows, if you don't want to build from within the VS IDE (and as a config
"wrapper" around gen-make.py).
- tools/dev/build-svn-deps-win.pl: needs resurrection, i.e. update and
cleanup of old vs updated components. It contains a couple of scripted
fixes for some of the externally broken build scripts (e.g. httpd). Perhaps
those fixes should be brought upstream (at least they should be checked
against the latest version of their component). Perhaps could use Debug vs.
Release configuration, as well as x86 vs. x64. Cross pointing between this
script and INSTALL would be ideal.

My personal notes for building SVN's dependencies (trying to build an x86
Release build):

- Get the following tools, and make sure they are in your PATH:
* Perl (I've taken the last Strawberry distribution from perl.org)
* Python from python.org (download both a 2.7 and a 3.x build, you'll
probably need both, as there are still problems with 3.x for svn builds).
* awk (from https://www.cs.princeton.edu/~bwk/btl.mirror/awk95.exe)
* test.exe, from GnuWin32 (used by that Makefile from
tools/dev/windows-build)

zlib:
    # clean: nmake -f win32/Makefile.msc clean
    nmake -f win32/Makefile.msc
    nmake -f win32/Makefile.msc test
    (workaround for svn build: it looks for zlibstat.lib) nmake /nologo -f
win32/Makefile.msc STATICLIB=zlibstat.lib all

    building DEBUG configuration:
    set CC_OPTS=/MDd /Gm /ZI /Od /GZ /D_DEBUG
    nmake /nologo -f win32/Makefile.msc STATICLIB=zlibstatD.lib all

    Do not try to build the assembler optimized versions, it causes
headaches

openssl:
    Need Netwide Assembler, a.k.a. NASM, available from https://www.nasm.us
(after install, put in PATH)
    perl Configure enable-zlib --with-zlib-include=../zlib-1.2.11
--with-zlib-lib=../zlib-1.2.11/zlib.lib VC-WIN32
    For openssl 1.0.2*:
      call ms\do_nasm
      nmake -f ms\ntdll.mak
      nmake -f ms\ntdll.mak test
    For openssl 1.1.x:
      nmake
      nmake test

PCRE (from pcre.org, needed for httpd -- not pcre2, only pcre (version 1)
works):
    cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DBUILD_SHARED_LIBS:BOOL=ON -DPCRE_NO_RECURSE:BOOL=ON .
    nmake
    nmake test

expat (needed for httpd / apr-util):
    download and extract expat (https://libexpat.github.io/)
    (Follow instructions from cmake.README):
    cd expat
    mkdir build
    cd build
    cmake ..
    msbuild expat.sln (debug build)
    msbuild expat.sln /p:Configuration=Release
>>>> This is 64-bit build!! httpd now also needs to be built 64bit
>>>> or: open expat.sln > Configuration Mgr > Add x86 (win32)
configuration, save & exit + edit all vcprojx files and remove "
/machine:x64"

httpd:
    download and extract httpd
    download and extract apr, apr-util, apr-iconv into httpd\srclib\apr
..\apr-util ..\apr-iconv
    Attention: Do not try to use junctions (windows symlinks), just copy
the directories.
    Attention 2: Check if the downloaded / extracted files are marked by
Windows as "Blocked" (rightclick -> Properties). If so unblock them in bulk
from within Powershell (Run as Administrator), with "dir -s | Unblock-File".
    put built pcre under httpd\srclib
    put built openssl under httpd\srclib (and name it 'openssl')
    put built zlib under httpd\srclib (and name it 'zlib')
    The directories below srclib should be:
        apr
        apr-iconv
        apr-util
        openssl
        pcre
        zlib
    put built expat under httpd\srclib\apr-util\xml
    copy libexpat.lib into srclib/apr-util
    copy libexpat.lib from Release and libexpatD.pdb from Debug into
expat\lib\LibR, and name them xml.lib and xml.pdb
    (for debug build) copy libexpatd.lib and libexpatD.pdb from Debug into
expat\lib\LibD, and name them xml.lib and xml.pdb
    edit apr-util\Makefile.win, and unquote libexpat in
XML_PARSER="libexpat"
      see https://www.mail-archive.com/dev@apr.apache.org/msg27347.html
    perl srclib\apr\build\lineends.pl
    perl srclib\apr\build\cvtdsp.pl -2005
    (for openssl 1.1.x) perl srclib\apr\build\cvtdsp.pl -ossl11
    Open Apache.dsw in VS2019 to let it be converted / upgrade to .sln with
.vcxproj files (made from de .dsp files)
    Strip "/Yuiconv" en "Yciconv" out of
srclib/apr-iconv/build/modules.mk.win (not sure if this is still needed)
    Insert
"<PropertyGroup><GenerateManifest>false</GenerateManifest></PropertyGroup>"
in support/win32/ApacheMonitor.vcxproj
    Insert
"<PropertyGroup><TargetName>libapr-1</TargetName></PropertyGroup>" in
srclib/apr/libapr.vcxproj
    Insert
"<PropertyGroup><TargetName>apr_ldap-1</TargetName></PropertyGroup>" in
srclib/aprutil/ldap/apr_ldap.vcxproj
    Insert
"<PropertyGroup><TargetName>libapriconv-1</TargetName></PropertyGroup>" in
srclib/apr-iconv/libapriconv.vcxproj
    Insert
"<PropertyGroup><TargetName>libaprutil-1</TargetName></PropertyGroup>" in
srclib/aprutil/libaprutil.vcxproj

    Create directory C:\Apache2.4.43 in which the httpd build can be
installed.
    # Add XML_PARSER="libexpat" to nmake commando (
https://www.mail-archive.com/dev@apr.apache.org/msg27346.html)
    nmake /f Makefile.win installr INSTDIR=C:\Apache2.4.43
XML_PARSER="libexpat"
    # If anything fails, first try it again:
    nmake /f Makefile.win installr INSTDIR=C:\Apache2.4.43
XML_PARSER="libexpat"

    Possibly: Rerun _install like this: nmake /f Makefile.win SHORT=R
LONG=Release _install INSTDIR=C:\Apache2.4.43 XML_PARSER="libexpat"
    Possibly: copy apr-util\xml\expat\Release\expat.dll to
C:\Apache2.4.43\bin

serf (the problems here below were just reported to dev_at_serf.a.o [2]):

    Download and install latest scons version, in your Python 2.7
installation (so first make sure Python 2.7 is first in PATH, then run the
installation of scons).
    The serf build does not work with Python 3.x.
    If using openssl 1.1.x, patch serf/SConstruct as follows:
    [[[
--- SConstruct.orig 2020-04-19 15:36:16.257450600 +0200
+++ SConstruct 2020-04-19 15:36:51.855740800 +0200
@@ -335,7 +335,7 @@
                LIBPATH=['$ZLIB'])

   # openssl
- env.Append(LIBS=['libeay32.lib', 'ssleay32.lib'])
+ env.Append(LIBS=['libcrypto.lib', 'libssl.lib'])
   if not env.get('SOURCE_LAYOUT', None):
     env.Append(CPPPATH=['$OPENSSL/include/openssl'],
                LIBPATH=['$OPENSSL/lib'])
@@ -343,8 +343,8 @@
     env.Append(CPPPATH=['$OPENSSL/inc32'],
                LIBPATH=['$OPENSSL/out32'])
   else:
- env.Append(CPPPATH=['$OPENSSL/inc32'],
- LIBPATH=['$OPENSSL/out32dll'])
+ env.Append(CPPPATH=['$OPENSSL/include'],
+ LIBPATH=['$OPENSSL'])
 else:
   if os.path.isdir(apr):
     apr = os.path.join(apr, 'bin', 'apr-1-config')
    ]]]

    With Python 2.7 in PATH, run:
    scons APR=..\httpd-2.4.43\srclib\apr
APU=..\httpd-2.4.43\srclib\apr-util OPENSSL=..\openssl-1.1.1f
ZLIB=..\zlib-1.2.11

    If you get this error:
        scons: *** Invalid value for option MSVC_VERSION: 14.2. Valid
values are: ('14.0', '12.0', '11.0', '10.0', '9.0', '8.0', '6.0')
        File "C:\research\svn\dev\deps\serf-1.3.9\SConstruct", line 157, in
<module>
    Delete the file .saved_config, and try again.

[1]
https://lists.apache.org/thread.html/r4c630849db5bc24c0e8dbde5ef5d03f6256727d6058a9a70862335b7%40%3Cdev.subversion.apache.org%3E
[2]
https://lists.apache.org/thread.html/r30cbdeea2c65f77af338fa2515e25ca971cdd511f83bf06672e4e6ed%40%3Cdev.serf.apache.org%3E

-- 
Johan
Received on 2020-04-20 15:36:17 CEST

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