[PATCH] libX11: Use AC_USE_SYSTEM_EXTENSIONS instead of hand-rolled check for _GNU_SOURCE

Alan Coopersmith alan.coopersmith at sun.com
Fri Apr 17 22:16:31 PDT 2009


Raises minimum autoconf version required to 2.60

Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
---
 configure.ac |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8821cfd..215199c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.57)
+AC_PREREQ(2.60)
 AC_INIT([libX11],
         1.2.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
@@ -18,6 +18,11 @@ AC_CONFIG_HEADER([include/X11/XlibConf.h])
 m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
 XORG_MACROS_VERSION(1.2)
 
+# Set common system defines for POSIX extensions, such as _GNU_SOURCE
+# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
+# to avoid autoconf errors.
+AC_USE_SYSTEM_EXTENSIONS
+
 # Checks for programs.
 AC_PROG_LIBTOOL
 DOLT
@@ -373,14 +378,6 @@ if test "x$GCC" = "xyes"; then
 	X11_CFLAGS="$GCC_WARNINGS $X11_CFLAGS"
 fi
 
-AC_TRY_COMPILE([
-#include <features.h>
-#ifndef __GLIBC__
-#error not glibc
-#endif
-], [], [AC_DEFINE(_GNU_SOURCE, 1,
-    [ Enable GNU and other extensions to the C environment for glibc])])
-
 X11_DATADIR="${datadir}/X11"
 AC_DEFINE_DIR(X11_DATADIR, X11_DATADIR, [Location of libX11 data])
 AC_SUBST(X11_DATADIR)
-- 
1.5.6.5



More information about the xorg-devel mailing list