summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/macosx-build-dependencies.sh40
-rwxr-xr-xscripts/ubuntu-build-dependencies.sh17
2 files changed, 36 insertions, 21 deletions
diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh
index f009fce..2d7275c 100755
--- a/scripts/macosx-build-dependencies.sh
+++ b/scripts/macosx-build-dependencies.sh
@@ -6,8 +6,9 @@
#
# This script must be run from the OpenSCAD source root directory
#
-# Usage: macosx-build-dependencies.sh [-6]
+# Usage: macosx-build-dependencies.sh [-6l]
# -6 Build only 64-bit binaries
+# -l Force use of LLVM compiler
#
# Prerequisites:
# - MacPorts: curl, cmake
@@ -24,13 +25,15 @@ SRCDIR=$BASEDIR/src
DEPLOYDIR=$BASEDIR/install
MAC_OSX_VERSION_MIN=10.5
OPTION_32BIT=true
+OPTION_LLVM=false
export QMAKESPEC=macx-g++
printUsage()
{
- echo "Usage: $0 [-6]"
+ echo "Usage: $0 [-6l]"
echo
echo " -6 Build only 64-bit binaries"
+ echo " -l Force use of LLVM compiler"
}
# Hack warning: gmplib is built separately in 32-bit and 64-bit mode
@@ -181,8 +184,11 @@ build_boost()
if $OPTION_32BIT; then
BOOST_EXTRA_FLAGS="-arch i386"
fi
- ./bjam cflags="-mmacosx-version-min=$MAC_OSX_VERSION_MIN -arch x86_64 $BOOST_EXTRA_FLAGS" linkflags="-mmacosx-version-min=$MAC_OSX_VERSION_MIN -arch x86_64 $BOOST_EXTRA_FLAGS"
- ./bjam install
+ if $OPTION_LLVM; then
+ BOOST_TOOLSET="toolset=darwin-llvm"
+ echo "using darwin : llvm : llvm-g++ ;" >> tools/build/v2/user-config.jam
+ fi
+ ./b2 -d+2 $BOOST_TOOLSET cflags="-mmacosx-version-min=$MAC_OSX_VERSION_MIN -arch x86_64 $BOOST_EXTRA_FLAGS" linkflags="-mmacosx-version-min=$MAC_OSX_VERSION_MIN -arch x86_64 $BOOST_EXTRA_FLAGS" install
install_name_tool -id $DEPLOYDIR/lib/libboost_thread.dylib $DEPLOYDIR/lib/libboost_thread.dylib
install_name_tool -id $DEPLOYDIR/lib/libboost_program_options.dylib $DEPLOYDIR/lib/libboost_program_options.dylib
install_name_tool -id $DEPLOYDIR/lib/libboost_filesystem.dylib $DEPLOYDIR/lib/libboost_filesystem.dylib
@@ -297,13 +303,35 @@ if [ ! -f $OPENSCADDIR/openscad.pro ]; then
exit 0
fi
-while getopts '6' c
+while getopts '6l' c
do
case $c in
- 6) OPTION_32BIT=false
+ 6) OPTION_32BIT=false;;
+ l) OPTION_LLVM=true;;
esac
done
+OSVERSION=`sw_vers -productVersion | cut -d. -f2`
+if [[ $OSVERSION -ge 7 ]]; then
+ echo "Detected Lion or later"
+ export LION=1
+ export CC=gcc
+ export CXX=g++
+ export CPP=cpp
+ # Somehow, qmake in Qt-4.8.2 doesn't detect Lion's gcc and falls back into
+ # project file mode unless manually given a QMAKESPEC
+ export QMAKESPEC=macx-llvm
+else
+ echo "Detected Snow Leopard or earlier"
+fi
+
+if $OPTION_LLVM; then
+ echo "Using LLVM compiler"
+ export CC=llvm-gcc
+ export CXX=llvm-g++
+ export QMAKESPEC=macx-llvm
+fi
+
echo "Using basedir:" $BASEDIR
mkdir -p $SRCDIR $DEPLOYDIR
build_eigen 3.1.1
diff --git a/scripts/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh
index 0609172..1754e32 100755
--- a/scripts/ubuntu-build-dependencies.sh
+++ b/scripts/ubuntu-build-dependencies.sh
@@ -26,21 +26,8 @@ fi
echo "tested on Ubuntu 12. If this fails try 'old linux' build (see README.md)"
-
-if [ "`dpkg --list | grep -i cgal`" ]; then
- echo "Please make sure you have run apt-get purge on all cgal packages"
- exit
-fi
-
-if [ "`dpkg --list | grep -i opencsg`" ]; then
- echo "Please make sure you have run apt-get purge on all opencsg packages"
- exit
-fi
-
sudo apt-get install build-essential libqt4-dev libqt4-opengl-dev \
libxmu-dev cmake bison flex libeigen2-dev git-core libboost-all-dev \
- libXi-dev libmpfr-dev libgmp-dev libboost-dev libglew1.6-dev
+ libXi-dev libmpfr-dev libgmp-dev libboost-dev libglew1.6-dev \
+ libcgal-dev libopencsg-dev
-echo "now copy/paste the following to install CGAL and OpenCSG from source:"
-echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs"
-echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg"
contact: Jan Huwald // Impressum