summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-06-22 08:32:40 +0000
committerJim Meyering <jim@meyering.net>2002-06-22 08:32:40 +0000
commitf35ad592ca2627e5a5a0ff5f24520a9bdb8287f3 (patch)
treeef643fd382aafad228d3d31813a53e97f518e385 /m4
parent8b213cb96f283024f944c0c6d80035e44ed06c03 (diff)
downloadcoreutils-f35ad592ca2627e5a5a0ff5f24520a9bdb8287f3.tar.xz
from diffutils-2.8.2.
Diffstat (limited to 'm4')
-rw-r--r--m4/gnu-source.m433
1 files changed, 10 insertions, 23 deletions
diff --git a/m4/gnu-source.m4 b/m4/gnu-source.m4
index d2f490b0d..edecf5ddb 100644
--- a/m4/gnu-source.m4
+++ b/m4/gnu-source.m4
@@ -1,25 +1,12 @@
-#serial 3
-# Make sure _GNU_SOURCE is defined where necessary: as early as possible
-# for configure-time tests, as well as for every source file that includes
-# config.h.
-
-# From Jim Meyering.
-
-AC_DEFUN([AC__GNU_SOURCE],
-[
- # Make sure that _GNU_SOURCE is defined for all subsequent
- # configure-time compile tests.
- # This definition must be emitted (into confdefs.h) before any
- # test that involves compilation.
- cat >>confdefs.h <<\EOF
+# AC_GNU_SOURCE
+# --------------
+AC_DEFUN([AC_GNU_SOURCE],
+[AH_VERBATIM([_GNU_SOURCE],
+[/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-EOF
-
- # Emit this code into config.h.in.
- # The ifndef is to avoid redefinition warnings.
- AH_VERBATIM([_GNU_SOURCE], [#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif])
+# undef _GNU_SOURCE
+#endif])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+AC_DEFINE([_GNU_SOURCE])
])