summaryrefslogtreecommitdiff
path: root/scripts/setenv-unibuild.sh
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-01-17 14:58:54 (GMT)
committerMarius Kintel <marius@kintel.net>2013-01-17 14:58:54 (GMT)
commit0b1029ff4d6f17a9f397adbf3f0a011cc20d76a5 (patch)
treee59dc3c1f4068bb748ebedde54c935a5ab3ef9ca /scripts/setenv-unibuild.sh
parent8dfc6d71cae370a84e50f4cc7624c05c859a4cea (diff)
parent20280e88cacc8935de139cd2ce46836beda87e0b (diff)
Merge branch 'master' of github.com:openscad/openscad
Diffstat (limited to 'scripts/setenv-unibuild.sh')
-rw-r--r--scripts/setenv-unibuild.sh89
1 files changed, 89 insertions, 0 deletions
diff --git a/scripts/setenv-unibuild.sh b/scripts/setenv-unibuild.sh
new file mode 100644
index 0000000..d13782c
--- /dev/null
+++ b/scripts/setenv-unibuild.sh
@@ -0,0 +1,89 @@
+# setup environment variables for building OpenSCAD against custom built
+# dependency libraries. works on Linux/BSD.
+#
+# Please see the 'uni-build-dependencies.sh' file for usage information
+#
+
+setenv_common()
+{
+ if [ ! $BASEDIR ]; then
+ if [ -f openscad.pro ]; then
+ # if in main openscad dir, put under $HOME
+ BASEDIR=$HOME/openscad_deps
+ else
+ # otherwise, assume its being run 'out of tree'. treat it somewhat like
+ # "configure" or "cmake", so you can build dependencies where u wish.
+ echo "Warning: Not in OpenSCAD src dir... using current directory as base of build"
+ BASEDIR=$PWD/openscad_deps
+ fi
+ fi
+ DEPLOYDIR=$BASEDIR
+
+ export BASEDIR
+ export PATH=$BASEDIR/bin:$PATH
+ export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64
+ export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64
+ export OPENSCAD_LIBRARIES=$DEPLOYDIR
+ export GLEWDIR=$DEPLOYDIR
+
+ echo BASEDIR: $BASEDIR
+ echo DEPLOYDIR: $DEPLOYDIR
+ echo PATH modified
+ echo LD_LIBRARY_PATH modified
+ echo LD_RUN_PATH modified
+ echo OPENSCAD_LIBRARIES modified
+ echo GLEWDIR modified
+
+ if [ "`command -v qmake-qt4`" ]; then
+ echo "Please re-run qmake-qt4 and run 'make clean' if necessary"
+ else
+ echo "Please re-run qmake and run 'make clean' if necessary"
+ fi
+}
+
+setenv_freebsd()
+{
+ setenv_common
+ QMAKESPEC=freebsd-g++
+ QTDIR=/usr/local/share/qt4
+}
+
+setenv_netbsd()
+{
+ setenv_common
+ QMAKESPEC=netbsd-g++
+ QTDIR=/usr/pkg/qt4
+ PATH=/usr/pkg/qt4/bin:$PATH
+ LD_LIBRARY_PATH=/usr/pkg/qt4/lib:/usr/X11R7/lib:$LD_LIBRARY_PATH
+
+ export QMAKESPEC
+ export QTDIR
+ export PATH
+ export LD_LIBRARY_PATH
+}
+
+setenv_linux_clang()
+{
+ export CC=clang
+ export CXX=clang++
+ export QMAKESPEC=unsupported/linux-clang
+
+ echo CC has been modified: $CC
+ echo CXX has been modified: $CXX
+ echo QMAKESPEC has been modified: $QMAKESPEC
+}
+
+if [ "`uname | grep -i 'linux\|debian'`" ]; then
+ setenv_common
+ if [ "`echo $* | grep clang`" ]; then
+ setenv_linux_clang
+ fi
+elif [ "`uname | grep -i freebsd`" ]; then
+ setenv_freebsd
+elif [ "`uname | grep -i netbsd`" ]; then
+ setenv_netbsd
+else
+ # guess
+ setenv_common
+ echo unknown system. guessed env variables. see 'setenv-unibuild.sh'
+fi
contact: Jan Huwald // Impressum