diff --git a/configure.ac b/configure.ac index b2fcd1e..e08510f 100644 --- a/configure.ac +++ b/configure.ac @@ -173,6 +173,30 @@ case "$host_os" in ;; esac +#### Mac OSX specific stuff ##### + +AC_ARG_ENABLE(mac-universal, + AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries]), + enable_mac_universal=$enableval, enable_mac_universal="no") + +AC_ARG_WITH(mac-version-min, + AS_HELP_STRING([--with-mac-version-min=], [Defines the earliest version of MacOS X that the executables will run on.]), + mac_version_min=$withval, mac_version_min="10.5") + +AC_ARG_WITH(mac-sysroot, + AS_HELP_STRING([--with-mac-sysroot=], [SDK basedir to use as the logical root directory for headers and libraries.]), + mac_sysroot=$withval, mac_sysroot="/Developer/SDKs/MacOSX10.5.sdk") + +if test "x$os_is_darwin" = "x1" ; then + LDFLAGS="$LDFLAGS -isysroot $mac_sysroot -mmacosx-version-min=$mac_version_min" + CFLAGS="$CFLAGS -isysroot $mac_sysroot -mmacosx-version-min=$mac_version_min" + + if test "x$enable_mac_universal" = "xyes" ; then + mac_arches="-arch i386 -arch x86_64" + LDFLAGS="$LDFLAGS $mac_arches" + CFLAGS="$CFLAGS $mac_arches" + fi +fi #### Compiler flags #### @@ -522,12 +546,9 @@ AC_SEARCH_LIBS([backtrace], [execinfo ubacktrace]) if test "x$os_is_darwin" = "x1" ; then AC_MSG_CHECKING([looking for Apple CoreService Framework]) # How do I check a framework "library" - AC_CHECK_LIB prob. won't work??, just assign LIBS & hope - AC_CHECK_HEADER([/Developer/Headers/FlatCarbon/CoreServices.h], + AC_CHECK_HEADERS([CoreServices/CoreServices.h], [LIBS="$LIBS -framework CoreServices"], - [AC_CHECK_HEADERS([/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h], - [LIBS="$LIBS -framework CoreServices"], - [AC_MSG_ERROR([CoreServices.h header file not found])] - )] + [AC_MSG_ERROR([CoreServices.h header file not found])] ) AC_MSG_RESULT([ok]) @@ -1341,31 +1362,6 @@ AC_DEFINE(PA_SOEXT, [".so"], [Shared object extension]) AC_SUBST(pulseconfdir, ["${sysconfdir}/pulse"]) AX_DEFINE_DIR(PA_DEFAULT_CONFIG_DIR, pulseconfdir, [Location of configuration files]) -#### Mac OSX specific stuff ##### - -AC_ARG_ENABLE(mac-universal, - AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries]), - enable_mac_universal=$enableval, enable_mac_universal="no") - -AC_ARG_WITH(mac-version-min, - AS_HELP_STRING([--with-mac-version-min=], [Defines the earliest version of MacOS X that the executables will run on.]), - mac_version_min=$withval, mac_version_min="10.5") - -AC_ARG_WITH(mac-sysroot, - AS_HELP_STRING([--with-mac-sysroot=], [SDK basedir to use as the logical root directory for headers and libraries.]), - mac_sysroot=$withval, mac_sysroot="/Developer/SDKs/MacOSX10.5.sdk") - -if test "x$os_is_darwin" = "x1" ; then - LDFLAGS="$LDFLAGS -isysroot $mac_sysroot -mmacosx-version-min=$mac_version_min" - CFLAGS="$CFLAGS -isysroot $mac_sysroot -mmacosx-version-min=$mac_version_min" - - if test "x$enable_mac_universal" = "xyes" ; then - mac_arches="-arch i386 -arch x86_64" - LDFLAGS="$LDFLAGS $mac_arches" - CFLAGS="$CFLAGS $mac_arches" - fi -fi - AC_ARG_ENABLE([webrtc-aec], AS_HELP_STRING([--enable-webrtc-aec], [Enable the optional WebRTC-based echo canceller]))