changeset 2725:3257099741e7

(AC__GNU_SOURCE): New file/macro.
author Jim Meyering <jim@meyering.net>
date Sun, 09 Jul 2000 17:24:41 +0000
parents 60a660766f7d
children b480e675b1ae
files m4/gnu-source.m4
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/m4/gnu-source.m4
@@ -0,0 +1,25 @@
+#serial 1
+# 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.
+  AC_DEFINE(_GNU_SOURCE_KLUDGE, [1
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif], [This definition has a four-line value, the last three of which
+ensure that _GNU_SOURCE is defined in confdefs.h.])
+
+  # 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])
+])