annotate m4/multiarch.m4 @ 423:079d43b6967b 3.0-beta2 3.0-beta2

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