summaryrefslogtreecommitdiff
path: root/scripts/mingw-x-build-dependencies.sh
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2012-07-15 14:39:20 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2012-07-15 14:39:20 (GMT)
commit14160d248a0f36416e84ad3e92f78226e5759ace (patch)
tree2d1aa018617abe5b6ae53a61725e81864cb7e027 /scripts/mingw-x-build-dependencies.sh
parent1b38030f7e243c4eeb288d07084a99ff1e616e85 (diff)
put obj files in separate dir during mingw win32 cross compilation
Diffstat (limited to 'scripts/mingw-x-build-dependencies.sh')
-rwxr-xr-xscripts/mingw-x-build-dependencies.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/scripts/mingw-x-build-dependencies.sh b/scripts/mingw-x-build-dependencies.sh
new file mode 100755
index 0000000..1b76f80
--- /dev/null
+++ b/scripts/mingw-x-build-dependencies.sh
@@ -0,0 +1,58 @@
+#!/bin/sh -e
+#
+# This script builds all library dependencies of OpenSCAD for cross-compilation
+# from linux to mingw32 for windows, using the MXE cross build system.
+#
+# This script must be run from the OpenSCAD source root directory
+#
+# Usage: ./scripts/mingw-x-build-dependencies.sh
+#
+# Prerequisites:
+#
+# Please see http://mxe.cc/#requirements
+#
+# Also see http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Cross-compiling_for_Windows_on_Linux_or_Mac_OS_X
+#
+
+OPENSCADDIR=$PWD
+if [ ! -f $OPENSCADDIR/openscad.pro ]; then
+ echo "Must be run from the OpenSCAD source root directory"
+ exit 0
+fi
+BASEDIR=$HOME/openscad_deps
+MXEDIR=$BASEDIR/mxe
+PATH=$MXEDIR/usr/bin:$PATH
+
+echo MXEDIR: $MXEDIR
+echo BASEDIR: $BASEDIR
+echo OPENSCADDIR: $OPENSCADDIR
+echo PATH modified with $MXEDIR/usr/bin
+if [ ! $NUMCPU ]; then
+ echo "note: you can 'export NUMCPU=x' for paralell builds (x=number)";
+ NUMCPU=1
+fi
+echo NUMCPU: $NUMCPU
+
+echo "Downloading MXE into " $MXEDIR
+cd $BASEDIR
+
+git clone git://github.com/mxe/mxe.git
+
+cd $MXEDIR
+make -j $NUMCPU JOBS=$NUMCPU mpfr eigen opencsg cgal qt
+#make -j $NUMCPU JOBS=1 mpfr # for testing
+echo 'make'
+
+echo "leaving" $MXEDIR
+echo "entering $OPENSCADDIR"
+cd $OPENSCADDIR
+if [ ! -e mingw-cross-env ]; then
+ ln -s $MXEDIR mingw-cross-env
+fi
+
+echo
+echo "now copy/paste the following to cross-build openscad"
+echo
+echo "i686-pc-mingw32-qmake CONFIG+=mingw-cross-env openscad.pro"
+echo "make"
+echo
contact: Jan Huwald // Impressum