Skip to content
Permalink
Browse files
support CouchDB 1.2.0 with SDK 7.1
- prepare for future switch to msys for faster forking & therefore compilation
- split out compilers into c:/opt and source into erlang and couchdb sections
- bump all component build scripts for compatibility with SDK 7.1 and Erlang/OTP R15B
  • Loading branch information
dch committed Mar 26, 2012
1 parent f595afd commit c89bf640406da7dff473e0f76a8e5a314bfd9832
Showing 18 changed files with 165 additions and 56 deletions.
@@ -186,9 +186,7 @@ can take several hours on slower machines:
erl_build.sh

* the output is logged into `$ERL_TOP/build_*.txt` if required
* at this point I usually duplicate the OTP source tree for later, as
Running the same command swapping the parameters will clean out
the build tree completely.
* at this point I usually duplicate the OTP source tree for later

robocopy $ERL_TOP /relax/release/$OTP_REL -mir

@@ -1,7 +1,7 @@
::setlocal
path=%path%;%relax%\cmake\bin;c:\mozilla-build\7zip;%relax%\openssl\bin;
path=%path%;%opt%\cmake\bin;c:\mozilla-build\7zip;%relax%\openssl\bin;

for %%i in ("%RELAX%\bits\curl-*.zip") do set curl_ver=%%~ni
for %%i in ("%glazier%\bits\curl-*.zip") do set curl_ver=%%~ni
setx CURL_VER %curl_ver%
set CURL_SRC=%RELAX%\%curl_ver%
setx CURL_SRC %curl_src%
@@ -30,6 +30,7 @@ set INCLUDE=%INCLUDE%;%SSL_PATH%\include;%SSL_PATH%\include\openssl;
set LIBPATH=%LIBPATH%;%SSL_PATH%\lib;
set LIB=%LIB%;%SSL_PATH%\lib;
pushd %curl_src%
:: same makefile works for vc9 heh heh
nmake VC=vc10 vc-ssl
popd
:: make this specific curl version available to CouchDB build script
@@ -7,7 +7,7 @@ setx ICU_PATH %icu_path%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ensure we have a fresh source tree to build from
if exist "%icu_path%" rd /s/q %icu_path%
7z x "%relax%\bits\icu4c-*src.zip" -o%relax% -y
7z x "%glazier%\bits\icu4c-*src.zip" -o%relax% -y
pushd %icu_path%
msbuild /m /p:Configuration=Release /p:Platform=Win32 /v:m /clp:summary %icu_path%\source\allinone\allinone.sln
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -1,12 +1,12 @@
setlocal
path=%path%;c:\mozilla-build\7zip;%relax%\nasm;%relax%\strawberry\perl\bin;
path=%path%;c:\mozilla-build\7zip;%opt%\nasm;%opt%\strawberry\perl\bin;

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: clean up existing installs
:: extract bundle and name
:: stash SSL version
del /f/q "%TEMP%\openssl*.tar"
7z x "%RELAX%\bits\openssl-*.tar.gz" -y -o"%TEMP%"
7z x "%glazier%\bits\openssl-*.tar.gz" -y -o"%TEMP%"

:: get the version of OpenSSL into the environment
for %%i in ("%TEMP%\openssl-*.tar") do set openssl_ver=%%~ni
@@ -15,6 +15,8 @@ set SSL_PATH=%relax%\openssl
setx SSL_PATH %ssl_path%

if exist "%ssl_path%" rd /s/q %ssl_path%
:: set up a softlink for openssl as Erlang seems to dumb to find it
if not exist c:\openssl mklink /d c:\openssl "%relax%\openssl"
if defined openssl_ver rd /s/q %relax%\%openssl_ver%
7z x "%TEMP%\openssl-*.tar" -o%relax%\ -y

@@ -3,16 +3,16 @@ path=%path%;c:\mozilla-build\7zip;
:: read the version of wxWidgets from the wxMSW source distribution
:: wx_ver is used later on only in this script to set up a softlink
:: so that Erlang finds it in the correct location
for %%i in ("%RELAX%\bits\wxMSW*.zip") do set wx_src=%%~ni
for %%i in ("%glazier%\bits\wxMSW*.zip") do set wx_src=%%~ni
set wx_ver=%wx_src:wxmsw=wxWidgets%
setx wx_ver %wx_ver%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if exist c:\cygwin\opt\local\pgm\%wx_ver% goto build
if exist %relax%\%wx_src% goto build
7z.exe x %RELAX%\bits\wxMSW* -aoa -y -o%RELAX%\
7z.exe x %glazier%\bits\wxMSW* -aoa -y -o%relax%\
mkdir c:\cygwin\opt\local\pgm > NUL: 2>&1
mklink /d c:\cygwin\opt\local\pgm\%wx_ver% c:\relax\%wx_src%
mklink /d c:\cygwin\opt\local\pgm\%wx_ver% %relax%\%wx_src%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:build
@@ -21,7 +21,7 @@ mklink /d c:\cygwin\opt\local\pgm\%wx_ver% c:\relax\%wx_src%
:: lib\vc_lib\msw\wx\setup.h VC++ static, wxMSW
:: lib\vc_lib\mswud\wx\setup.h VC++ static, wxMSW, Unicode, debug
:: lib\vc_lib\mswunivd\wx\setup.h VC++ static, wxUniversal, debug
type %relax%\bits\wxwidgets_setup.h >> %relax%\%wx_src%\include\wx\msw\setup.h
type %glazier%\bits\wxwidgets_setup.h >> %relax%\%wx_src%\include\wx\msw\setup.h

nmake BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc
pushd %RELAX%\%wx_src%\build\msw
@@ -1,8 +1,8 @@
setlocal
path=%path%;c:\mozilla-build\7zip;%relax%\nasm;%relax%\strawberry\perl\bin;
path=%path%;c:\mozilla-build\7zip;%opt%\nasm;%opt%\strawberry\perl\bin;
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: clean up existing installs
7z x "%relax%\bits\zlib-*.zip" -y -o%relax%
7z x "%glazier%\bits\zlib-*.zip" -y -o%glazier%
for %%i in ("%") do set zlib_ver=%%~ni
if defined zlib_ver rd /s/q %relax%\%zlib_ver%
setx zlib_ver %zlib_ver%
@@ -0,0 +1,4 @@
defrag /c /h /u /v
defrag /c /x /h /u /v
start /d c: /high cmd /k %opt%\sysinternals\sdelete.exe -z
start /d d: /high cmd /k %opt%\sysinternals\sdelete.exe -z
@@ -17,15 +17,16 @@ echo DONE. | tee -a $COUCH_TOP/build_dist.txt
echo DONE.
echo to move build files to release area run the following:
echo PATCH=_otp_$OTP_REL.exe
echo DEST=/relax/z/Dropbox/CouchDB/Snapshots/`date +%Y%m%d`
echo DEST=/cygdrive/d/release/CouchDB/Snapshots/`date +%Y%m%d`
echo pushd $COUCH_TOP/etc/windows/
echo rename .exe \$PATCH setup-couchdb-*
echo WINCOUCH=\`ls -1 setup-*.exe\`
echo rm \$WINCOUCH.*
echo shasum \$WINCOUCH \> \$WINCOUCH.sha
echo md5sum \$WINCOUCH \> \$WINCOUCH.md5
echo mkdir -p \$DEST
echo mkdir -p \$DEST/
echo mv setup-couchdb-* \$DEST/
echo tar cvzf \$DEST/\$WINCOUCH.build_logs.tgz $COUCH_TOP/bui\*.txt
echo popd

echo DONE.
@@ -5,12 +5,12 @@ export COUCH_TOP
./configure \
--prefix=$ERL_TOP/release/win32 \
--with-erlang=$ERL_TOP/release/win32/usr/include \
--with-win32-icu-binaries=/relax/icu \
--with-win32-icu-binaries=$RELAX/icu \
--without-win32-curl \
--with-openssl-bin-dir=/relax/openssl/bin \
--with-msvc-redist-dir=/relax \
--with-js-lib=/relax/js-1.8.5/js/src/dist/lib \
--with-js-include=/relax/js-1.8.5/js/src/dist/include \
--with-openssl-bin-dir=$RELAX/openssl/bin \
--with-msvc-redist-dir=$RELAX \
--with-js-lib=$RELAX/js-1.8.5/js/src/dist/lib \
--with-js-include=$RELAX/js-1.8.5/js/src/dist/include \
2>&1 | tee $COUCH_TOP/build_configure.txt
### --enable-static \

@@ -9,12 +9,12 @@ export COUCH_TOP
./configure \
--prefix=$ERL_TOP/release/win32 \
--with-erlang=$ERL_TOP/release/win32/usr/include \
--with-win32-icu-binaries=/relax/icu \
--with-win32-curl=/relax/curl \
--with-openssl-bin-dir=/relax/openssl/bin \
--with-msvc-redist-dir=/relax \
--with-js-lib=/relax/tracemonkey-57a6ad20eae9/js/src/dist/lib \
--with-js-include=/relax/tracemonkey-57a6ad20eae9/js/src/dist/include \
--with-win32-icu-binaries=$RELAX/icu \
--with-win32-curl=$RELAX/curl \
--with-openssl-bin-dir=$RELAX/openssl/bin \
--with-msvc-redist-dir=$RELAX \
--with-js-lib=$RELAX/tracemonkey-57a6ad20eae9/js/src/dist/lib \
--with-js-include=$RELAX/tracemonkey-57a6ad20eae9/js/src/dist/include \
2>&1 | tee $COUCH_TOP/build_configure.txt

echo DONE. | tee -a $COUCH_TOP/build_configure.txt
@@ -5,12 +5,14 @@ export COUCH_TOP
./configure \
--prefix=$ERL_TOP/release/win32 \
--with-erlang=$ERL_TOP/release/win32/usr/include \
--with-win32-icu-binaries=/relax/icu \
--with-win32-curl=/relax/curl \
--with-openssl-bin-dir=/relax/openssl/bin \
--with-msvc-redist-dir=/relax \
--with-js-lib=/relax/js-1.8.5/js/src/dist/lib \
--with-js-include=/relax/js-1.8.5/js/src/dist/include \
--with-win32-icu-binaries=$COUCH_TOP/../icu \
--with-win32-curl=$COUCH_TOP/../curl \
--with-openssl-bin-dir=$COUCH_TOP/../openssl/bin \
--with-msvc-redist-dir=$ERL_TOP/.. \
--with-js-lib=$COUCH_TOP/../js-1.8.5/js/src/dist/lib \
--with-js-include=$COUCH_TOP/../js-1.8.5/js/src/dist/include \
--disable-init \
--disable-launchd \
2>&1 | tee $COUCH_TOP/build_configure.txt
### --enable-static \

@@ -7,7 +7,7 @@ echo DONE. | tee -a $ERL_TOP/build_boot.txt
echo DONE. | tee -a $ERL_TOP/build_release.txt

./otp_build installer_win32 2>&1 | tee $ERL_TOP/build_installer_win32.txt
mv --force $ERL_TOP/release/win32/otp_win32_R*.exe /relax/release/ 2>&1 | tee -a $ERL_TOP/build_installer_win32.txt
mv --force $ERL_TOP/release/win32/otp_win32_R*.exe $RELAX/release/ 2>&1 | tee -a $ERL_TOP/build_installer_win32.txt

rm $ERL_TOP/release/win32/vcredist_x86.exe

@@ -4,6 +4,6 @@ pushd $ERL_TOP
# from Erlang/OTP R14B03 onwards, Erlang by default is built with
# *static* OpenSSL. Uncomment following, and change build_openssl.cmd
# to revert this.
./otp_build configure --enable-dynamic-ssl-lib 2>&1 | tee $ERL_TOP/build_configure.txt
./otp_build configure --enable-dynamic-ssl-lib --with-ssl=$RELAX/openssl 2>&1 | tee $ERL_TOP/build_configure.txt
## ./otp_build configure --with-ssl=/relax/openssl 2>&1 | tee $ERL_TOP/build_configure.txt
popd
@@ -40,9 +40,9 @@ echo setting up links to tools, SDK and VC++
:: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\mt.exe
:: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\lc.exe
:: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\lc.exe
if defined WindowsSDKVersionOverride mklink /d "%RELAX%\SDK" "%programfiles%\Microsoft SDKs\Windows\%WindowsSDKVersionOverride%"
if defined SDKdir mklink /d "%RELAX%\SDK" "%sdkdir%"
if defined VS100COMNTOOLS mklink /d "%RELAX%\VC" "%VS100COMNTOOLS%..\.."
if defined WindowsSDKVersionOverride mklink /d "%OPT%\SDK" "%programfiles%\Microsoft SDKs\Windows\%WindowsSDKVersionOverride%"
if defined SDKdir mklink /d "%OPT%\SDK" "%sdkdir%"
if defined VS100COMNTOOLS mklink /d "%OPT%\VC" "%VS100COMNTOOLS%..\.."

:: VS2010/SDK7.1

@@ -57,22 +57,21 @@ if defined VS100COMNTOOLS mklink /d "%RELAX%\VC" "%VS100COMNTOOLS%..\.."
:: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl.exe
:: C:\Program Files\Microsoft SDKs\Windows\v7.0\mc.exe
:: etc.
if defined VS90COMNTOOLS mklink /d "%RELAX%\VC" "%VS90COMNTOOLS%..\.."
if defined VCINSTALLDIR mklink /d "%RELAX%\VC" "%VCINSTALLDIR%.."
if defined SdkSetupDir mklink /d "%RELAX%\VC" "%SdkSetupDir%\.."
if not exist "%RELAX%\SDK" mklink /d "%RELAX%\SDK" "%programfiles%\Microsoft SDKs\Windows\v7.0"
if defined VS90COMNTOOLS mklink /d "%OPT%\VC" "%VS90COMNTOOLS%..\.."
if defined VCINSTALLDIR mklink /d "%OPT%\VC" "%VCINSTALLDIR%.."
if defined SdkSetupDir mklink /d "%OPT%\VC" "%SdkSetupDir%\.."
if not exist "%OPT%\SDK" mklink /d "%OPT%\SDK" "%programfiles%\Microsoft SDKs\Windows\v7.0"

:: last chance
if defined VCINSTALLDIR mklink /d "%RELAX%\VC" "%VCINSTALLDIR%\.."
if defined WindowsSDKDir mklink /d "%RELAX%\SDK" "%WindowsSDKDir%"
if defined VCINSTALLDIR mklink /d "%OPT%\VC" "%VCINSTALLDIR%\.."
if defined WindowsSDKDir mklink /d "%OPT%\SDK" "%WindowsSDKDir%"

::TODO
if not exist %relax%\sdk goto fail
if not exist %relax%\vc goto fail
if not exist %OPT%\sdk goto fail
if not exist %OPT%\vc goto fail

:: components
if not exist "c:\cygwin\relax" mklink /d C:\cygwin\relax "%RELAX%"
if not exist "C:\openssl" mklink /d c:\openssl "%RELAX%\openssl"
if not exist "c:\cygwin\relax" mklink /d C:\cygwin\relax "%relax%"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto eof
@@ -22,8 +22,21 @@ if not defined ZLIB_PATH set ZLIB_PATH=%RELAX%\zlib
:: these are *NOT* the same but when we shell out to CL.exe and LINK.exe
:: all is well again

set LIB=%RELAX%\VC\VC\lib;%RELAX%\SDK\lib;%LIB%
SET INCLUDE=%RELAX%\VC\VC\Include;%RELAX%\SDK\Include;%RELAX%\SDK\Include\gl;%INCLUDE%
:: opt is for build tools
:: glazier our scripts
:: relax for couchdb
:: werldir for building erlang

if not defined OPT set OPT=c:\opt
if not defined GLAZIER set GLAZIER=%~dp0
if not defined RELAX set RELAX=%d0\relax
if not defined WERLDIR set WERLDIR=%d0\werl
setx OPT %OPT% > NUL:
setx GLAZIER %GLAZIER% > NUL:
setx RELAX %RELAX% > NUL:

set LIB=%OPT%\VC\VC\lib;%OPT%\SDK\lib;%LIB%
SET INCLUDE=%OPT%\VC\VC\Include;%OPT%\SDK\Include;%OPT%\SDK\Include\gl;%INCLUDE%

set INCLUDE=%INCLUDE%;%SSL_PATH%\include\openssl;%SSL_PATH%\include;%CURL_PATH%\include\curl;%ICU_PATH%\include;%ZLIB_PATH%\include;
set LIBPATH=%LIBPATH%;%SSL_PATH%\lib;%CURL_PATH%\lib;%ICU_PATH%\lib;%ZLIB_PATH%\lib;
@@ -50,36 +63,36 @@ goto eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:R14B03
set ERL_TOP=/relax/otp_src_R14B03
set ERTS_VSN=5.8.4
set OTP_REL=R14B03
goto unix_shell

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:R15B
set ERL_TOP=/relax/otp_src_R15B
set ERTS_VSN=5.9
set OTP_REL=R15B
goto unix_shell

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:R15B01
set ERL_TOP=/relax/otp_src_R15B01
set ERTS_VSN=5.9.1
set OTP_REL=R15B01
goto unix_shell

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:R14B04
set ERL_TOP=/relax/otp_src_R14B04
set ERTS_VSN=5.8.5
set OTP_REL=R14B04
goto unix_shell

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:unix_shell
color
title Building in %ERL_TOP% with OTP %OTP_REL% and Erlang v%ERTS_VSN%
c:\cygwin\bin\bash %RELAX%\bin\relax.sh
pushd %WERL%\
for /f "usebackq" %%i in (`c:\cygwin\bin\cygpath.exe %WERLDIR%`) do @set WERL_PATH=%%i
set ERL_TOP=%WERL_PATH%/otp_src_%OTP_REL%
c:\cygwin\bin\bash %GLAZIER%\bin\shell.sh
goto eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

0 comments on commit c89bf64

Please sign in to comment.