diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2014-08-21 10:24:31 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2014-08-21 10:24:31 +0000 |
| commit | 7550e6f258832594ec9e80144cd9f09bcd4fd5ef (patch) | |
| tree | db86abb167796e1afbb13c3dbeabd6e07164b8e7 | |
| parent | launcher scripts: we introduced bashism for command substitution, make sure t... (diff) | |
| download | inkscape-7550e6f258832594ec9e80144cd9f09bcd4fd5ef.tar.gz inkscape-7550e6f258832594ec9e80144cd9f09bcd4fd5ef.zip | |
build scripts: refactor tests based on OS X version
(bzr r13506.1.35)
| -rwxr-xr-x | packaging/macosx/osx-app.sh | 31 | ||||
| -rwxr-xr-x | packaging/macosx/osx-build.sh | 92 |
2 files changed, 75 insertions, 48 deletions
diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 31640546a..aadc06e68 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -111,7 +111,9 @@ done echo -e "\n\033[1mCREATE INKSCAPE APP BUNDLE\033[0m\n" + # Safety tests +#---------------------------------------------------------- if [ "x$binary" == "x" ]; then echo "Inkscape binary path not specified." >&2 @@ -172,19 +174,25 @@ if [ ! -e "$LIBPREFIX/lib/aspell-0.60/en.dat" ]; then fi +# OS X version +#---------------------------------------------------------- +OSXVERSION="$(/usr/bin/sw_vers | grep ProductVersion | cut -f2)" +OSXMINORVER="$(cut -d. -f 1,2 <<< $OSXVERSION)" +OSXMINORNO="$(cut -d. -f2 <<< $OSXVERSION)" +OSXPOINTNO="$(cut -d. -f3 <<< $OSXVERSION)" +ARCH="$(uname -a | awk '{print $NF;}')" + + +# Setup +#---------------------------------------------------------- # Handle some version specific details. -VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'` -if [ "$VERSION" -ge "4" ]; then - # We're on Tiger (10.4) or later. - # XCode behaves a little differently in Tiger and later. +if [ "$OSXMINORNO" -le "4" ]; then + echo "Note: Inkscape packaging requires Mac OS X 10.5 Leopard or later." + exit 1 +else # if [ "$OSXMINORNO" -ge "5" ]; then XCODEFLAGS="-configuration Deployment" SCRIPTEXECDIR="ScriptExec/build/Deployment/ScriptExec.app/Contents/MacOS" EXTRALIBS="" -else - # Panther (10.3) or earlier. - XCODEFLAGS="-buildstyle Deployment" - SCRIPTEXECDIR="ScriptExec/build/ScriptExec.app/Contents/MacOS" - EXTRALIBS="" fi @@ -212,9 +220,9 @@ fi #---------------------------------------------------------- pkgexec="$package/Contents/MacOS" pkgbin="$package/Contents/Resources/bin" -pkgshare="$package/Contents/Resources/share" -pkglib="$package/Contents/Resources/lib" pkgetc="$package/Contents/Resources/etc" +pkglib="$package/Contents/Resources/lib" +pkgshare="$package/Contents/Resources/share" pkglocale="$package/Contents/Resources/share/locale" pkgpython="$package/Contents/Resources/python/site-packages/" pkgresources="$package/Contents/Resources" @@ -227,6 +235,7 @@ mkdir -p "$pkgshare" mkdir -p "$pkglocale" mkdir -p "$pkgpython" + # Build and add the launcher #---------------------------------------------------------- ( diff --git a/packaging/macosx/osx-build.sh b/packaging/macosx/osx-build.sh index fab5c6a99..b82b038c8 100755 --- a/packaging/macosx/osx-build.sh +++ b/packaging/macosx/osx-build.sh @@ -151,9 +151,8 @@ do shift 1 done -# OSXMINORVER=`/usr/bin/sw_vers | grep ProductVersion | cut -d' ' -f2 | cut -f1-2 -d.` - # OS X version +# ---------------------------------------------------------- OSXVERSION="$(/usr/bin/sw_vers | grep ProductVersion | cut -f2)" OSXMINORVER="$(cut -d. -f 1,2 <<< $OSXVERSION)" OSXMINORNO="$(cut -d. -f2 <<< $OSXVERSION)" @@ -173,53 +172,72 @@ export LDFLAGS="$LDFLAGS -L$LIBPREFIX/lib" # compiler arguments export CFLAGS="$CFLAGS -pipe -Os" -# compiler -# TODO: detailed configure flags for each OS X version (Mavericks!) -if [ "$OSXMINORNO" -gt "8" ]; then - ## Apple's clang on Mavericks and later - TARGETNAME="MAVERICKS+" - TARGETVERSION="10.9" +# Use system compiler and compiler flags which are known to work: +if [ "$OSXMINORNO" -le "4" ]; then + echo "Note: Inkscape packaging requires Mac OS X 10.5 Leopard or later." + exit 1 +elif [ "$OSXMINORNO" -eq "5" ]; then + ## Apple's GCC 4.2.1 on Leopard + TARGETNAME="LEOPARD" + TARGETVERSION="10.5" + export CC="/usr/bin/gcc-4.2" + export CXX="/usr/bin/g++-4.2" + export CLAGS="$CFLAGS -arch $ARCH" + export CXXFLAGS="$CFLAGS" + CONFFLAGS="--disable-openmp $CONFFLAGS" +elif [ "$OSXMINORNO" -eq "6" ]; then + ## Apple's LLVM-GCC 4.2.1 on Snow Leopard + TARGETNAME="SNOW LEOPARD" + TARGETVERSION="10.6" + export CC="/usr/bin/llvm-gcc-4.2" + export CXX="/usr/bin/llvm-g++-4.2" + export CLAGS="$CFLAGS -arch $ARCH" + export CXXFLAGS="$CFLAGS" + CONFFLAGS="--disable-openmp $CONFFLAGS" +elif [ "$OSXMINORNO" -eq "7" ]; then + ## Apple's clang on Lion and later + TARGETNAME="LION" + TARGETVERSION="10.7" export CC="/usr/bin/clang" export CXX="/usr/bin/clang++" export CLAGS="$CFLAGS -arch $ARCH" - export CXXFLAGS="$CLAGS -Wno-mismatched-tags -Wno-cast-align -std=c++11 -stdlib=libc++" -elif [ "$OSXMINORNO" -gt "7" ]; then - ## Apple's clang on Mountain Lion and later - TARGETNAME="MOUTAIN LION+" + export CXXFLAGS="$CFLAGS -Wno-mismatched-tags -Wno-cast-align" #-stdlib=libstdc++ -std=c++11 +elif [ "$OSXMINORNO" -eq "8" ]; then + ## Apple's clang on Mountain Lion + TARGETNAME="MOUTAIN LION" TARGETVERSION="10.8" export CC="/usr/bin/clang" export CXX="/usr/bin/clang++" export CLAGS="$CFLAGS -arch $ARCH" - export CXXFLAGS="$CFLAGS -Wno-mismatched-tags -Wno-cast-align -std=c++11 -stdlib=libstdc++" -elif [ "$OSXMINORNO" -gt "6" ]; then - ## Apple's clang on Lion and later - TARGETNAME="LION+" - TARGETVERSION="10.7" + export CXXFLAGS="$CFLAGS -Wno-mismatched-tags -Wno-cast-align -std=c++11 -stdlib=libstdc++" +elif [ "$OSXMINORNO" -eq "9" ]; then + ## Apple's clang on Mavericks + TARGETNAME="MAVERICKS" + TARGETVERSION="10.9" export CC="/usr/bin/clang" export CXX="/usr/bin/clang++" export CLAGS="$CFLAGS -arch $ARCH" - export CXXFLAGS="$CFLAGS -Wno-mismatched-tags -Wno-cast-align" #-stdlib=libstdc++ -std=c++11 -elif [ "$OSXMINORNO" -gt "5" ]; then - ## Apple's LLVM-GCC 4.2.1 on Snow Leopard and later - TARGETNAME="SNOW LEOPARD+" - TARGETVERSION="10.6" - export CC="/usr/bin/llvm-gcc-4.2" - export CXX="/usr/bin/llvm-g++-4.2" + export CXXFLAGS="$CLAGS -Wno-mismatched-tags -Wno-cast-align -std=c++11 -stdlib=libc++" +elif [ "$OSXMINORNO" -eq "10" ]; then + ## Apple's clang on Yosemite + TARGETNAME="YOSEMITE" + TARGETVERSION="10.10" + export CC="/usr/bin/clang" + export CXX="/usr/bin/clang++" export CLAGS="$CFLAGS -arch $ARCH" - export CXXFLAGS="$CFLAGS" - CONFFLAGS="--disable-openmp $CONFFLAGS" -elif [ "$OSXMINORNO" -eq "5" ]; then - ## Apple's GCC 4.2.1 on Leopard - TARGETNAME="LEOPARD+" - TARGETVERSION="10.5" - export CC="/usr/bin/gcc-4.2" - export CXX="/usr/bin/g++-4.2" + export CXXFLAGS="$CLAGS -Wno-mismatched-tags -Wno-cast-align -std=c++11 -stdlib=libc++" + echo "Note: Detected version of OS X: $TARGETNAME $OSXVERSION" + echo " Inkscape packaging has not been tested on ${TARGETNAME}." +else # if [ "$OSXMINORNO" -ge "11" ]; then + ## Apple's clang after Yosemite? + TARGETNAME="UNKNOWN" + TARGETVERSION="10.XX" + export CC="/usr/bin/clang" + export CXX="/usr/bin/clang++" export CLAGS="$CFLAGS -arch $ARCH" - export CXXFLAGS="$CFLAGS" - CONFFLAGS="--disable-openmp $CONFFLAGS" -else - echo "Unsupported OS X version." - exit 1 + export CXXFLAGS="$CLAGS -Wno-mismatched-tags -Wno-cast-align -std=c++11 -stdlib=libc++" + echo "Note: Detected version of OS X: $TARGETNAME $OSXVERSION" + echo " Inkscape packaging has not been tested on this unknown version of OS X (${OSXVERSION})." fi # Utility functions |
