[Top][All Lists]
[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: |
Fri, 7 Nov 2003 14:56:40 +0100 |
User-agent: |
KMail/1.5 |
[Resent from 2003-01-09. Still applies to autoconf-2.58.]
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
- AC_GNU_SOURCE is nearly unusable,
Bruno Haible <=