diff options
| -rwxr-xr-x | scripts/macosx-build-dependencies.sh | 40 | 
1 files changed, 34 insertions, 6 deletions
| diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh index f7b6b18..20ed1f2 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  @@ -288,13 +294,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 2.0.17 | 
