diff options
-rw-r--r-- | openscad.pro | 27 | ||||
-rwxr-xr-x | scripts/linux-build-dependencies.sh | 29 | ||||
-rw-r--r-- | scripts/setenv-linbuild.sh | 6 | ||||
-rw-r--r-- | src/cgal.h | 5 | ||||
-rw-r--r-- | src/version_check.cc | 2 | ||||
-rw-r--r-- | src/version_check.h | 107 |
6 files changed, 159 insertions, 17 deletions
diff --git a/openscad.pro b/openscad.pro index 591ed5f..048fbb5 100644 --- a/openscad.pro +++ b/openscad.pro @@ -108,6 +108,11 @@ CONFIG(mingw-cross-env) { include(mingw-cross-env.pri) } +CONFIG(skip-version-check) { + # force the use of outdated libraries + DEFINES += OPENSCAD_SKIP_VERSION_CHECK +} + # Application configuration macx:CONFIG += mdi CONFIG += cgal @@ -122,14 +127,7 @@ mdi { DEFINES += ENABLE_MDI } -# FIXME: This can be made default by now -CONFIG += progresswidget -progresswidget { - DEFINES += USE_PROGRESSWIDGET - FORMS += src/ProgressWidget.ui - HEADERS += src/ProgressWidget.h - SOURCES += src/ProgressWidget.cc -} +DEFINES += USE_PROGRESSWIDGET include(common.pri) @@ -145,9 +143,12 @@ RESOURCES = openscad.qrc FORMS += src/MainWindow.ui \ src/Preferences.ui \ - src/OpenCSGWarningDialog.ui + src/OpenCSGWarningDialog.ui \ + src/ProgressWidget.ui -HEADERS += src/parsersettings.h \ +HEADERS += src/version_check.h \ + src/ProgressWidget.h \ + src/parsersettings.h \ src/renderer.h \ src/rendersettings.h \ src/ThrownTogetherRenderer.h \ @@ -203,8 +204,10 @@ HEADERS += src/parsersettings.h \ src/system-gl.h \ src/stl-utils.h -SOURCES += src/mathc99.cc \ - src/linalg.cc \ +SOURCES += src/version_check.cc \ + src/ProgressWidget.cc \ + src/mathc99.cc \ + src/linalg.cc \ src/handle_dep.cc \ src/value.cc \ src/expr.cc \ diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 6ff0dd8..f15110d 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -11,12 +11,36 @@ # - Qt4 # +BASEDIR=$HOME/openscad_deps +OPENSCADDIR=$PWD +SRCDIR=$BASEDIR/src +DEPLOYDIR=$BASEDIR +if [ ! $NUMCPU ]; then + NUMCPU=1 # paralell builds for some libraries +fi + printUsage() { echo "Usage: $0" echo } +build_git() +{ + version=$1 + echo "Building git" $version "..." + cd $BASEDIR/src + rm -rf git-$version + if [ ! -f git-$version.tar.gz ]; then + curl -O http://git-core.googlecode.com/files/git-$version.tar.gz + fi + tar zxf git-$version.tar.gz + cd git-$version + ./configure --prefix=$DEPLOYDIR + make -j$NUMCPU + make install +} + build_cmake() { version=$1 @@ -230,6 +254,11 @@ fi if [ ! "`command -v cmake`" ]; then build_cmake 2.8.8 fi +if [ "`cmake --version | grep 'version 2.[1-6][^0-9]'`" ]; then + build_cmake 2.8.8 +fi + +# build_git 1.7.10.3 # Singly build CGAL or OpenCSG # (Most systems have all libraries available as packages except CGAL/OpenCSG) diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh index e77d969..6361dd4 100644 --- a/scripts/setenv-linbuild.sh +++ b/scripts/setenv-linbuild.sh @@ -26,3 +26,9 @@ 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 + @@ -11,11 +11,6 @@ using boost::intmax_t; using boost::uintmax_t; #endif -#include <CGAL/version.h> -#if CGAL_VERSION_NR < 1030601000 - #error CGAL >= 3.6 is required! -#endif - // NDEBUG must be disabled when including CGAL headers, otherwise CGAL assertions // will not be thrown, causing OpenSCAD's CGAL error checking to fail. // To be on the safe side, this has to be done when including any CGAL header file. diff --git a/src/version_check.cc b/src/version_check.cc new file mode 100644 index 0000000..87dfeeb --- /dev/null +++ b/src/version_check.cc @@ -0,0 +1,2 @@ +#include "version_check.h" + diff --git a/src/version_check.h b/src/version_check.h new file mode 100644 index 0000000..4d10b0b --- /dev/null +++ b/src/version_check.h @@ -0,0 +1,107 @@ +// version_check.h copyright 2012 don bright. released under the GPL 2, or +// later, as described in the file named 'COPYING' in OpenSCAD's project root. + +/* This file will check versions of libraries at compile time. If they +are too old, the user will be warned. If the user wishes to force +compilation, they can run + + qmake CONFIG=skip-version-check + +Otherwise they will be guided to README.md and an -build-dependencies script. + +The extensive #else #endif is to ensure only a single error is printed at +a time, to avoid confusion. +*/ + +#ifndef OPENSCAD_SKIP_VERSION_CHECK + + +#include <gmp.h> +// set minimum numbers here. +#define GMPMAJOR 5 +#define GMPMINOR 0 +#define GMPPATCH 0 +#define SYS_GMP_VER (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL * 1) +#if SYS_GMP_VER < GMPMAJOR * 10000 + GMPMINOR * 100 + GMPPATCH * 1 +#error GNU GMP library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include <mpfr.h> +#if MPFR_VERSION < MPFR_VERSION_NUM( 3,0,0 ) +#error GNU MPFR library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include <Eigen/Core> +#if not EIGEN_VERSION_AT_LEAST( 2,0,13 ) +#error eigen2 library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include <boost/version.hpp> +// boost 1.3.5 = 103500 +#if BOOST_VERSION < 103500 +#error boost library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#ifdef ENABLE_CGAL +#include <CGAL/version.h> + +#if CGAL_VERSION_NR < 1030601000 +#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 +#warning "=======================" +#warning "." +#warning "." +#warning "." +#warning "." +#warning CGAL library version is old, risking buggy behavior. Please see README.md. Continuing anyway. +#warning "." +#warning "." +#warning "." +#warning "." +#warning "=======================" +#endif // CGAL_VERSION_NR < 10400010000 +#endif //ENABLE_CGAL + +#ifdef ENABLE_OPENCSG +#include <GL/glew.h> +// kludge - GLEW doesnt have compiler-accessible version numbering +#ifndef GLEW_ARB_occlusion_query2 +#error GLEW library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include <opencsg.h> +// 1.3.2 -> 0x0132 +#if OPENCSG_VERSION < 0x0132 +#error OPENCSG library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else +#endif // ENABLE_OPENCSG + +#include <QtCore/qglobal.h> +#if QT_VERSION < 0x040603 +#error QT library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#endif // QT + + +#ifdef ENABLE_OPENCSG +#endif // OpenCSG +#endif // GLEW +#endif // ENABLE_OPENCSG + +#ifdef ENABLE_CGAL +#endif // CGAL error +#endif // ENABLE_CGAL + +#endif // Boost +#endif // Eigen2 +#endif // MPFR +#endif // GMP + +#endif // OPENSCAD_SKIP_VERSION_CHECK + |