Skip to content

Instantly share code, notes, and snippets.

@ahwm
Last active December 29, 2023 21:28
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahwm/47dca1ae4290094a539d5dcc30338fb9 to your computer and use it in GitHub Desktop.
Save ahwm/47dca1ae4290094a539d5dcc30338fb9 to your computer and use it in GitHub Desktop.
Build SVN 1.14.x on Windows using ApacheLounge release of Apache 2.4
rem Prerequisite: Visual Studio 2019 with "Desktop Development with C++" workload installed (different versions may work with modifications)
rem Prerequisite: Python 2.7 or 3.8 (Subversion's 3.x support is experimental, so this script still uses 2.7)
rem Prerequisite: JDK, uses Amazon Corretto 8: https://corretto.aws/downloads/latest/amazon-corretto-8-x64-windows-jdk.zip (Update path below)
rem Prerequisite: OpenSSL, download from: https://slproweb.com/products/Win32OpenSSL.html
rem md \build-svn
rem md \build-svn\svn
rem download httpd 2.4 from https://www.apachelounge.com/download/ -> \build-svn\Apache24
rem download subversion 1.14.x from https://subversion.apache.org/download.cgi#recommended-release -> \build-svn\subversion-%VERSION%
rem download serf 1.3.10 from https://downloads.apache.org/serf/serf-1.3.10.zip -> \build-svn\serf-1.3.10
rem download serf.mak from https://github.com/Jan-E/svn-windows/raw/master/serf.mak -> \build-svn\serf-1.3.10\serf.mak
rem download expat from https://github.com/libexpat/libexpat/archive/R_2_5_0.zip -> \build-svn\expat-2.5.0
rem download sqlite from https://www.sqlite.org/2023/sqlite-amalgamation-3440200.zip -> \build-svn\sqlite-amalgamation-3440200
rem download zlib from https://zlib.net/zlib13.zip -> \build-svn\zlib-1.3
rem save following batch -> \build-svn\build.cmd
rem cd \build-svn
rem build.cmd
set SVNVERSION=1.14.3
set JDK=C:\Downloads\amazon-corretto-8.392.08.1-windows-x64-jdk\jdk1.8.0_392
set APR=C:\build-svn\Apache24
set HTTPD=C:\build-svn\Apache24
set OPENSSL=C:\Program Files\OpenSSL-Win64
set ZLIB=C:\build-svn\Apache24
set ZLIBINC=C:\build-svn\zlib-1.3
set EXPAT=C:\build-svn\expat-2.5.0
set SQLITE=C:\build-svn\sqlite-amalgamation-3440200
set SERF=C:\build-svn\serf-1.3.10
set PYTHON=C:\Python27
set VS=2019
set VSPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
copy %ZLIBINC%\*.h .\Apache24\include
copy %EXPAT%\lib\*.h .\Apache24\include /y
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
cd %ZLIBINC%
nmake -f win32/Makefile.msc clean
nmake -f win32/Makefile.msc
copy *.lib %HTTPD%\lib
copy *.dll %HTTPD%\bin
set lib="%OPENSSL%\lib";%ZLIBINC%;%HTTPD%\lib;%lib%
set include="%OPENSSL%\include";%ZLIBINC%;%HTTPD%\include;%include%
cd %SERF%
nmake /s /nologo /f serf.mak CLEAN APR_SRC=%APR% APRUTIL_SRC=%APR% ZLIB_SRC=%ZLIB% OPENSSL_SRC=%OPENSSL%
nmake /s /nologo /f serf.mak ALL APR_SRC=%APR% APRUTIL_SRC=%APR% ZLIB_SRC=%ZLIB% OPENSSL_SRC=%OPENSSL%
if exist Release\serf-1.lib copy Release\serf-1.lib . /y
cd \build-svn\subversion-%SVNVERSION%
%PYTHON%\python gen-make.py --release -t vcproj --vsnet-version=%VS% --with-apr-util=%APR% --with-apr=%APR% --with-apr-iconv=%APR% --with-apr_memcache=%APR% --with-httpd=%HTTPD% --with-openssl=%OPENSSL% --with-zlib=%ZLIB% --with-sqlite=%SQLITE% --with-jdk=%JDK% --with-serf=%SERF%
devenv subversion_vcnet.sln /Build "Release|x64"
set path="%OPENSSL%\bin";%HTTPD%\bin;C:\build-svn\subversion-%SVNVERSION%\Release;%path%
%PYTHON%\python win-tests.py --release --cleanup
md \build-svn\svn\bin
md \build-svn\svn\lib
md \build-svn\svn\modules
cd \build-svn\subversion-%SVNVERSION%
for /r %%f in (*.dll, *.exe) do @copy "%%f" \build-svn\svn\bin /y
for /r %%f in (*.lib) do @copy "%%f" \build-svn\svn\lib /y
for /r %%f in (*.so) do @copy "%%f" \build-svn\svn\modules /y
cd \build-svn\svn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment