Debian Codegraph @

m4/macosx.m4

raw
1 AC_DEFUN([AC_FL_MACOSX], [
2 case "$target_os" in
3 darwin*)
4 target_darwin="yes"
5 ;;
6 *)
7 target_darwin="no"
8 ;;
9 esac
10
11 AC_ARG_ENABLE([mac-universal], AC_HELP_STRING([--enable-mac-universal],
12 [build a universal binary on Mac OS X @<:@no@:>@]),
13 [case "${enableval}" in
14 yes|no) ac_cv_mac_universal="${enableval}" ;;
15 *) AC_MSG_ERROR([bad value "${enableval}" for --enable-mac-universal]) ;;
16 esac],
17 [ac_cv_mac_universal=no])
18
19 if test "x$target_darwin" = "xyes" && test "x$ac_cv_mac_universal" = "xyes"; then
20 mac_minversion="-mmacosx-version-min=10.4"
21 case "$target_os" in
22 darwin8*)
23 mac_arches="-arch i386 -arch ppc"
24 mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
25 ;;
26 darwin9*)
27 mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64"
28 mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
29 ;;
30 *)
31 mac_arches=""
32 mac_sysroot=""
33 ;;
34 esac
35 MAC_UNIVERSAL_CFLAGS="$mac_arches $mac_sysroot $mac_minversion"
36 MAC_UNIVERSAL_LDFLAGS="$mac_arches"
37 fi
38 AC_SUBST([MAC_UNIVERSAL_CFLAGS])
39 AC_SUBST([MAC_UNIVERSAL_LDFLAGS])
40
41 AM_CONDITIONAL([DARWIN], [test "x$target_darwin" = "xyes"])
42 ])