bug-autoconf
[Top][All Lists]
Advanced

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

unjustified warning from AC_BEFORE


From: Bruno Haible
Subject: unjustified warning from AC_BEFORE
Date: Mon, 31 Jul 2006 16:52:02 +0200
User-agent: KMail/1.9.1

This configure.ac file, when processed with autoconf-2.60, gives a
warning that has no justification.

============================== configure.ac ==============================
AC_INIT
AC_CONFIG_SRCDIR(configure.ac)

AC_PROG_CC
AC_PROG_INSTALL

AC_DEFUN([gl_RELOCATABLE],
[
  AC_REQUIRE([AC_PROG_INSTALL])
  AC_BEFORE([AC_PROG_INSTALL],[gl_RELOCATABLE])
  INSTALL_PROGRAM=my_install
])

gl_RELOCATABLE

gl_RELOCATABLE

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

$ autoconf --version | head -1
autoconf (GNU Autoconf) 2.60
$ autoconf
configure.ac:16: warning: gl_RELOCATABLE was called before AC_PROG_INSTALL
configure.ac:12: gl_RELOCATABLE is expanded from...
configure.ac:16: the top level

According to the autoconf documentation, section "Suggested Ordering",
AC_BEFORE([AC_PROG_INSTALL],[gl_RELOCATABLE])
should have the effect to "warn the user if a call to gl_RELOCATABLE
has already occurred when AC_PROG_INSTALL is called". But AC_PROG_INSTALL
is only called once, in line 5; the following two references (via
AC_REQUIRE) to this macro ought to be no-ops, since AC_PROG_INSTALL
has already been expanded in line 5.

You might wonder what I'm trying to achieve. Isn't the
AC_REQUIRE([AC_PROG_INSTALL]) enough to ensure that AC_PROG_INSTALL
comes before gl_RELOCATABLE, not after it? No. What I want to get warned
about is this situation:

   AC_PROG_INSTALL
   gl_RELOCATABLE
   AC_PROG_INSTALL

becauce AC_PROG_INSTALL might overwrite the INSTALL_PROGRAM variable that
gl_RELOCATABLE has taken care to set. (Currently AC_PROG_INSTALL doesn't
do so, due to the way this macro is written, but this is an undocumented
detail that I don't want to rely upon. It actually is documented to
erase previous settings of INSTALL and INSTALL_PROGRAM, but fortunately
it doesn't do so.)

Bruno




reply via email to

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