From 1145bed3203ed0e489369801b0b1ac13e783d183 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Sat, 25 Oct 2014 20:01:38 +0300 Subject: [PATCH] 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"