bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_GNU_SOURCE is nearly unusable


From: Bruno Haible
Subject: AC_GNU_SOURCE is nearly unusable
Date: Thu, 9 Jan 2003 21:51:00 +0100 (CET)

Hi,

Some autoconf macros of mine contain AC_GNU_SOURCE, for example because
the strnlen() declaration on glibc needs _GNU_SOURCE in order to become
visible. But other macros contain AC_HEADER_STDC or AC_CHECK_DECLS(getenv)
or similar calls. And autoconf gives me an error because the order is not
as it expects.

============================= configure.in ====================================
AC_INIT
AC_PROG_CC

dnl Each of these three invocations makes a later AC_GNU_SOURCE call complain.
AC_CHECK_HEADERS(string.h)
AC_HEADER_STDC
AC_CHECK_DECLS(getenv)

dnl This call actually comes from an AC_REQUIRE([AC_GNU_SOURCE]) inside
dnl a more complicated autoconf macro gl_FUNC_STRNLEN.
AC_GNU_SOURCE

AC_OUTPUT
===============================================================================

$ autoconf-2.57
configure.in:11: warning: AC_COMPILE_IFELSE was called before AC_GNU_SOURCE
configure.in:11: warning: AC_RUN_IFELSE was called before AC_GNU_SOURCE

I cannot simply change the order in which the AC_REQUIREd macros of my
complicated macros appear.

Therefore I suggest that AC_GNU_SOURCE itself puts its expansion into the
INIT_PREPARE diversion (or shortly afterwards, but before the BODY diversion),
where it will take effect early enough. Then you can remove the AC_BEFORE
relation between AC_GNU_SOURCE and each of AC_CHECK_HEADERS, AC_HEADER_STDC,
AC_CHECK_DECLS.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]