annotate m4/multiarch.m4 @ 400:573ed4940625 3.0-beta1 3.0-beta1

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