OLD | NEW |
1 # serial 9 -*- Autoconf -*- | 1 # serial 12 -*- Autoconf -*- |
2 # Enable extensions on systems that normally disable them. | 2 # Enable extensions on systems that normally disable them. |
3 | 3 |
4 # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc. | 4 # Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc. |
5 # This file is free software; the Free Software Foundation | 5 # This file is free software; the Free Software Foundation |
6 # gives unlimited permission to copy and/or distribute it, | 6 # gives unlimited permission to copy and/or distribute it, |
7 # with or without modifications, as long as this notice is preserved. | 7 # with or without modifications, as long as this notice is preserved. |
8 | 8 |
9 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS | 9 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS |
10 # Autoconf. Perhaps we can remove this once we can assume Autoconf | 10 # Autoconf. Perhaps we can remove this once we can assume Autoconf |
11 # 2.62 or later everywhere, but since CVS Autoconf mutates rapidly | 11 # 2.62 or later everywhere, but since CVS Autoconf mutates rapidly |
12 # enough in this area it's likely we'll need to redefine | 12 # enough in this area it's likely we'll need to redefine |
13 # AC_USE_SYSTEM_EXTENSIONS for quite some time. | 13 # AC_USE_SYSTEM_EXTENSIONS for quite some time. |
14 | 14 |
(...skipping 21 matching lines...) Expand all Loading... |
36 # cause problems on some platforms (such as __EXTENSIONS__). | 36 # cause problems on some platforms (such as __EXTENSIONS__). |
37 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], | 37 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], |
38 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl | 38 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl |
39 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl | 39 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl |
40 | 40 |
41 AC_REQUIRE([AC_CANONICAL_HOST]) | 41 AC_REQUIRE([AC_CANONICAL_HOST]) |
42 | 42 |
43 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) | 43 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) |
44 if test "$MINIX" = yes; then | 44 if test "$MINIX" = yes; then |
45 AC_DEFINE([_POSIX_SOURCE], [1], | 45 AC_DEFINE([_POSIX_SOURCE], [1], |
46 [Define to 1 if you need to in order for `stat' and other | 46 [Define to 1 if you need to in order for 'stat' and other |
47 things to work.]) | 47 things to work.]) |
48 AC_DEFINE([_POSIX_1_SOURCE], [2], | 48 AC_DEFINE([_POSIX_1_SOURCE], [2], |
49 [Define to 2 if the system does not provide POSIX.1 features | 49 [Define to 2 if the system does not provide POSIX.1 features |
50 except with this defined.]) | 50 except with this defined.]) |
51 AC_DEFINE([_MINIX], [1], | 51 AC_DEFINE([_MINIX], [1], |
52 [Define to 1 if on MINIX.]) | 52 [Define to 1 if on MINIX.]) |
53 fi | 53 fi |
54 | 54 |
55 dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, | 55 dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, |
56 dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already | 56 dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already |
57 dnl provided. | 57 dnl provided. |
58 case "$host_os" in | 58 case "$host_os" in |
59 hpux*) | 59 hpux*) |
60 AC_DEFINE([_XOPEN_SOURCE], [500], | 60 AC_DEFINE([_XOPEN_SOURCE], [500], |
61 [Define to 500 only on HP-UX.]) | 61 [Define to 500 only on HP-UX.]) |
62 ;; | 62 ;; |
63 esac | 63 esac |
64 | 64 |
65 AH_VERBATIM([__EXTENSIONS__], | 65 AH_VERBATIM([__EXTENSIONS__], |
66 [/* Enable extensions on AIX 3, Interix. */ | 66 [/* Enable extensions on AIX 3, Interix. */ |
67 #ifndef _ALL_SOURCE | 67 #ifndef _ALL_SOURCE |
68 # undef _ALL_SOURCE | 68 # undef _ALL_SOURCE |
69 #endif | 69 #endif |
| 70 /* Enable general extensions on Mac OS X. */ |
| 71 #ifndef _DARWIN_C_SOURCE |
| 72 # undef _DARWIN_C_SOURCE |
| 73 #endif |
70 /* Enable GNU extensions on systems that have them. */ | 74 /* Enable GNU extensions on systems that have them. */ |
71 #ifndef _GNU_SOURCE | 75 #ifndef _GNU_SOURCE |
72 # undef _GNU_SOURCE | 76 # undef _GNU_SOURCE |
73 #endif | 77 #endif |
74 /* Enable threading extensions on Solaris. */ | 78 /* Enable threading extensions on Solaris. */ |
75 #ifndef _POSIX_PTHREAD_SEMANTICS | 79 #ifndef _POSIX_PTHREAD_SEMANTICS |
76 # undef _POSIX_PTHREAD_SEMANTICS | 80 # undef _POSIX_PTHREAD_SEMANTICS |
77 #endif | 81 #endif |
78 /* Enable extensions on HP NonStop. */ | 82 /* Enable extensions on HP NonStop. */ |
79 #ifndef _TANDEM_SOURCE | 83 #ifndef _TANDEM_SOURCE |
80 # undef _TANDEM_SOURCE | 84 # undef _TANDEM_SOURCE |
81 #endif | 85 #endif |
82 /* Enable general extensions on Solaris. */ | 86 /* Enable general extensions on Solaris. */ |
83 #ifndef __EXTENSIONS__ | 87 #ifndef __EXTENSIONS__ |
84 # undef __EXTENSIONS__ | 88 # undef __EXTENSIONS__ |
85 #endif | 89 #endif |
86 ]) | 90 ]) |
87 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], | 91 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], |
88 [ac_cv_safe_to_define___extensions__], | 92 [ac_cv_safe_to_define___extensions__], |
89 [AC_COMPILE_IFELSE( | 93 [AC_COMPILE_IFELSE( |
90 [AC_LANG_PROGRAM([[ | 94 [AC_LANG_PROGRAM([[ |
91 # define __EXTENSIONS__ 1 | 95 # define __EXTENSIONS__ 1 |
92 ]AC_INCLUDES_DEFAULT])], | 96 ]AC_INCLUDES_DEFAULT])], |
93 [ac_cv_safe_to_define___extensions__=yes], | 97 [ac_cv_safe_to_define___extensions__=yes], |
94 [ac_cv_safe_to_define___extensions__=no])]) | 98 [ac_cv_safe_to_define___extensions__=no])]) |
95 test $ac_cv_safe_to_define___extensions__ = yes && | 99 test $ac_cv_safe_to_define___extensions__ = yes && |
96 AC_DEFINE([__EXTENSIONS__]) | 100 AC_DEFINE([__EXTENSIONS__]) |
97 AC_DEFINE([_ALL_SOURCE]) | 101 AC_DEFINE([_ALL_SOURCE]) |
| 102 AC_DEFINE([_DARWIN_C_SOURCE]) |
98 AC_DEFINE([_GNU_SOURCE]) | 103 AC_DEFINE([_GNU_SOURCE]) |
99 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) | 104 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
100 AC_DEFINE([_TANDEM_SOURCE]) | 105 AC_DEFINE([_TANDEM_SOURCE]) |
101 ])# AC_USE_SYSTEM_EXTENSIONS | 106 ])# AC_USE_SYSTEM_EXTENSIONS |
102 | 107 |
103 # gl_USE_SYSTEM_EXTENSIONS | 108 # gl_USE_SYSTEM_EXTENSIONS |
104 # ------------------------ | 109 # ------------------------ |
105 # Enable extensions on systems that normally disable them, | 110 # Enable extensions on systems that normally disable them, |
106 # typically due to standards-conformance issues. | 111 # typically due to standards-conformance issues. |
107 AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], | 112 AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], |
108 [ | 113 [ |
109 dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. | 114 dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. |
110 dnl gnulib does not need it. But if it gets required by third-party macros | 115 dnl gnulib does not need it. But if it gets required by third-party macros |
111 dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a | 116 dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a |
112 dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". | 117 dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". |
113 dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, | 118 dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, |
114 dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. | 119 dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. |
115 AC_REQUIRE([AC_GNU_SOURCE]) | 120 AC_REQUIRE([AC_GNU_SOURCE]) |
116 | 121 |
117 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) | 122 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
118 ]) | 123 ]) |
OLD | NEW |