aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-05-11 06:53:14 +0100
committerJoão Valverde <j@v6e.pt>2016-05-12 11:19:04 +0000
commit21090cab5d721906249c1f44f0c357cb845665a9 (patch)
tree6f70c0518718d077119462405b21cc735af9dfb3 /configure.ac
parentb9c7b126f79b8420e7efe5ff5fcb346d0fa466a1 (diff)
autotools: Move OSX autoconf macros to ws_osx.m4
Change-Id: Icde077957810a0eb2a99cdfd6ec57dfd04b4ad47 Reviewed-on: https://code.wireshark.org/review/15354 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Tüxen <tuexen@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac264
1 files changed, 4 insertions, 260 deletions
diff --git a/configure.ac b/configure.ac
index 41bb412108..a7dffab5dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -231,266 +231,10 @@ if test -z "$PKG_CONFIG"; then
AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
fi
-AC_ARG_ENABLE(osx-deploy-target,
- AC_HELP_STRING( [--enable-osx-deploy-target],
- [choose an OS X deployment target @<:@default=major release on which you're building@:>@]),
-[
- #
- # Is this OS X?
- #
- case "$host_os" in
- darwin*)
- #
- # Yes.
- #
- # Let the user 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, then, if we have SDKs available,
- # 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.
- #
- # Check for an OS X deployment target early, so that
- # as many tests using the compiler are done using the
- # flags that we'll be using when building.
- #
- if test $enableval = no
- then
- #
- # The user explicitly said
- # --disable-osx-deploy-target, so don't build
- # against an SDK.
- #
- deploy_target=
- elif test $enableval = yes
- then
- #
- # The user said --enable-osx-deploy-target, but
- # didn't say what version to target; target the
- # major version number of the version of OS X on
- # which we're running.
- #
- # (We quote the command so that we can use
- # autoconf's M4 quoting characters, [ and ], in
- # the sed expression.)
- #
- [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
- else
- deploy_target="$enableval"
- fi
- ;;
-
- *)
- #
- # No. Fail, because whatever the user intended for us to
- # do, we can't do it.
- #
- AC_MSG_ERROR([--enable-osx-deploy-target specified on an OS other than OS X])
- ;;
- esac
-],[
- #
- # Is this OS X?
- #
- case "$host_os" in
- darwin*)
- #
- # Yes.
- #
- # If we have SDKs available, default to targeting the major
- # version number of the version of OS X on which we're
- # running.
- #
- # (We quote the command so that we can use autoconf's
- # M4 quoting characters, [ and ], in the sed expression.)
- #
- for i in /Developer/SDKs \
- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
- /Library/Developer/CommandLineTools/SDKs
- do
- if test -d "$i"
- then
- [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
- break
- fi
- done
- ;;
-
- *)
- #
- # No. There's nothing to do.
- #
- ;;
- esac
-])
-
-if test ! -z "$deploy_target"
-then
- AC_MSG_CHECKING([whether we can build for OS X $deploy_target])
- case $deploy_target in
-
- 10.0|10.1|10.2)
- #
- # I'm not sure this would even work.
- #
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([We don't support building for OS X $deploy_target])
- ;;
-
- 10.3)
- #
- # XXX - never tested.
- #
- AC_MSG_RESULT(yes)
- SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
- ;;
-
- *)
- #
- # 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.
- #
-
- #
- # 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
- #
- # Get a list of all the SDKs.
- #
- if ! test -d "$sdksdir"
- then
- #
- # 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"
- then
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
- fi
- SDKPATH="$sdkpath"
- AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
- ;;
- esac
-
- #
- # Add a -mmacosx-version-min flag to force tests that
- # use the compiler, as well as the build itself, not to,
- # for example, use compiler or linker features not supported
- # by the minimum targeted version of the OS.
- #
- # Add an -isysroot flag to use the SDK.
- #
- WS_CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CFLAGS"
- WS_CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CXXFLAGS"
- WS_LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_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?
- # XXX - is this still necessary with the -mmacosx-version-min
- # flag being set?
- #
- OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
-
- #
- # In the installer package XML file, give the deployment target
- # as the minimum version.
- #
- OSX_MIN_VERSION="$deploy_target"
-
- case $deploy_target in
-
- 10.4|10.5)
- #
- # Only 32-bit builds are supported. 10.5
- # (and 10.4?) had a bug that causes some BPF
- # functions not to work with 64-bit userland
- # code, so capturing won't work.
- #
- WS_CFLAGS="-m32 $WS_CFLAGS"
- WS_CXXFLAGS="-m32 $WS_CXXFLAGS"
- WS_LDFLAGS="-m32 $WS_LDFLAGS"
- ;;
- esac
-else
- #
- # Is this OS X?
- #
- case "$host_os" in
- darwin*)
- #
- # Yes.
- #
- # In the installer package XML file, give the current OS
- # version, minor version and all, as the minimum version.
- # We can't guarantee that the resulting binary will work
- # on older OS versions, not even older minor versions
- # (original release or earlier software updates).
- #
- OSX_MIN_VERSION=`sw_vers -productVersion`
- ;;
- esac
-fi
-AC_SUBST(OSX_MIN_VERSION)
+#
+# Add configure argument to select OSX deployment target.
+#
+AC_WIRESHARK_OSX_DEPLOY_TARGET
#
# Try to arrange for large file support.