diff options
Diffstat (limited to 'scripts/release-common.sh')
-rwxr-xr-x | scripts/release-common.sh | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 02b276b..7d36907 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -7,11 +7,12 @@ # The script will create a file called openscad-<versionstring>.<extension> in # the current directory (or under ./mingw32) # -# Usage: release-common.sh [-v <versionstring>] [-c] [-x32] +# Usage: release-common.sh [-v <versionstring>] [-c] [-mingw[32|64]] # -v Version string (e.g. -v 2010.01) # -d Version date (e.g. -d 2010.01.23) # -c Build with commit info # -mingw32 Cross-compile for win32 using MXE +# -mingw64 Cross-compile for win64 using Tony Theodore's MXE fork # # If no version string or version date is given, todays date will be used (YYYY-MM-DD) # If only verion date is given, it will be used also as version string. @@ -20,7 +21,7 @@ # The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT # to identify a build in the about box. # -# The mingw32 cross compile depends on the MXE cross-build tools. Please +# The mingw cross compile depends on the MXE cross-build tools. Please # see the README.md file on how to install these dependencies. printUsage() @@ -47,11 +48,19 @@ elif [[ $OSTYPE == "linux-gnu" ]]; then else ARCH=32 fi - echo "Detected ARCH: $ARCH" + echo "Detected build-machine ARCH: $ARCH" fi if [ "`echo $* | grep mingw32`" ]; then OS=LINXWIN + ARCH=32 + echo Mingw-cross build using ARCH=32 +fi + +if [ "`echo $* | grep mingw64`" ]; then + OS=LINXWIN + ARCH=64 + echo Mingw-cross build using ARCH=64 fi if [ $OS ]; then @@ -83,7 +92,6 @@ echo "Checking pre-requisites..." case $OS in LINXWIN) MAKENSIS= - if [ "`command -v makensis`" ]; then MAKENSIS=makensis elif [ "`command -v i686-pc-mingw32-makensis`" ]; then @@ -110,6 +118,13 @@ fi echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIGURATION..." +if [ ! $NUMCPU ]; then + echo "note: you can 'export NUMCPU=x' for multi-core compiles (x=number)"; + NUMCPU=2 +else + echo "NUMCPU: " $NUMCPU +fi + CONFIG=deploy case $OS in LINUX|MACOSX) @@ -124,10 +139,10 @@ case $OS in TARGET=release ;; LINXWIN) - . ./scripts/setenv-mingw-xbuild.sh + . ./scripts/setenv-mingw-xbuild.sh $ARCH TARGET=release ZIP="zip" - ZIPARGS="-r" + ZIPARGS="-r -q" ;; esac @@ -145,7 +160,7 @@ esac case $OS in LINXWIN) cd $DEPLOYDIR - make -s clean ## comment out for test-run + make clean ## comment out for test-run cd $OPENSCADDIR ;; *) @@ -163,25 +178,22 @@ case $OS in ;; esac -if [ ! $NUMCPU ]; then - echo "note: you can 'export NUMCPU=x' for multi-core compiles (x=number)"; - NUMCPU=2 -fi - case $OS in LINXWIN) - # dont use paralell builds, it can error-out on parser_yacc. - # make main openscad.exe cd $DEPLOYDIR - make $TARGET ## comment out for test-run + make $TARGET -j$NUMCPU ## comment 4 test if [ ! -e $TARGET/openscad.exe ]; then - echo 'build failed. stopping.' + echo "cant find $TARGET/openscad.exe. build failed. stopping." exit fi # make console pipe-able openscad.com - see winconsole.pri for info qmake CONFIG+=winconsole ../openscad.pro make + if [ ! -e $TARGET/openscad.com ]; then + echo "cant find $TARGET/openscad.com. build failed. stopping." + exit + fi cd $OPENSCADDIR ;; @@ -271,8 +283,11 @@ case $OS in echo "Creating installer" echo "Copying NSIS files to $DEPLOYDIR/openscad-$VERSION" - cp ./scripts/installer.nsi $DEPLOYDIR/openscad-$VERSION - cp ./scripts/mingw-file-association.nsh $DEPLOYDIR/openscad-$VERSION + cp ./scripts/installer$ARCH.nsi $DEPLOYDIR/openscad-$VERSION/installer_arch.nsi + cp ./scripts/installer.nsi $DEPLOYDIR/openscad-$VERSION/ + cp ./scripts/mingw-file-association.nsh $DEPLOYDIR/openscad-$VERSION/ + cp ./scripts/x64.nsh $DEPLOYDIR/openscad-$VERSION/ + cp ./scripts/LogicLib.nsh $DEPLOYDIR/openscad-$VERSION/ cd $DEPLOYDIR/openscad-$VERSION NSISDEBUG=-V2 # NSISDEBUG= # leave blank for full log @@ -288,12 +303,11 @@ case $OS in echo "Installer created:" $INSTFILE echo else - echo "Build failed. Cannot find" $INSTFILE - exit 1 + echo "Build failed. Cannot find" $INSTFILE fi else - echo "Build failed. Cannot find" $BINFILE - exit 1 + echo "Build failed. Cannot find" $BINFILE + exit 1 fi ;; LINUX) |