From 1145bed3203ed0e489369801b0b1ac13e783d183 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Sat, 25 Oct 2014 20:01:38 +0300 Subject: [PATCH 1/3] macosx: locate the best newest SDK present on the computer. With recent versions of XCode, PC/SC headers are hidden inside the SDK folder inside XCode app, and the global path is not guaranteed to be present. This allows to build easily from source without depending on a specific XCode/OSX version. --- configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index df62bb00..b2853ae3 100644 --- a/configure.ac +++ b/configure.ac @@ -530,7 +530,11 @@ if test "${enable_pcsc}" = "yes"; then if test -z "${PCSC_CFLAGS}"; then case "${host}" in *-*-darwin*) - PCSC_CFLAGS="-I/System/Library/Frameworks/PCSC.framework/Headers" + # Locate the latest SDK. + SDKS_PATH="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs" + SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -t. -k2 -r | head -1)}" + # and set the PC/SC include path + PCSC_CFLAGS="-I$SDK_PATH/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers" ;; *) PCSC_CFLAGS="-I/usr/include/PCSC" From 82624a98b79895e66fbb18dc86af142a4a1ab147 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Sat, 25 Oct 2014 20:07:36 +0300 Subject: [PATCH 2/3] macosx: locate and target the latest SDK to build against. --- MacOSX/build-package.in | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/MacOSX/build-package.in b/MacOSX/build-package.in index cd5fd28e..2cc59283 100755 --- a/MacOSX/build-package.in +++ b/MacOSX/build-package.in @@ -8,22 +8,12 @@ set -ex test -x ./configure || ./bootstrap BUILDPATH=${PWD} -# Use new locations for SDK on 10.8+ -OSX_RELEASE=`sw_vers -productVersion` -case ${OSX_RELEASE:0:4} in - "10.8") - SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk" - export CFLAGS="-isysroot $SYSROOT -arch i386 -arch x86_64 -mmacosx-version-min=10.7" - ;; - "10.9") - SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" - export CFLAGS="-isysroot $SYSROOT -arch i386 -arch x86_64 -mmacosx-version-min=10.7" - ;; - *) - SYSROOT="/Developer/SDKs/MacOSX10.6.sdk" - export CFLAGS="-isysroot $SYSROOT -arch i386 -arch x86_64 -mmacosx-version-min=10.6" - ;; -esac +# Locate the latest OSX SDK present +SDKS_PATH="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs" +SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -k2 -t. -r | head -1)}" + +# Set SDK path +export CFLAGS="-isysroot $SDK_PATH -arch i386 -arch x86_64 -mmacosx-version-min=10.7" # OpenSSL is deprecated on OSX since 10.7 and that generates lots of # "false positive" warnings and there is no alternative option. From 54489011609d05935c8cdd0012e461a9edb3bb09 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Sun, 26 Oct 2014 11:48:57 +0200 Subject: [PATCH 3/3] macosx: update the minimal building instructions. --- MacOSX/build-package.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MacOSX/build-package.in b/MacOSX/build-package.in index 2cc59283..4f671c45 100755 --- a/MacOSX/build-package.in +++ b/MacOSX/build-package.in @@ -1,14 +1,16 @@ #!/bin/bash -# Building the installer is only tested and supported on 10.9 with Xcode 5.0.1 -# Command line tools for Xcode required, install with "xcode-select --install" +# Building the installer is only tested and supported on 10.9+ with Xcode 6.0.1 # Built package targets 10.9+ # Building should also work on older versions with older revisions or slight changes, YMMV +# You need to have the following from homebrew or macports or fink: +# autoconf automake libtool pkg-config + set -ex test -x ./configure || ./bootstrap BUILDPATH=${PWD} -# Locate the latest OSX SDK present +# Locate the latest OSX SDK SDKS_PATH="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs" SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -k2 -t. -r | head -1)}"