Skip to content
Permalink
Browse files
align environment variable names between Erlang build and Glazier
  • Loading branch information
dch committed Sep 5, 2011
1 parent 3684c56 commit 0f657b14b29b3d732cda753be754223cf99f40d2
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 49 deletions.
@@ -1,27 +1,13 @@
Workflow
.- wxwidgets
.- openssl
- erlang
.- spidermonkey
.- libcurl
.- icu
- zlib

# Download Glazier scripts, tools, and source
################################################################################
* download and unzip [glazier latest zip](https://nodeload.github.com/dch/glazier/zipball/windows_sdk_7.0)
* set where you plan to build in. I am using `C:\relax` so:

:: set in current shell and then user environment
set RELAX=c:\relax
setx RELAX %RELAX%
mklink /d c:\cygwin\relax %RELAX%
cd %RELAX%

* download and unzip [glazier latest zip](https://nodeload.github.com/dch/glazier/zipball/master) into `c:\relax`
* run `c:\relax\bin\setup.cmd` once to set up links and environment variables
* download source & tools using aria, and then check MD5 hashes:

pushd %relax%
path=%path%;%relax%\bin;
aria2c.exe --force-sequential=false --max-connection-per-server=4 --check-certificate=false --auto-file-renaming=false --input-file=downloads.md --max-concurrent-downloads=5 --dir=bits --save-session=bits/a2session.txt
md5sum.exe --check md5sums.txt
cd bits && md5sum.exe --check md5sums.txt

# Install Compilers
################################################################################
@@ -48,18 +34,21 @@ mozilla & cygwin setup.
################################################################################
The express solution is just to use 7zip to unpack [glazier tools](https://www.dropbox.com/s/jeifcxpbtpo78ak/Building_from_Source/glazier_tools.7z) inside `%relax%`. Or do it manually for the same result:

* Download [7zip] to `7zip` and add to the user environment PATH
* Innosoft's [isetup] to `inno5` and add to PATH
* [Nullsoft] Installer to `nsis` and add to PATH
* using 7zip, extract [nasm] in `%relax%` and add to PATH
* using 7zip, extract [cmake] to `cmake` and add `cmake/bin` to PATH
* `mkdir strawberry && cd strawberry` then using 7zip, extract Strawberry [Perl] and add `strawberry\perl\bin` to PATH
* copy [vcredist] to `%relax%`
* Download [7zip] to `%relax%/7zip`
* Innosoft's [isetup] to `%relax%/inno5`
* Nullsoft [NSIS] Installer to `%relax%/nsis`
* Add 7zip, Inno5, and nsis to the user environment PATH
* using 7zip, extract and rename [nasm] to `%relax%/nasm`
* using 7zip, extract and rename [cmake] to `%relax%/cmake`
* `mkdir strawberry && cd strawberry` then using 7zip, extract Strawberry [Perl]
* copy [vcredist] to `%relax%/` for later use by Erlang and CouchDB builds

[perl]: http://strawberryperl.com/download/5.12.2.0/strawberry-perl-5.12.2.0-portable.zip
[nasm]: http://www.nasm.us/pub/nasm/releasebuilds/2.09.07/win32/nasm-2.09.07-win32.zip
[cmake]: http://www.cmake.org/files/v2.8/cmake-2.8.5-win32-x86.zip
[vcredist]: http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe
[nsis]: http://download.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46-setup.exe
[isetup]: http://www.jrsoftware.org/download.php/is-unicode.exe

## wxWidgets
################################################################################
@@ -76,12 +65,12 @@ The express solution is just to use 7zip to unpack [glazier tools](https://www.d
## OpenSSL
################################################################################
Erlang requires finding OpenSSL in `c:\OpenSSL` so that's where we build to,
using mount point to keep things clean=ish.
using mount point to keep things clean=ish under `%relax%`.

* [OpenSSL] source has already been downloaded
* start an SDK shell via 'setenv.cmd /Release /x86'
* start an SDK shell via `setenv.cmd /Release /x86`
* run `c:\relax\bin\build_openssl.cmd` to extract and build OpenSSL
* it requires nasm, 7zip, strawberry perl all in the path
* it requires nasm, 7zip, strawberry perl all in place
* check for errors
* ensure Erlang can locate SSL with `mklink /d c:\OpenSSL %relax%\OpenSSL`

@@ -92,14 +81,24 @@ using mount point to keep things clean=ish.
Our goal is to get the path set up in this order:

1. erlang and couchdb build helper scripts
2. Microsoft VC compiler from Windows SDK 7.0
2. Microsoft VC compiler, linker, etc from Windows SDK 7.0
3. cygwin path for other build tools like make, autoconf, libtool
4. the remaining windows system path

Express start is to:
* start an SDK shell via 'setenv.cmd /Release /x86'
* `c:\relax\bin\setup.cmd` is only needed the first time round
* start an SDK shell via `setenv.cmd /Release /x86`
* launch a cygwin erl-ified shell via `c:\relax\bin\shell.cmd`
* choose your preferred erlang version - R14B03 is recommended
* after validating the path, I usually run these two scripts which
can take several hours on slower machines:

erl_config.sh
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

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

cfdc2ab751bf18049c5ef7866602d8ed *apache-couchdb-1.0.3.tar.gz
907b763d3a14b6649bf0371ffa75a36b *apache-couchdb-1.1.0.tar.gz
@@ -16,7 +16,7 @@ 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_VER.exe
echo PATCH=_otp_$OTP_REL.exe
echo DEST=/relax/z/Dropbox/CouchDB/Snapshots/`date +%Y%m%d`
echo pushd $COUCH_TOP/etc/windows/
echo rename .exe \$PATCH setup-couchdb-*
@@ -9,6 +9,8 @@ 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

rm $ERL_TOP/release/win32/vcredist_x86.exe

./release/win32/Install.exe -s 2>&1 | tee -a $ERL_TOP/build_release.txt
echo DONE. | tee -a $ERL_TOP/build_release.txt
popd
popd
@@ -11,14 +11,14 @@
## /cygdrive/c/src/otp_src_R13B04/erts/etc/win32/cygwin_tools/vc:/cygdrive/c/src/otp_src_R13B04/erts/etc/win32/cygwin_tools:/cygdrive/c/PROGRA~2/MICROS~1.0/Common7/IDE:/cygdrive/c/PROGRA~2/MICROS~1.0/VC/bin:/cygdrive/c/PROGRA~2/MICROS~1.0/Common7/Tools/:/cygdrive/c/Windows/MICROS~1.NET/FRAMEW~1/:/cygdrive/c/Windows/MICROS~1.NET/FRAMEW~1/:/cygdrive/c/Windows/MICROS~1.NET/FRAMEW~1/V20~1.507:/cygdrive/c/PROGRA~2/MICROS~1.0/VC/VCPACK~1:/cygdrive/c/PROGRA~1/MICROS~1/Windows/v6.0A/bin:/cygdrive/c/PROGRA~1/MICROS~1/Windows/v7.0/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WINDOW~1/v1.0/:/cygdrive/c/PROGRA~2/NSIS:/cygdrive/c/OpenSSL/bin

# build for the right version of erlang
echo Using Erlang $ERL_VER OTP $OTP_VER in $ERL_TOP
echo Using Erlang $ERTS_VSN OTP $OTP_VER in $ERL_TOP
echo

echo doing sanity checks
# here we want to see that junction points are set up and
# rebuild path from scratch as ./otp_build env_win32 gets it wrong
# first up are erlang build helper scripts
PATH=$ERL_TOP/release/win32/erts-$ERL_VER/bin:$ERL_TOP/erts/etc/win32/cygwin_tools/vc:$ERL_TOP/erts/etc/win32/cygwin_tools
PATH=$ERL_TOP/release/win32/erts-$ERTS_VSN/bin:$ERL_TOP/erts/etc/win32/cygwin_tools/vc:$ERL_TOP/erts/etc/win32/cygwin_tools

# then MSVC9 binaries using the new junction points
###PATH=$PATH:/cygdrive/c/PROGRA~2/MICROS~1.0/Common7/IDE:/cygdrive/c/PROGRA~2/MICROS~1.0/VC/BIN:/cygdrive/c/PROGRA~2/MICROS~1.0/Common7/Tools:/cygdrive/c/PROGRA~2/MICROS~1.0/VC/VCPACK~1
@@ -59,7 +59,7 @@ RC_SH_DEBUG_LOG=$TMP/rc_r$OTP_VER.log
MD_SH_DEBUG_LOG=$TMP/md_r$OTP_VER.log
MC_SH_DEBUG_LOG=$TMP/mc_r$OTP_VER.log

export OVERRIDE_TARGET CC CXX AR RANLIB OVERRIDE_CONFIG_CACHE_STATIC OVERRIDE_CONFIG_CACHE INCLUDE LIB LIBPATH LINK CL PATH TMP CC_SH LD_SH RC_SH MD_SH MC_SH ERL_TOP ERL_VER OTP_VER SHELL RELAX GLAZIER
export OVERRIDE_TARGET CC CXX AR RANLIB OVERRIDE_CONFIG_CACHE_STATIC OVERRIDE_CONFIG_CACHE INCLUDE LIB LIBPATH LINK CL PATH TMP CC_SH LD_SH RC_SH MD_SH MC_SH ERL_TOP ERTS_VSN OTP_VER SHELL RELAX GLAZIER

# first change to $RELAX as if erlang tar.gz are not extracted the latter will fail
cd $RELAX
@@ -74,7 +74,7 @@ echo please check the toolkit paths point to Microsoft versions:
which mc; which lc; which cl; which link; which mt
echo

echo Ready to build Erlang and CouchDB using Erlang $ERL_VER OTP $OTP_VER in $ERL_TOP
echo Ready to build Erlang and CouchDB using Erlang $ERTS_VSN OTP $OTP_VER in $ERL_TOP
echo Time to Relax.

bash -i
@@ -29,7 +29,8 @@ if not defined ZLIB_PATH set ZLIB_PATH=%RELAX%\zlib
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: LIB and INCLUDE are preset by Windows SDK and/or Visual C++ shells
:: however VC++ uses LIB & INCLUDE and SDK uses Lib & Include. In Cygwin
:: these are *NOT* the same
:: 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%
@@ -56,27 +57,27 @@ goto eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:R14B03
set ERL_TOP=/relax/otp_src_R14B03
set ERL_VER=5.8.4
set OTP_VER=R14B03
set ERTS_VSN=5.8.4
set OTP_REL=R14B03
goto unix_shell

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:R14B01
set ERL_TOP=/relax/otp_src_R14B01
set ERL_VER=5.8.2
set OTP_VER=R14B01
set ERTS_VSN=5.8.2
set OTP_REL=R14B01
goto unix_shell

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

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:unix_shell
title Building in %ERL_TOP% with OTP %OTP_VER% and Erlang v%ERL_VER%
title Building in %ERL_TOP% with OTP %OTP_REL% and Erlang v%ERTS_VSN%
c:\cygwin\bin\bash %RELAX%\bin\relax.sh
goto eof

@@ -41,8 +41,8 @@ http://curl.haxx.se/download/curl-7.21.7.zip
### bits required to build erlang
http://www.erlang.org/download/otp_src_R14B03.tar.gz
http://www.erlang.org/download/otp_src_R14B01.tar.gz
### nsis nsis-2.46-setup.exe
http://download.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46-setup.exe
http://www.jrsoftware.org/download.php/is-unicode.exe
http://www.erlang.org/download/tcltk85_win32_bin.tar.gz

################################################################################
@@ -51,8 +51,8 @@ http://www.erlang.org/download/tcltk85_win32_bin.tar.gz
# http://download.icu-project.org/files/icu4c/4.4.2/icu4c-4_4_2-src.zip
### libicu icu4c-4_4_2-src.tgz
http://download.icu-project.org/files/icu4c/4.4.2/icu4c-4_4_2-src.tgz
### nsis nsis-2.46-setup.exe
http://download.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46-setup.exe
### inno5_setup isetup-5.4.2-unicode.exe
http://www.jrsoftware.org/download.php/is-unicode.exe
### spidermonkey 57a6ad20eae9.tar.gz
http://hg.mozilla.org/tracemonkey/archive/57a6ad20eae9.tar.gz
### spidermonkey js185-1.0.0.tar.gz

0 comments on commit 0f657b1

Please sign in to comment.