summaryrefslogtreecommitdiff
path: root/scripts/release-common.sh
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
commit1e64dddf1ea30282c89de7f35854a68614234652 (patch)
tree165d37c1c66f6ff79d48c74794238b3f0bed09da /scripts/release-common.sh
parent5c779159c208ca3d88c88479ab29f9cd66574859 (diff)
parentd0856efe6da545693f9c50a8a2514a9f999ab5ef (diff)
Merge branch 'master' of github.com:openscad/openscad into issue159
Diffstat (limited to 'scripts/release-common.sh')
-rwxr-xr-xscripts/release-common.sh53
1 files changed, 39 insertions, 14 deletions
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 62f8ed8..de14cb1 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -1,25 +1,29 @@
#!/bin/bash
#
-# This script creates a binary release of OpenSCAD.
-# This should work under Mac OS X, Windows (msys), and Linux cross-compiling
-# for windows using mingw-cross-env (use like: OSTYPE=mingw-cross-env release-common.sh).
-# Linux support pending.
-# The script will create a file called openscad-<versionstring>.zip
-# in the current directory (or in the $DEPLOYDIR of a mingw cross build)
+# This script creates a binary release of OpenSCAD. This should work
+# under Mac OS X, Linux 32, Linux 64, and Linux->Win32 MXE cross-build.
+# Windows under msys has not been tested recently.
#
-# Usage: release-common.sh [-v <versionstring>] [-c]
-# -v Version string (e.g. -v 2010.01)
-# -c Build with commit info
+# 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]
+# -v Version string (e.g. -v 2010.01)
+# -c Build with commit info
+# -mingw32 Cross-compile for win32 using MXE
#
# If no version string is given, todays date will be used (YYYY-MM-DD)
# If no make target is given, release will be used on Windows, none one Mac OS X
#
# 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
+# see the README.md file on how to install these dependencies.
printUsage()
{
- echo "Usage: $0 -v <versionstring> -c
+ echo "Usage: $0 -v <versionstring> -c -mingw32
echo
echo " Example: $0 -v 2010.01
}
@@ -42,11 +46,18 @@ elif [[ $OSTYPE == "linux-gnu" ]]; then
ARCH=32
fi
echo "Detected ARCH: $ARCH"
-elif [[ $OSTYPE == "mingw-cross-env" ]]; then
+fi
+
+if [ "`echo $* | grep mingw32`" ]; then
OS=LINXWIN
fi
-echo "Detected OS: $OS"
+if [ $OS ]; then
+ echo "Detected OS: $OS"
+else
+ echo "Error: Couldn't detect OSTYPE"
+ exit
+fi
while getopts 'v:c' c
do
@@ -147,14 +158,26 @@ 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)
- # make -jx sometimes has problems with parser_yacc
+ # dont use paralell builds, it can error-out on parser_yacc.
+
+ # make main openscad.exe
cd $DEPLOYDIR && make $TARGET
+
+ # make console pipe-able openscad.com - see winconsole.pri for info
+ i686-pc-mingw32-qmake CONFIG+=winconsole ../openscad.pro
+ make
+
cd $OPENSCADDIR
;;
*)
- make -j2 $TARGET
+ make -j$NUMCPU $TARGET
;;
esac
@@ -216,6 +239,7 @@ case $OS in
#package
cp win32deps/* openscad-$VERSION
cp $TARGET/openscad.exe openscad-$VERSION
+ cp $TARGET/openscad.com openscad-$VERSION
rm -f openscad-$VERSION.zip
"$ZIP" $ZIPARGS openscad-$VERSION.zip openscad-$VERSION
rm -rf openscad-$VERSION
@@ -226,6 +250,7 @@ case $OS in
echo "Creating binary package"
cd $DEPLOYDIR
cp $TARGET/openscad.exe openscad-$VERSION
+ cp $TARGET/openscad.com openscad-$VERSION
rm -f OpenSCAD-$VERSION.zip
"$ZIP" $ZIPARGS OpenSCAD-$VERSION.zip openscad-$VERSION
cd $OPENSCADDIR
contact: Jan Huwald // Impressum