diff --git a/configure.ac b/configure.ac index b4593f40..5ecd6267 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 @@ -364,14 +369,6 @@ if test "x$GCC" = "xyes"; then X11_CFLAGS="$GCC_WARNINGS $X11_CFLAGS" fi -AC_TRY_COMPILE([ -#include -#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)