aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-31 12:11:22 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-31 19:16:10 +0000
commit3426ffa248780f3bc1a1bdefa225d2255c4db3af (patch)
tree839976eadd6e0f6697a36b9f26a1a00d954b027c /configure.ac
parentd93be95fc0e7011e8b4ade9171e7e66146063296 (diff)
For OS X, don't rigidly tie the SDK version to the minimum target version.
According to https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html#//apple_ref/doc/uid/10000163i-CH1-SW1 the deployment target (minimum target OS version) and SDK version aren't necessarily the same and, in fact, Apple typically only ship two SDKs with each Xcode release, so if you want to build for 10.6 with the 10.6 SDK, you have to use a version of Xcode sufficiently old to have the 10.6 SDK. Here, we instead search for the oldest SDK for an OS whose version is greater than or equal to the deployment target. Note that this may not work for X11-based Wireshark, as the X11 libraries can change incompatibly between releases. (Fortunately, our plan is to kick X11-based Wireshark to the curb for OS X, removing a large pile of aggravation for users.) This also requires some fixes when building Qt and gdk-pixbuf, as some cases where we were using the minimum OS target version we needed to be using the SDK version. For CMake, we're using its native "deployment target" support for OS X, and hope that it will somehow do the right thing. Change-Id: Ie8f42c5e4719e7ebdc56b9ba5a330665bee06280 Reviewed-on: https://code.wireshark.org/review/5031 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac67
1 files changed, 60 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index c6acee7103..2e7715113b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -358,28 +358,81 @@ then
*)
#
+ # Look for the oldest SDK we can find that's
+ # for an OS equal to or later than this one.
+ #
# XXX - for 10.4, do we need 10.4u? We're
# not currently doing fat builds (we'd need
# fat versions of the support libraries for
# that to be useful), but, if we do, we'd
# need to use 10.4u.
#
- for i in /Developer/SDKs \
+
+ #
+ # Get the real version - strip off the "10.".
+ # We'll worry about that if, as, and when there's ever
+ # an OS XI.
+ #
+ deploy_real_version=`echo "$deploy_target" | sed -n 's/10\.\(.*\)/\1/p'`
+
+ #
+ # Search each directory that might contain SDKs.
+ #
+ sdkpath=""
+ for sdksdir in /Developer/SDKs \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
/Library/Developer/CommandLineTools/SDKs
do
- if test -d "$i"/"MacOSX$deploy_target.sdk"
+ #
+ # Get a list of all the SDKs.
+ #
+ if ! test -d "$sdksdir"
then
- SDKPATH="$i"/"MacOSX$deploy_target.sdk"
- break
+ #
+ # There is no directory with that name.
+ # Move on to the next one in the list,
+ # if any.
+ #
+ continue
fi
+
+ #
+ # Get a list of all the SDKs in that directory,
+ # if any.
+ #
+ # We have to use @<:@ for [ and @:>@ for ] to
+ # avoid m4 removing the square brackets.
+ #
+ sdklist=`(cd "$sdksdir"; ls -d MacOSX10.@<:@0-9@:>@*.sdk 2>/dev/null)`
+
+ for sdk in $sdklist
+ do
+ #
+ # Get the real version for this SDK.
+ #
+ sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
+
+ #
+ # Is it for the deployment target or
+ # some later release?
+ #
+ if test "$sdk_real_version" -ge "$deploy_real_version"
+ then
+ #
+ # Yes, use it.
+ #
+ sdkpath="$sdksdir/$sdk"
+ break 2
+ fi
+ done
done
- if test -z "$SDKPATH"
+ if test -z "$sdkpath"
then
AC_MSG_RESULT(no)
- AC_MSG_ERROR([We couldn't find the SDK for OS X $deploy_target])
+ AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
fi
- AC_MSG_RESULT(yes)
+ SDKPATH="$sdkpath"
+ AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
;;
esac