summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/freebsd-build-dependencies.sh28
-rwxr-xr-xscripts/linux-build-dependencies.sh77
-rw-r--r--scripts/setenv-freebsdbuild.sh6
-rw-r--r--scripts/setenv-linbuild-clang.sh12
-rw-r--r--scripts/setenv-linbuild.sh4
5 files changed, 105 insertions, 22 deletions
diff --git a/scripts/freebsd-build-dependencies.sh b/scripts/freebsd-build-dependencies.sh
new file mode 100755
index 0000000..4ea61de
--- /dev/null
+++ b/scripts/freebsd-build-dependencies.sh
@@ -0,0 +1,28 @@
+#!/usr/local/bin/bash -e
+
+echo "Tested on FreeBSD 9. Please see README.md for info on older systems."
+
+if [ "`pkg_info | grep -i cgal `" ]; then
+ echo Stopping. Please remove any CGAL packages you have installed and restart
+ exit
+fi
+
+if [ "`pkg_info | grep -i opencsg`" ]; then
+ echo Stopping. Please remove any OpenCSG packages you have installed and restart
+ exit
+fi
+
+OPENSCADDIR=$PWD
+if [ ! -f $OPENSCADDIR/openscad.pro ]; then
+ echo "Must be run from the OpenSCAD source root directory"
+ exit 0
+fi
+
+. ./scripts/setenv-freebsdbuild.sh
+
+pkg_add -r bison boost-libs cmake git bash eigen2 flex gmake gmp mpfr
+pkg_add -r xorg libGLU libXmu libXi xorg-vfbserver glew
+pkg_add -r qt4-corelib qt4-gui qt4-moc qt4-opengl qt4-qmake qt4-rcc qt4-uic
+
+BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs
+BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg
diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh
index 36dc2ee..5339de1 100755
--- a/scripts/linux-build-dependencies.sh
+++ b/scripts/linux-build-dependencies.sh
@@ -118,8 +118,15 @@ build_boost()
cd boost_$bversion
# We only need certain portions of boost
./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options,filesystem,system,regex
- ./bjam -j$NUMCPU
- ./bjam install
+ if [ $CXX ]; then
+ if [ $CXX = "clang" ]; then
+ ./b2 -j$NUMCPU toolset=clang install
+ # ./b2 -j$NUMCPU toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" install
+ fi
+ else
+ ./b2 -j$NUMCPU
+ ./b2 install
+ fi
}
build_cgal()
@@ -129,15 +136,16 @@ build_cgal()
cd $BASEDIR/src
rm -rf CGAL-$version
if [ ! -f CGAL-$version.tar.gz ]; then
- #4.0
- curl -O https://gforge.inria.fr/frs/download.php/30387/CGAL-$version.tar.gz
+ #4.0.2
+ curl -O https://gforge.inria.fr/frs/download.php/31174/CGAL-$version.tar.bz2
+ # 4.0 curl -O https://gforge.inria.fr/frs/download.php/30387/CGAL-$version.tar.gz
# 3.9 curl -O https://gforge.inria.fr/frs/download.php/29125/CGAL-$version.tar.gz
# 3.8 curl -O https://gforge.inria.fr/frs/download.php/28500/CGAL-$version.tar.gz
# 3.7 curl -O https://gforge.inria.fr/frs/download.php/27641/CGAL-$version.tar.gz
fi
- tar xzf CGAL-$version.tar.gz
+ tar jxf CGAL-$version.tar.bz2
cd CGAL-$version
- if [ $2 = use-sys-libs ]; then
+ if [ $2 = use-sys-libs ]; then
cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DCMAKE_BUILD_TYPE=Debug
else
cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DCMAKE_BUILD_TYPE=Debug
@@ -160,12 +168,21 @@ build_glew()
mkdir -p $DEPLOYDIR/lib/pkgconfig
# Fedora 64-bit
- if [ "`ls /usr/lib64 | grep Xmu`" ]; then
- echo "modifying glew makefile for 64 bit machine"
- sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux
- fi
+ if [ -e /usr/lib64 ]; then
+ if [ "`ls /usr/lib64 | grep Xmu`" ]; then
+ echo "modifying glew makefile for 64 bit machine"
+ sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux
+ fi
+ fi
+
+ if [ $CC ]; then
+ if [ $CC = "clang" ]; then
+ echo "modifying glew makefile for clang"
+ sed -i s/\$\(CC\)/clang/ Makefile
+ fi
+ fi
- GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
+ GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
GLEW_DEST=$DEPLOYDIR make install
}
@@ -183,19 +200,39 @@ build_opencsg()
sed -ibak s/example// opencsg.pro # examples might be broken without GLUT
# Fedora 64-bit
- if [ "`ls /usr/lib64 | grep Xmu`" ]; then
- echo "modifying opencsg makefile for 64 bit machine"
- sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile
- fi
+ if [ -e /usr/lib64 ]; then
+ if [ "`ls /usr/lib64 | grep Xmu`" ]; then
+ echo "modifying opencsg makefile for 64 bit machine"
+ sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile
+ fi
+ fi
+
+ if [ `uname | grep FreeBSD` ]; then
+ sed -ibak s/X11R6/local/g src/Makefile
+ fi
if [ "`command -v qmake-qt4`" ]; then
- qmake-qt4
+ OPENCSG_QMAKE=qmake-qt4
else
- qmake
+ OPENCSG_QMAKE=qmake
fi
+
+ if [ $CXX ]; then
+ if [ $CXX = "clang++" ]; then
+ cd $BASEDIR/src/OpenCSG-$version/src
+ $OPENCSG_QMAKE
+ cd $BASEDIR/src/OpenCSG-$version
+ $OPENCSG_QMAKE
+ fi
+ else
+ $OPENCSG_QMAKE
+ fi
+
make
+
cp -av lib/* $DEPLOYDIR/lib
cp -av include/* $DEPLOYDIR/include
+ cd $OPENSCADDIR
}
build_eigen()
@@ -235,7 +272,7 @@ if [ ! $NUMCPU ]; then
fi
if [ ! -d $BASEDIR/bin ]; then
- mkdir --parents $BASEDIR/bin
+ mkdir -p $BASEDIR/bin
fi
echo "Using basedir:" $BASEDIR
@@ -263,7 +300,7 @@ fi
# (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
- build_cgal 4.0 use-sys-libs
+ build_cgal 4.0.2 use-sys-libs
exit
fi
if [ $1 = "opencsg" ]; then
@@ -283,7 +320,7 @@ build_gmp 5.0.5
build_mpfr 3.1.1
build_boost 1.47.0
# NB! For CGAL, also update the actual download URL in the function
-build_cgal 4.0
+build_cgal 4.0.2
build_glew 1.7.0
build_opencsg 1.3.2
diff --git a/scripts/setenv-freebsdbuild.sh b/scripts/setenv-freebsdbuild.sh
new file mode 100644
index 0000000..49f1783
--- /dev/null
+++ b/scripts/setenv-freebsdbuild.sh
@@ -0,0 +1,6 @@
+# run with '. ./scripts/setenv-freebsdbuild.sh'
+
+# use in conjuction with freebsd-build-dependencies.sh
+
+QMAKESPEC=freebsd-g++
+QTDIR=/usr/local/share/qt4
diff --git a/scripts/setenv-linbuild-clang.sh b/scripts/setenv-linbuild-clang.sh
new file mode 100644
index 0000000..9551235
--- /dev/null
+++ b/scripts/setenv-linbuild-clang.sh
@@ -0,0 +1,12 @@
+# build dependencies and/or openscad on linux with the clang compiler
+
+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
+
+. ./scripts/setenv-linbuild.sh
+
diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh
index 6361dd4..338cac9 100644
--- a/scripts/setenv-linbuild.sh
+++ b/scripts/setenv-linbuild.sh
@@ -3,9 +3,9 @@
# run this file with 'source setenv-linbuild.sh' every time you re-login
# and want to build or run openscad against custom libraries installed
-# into BASEDIR.
+# into BASEDIR.
-# copy this file to your .bashrc if desired.
+# copy this file to your .bashrc if desired.
if [ ! $BASEDIR ]; then
BASEDIR=$HOME/openscad_deps
contact: Jan Huwald // Impressum