summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--cgal.pri4
-rw-r--r--openscad.pro10
-rwxr-xr-xscripts/linux-build-dependencies.sh67
-rw-r--r--scripts/setenv-linbuild-clang.sh12
-rw-r--r--scripts/setenv-linbuild.sh4
-rw-r--r--src/version_check.h2
7 files changed, 79 insertions, 22 deletions
diff --git a/README.md b/README.md
index 0b9e53b..ffb6b6e 100644
--- a/README.md
+++ b/README.md
@@ -85,7 +85,7 @@ are build scripts that download and compile the libraries from source.
Follow the instructions for the platform you're compiling on below.
* [Qt4 (4.4 - 4.7)](http://www.qt.nokia.com/)
-* [CGAL (3.6 - 3.9)](http://www.cgal.org/)
+* [CGAL (3.6 - 4.0.2)](http://www.cgal.org/)
* [GMP (5.0.x)](http://www.gmplib.org/)
* [cmake (2.6 - 2.8, required by CGAL and the test framework)](http://www.cmake.org/)
* [MPFR (3.x)](http://www.mpfr.org/)
diff --git a/cgal.pri b/cgal.pri
index 7cd5389..ae532f0 100644
--- a/cgal.pri
+++ b/cgal.pri
@@ -25,4 +25,8 @@ cgal {
QMAKE_CXXFLAGS += -frounding-math
}
}
+
+ *clang* {
+ QMAKE_CXXFLAGS -= -frounding-math
+ }
}
diff --git a/openscad.pro b/openscad.pro
index 68aa1cc..3dfd1c5 100644
--- a/openscad.pro
+++ b/openscad.pro
@@ -103,6 +103,16 @@ netbsd* {
QMAKE_CXXFLAGS *= -fno-strict-aliasing
}
+*clang* {
+ # disable enormous amount of warnings about CGAL
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions
+ # might want to actually turn this on once in a while
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare
+}
+
CONFIG(skip-version-check) {
# force the use of outdated libraries
DEFINES += OPENSCAD_SKIP_VERSION_CHECK
diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh
index bc1e74d..a9dbbc5 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
-
- GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
+ 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 install
}
@@ -183,25 +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()
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
diff --git a/src/version_check.h b/src/version_check.h
index 4d10b0b..8e131be 100644
--- a/src/version_check.h
+++ b/src/version_check.h
@@ -53,7 +53,7 @@ a time, to avoid confusion.
#error CGAL library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check
#else
-#if CGAL_VERSION_NR < 1040001000
+#if CGAL_VERSION_NR < 1040021000
#warning "======================="
#warning "."
#warning "."
contact: Jan Huwald // Impressum