summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/setenv-unibuild.sh10
-rwxr-xr-xscripts/uni-build-dependencies.sh21
-rwxr-xr-xscripts/uni-get-dependencies.sh8
3 files changed, 25 insertions, 14 deletions
diff --git a/scripts/setenv-unibuild.sh b/scripts/setenv-unibuild.sh
index ba99235..19d37f9 100644
--- a/scripts/setenv-unibuild.sh
+++ b/scripts/setenv-unibuild.sh
@@ -11,7 +11,15 @@
setenv_common()
{
if [ ! $BASEDIR ]; then
- BASEDIR=$HOME/openscad_deps
+ 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 "Not in OpenSCAD dir... using current directory as base of build"
+ BASEDIR=$PWD
+ fi
fi
DEPLOYDIR=$BASEDIR
diff --git a/scripts/uni-build-dependencies.sh b/scripts/uni-build-dependencies.sh
index 009d41e..e091444 100755
--- a/scripts/uni-build-dependencies.sh
+++ b/scripts/uni-build-dependencies.sh
@@ -7,8 +7,6 @@
#
# This script builds all library dependencies of OpenSCAD for Linux/BSD
#
-# This script must be run from the OpenSCAD source root directory
-#
# Usage: uni-build-dependencies.sh
#
# Prerequisites:
@@ -238,7 +236,7 @@ build_opencsg()
cp -av lib/* $DEPLOYDIR/lib
cp -av include/* $DEPLOYDIR/include
- cd $OPENSCADDIR
+ cd $BASEDIR
}
build_eigen()
@@ -270,13 +268,18 @@ build_eigen()
}
-OPENSCADDIR=$PWD
-if [ ! -f $OPENSCADDIR/openscad.pro ]; then
- echo "Must be run from the OpenSCAD source root directory"
- exit 0
+if [ "`command -v dirname`" ]; then
+ OPENSCAD_SCRIPTDIR=`dirname $0`
+else
+ if [ ! -f openscad.pro ]; then
+ echo "Must be run from the OpenSCAD source root directory (dont have 'dirname')"
+ exit 1
+ else
+ OPENSCAD_SCRIPTDIR=$PWD
+ fi
fi
-. ./scripts/setenv-unibuild.sh # '.' is equivalent to 'source'
+. $OPENSCAD_SCRIPTDIR/setenv-unibuild.sh # '.' is equivalent to 'source'
SRCDIR=$BASEDIR/src
if [ ! $NUMCPU ]; then
@@ -312,7 +315,7 @@ fi
# (Most systems have all libraries available as packages except CGAL/OpenCSG)
# (They can be built singly here by passing a command line arg to the script)
if [ $1 ]; then
- if [ $1 = "cgal-use-sys-libs" ]; then
+ if [ $1 = "cgal" ]; then
build_cgal 4.0.2 use-sys-libs
exit
fi
diff --git a/scripts/uni-get-dependencies.sh b/scripts/uni-get-dependencies.sh
index 91a87a4..3ed12e6 100755
--- a/scripts/uni-get-dependencies.sh
+++ b/scripts/uni-get-dependencies.sh
@@ -43,16 +43,16 @@ get_debian_deps()
if [ "`cat /etc/issue | grep 'Debian GNU/Linux 5'`" ]; then
debian_too_old
fi
- if [ "`cat /etc/issue | grep 'Ubunutu 10'`" ]; then
+ if [ "`cat /etc/issue | grep 'Ubuntu 10'`" ]; then
debian_too_old
fi
- if [ "`cat /etc/issue | grep 'Ubunutu 9'`" ]; then
+ if [ "`cat /etc/issue | grep 'Ubuntu 9'`" ]; then
debian_too_old
fi
- if [ "`cat /etc/issue | grep 'Ubunutu 8'`" ]; then
+ if [ "`cat /etc/issue | grep 'Ubuntu 8'`" ]; then
debian_too_old
fi
- if [ "`cat /etc/issue | grep 'Ubunutu 7'`" ]; then
+ if [ "`cat /etc/issue | grep 'Ubuntu 7'`" ]; then
debian_too_old
fi
echo "tested on Ubuntu 12. If this fails try 'old linux' build (see README.md)"
contact: Jan Huwald // Impressum