1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-10-27 18:20:13 -04:00
trader/m4/multiarch.m4
John Zaitseff d07dc71f1b Update all auto-generated files
These files have been created by running ./build-aux/bootstrap with
Gnulib as at commit f9b39c4e337f1dc0dd07c4f3985c476fb875d799 (with a date
stamp of Sun Jul 31 23:28:18 2022 +0200), Autoconf 2.71, Automake 1.16.5,
Gettext 0.21 and pkgconf 1.8.0.
2022-08-03 19:13:31 +10:00

66 lines
2.1 KiB
Plaintext

# multiarch.m4 serial 9
dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Determine whether the compiler is or may be producing universal binaries.
#
# On Mac OS X 10.5 and later systems, the user can create libraries and
# executables that work on multiple system types--known as "fat" or
# "universal" binaries--by specifying multiple '-arch' options to the
# compiler but only a single '-arch' option to the preprocessor. Like
# this:
#
# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
# CPP="gcc -E" CXXCPP="g++ -E"
#
# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
AC_DEFUN_ONCE([gl_MULTIARCH],
[
dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
[gl_cv_c_multiarch],
[gl_cv_c_multiarch=no
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifndef __APPLE_CC__
not a universal capable compiler
#endif
typedef int dummy;
]])],
[
dnl Check for potential -arch flags. It is not universal unless
dnl there are at least two -arch flags with different values.
arch=
prev=
for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
if test -n "$prev"; then
case $word in
i?86 | x86_64 | ppc | ppc64 | arm | arm64)
if test -z "$arch" || test "$arch" = "$word"; then
arch="$word"
else
gl_cv_c_multiarch=yes
fi
;;
esac
prev=
else
if test "x$word" = "x-arch"; then
prev=arch
fi
fi
done
])
])
if test $gl_cv_c_multiarch = yes; then
APPLE_UNIVERSAL_BUILD=1
else
APPLE_UNIVERSAL_BUILD=0
fi
AC_SUBST([APPLE_UNIVERSAL_BUILD])
])