Merge from gnulib.
* lib/filemode.h, lib/signal.in.h, lib/stat.c, lib/stdint.in.h:
* lib/stdlib.in.h, lib/unistd.in.h, m4/extensions.m4, m4/getloadavg.m4:
* m4/getopt.m4, m4/gnulib-common.m4, m4/largefile.m4, m4/mktime.m4:
* m4/multiarch.m4, m4/nocrash.m4, m4/stdio_h.m4, m4/time_r.m4:
Copy new versions from gnulib, incorporating the following changes:
2012-06-22 time_r: fix typo that always overrode localtime_r decl
2012-06-22 Write "Mac OS X" instead of "MacOS X".
2012-06-21 mktime: fix integer overflow in 'configure'-time test
2012-06-21 nonblocking: Avoid compilation error on mingw64.
2012-06-19 stat, fstat: Avoid warnings on mingw64.
2012-06-19 getopt-gnu: Fix exit code overflow in autoconf test.
2012-06-22 17:20:00 +00:00
|
|
|
# multiarch.m4 serial 7
|
2014-01-01 07:43:34 +00:00
|
|
|
dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
2011-01-09 06:57:07 +00:00
|
|
|
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.
|
|
|
|
#
|
Merge from gnulib.
* lib/filemode.h, lib/signal.in.h, lib/stat.c, lib/stdint.in.h:
* lib/stdlib.in.h, lib/unistd.in.h, m4/extensions.m4, m4/getloadavg.m4:
* m4/getopt.m4, m4/gnulib-common.m4, m4/largefile.m4, m4/mktime.m4:
* m4/multiarch.m4, m4/nocrash.m4, m4/stdio_h.m4, m4/time_r.m4:
Copy new versions from gnulib, incorporating the following changes:
2012-06-22 time_r: fix typo that always overrode localtime_r decl
2012-06-22 Write "Mac OS X" instead of "MacOS X".
2012-06-21 mktime: fix integer overflow in 'configure'-time test
2012-06-21 nonblocking: Avoid compilation error on mingw64.
2012-06-19 stat, fstat: Avoid warnings on mingw64.
2012-06-19 getopt-gnu: Fix exit code overflow in autoconf test.
2012-06-22 17:20:00 +00:00
|
|
|
# On Mac OS X 10.5 and later systems, the user can create libraries and
|
2011-01-09 06:57:07 +00:00
|
|
|
# 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"
|
|
|
|
#
|
2011-01-22 00:12:10 +00:00
|
|
|
# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
|
2011-01-09 06:57:07 +00:00
|
|
|
|
|
|
|
AC_DEFUN_ONCE([gl_MULTIARCH],
|
|
|
|
[
|
|
|
|
dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
|
|
|
|
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)
|
|
|
|
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])
|
|
|
|
])
|