annotate m4/extensions.m4 @ 448:5cccf90bf838 3.0 tip

Fixed bug with complex external references generating invalid relocations in the object file
author lost@l-w.ca
date Fri, 05 Nov 2010 22:27:00 -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 # serial 9 -*- Autoconf -*-
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
2 # Enable extensions on systems that normally disable them.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
3
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
4 # Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
5 # This file is free software; the Free Software Foundation
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
6 # gives unlimited permission to copy and/or distribute it,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
7 # 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
8
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
9 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
10 # Autoconf. Perhaps we can remove this once we can assume Autoconf
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
11 # 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
12 # enough in this area it's likely we'll need to redefine
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
13 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
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 # If autoconf reports a warning
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
16 # warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
17 # or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
18 # the fix is
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
19 # 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
20 # but always AC_REQUIREd,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
21 # 2) to ensure that for each occurrence of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
22 # AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
23 # or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
24 # AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
25 # the corresponding gnulib module description has 'extensions' among
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
26 # its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
27 # invocation occurs in gl_EARLY, not in gl_INIT.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
28
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
29 # AC_USE_SYSTEM_EXTENSIONS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
30 # ------------------------
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
31 # Enable extensions on systems that normally disable them,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
32 # typically due to standards-conformance issues.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
33 # Remember that #undef in AH_VERBATIM gets replaced with #define by
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
34 # AC_DEFINE. The goal here is to define all known feature-enabling
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
35 # macros, then, if reports of conflicts are made, disable macros that
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
36 # cause problems on some platforms (such as __EXTENSIONS__).
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
37 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
38 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
39 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
40
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
41 AC_REQUIRE([AC_CANONICAL_HOST])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
42
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
43 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
44 if test "$MINIX" = yes; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
45 AC_DEFINE([_POSIX_SOURCE], [1],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
46 [Define to 1 if you need to in order for `stat' and other
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
47 things to work.])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
48 AC_DEFINE([_POSIX_1_SOURCE], [2],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
49 [Define to 2 if the system does not provide POSIX.1 features
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
50 except with this defined.])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
51 AC_DEFINE([_MINIX], [1],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
52 [Define to 1 if on MINIX.])
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
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
55 dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
56 dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
57 dnl provided.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
58 case "$host_os" in
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
59 hpux*)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
60 AC_DEFINE([_XOPEN_SOURCE], [500],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
61 [Define to 500 only on HP-UX.])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
62 ;;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
63 esac
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
64
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
65 AH_VERBATIM([__EXTENSIONS__],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
66 [/* Enable extensions on AIX 3, Interix. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
67 #ifndef _ALL_SOURCE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
68 # undef _ALL_SOURCE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
69 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
70 /* Enable GNU extensions on systems that have them. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
71 #ifndef _GNU_SOURCE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
72 # undef _GNU_SOURCE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
73 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
74 /* Enable threading extensions on Solaris. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
75 #ifndef _POSIX_PTHREAD_SEMANTICS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
76 # undef _POSIX_PTHREAD_SEMANTICS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
77 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
78 /* Enable extensions on HP NonStop. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
79 #ifndef _TANDEM_SOURCE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
80 # undef _TANDEM_SOURCE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
81 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
82 /* Enable general extensions on Solaris. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
83 #ifndef __EXTENSIONS__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
84 # undef __EXTENSIONS__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
85 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
86 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
87 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
88 [ac_cv_safe_to_define___extensions__],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
89 [AC_COMPILE_IFELSE(
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
90 [AC_LANG_PROGRAM([[
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
91 # define __EXTENSIONS__ 1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
92 ]AC_INCLUDES_DEFAULT])],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
93 [ac_cv_safe_to_define___extensions__=yes],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
94 [ac_cv_safe_to_define___extensions__=no])])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
95 test $ac_cv_safe_to_define___extensions__ = yes &&
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
96 AC_DEFINE([__EXTENSIONS__])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
97 AC_DEFINE([_ALL_SOURCE])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
98 AC_DEFINE([_GNU_SOURCE])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
99 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
100 AC_DEFINE([_TANDEM_SOURCE])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
101 ])# AC_USE_SYSTEM_EXTENSIONS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
102
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
103 # gl_USE_SYSTEM_EXTENSIONS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
104 # ------------------------
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
105 # Enable extensions on systems that normally disable them,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
106 # typically due to standards-conformance issues.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
107 AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
108 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
109 dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
110 dnl gnulib does not need it. But if it gets required by third-party macros
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
111 dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
112 dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
113 dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
114 dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
115 AC_REQUIRE([AC_GNU_SOURCE])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
116
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
117 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
118 ])