diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2014-08-20 18:13:08 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2014-08-20 18:13:08 +0000 |
| commit | 67a2458a2c116f87ebc81d91680684381db2c471 (patch) | |
| tree | 0eeeec1978384a3b7cbf7fe8b5bcaf4eee90ceee | |
| parent | osx-build.sh: refactor for easier maintenance (don't hard-code build prefix i... (diff) | |
| download | inkscape-67a2458a2c116f87ebc81d91680684381db2c471.tar.gz inkscape-67a2458a2c116f87ebc81d91680684381db2c471.zip | |
osx-build.sh: refactor OS X version tests (thx Liam)
(bzr r13506.1.33)
| -rwxr-xr-x | packaging/macosx/osx-build.sh | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/packaging/macosx/osx-build.sh b/packaging/macosx/osx-build.sh index 1b220576c..fab5c6a99 100755 --- a/packaging/macosx/osx-build.sh +++ b/packaging/macosx/osx-build.sh @@ -155,9 +155,9 @@ done # OS X version OSXVERSION="$(/usr/bin/sw_vers | grep ProductVersion | cut -f2)" -OSXMINORVER="$(echo "$OSXVERSION" | cut -d. -f 1,2)" -OSXMINORNO="$(echo "$OSXVERSION" | cut -d. -f2)" -OSXPOINTNO="$(echo "$OSXVERSION" | cut -d. -f3)" +OSXMINORVER="$(cut -d. -f 1,2 <<< $OSXVERSION)" +OSXMINORNO="$(cut -d. -f2 <<< $OSXVERSION)" +OSXPOINTNO="$(cut -d. -f3 <<< $OSXVERSION)" ARCH="$(uname -a | awk '{print $NF;}')" # Set environment variables @@ -177,24 +177,32 @@ export CFLAGS="$CFLAGS -pipe -Os" # 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" 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+" + 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 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 CLAGS="$CFLAGS -arch $ARCH" @@ -202,6 +210,8 @@ elif [ "$OSXMINORNO" -gt "5" ]; then 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 CLAGS="$CFLAGS -arch $ARCH" @@ -215,37 +225,18 @@ fi # Utility functions # ---------------------------------------------------------- function getinkscapeinfo () { - # Fetch some information + osxapp_domain="$BUILDPREFIX/Info" INKVERSION="$(defaults read $osxapp_domain CFBundleVersion)" [ $? -ne 0 ] && INKVERSION="devel" REVISION="$(bzr revno)" [ $? -ne 0 ] && REVISION="" || REVISION="-r$REVISION" - if [[ "$OSXMINORVER" == "10.5" ]]; then - TARGETNAME="LEOPARD+" - TARGETVERSION="10.5" - elif [[ "$OSXMINORVER" == "10.6" ]]; then - TARGETNAME="SNOW LEOPARD+" - TARGETVERSION="10.6" - elif [[ "$OSXMINORVER" == "10.7" ]]; then - TARGETNAME="LION+" - TARGETVERSION="10.7" - elif [[ "$OSXMINORVER" == "10.8" ]]; then - TARGETNAME="MOUTAIN LION+" - TARGETVERSION="10.8" - elif [[ "$OSXMINORVER" == "10.9" ]]; then - TARGETNAME="MAVERICKS+" - TARGETVERSION="10.9" - else - echo "Unsupported OS X version." - exit 1 - fi - TARGETARCH="$ARCH" NEWNAME="Inkscape-$INKVERSION$REVISION-$TARGETVERSION-$TARGETARCH" DMGFILE="$NEWNAME.dmg" INFOFILE="$NEWNAME-info.txt" + } # Actions |
