@echo off @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM http://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. rem NOTE: This file expects to be run from the Visual Studio rem Command Prompt, typically accessed by going to rem "Tools" -> "Visual Studio Command Prompt". This isn't strictly rem required, but more of the environment must then be explicitly set. rem ====== Environment change lives only for the duration of the script setlocal rem ====== Set these shell variables before doing a build. rem VER is used to name the output bin dir as svn-win32-%VER% set VER=trunk rem DIR is appended to src- to make the dir name, e.g., src-trunk set DIR=trunk set DRIVE=C set PYTHONDIR=C:\Python27 set AWKDIR=C:\SVN\awk set NASMDIR=C:\SVN\NASM set APACHEDIR=C:\Program Files\Apache Group\Apache2 set GETTEXTINC=C:\SVN\gettext\include set GETTEXTLIB=C:\SVN\gettext\lib set GETTEXTBIN=C:\SVN\gettext\bin set ZLIBPROJ=zlib\contrib\vstudio\vc14 rem These values can be found by looking at available options in Visual Studio rem under "Target Platform Version" for VSSDKVER, and "Platform Toolset" for VSPLATVER set VSPLATVER=v140 set VSSDKVER=10.0.14393.0 rem Set to enable building httpd and server DSO modules, otherwise only apr,apr-util,apr-iconv rem is necessary set BUILD_HTTPD=0 rem ====== End of shell variables which need to be set. rem Set up path to include Python and BDB. PATH=%PATH%;%DRIVE%:\SVN\src-%DIR%\db4-win32;%NASMDIR%;%PYTHONDIR%;%AWKDIR%;%GETTEXTBIN% set INCLUDE=%INCLUDE%;%GETTEXTINC% set LIB=%LIB%;%GETTEXTLIB% rem Check that the subversion code exists here. cd %DRIVE%:\SVN\src-%DIR% if not exist subversion goto wrongstartdir cd .. rem ====== Check the prerequisites are at least in the right place. if /I "%BUILD_HTTPD%" EQU "1" ( if not exist httpd goto httpderr ) else ( if not exist libexpat goto expaterr if not exist apr goto aprerr if not exist apr-util goto aprutilerr if not exist apr-iconv goto apriconverr ) if not exist nasm goto nasmerr if not exist openssl goto opensslerr if not exist src-%DIR% goto svnerr if not exist zlib goto zliberr if not exist src-%DIR%\db4-win32 goto bdberr if not exist gettext goto gettexterr goto allok :wrongstartdir echo Unable to find %DRIVE%:\SVN\src-%DIR%\subversion goto theveryend :aprerr echo Unable to find apr goto end :expaterr echo Unable to find libexpat goto end :aprutilerr echo Unable to find apr-util goto end :apriconverr echo Unable to find apr-iconv goto end :httpderr echo Unable to find httpd goto end :nasmerr echo Unable to find nasm goto end :opensslerr echo Unable to find openssl goto end :svnerr echo Unable to find Subversion source in src-%DIR% goto end :zliberr echo Unable to find zlib goto end :bdberr echo Unable to find Berekely DB goto end :gettexterr echo Unable to find gettext goto end :allok rem ====== Build openssl. cd openssl perl Configure VC-WIN32 call ms\do_nasm nmake -f ms\ntdll.mak cd out32dll REM call ..\ms\test cd ..\.. if /I "%BUILD_HTTPD%" EQU "1" ( rem ====== Build Apache 2 rem FIXME - STILL USING VC6 commands here, needs to be updated. cd src-%DIR% python gen-make.py -t dsp --with-httpd=..\httpd-2.0.50 --with-berkeley-db=db4-win32 --with-openssl=..\openssl-0.9.7d --with-zlib=..\zlib --enable-nls --enable-bdb-in-apr-util cd .. msdev httpd-2.0.50\apache.dsw /MAKE "BuildBin - Win32 Release" ) else ( rem ====== libexpat cd libexpat\expat msbuild /p:Configuration=Release /p:PlatformToolset=%VSPLATVER% /p:WindowsTargetPlatformVersion=%VSSDKVER% set LIB=!LIB!;%DRIVE%:\SVN\libexpat\expat\win32\bin\Release set INCLUDE=!INCLUDE!;%DRIVE%:\SVN\libexpat\expat\lib cd ..\..\ rem ======= apr cd apr nmake /f Makefile.win buildall install rem ======= apr-util cd ..\apr-util nmake /f Makefile.win XML_PARSER=libexpat buildall install cd ..\ copy libexpat\expat\lib\expat.h apr-dist\include copy libexpat\expat\lib\expat_external.h apr-dist\include copy libexpat\expat\win32\bin\Release\libexpat.lib apr-dist\lib ) rem ======= zlib rem == If the project needs updating to current visual studio project, use command; rem devenv zlibstat.vcxproj /upgrade cd zlib\contrib\masmx86 bld_ml32 cd ..\..\.. msbuild %ZLIBPROJ%\zlibstat.vcxproj /p:Configuration=Release copy %ZLIBPROJ%\x86\ZlibStatRelease\zlibstat.lib zlib copy %ZLIBPROJ%\x86\ZlibStatDebug\zlibstat.lib zlib\zlibstatD.lib rem ====== Subversion cd src-%DIR% if /I "%BUILD_HTTPD%" EQU "0" ( python gen-make.py ^ --vsnet-version=2015 --with-openssl=C:\SVN\openssl ^ --with-apr=C:\SVN\apr-dist --with-apr-util=C:\SVN\apr-dist ^ --with-apr-iconv=C:\SVN\apr-dist --with-zlib=C:\SVN\zlib msbuild /p:Configuration=Release subversion_vcnet.sln ) REM msdev subversion_msvc.dsw /USEENV /MAKE "__ALL_TESTS__ - Win32 Release" REM mkdir Release\subversion\tests\cmdline REM xcopy /S /Y subversion\tests\cmdline Release\subversion\tests\cmdline REM copy Release\subversion\mod_dav_svn\mod_dav_svn.so "%APACHEDIR%"\modules REM copy Release\subversion\mod_authz_svn\mod_authz_svn.so "%APACHEDIR%"\modules cd .. rem ====== Copy the binaries into a tree suitable for zipping. mkdir svn-win32-%VER% mkdir svn-win32-%VER%\bin mkdir svn-win32-%VER%\iconv copy src-%DIR%\db4-win32\bin\libdb42.dll svn-win32-%VER%\bin copy openssl\out32dll\libeay32.dll svn-win32-%VER%\bin copy openssl\out32dll\ssleay32.dll svn-win32-%VER%\bin if /I "%BUILD_HTTPD%" EQU "1" ( mkdir svn-win32-%VER%\httpd copy httpd\srclib\apr\Release\libapr.dll svn-win32-%VER%\bin copy httpd\srclib\apr-iconv\Release\libapriconv.dll svn-win32-%VER%\bin copy httpd\srclib\apr-iconv\Release\iconv\*.so svn-win32-%VER%\iconv copy httpd\srclib\apr-util\Release\libaprutil.dll svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\mod_authz_svn\mod_authz_svn.so svn-win32-%VER%\httpd copy src-%DIR%\Release\subversion\mod_dav_svn\mod_dav_svn.so svn-win32-%VER%\httpd ) ELSE ( ) copy gettext\bin\libintl3.dll svn-win32-%VER%\bin copy gettext\bin\libiconv2.dll svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svn\svn.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svnadmin\svnadmin.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svndumpfilter\svndumpfilter.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svnlook\svnlook.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svnserve\svnserve.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svnversion\svnversion.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svnrdump\svnrdump.exe svn-win32-%VER%\bin copy src-%DIR%\Release\subversion\svnmucc\svnmucc.exe svn-win32-%VER%\bin REM copy svn-win32-%VER%\bin\intl.dll "%APACHEDIR%\bin" REM copy svn-win32-%VER%\bin\iconv.dll "%APACHEDIR%\bin" REM copy svn-win32-%VER%\bin\libdb42.dll "%APACHEDIR%\bin" rem ====== Configure Apache ready for doing tests. REM @echo off REM echo Configure Apache to use the mod_dav_svn and mod_authz_svn modules REM echo by making sure these lines appear uncommented in httpd.conf: REM echo LoadModule dav_module modules/mod_dav.so REM echo LoadModule dav_fs_module modules/mod_dav_fs.so REM echo LoadModule dav_svn_module modules/mod_dav_svn.so REM echo LoadModule authz_svn_module modules/mod_authz_svn.so REM echo And further down the file add: REM echo ^ REM echo DAV svn REM echo SVNParentPath %DRIVE%:/SVN/src-%DIR%/Release/subversion/tests/cmdline/svn-test-work/repositories REM echo ^ REM echo ^ REM echo DAV svn REM echo SVNPath %DRIVE%:/SVN/src-%DIR%/Release/subversion/tests/cmdline/svn-test-work/local_tmp/repos REM echo ^ REM echo Then restart Apache. REM echo Please configure Apache and press enter: REM pause REM @echo on rem ====== Run the tests. PATH=%DRIVE%:\SVN\svn-win32-%VER%\bin;%PATH% cd src-%DIR% python win-tests.py -c -r -v REM python win-tests.py -c -r -v -u http://localhost cd .. :end cd src-%DIR% endlocal :theveryend