forked from osmocom/wireshark
Add a --enable-osx-deploy-target option to set the deployment target
when building for OS X; that causes the MACOSX_DEPLOYMENT_TARGET environment variable to be set when building (so that, for example, we don't use linker features available on the version on which we're building but not on the minimum OS version for which we're building), and causes the SDK for that version to be used (so that, for example, we don't link with libraries with later version numbers than the ones provided with the OS version for which we're building). svn path=/trunk/; revision=50410
This commit is contained in:
parent
5a744f4afa
commit
519c5affa2
|
@ -1138,7 +1138,7 @@ osx-app: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) packaging/macosx/Info.plist
|
|||
rm -rf $(stagedir) ; \
|
||||
$(MAKE) DESTDIR=$(stagedir) install; \
|
||||
cd $(srcdir)/packaging/macosx ; \
|
||||
./osx-app.sh -bp ../staging/$(PACKAGE).inst$(bindir) ; \
|
||||
./osx-app.sh @OSX_APP_FLAGS@ -bp ../staging/$(PACKAGE).inst$(bindir) ; \
|
||||
else \
|
||||
echo "Error: OS X packaging tools not found." ; \
|
||||
echo "Package build abandoned." ; \
|
||||
|
|
98
configure.ac
98
configure.ac
|
@ -688,6 +688,13 @@ bar(void)
|
|||
# open-source application in favor of various frameworks that are
|
||||
# OS X-only.
|
||||
#
|
||||
# Also, let the user to specify an OS X release to use as a deplayment
|
||||
# target; if they specify that we should have a deployment target but
|
||||
# don't specify the deployment target, pick the OS version on which
|
||||
# the build is being done. This also causes the build to be done
|
||||
# against an SDK rather than against the headers and libraries in
|
||||
# /usr/include and /usr/lib.
|
||||
#
|
||||
case "$host_os" in
|
||||
darwin*)
|
||||
AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-deprecated-declarations)
|
||||
|
@ -924,11 +931,102 @@ darwin*)
|
|||
LIBS="$LIBS $COREFOUNDATION_FRAMEWORKS"
|
||||
AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
||||
#
|
||||
# Get the OS X major version number.
|
||||
# (We quote the command so that we can use autoconf's M4
|
||||
# quoting characters, [ and ], in the sed expression.)
|
||||
#
|
||||
[os_version=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
|
||||
|
||||
AC_ARG_ENABLE(osx-deploy-target,
|
||||
AC_HELP_STRING( [--enable-osx-deploy-target],
|
||||
[choose an OS X deployment target @<:@default=none@:>@]),
|
||||
[
|
||||
if test $enableval = no
|
||||
then
|
||||
deploy_target=
|
||||
elif test $enableval = yes
|
||||
then
|
||||
deploy_target=$os_version
|
||||
else
|
||||
deploy_target="$enableval"
|
||||
fi
|
||||
],[
|
||||
deploy_target=
|
||||
])
|
||||
AC_MSG_CHECKING([what deployment target to use])
|
||||
if test -z "$deploy_target"
|
||||
then
|
||||
AC_MSG_RESULT(none)
|
||||
OSX_DEPLOY_TARGET=
|
||||
else
|
||||
AC_MSG_RESULT($deploy_target)
|
||||
|
||||
case $deploy_target in
|
||||
|
||||
10.0|10.1|10.2)
|
||||
#
|
||||
# I'm not sure this would even work.
|
||||
#
|
||||
AC_ERROR([$deploy_target not supported as a deployment target])
|
||||
;;
|
||||
|
||||
10.3)
|
||||
#
|
||||
# XXX - never tested.
|
||||
#
|
||||
SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
|
||||
;;
|
||||
|
||||
*)
|
||||
#
|
||||
# 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 \
|
||||
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
|
||||
/Library/Developer/CommandLineTools/SDKs
|
||||
do
|
||||
if test -d "$i"/"MacOSX$deploy_target.sdk"
|
||||
then
|
||||
SDKPATH="$i"/"MacOSX$deploy_target.sdk"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$SDKPATH"
|
||||
then
|
||||
AC_MSG_ERROR([couldn't find the SDK for OS X $deploy_target])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# Add -isysroot flags to use the SDK.
|
||||
#
|
||||
CFLAGS="-isysroot $SDKPATH $CFLAGS"
|
||||
CPPFLAGS="-isysroot $SDKPATH $CPPFLAGS"
|
||||
LDFLAGS="-isysroot $SDKPATH $LDFLAGS"
|
||||
|
||||
#
|
||||
# Add a -sdkroot flag to use with osx-app.sh.
|
||||
#
|
||||
OSX_APP_FLAGS="-sdkroot $SDKPATH"
|
||||
|
||||
#
|
||||
# XXX - do we need this to build the Wireshark wrapper?
|
||||
#
|
||||
OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
|
||||
AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
|
||||
AC_SUBST(COREFOUNDATION_FRAMEWORKS)
|
||||
AC_SUBST(OSX_APP_FLAGS)
|
||||
|
||||
dnl Look in /usr/local for header files and libraries ?
|
||||
dnl XXX FIXME don't include /usr/local if it is already in the system
|
||||
|
|
|
@ -91,9 +91,11 @@ OPTIONS
|
|||
specify the path to Info.plist. Info.plist can be found
|
||||
in the base directory of the source code once configure
|
||||
has been run.
|
||||
-sdkroot
|
||||
specify the root of the SDK to use
|
||||
|
||||
EXAMPLE
|
||||
$0 -s -l /opt/local -bp ../../Build/bin -p Info.plist
|
||||
$0 -s -l /opt/local -bp ../../Build/bin -p Info.plist -sdkroot /Developer/SDKs/MacOSX10.5.sdk
|
||||
"
|
||||
}
|
||||
|
||||
|
@ -117,6 +119,9 @@ do
|
|||
-h|--help)
|
||||
help
|
||||
exit 0 ;;
|
||||
-sdkroot)
|
||||
sdkroot="$2"
|
||||
shift 1 ;;
|
||||
*)
|
||||
echo "Invalid command line option: $1"
|
||||
exit 2 ;;
|
||||
|
@ -160,6 +165,13 @@ else
|
|||
EXTRALIBS=""
|
||||
fi
|
||||
|
||||
# Set the SDK root, if an SDK was specified.
|
||||
# (-sdk is only supported by the xcodebuild in the version of the
|
||||
# developer tools that came with Snow Leopard and later versions)
|
||||
if [ ! -z "$sdkroot" ]
|
||||
then
|
||||
XCODEFLAGS="$XCODEFLAGS SDKROOT=$sdkroot"
|
||||
fi
|
||||
|
||||
# Package always has the same name. Version information is stored in
|
||||
# the Info.plist file which is filled in by the configure script.
|
||||
|
|
Loading…
Reference in New Issue