annotate m4/multiarch.m4 @ 267:bec6d2480f08 2.6

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