Remove obsolete test-suite makefile snippets.
[bpt/guile.git] / m4 / extensions.m4
CommitLineData
f240aacb 1# serial 8 -*- Autoconf -*-
103dc4d4
LC
2# Enable extensions on systems that normally disable them.
3
f240aacb 4# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc.
103dc4d4
LC
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
10# Autoconf. Perhaps we can remove this once we can assume Autoconf
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
13# AC_USE_SYSTEM_EXTENSIONS for quite some time.
14
15# AC_USE_SYSTEM_EXTENSIONS
16# ------------------------
17# Enable extensions on systems that normally disable them,
18# typically due to standards-conformance issues.
19# Remember that #undef in AH_VERBATIM gets replaced with #define by
20# AC_DEFINE. The goal here is to define all known feature-enabling
21# macros, then, if reports of conflicts are made, disable macros that
22# cause problems on some platforms (such as __EXTENSIONS__).
f240aacb 23AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
103dc4d4
LC
24[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
25AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
26
4a462e35
NJ
27 AC_REQUIRE([AC_CANONICAL_HOST])
28
103dc4d4
LC
29 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
30 if test "$MINIX" = yes; then
31 AC_DEFINE([_POSIX_SOURCE], [1],
32 [Define to 1 if you need to in order for `stat' and other
33 things to work.])
34 AC_DEFINE([_POSIX_1_SOURCE], [2],
35 [Define to 2 if the system does not provide POSIX.1 features
36 except with this defined.])
37 AC_DEFINE([_MINIX], [1],
38 [Define to 1 if on MINIX.])
39 fi
40
4a462e35
NJ
41 dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
42 dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
43 dnl provided.
44 case "$host_os" in
45 hpux*)
46 AC_DEFINE([_XOPEN_SOURCE], [500],
47 [Define to 500 only on HP-UX.])
48 ;;
49 esac
50
103dc4d4
LC
51 AH_VERBATIM([__EXTENSIONS__],
52[/* Enable extensions on AIX 3, Interix. */
53#ifndef _ALL_SOURCE
54# undef _ALL_SOURCE
55#endif
56/* Enable GNU extensions on systems that have them. */
57#ifndef _GNU_SOURCE
58# undef _GNU_SOURCE
59#endif
60/* Enable threading extensions on Solaris. */
61#ifndef _POSIX_PTHREAD_SEMANTICS
62# undef _POSIX_PTHREAD_SEMANTICS
63#endif
64/* Enable extensions on HP NonStop. */
65#ifndef _TANDEM_SOURCE
66# undef _TANDEM_SOURCE
67#endif
68/* Enable general extensions on Solaris. */
69#ifndef __EXTENSIONS__
70# undef __EXTENSIONS__
71#endif
72])
73 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
74 [ac_cv_safe_to_define___extensions__],
75 [AC_COMPILE_IFELSE(
76 [AC_LANG_PROGRAM([[
77# define __EXTENSIONS__ 1
78 ]AC_INCLUDES_DEFAULT])],
79 [ac_cv_safe_to_define___extensions__=yes],
80 [ac_cv_safe_to_define___extensions__=no])])
81 test $ac_cv_safe_to_define___extensions__ = yes &&
82 AC_DEFINE([__EXTENSIONS__])
83 AC_DEFINE([_ALL_SOURCE])
84 AC_DEFINE([_GNU_SOURCE])
85 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
86 AC_DEFINE([_TANDEM_SOURCE])
87])# AC_USE_SYSTEM_EXTENSIONS
88
89# gl_USE_SYSTEM_EXTENSIONS
90# ------------------------
91# Enable extensions on systems that normally disable them,
92# typically due to standards-conformance issues.
f240aacb
LC
93AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
94[
95 dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
96 dnl gnulib does not need it. But if it gets required by third-party macros
97 dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
98 dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
99 dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
100 dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
101 AC_REQUIRE([AC_GNU_SOURCE])
102
103 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
104])