diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2011-09-28 12:10:49 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2011-09-28 12:10:49 +0000 |
commit | ef8be7fbc50f902c4f19ea0864d03c0c16904f97 (patch) | |
tree | 9babe4f277d54a561139ff4279655188874d87bb /m4/iem_fat.m4 | |
parent | f2a92ff4c6df9404478186f48c9e972d08f53932 (diff) |
m4 marcros
svn path=/trunk/externals/zexy/; revision=15370
Diffstat (limited to 'm4/iem_fat.m4')
-rw-r--r-- | m4/iem_fat.m4 | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/m4/iem_fat.m4 b/m4/iem_fat.m4 new file mode 100644 index 0000000..bb1238d --- /dev/null +++ b/m4/iem_fat.m4 @@ -0,0 +1,52 @@ +dnl Copyright (C) 2005-2006 IOhannes m zmölnig +dnl This file is free software; IOhannes m zmölnig +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([AC_CHECK_FAT], +[ +AC_ARG_ENABLE(fat-binary, + [ --enable-fat-binary=ARCHS + build an Apple Multi Architecture Binary (MAB); + ARCHS is a comma-delimited list of architectures for + which to build; if ARCHS is omitted, then the package + will be built for all architectures supported by the + platform (e.g. "ppc,i386" for MacOS/X and Darwin; + if this option is disabled or omitted entirely, then + the package will be built only for the target + platform], + [fat_binary=$enableval], [fat_binary=no]) +if test "$fat_binary" != no; then + AC_MSG_CHECKING([target architectures]) + + # Respect TARGET_ARCHS setting from environment if available. + if test -z "$TARGET_ARCHS"; then + # Respect ARCH given to --enable-fat-binary if present. + if test "$fat_binary" != yes; then + TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '` + else + # Choose a default set of architectures based upon platform. + TARGET_ARCHS="ppc i386" + fi + fi + AC_MSG_RESULT([$TARGET_ARCHS]) + + define([Name],[translit([$1],[./-], [___])]) + # /usr/lib/arch_tool -archify_list $TARGET_ARCHS + []Name="" + for archs in $TARGET_ARCHS + do + []Name="$[]Name -arch $archs" + done + + if test "x$[]Name" != "x"; then + AC_CHECK_CFLAGS($[]Name,,[]Name="") + fi + + if test "x$[]Name" != "x"; then + AC_CHECK_LDFLAGS($[]Name,,[]Name="") + fi + + undefine([Name]) +fi +])# AC_CHECK_FAT |