3 --- aclocal.m4.orig 2008-09-06 22:03:58.000000000 -0400
5 @@ -940,3 +940,66 @@ m4_include([m4/gnupg-pth.m4])
6 m4_include([m4/onceonly.m4])
7 m4_include([m4/socklen.m4])
8 m4_include([m4/sys_socket_h.m4])
10 +# AC_USE_SYSTEM_EXTENSIONS
11 +# ------------------------
12 +# Enable extensions on systems that normally disable them,
13 +# typically due to standards-conformance issues.
15 +# Remember that #undef in AH_VERBATIM gets replaced with #define by
16 +# AC_DEFINE. The goal here is to define all known feature-enabling
17 +# macros, then, if reports of conflicts are made, disable macros that
18 +# cause problems on some platforms (such as __EXTENSIONS__).
19 +AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
20 +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
21 +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
23 + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
24 + if test "$MINIX" = yes; then
25 + AC_DEFINE([_POSIX_SOURCE], [1],
26 + [Define to 1 if you need to in order for `stat' and other
28 + AC_DEFINE([_POSIX_1_SOURCE], [2],
29 + [Define to 2 if the system does not provide POSIX.1 features
30 + except with this defined.])
31 + AC_DEFINE([_MINIX], [1],
32 + [Define to 1 if on MINIX.])
35 + AH_VERBATIM([__EXTENSIONS__],
36 +[/* Enable extensions on AIX 3, Interix. */
40 +/* Enable GNU extensions on systems that have them. */
44 +/* Enable threading extensions on Solaris. */
45 +#ifndef _POSIX_PTHREAD_SEMANTICS
46 +# undef _POSIX_PTHREAD_SEMANTICS
48 +/* Enable extensions on HP NonStop. */
49 +#ifndef _TANDEM_SOURCE
50 +# undef _TANDEM_SOURCE
52 +/* Enable general extensions on Solaris. */
53 +#ifndef __EXTENSIONS__
54 +# undef __EXTENSIONS__
57 + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
58 + [ac_cv_safe_to_define___extensions__],
61 +# define __EXTENSIONS__ 1
62 + AC_INCLUDES_DEFAULT])],
63 + [ac_cv_safe_to_define___extensions__=yes],
64 + [ac_cv_safe_to_define___extensions__=no])])
65 + test $ac_cv_safe_to_define___extensions__ = yes &&
66 + AC_DEFINE([__EXTENSIONS__])
67 + AC_DEFINE([_ALL_SOURCE])
68 + AC_DEFINE([_GNU_SOURCE])
69 + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
70 + AC_DEFINE([_TANDEM_SOURCE])
71 +])# AC_USE_SYSTEM_EXTENSIONS