annotate m4/multiarch.m4 @ 436:4c272633fce2 3.0 3.0

Added missing files
author lost@l-w.ca
date Fri, 29 Oct 2010 19:28:54 -0600
parents b8bf63962a99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
1 # multiarch.m4 serial 5
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
2 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
6
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
7 # Determine whether the compiler is or may be producing universal binaries.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
8 #
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
9 # On MacOS X 10.5 and later systems, the user can create libraries and
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
10 # executables that work on multiple system types--known as "fat" or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
11 # "universal" binaries--by specifying multiple '-arch' options to the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
12 # compiler but only a single '-arch' option to the preprocessor. Like
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
13 # this:
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
14 #
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
15 # ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
16 # CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
17 # CPP="gcc -E" CXXCPP="g++ -E"
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
18 #
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
19 # Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
20 # beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
21
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
22 AC_DEFUN_ONCE([gl_MULTIARCH],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
23 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
24 dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
25 gl_cv_c_multiarch=no
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
26 AC_COMPILE_IFELSE(
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
27 [AC_LANG_SOURCE(
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
28 [[#ifndef __APPLE_CC__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
29 not a universal capable compiler
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
30 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
31 typedef int dummy;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
32 ]])],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
33 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
34 dnl Check for potential -arch flags. It is not universal unless
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
35 dnl there are at least two -arch flags with different values.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
36 arch=
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
37 prev=
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
38 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
39 if test -n "$prev"; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
40 case $word in
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
41 i?86 | x86_64 | ppc | ppc64)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
42 if test -z "$arch" || test "$arch" = "$word"; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
43 arch="$word"
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
44 else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
45 gl_cv_c_multiarch=yes
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
46 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
47 ;;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
48 esac
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
49 prev=
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
50 else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
51 if test "x$word" = "x-arch"; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
52 prev=arch
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
53 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
54 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
55 done
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
56 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
57 if test $gl_cv_c_multiarch = yes; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
58 AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
59 [Define if the compiler is building for multiple architectures of Apple platforms at once.])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
60 APPLE_UNIVERSAL_BUILD=1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
61 else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
62 APPLE_UNIVERSAL_BUILD=0
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
63 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
64 AC_SUBST([APPLE_UNIVERSAL_BUILD])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
65 ])