From: Wouter Wijngaards Date: Thu, 16 Jul 2009 10:56:00 +0000 (+0000) Subject: makedist can setup.exe crosscompile X-Git-Tag: release-1.3.3rc1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5f7bf86acc3d1365244fb535f6f0e4772d5527d;p=thirdparty%2Funbound.git makedist can setup.exe crosscompile git-svn-id: file:///svn/unbound/trunk@1730 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index ae429daa8..92781f284 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 16 July 2009: Wouter - fix replacement malloc code. Used in crosscompile. + - makedist -w creates crosscompiled setup.exe on fedora11. 15 July 2009: Wouter - dependencies for compat items, for crosscompile. diff --git a/makedist.sh b/makedist.sh index e0c77e4f6..256b79add 100755 --- a/makedist.sh +++ b/makedist.sh @@ -107,6 +107,27 @@ replace_all () { replace_text "$1" "@date@" "`date +'%b %e, %Y'`" } +check_svn_root () { + # Check if SVNROOT is specified. + if [ -z "$SVNROOT" ]; then + if test -f .svn/entries; then + eval `svn info | grep 'URL:' | sed -e 's/URL: /url=/' | head -1` + SVNROOT="$url" + fi + if test -z "$SVNROOT"; then + error "SVNROOT must be specified (using -d)" + fi + fi +} + +create_temp_dir () { + # Creating temp directory + info "Creating temporary working directory" + temp_dir=`mktemp -d unbound-dist-XXXXXX` + info "Directory '$temp_dir' created." + cd $temp_dir +} + SNAPSHOT="no" RC="no" @@ -147,6 +168,30 @@ while [ "$1" ]; do done if [ "$DOWIN" = "yes" ]; then + # detect crosscompile, from Fedora11 at this point. + if test "`uname`" = "Linux"; then + info "Crosscompile windows dist" + cross="yes" + configure="mingw32-configure" + strip="i686-pc-mingw32-strip" + makensis="makensis" # from mingw32-nsis package + + check_svn_root + create_temp_dir + info "Exporting source from SVN." + svn export "$SVNROOT" unbound || error_cleanup "SVN command failed" + cd unbound || error_cleanup "Unbound not exported correctly from SVN" + + # on a re-configure the cache may no longer be valid... + if test -f mingw32-config.cache; then rm mingw32-config.cache; fi + else + cross="no" # mingw and msys + configure="./configure" + strip="strip" + makensis="c:/Program Files/NSIS/makensis.exe" # http://nsis.sf.net + fi + + # version gets compiled into source, edit the configure to set it version=`./configure --version | head -1 | awk '{ print $3 }'` \ || error_cleanup "Cannot determine version number." if [ "$RC" != "no" -o "$SNAPSHOT" != "no" ]; then @@ -165,21 +210,6 @@ if [ "$DOWIN" = "yes" ]; then rm -r autom4te* || echo "ignored" fi - # detect crosscompile, from Fedora11 at this point. - if test "`uname`" = "Linux"; then - cross="yes" - configure="mingw32-configure" - strip="i686-pc-mingw32-strip" - makensis="makensis" # from mingw32-nsis package - # on a re-configure the cache may no longer be valid... - if test -f mingw32-config.cache; then rm mingw32-config.cache; fi - else - cross="no" # mingw and msys - configure="./configure" - strip="strip" - makensis="c:/Program Files/NSIS/makensis.exe" # http://nsis.sf.net - fi - # procedure for making unbound installer on mingw. info "Creating windows dist unbound $version" info "Calling configure" @@ -218,22 +248,18 @@ if [ "$DOWIN" = "yes" ]; then cd .. rm -rf tmp.$$ mv winrc/unbound_setup_$version.exe . + if test "$cross" = "yes"; then + mv unbound_setup_$version.exe $cwd/. + mv unbound-$version.zip $cwd/. + cleanup + fi ls -lG unbound_setup_$version.exe ls -lG unbound-$version.zip info "Done" exit 0 fi -# Check if SVNROOT is specified. -if [ -z "$SVNROOT" ]; then - if test -f .svn/entries; then - eval `svn info | grep 'URL:' | sed -e 's/URL: /url=/' | head -1` - SVNROOT="$url" - fi - if test -z "$SVNROOT"; then - error "SVNROOT must be specified (using -d)" - fi -fi +check_svn_root # Check if LDNSDIR is specified. if test -z "$LDNSDIR"; then # try to autodetect from Makefile (if present) @@ -251,12 +277,7 @@ info "SNAPSHOT is $SNAPSHOT" #question "Do you wish to continue with these settings?" || error "User abort." - -# Creating temp directory -info "Creating temporary working directory" -temp_dir=`mktemp -d unbound-dist-XXXXXX` -info "Directory '$temp_dir' created." -cd $temp_dir +create_temp_dir info "Exporting source from SVN." svn export "$SVNROOT" unbound || error_cleanup "SVN command failed"