From 72fd006b924d5cb59905477d5f28dfe2a9c50747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 9 Apr 2009 11:52:00 +0000 Subject: acinclude with fat-check svn path=/trunk/externals/iem/iemmatrix/; revision=10995 --- src/acinclude.m4 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'src/acinclude.m4') diff --git a/src/acinclude.m4 b/src/acinclude.m4 index 772fecf..30a5080 100644 --- a/src/acinclude.m4 +++ b/src/acinclude.m4 @@ -93,3 +93,55 @@ AC_DEFUN([AC_CHECK_LDFLAGS], fi ])# AC_CHECK_LDFLAGS + +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 + tmp_arch_cflags="$CFLAGS" + AC_CHECK_CFLAGS($[]Name,,[]Name="") + CFLAGS="$tmp_arch_cflags" + fi + + if test "x$[]Name" != "x"; then + tmp_arch_ldflags="$LDFLAGS" + AC_CHECK_LDFLAGS($[]Name,,[]Name="") + LDFLAGS="$tmp_arch_ldflags" + fi + + undefine([Name]) +fi +])# AC_CHECK_FAT -- cgit v1.2.1