autoconf-patches
[Top][All Lists]
Advanced

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

Re: Spurious datarootdir warnings in Wine configure


From: Ralf Wildenhues
Subject: Re: Spurious datarootdir warnings in Wine configure
Date: Fri, 23 Jun 2006 16:56:30 +0200
User-agent: Mutt/1.5.11+cvs20060403

* Paul Eggert wrote on Fri, Jun 23, 2006 at 01:54:02AM CEST:
> Ralf Wildenhues <address@hidden> writes:
> 
> >  To help with the transition, Autoconf warns about makefiles that seem
> >  to use @code{datarootdir} without defining it.  In some cases, it then
> >  expands the value of @code{$datarootdir} in substitutions of the
> >  directory variables.
> 
> Yes, much better, thanks.  My earlier paraphrase was much shorter only
> because I didn't understand the situation.

OK.  I've finally applied the patch like this.

One more issue is noteworthy:  on my system, the test sometimes
completed the first autoconf execution and the following configure.ac
modification within the same second, so it has the same time stamp as
configure, so the latter is not updated even with `autoconf --force',
causing a spurious test failure.  Removing either autom4te.cache or the
older configure prevents that.

Cheers,
Ralf

        * lib/autoconf/status.m4 (_AC_OUTPUT_FILE): Expand tests for
        datarootdir-related errors only if AC_DATAROOTDIR_CHECKED is
        not defined.
        * doc/autoconf.texi (Changed Directory Variables): New node,
        to document the whole `datarootdir' business a bit better.
        * NEWS: Update.
        * tests/torture.at (datarootdir workaround): Extend test.
        Prompted by report by Alexandre Julliard.

Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.383
diff -u -r1.383 NEWS
--- NEWS        20 Jun 2006 19:49:14 -0000      1.383
+++ NEWS        23 Jun 2006 15:50:36 -0000
@@ -4,6 +4,8 @@
   or LIFO (as in GNU M4 1.4.x).  GNU M4 2.0 is expected to conform to Posix
   here, so m4wrap/m4_wrap users should no longer depend on LIFO behavior.
 
+** Provide a way to turn off warnings about the changed directory variables.
+
 * Major changes in Autoconf 2.59d
 
   Released 2006-06-05, by Ralf Wildenhues.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1053
diff -u -r1.1053 autoconf.texi
--- doc/autoconf.texi   20 Jun 2006 19:49:14 -0000      1.1053
+++ doc/autoconf.texi   23 Jun 2006 15:50:37 -0000
@@ -318,6 +318,7 @@
 
 * Preset Output Variables::     Output variables that are always set
 * Installation Directory Variables::  Other preset output variables
+* Changed Directory Variables:: Warnings about @file{datarootdir}
 * Build Directories::           Supporting multiple concurrent compiles
 * Automatic Remaking::          Makefile rules for configuring
 
@@ -2197,6 +2198,7 @@
 @menu
 * Preset Output Variables::     Output variables that are always set
 * Installation Directory Variables::  Other preset output variables
+* Changed Directory Variables:: Warnings about @file{datarootdir}
 * Build Directories::           Supporting multiple concurrent compiles
 * Automatic Remaking::          Makefile rules for configuring
 @end menu
@@ -2667,6 +2669,87 @@
 @xref{Erlang Libraries}, for details.
 
 
address@hidden Changed Directory Variables
address@hidden Changed Directory Variables
address@hidden @file{datarootdir}
+
+In Autoconf 2.60, the set of directory variables has changed, and the
+defaults of some variables have been adjusted
+(@pxref{Installation Directory Variables}) to changes in the
address@hidden Coding Standards.  Notably, @file{datadir}, @file{infodir}, and
address@hidden are now expressed in terms of @file{datarootdir}.  If you are
+upgrading from an earlier Autoconf version, you may need to adjust your files
+to ensure that the directory variables are substituted correctly
+(@pxref{Defining Directories}), and that a definition of @file{datarootdir} is
+in place.  For example, in a @file{Makefile.in}, adding
+
address@hidden
+datarootdir = @@datarootdir@@
address@hidden example
+
address@hidden
+is usually sufficient.  If you use Automake to create @file{Makefile.in},
+it will add this for you.
+
+To help with the transition, Autoconf warns about files that seem to use
address@hidden without defining it.  In some cases, it then expands
+the value of @code{$datarootdir} in substitutions of the directory
+variables.  The following example shows such a warning:
+
address@hidden
+$ @kbd{cat configure.ac}
+AC_INIT
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+$ @kbd{cat Makefile.in}
+prefix = @@prefix@@
+datadir = @@datadir@@
+$ @kbd{autoconf}
+$ @kbd{configure}
+configure: creating ./config.status
+config.status: creating Makefile
+config.status: WARNING:
+               Makefile.in seems to ignore the --datarootdir setting
+$ @kbd{cat Makefile}
+prefix = /usr/local
+datadir = address@hidden@}/share
address@hidden example
+
+Usually one can easily change the file to accommodate both older and newer
+Autoconf releases:
+
address@hidden
+$ @kbd{cat Makefile.in}
+prefix = @@prefix@@
+datarootdir = @@datarootdir@@
+datadir = @@datadir@@
+$ @kbd{configure}
+configure: creating ./config.status
+config.status: creating Makefile
+$ @kbd{cat Makefile}
+prefix = /usr/local
+datarootdir = address@hidden@}/share
+datadir = address@hidden@}
address@hidden example
+
address@hidden
+In some cases, however, the checks may not be able to detect that a suitable
+initialization of @code{datarootdir} is in place, or they may fail to detect
+that such an initialization is necessary in the output file.  If, after
+auditing your package, there are still spurious @file{configure} warnings about
address@hidden, you may add the line
+
address@hidden
+AC_DEFUN([AC_DATAROOTDIR_CHECKED])
address@hidden example
+
address@hidden
+to your @file{configure.ac} to disable the warnings.  This is an exception
+to the usual rule that you should not define a macro whose name begins with
address@hidden (@pxref{Macro Names}).
+
+
+
 @node Build Directories
 @subsection Build Directories
 @cindex Build directories
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.115
diff -u -r1.115 status.m4
--- lib/autoconf/status.m4      22 Jun 2006 17:16:42 -0000      1.115
+++ lib/autoconf/status.m4      23 Jun 2006 15:50:37 -0000
@@ -505,7 +505,8 @@
 ])dnl
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+m4_ifndef([AC_DATAROOTDIR_CHECKED],
+[cat >>$CONFIG_STATUS <<\_ACEOF
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
@@ -530,6 +531,7 @@
   s&\\\${datarootdir}&$datarootdir&g' ;;
 esac
 _ACEOF
+])dnl
 
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
@@ -550,14 +552,17 @@
                        abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], 
[[, INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [[, MKDIR_P]]),
           [s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var)
 ])dnl
-$ac_datarootdir_hack
+m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
+])dnl
 " $ac_file_inputs m4_defn([_AC_SED_CMDS])>$tmp/out
 
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+m4_ifndef([AC_DATAROOTDIR_CHECKED],
+[test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[[        ]]*datarootdir[[        ]]*:*=/p' "$tmp/out"`; 
test -z "$ac_out"; } &&
   AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
 which seems to be undefined.  Please make sure it is defined.])
+])dnl
 
   rm -f "$tmp/stdin"
   case $ac_file in
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.64
diff -u -r1.64 torture.at
--- tests/torture.at    28 May 2006 12:38:49 -0000      1.64
+++ tests/torture.at    23 Jun 2006 15:50:37 -0000
@@ -673,6 +673,8 @@
 
 AT_DATA([configure.ac],
 [[AC_INIT
+d@&address@hidden The following line silences the warnings, if uncommented:
+d@&address@hidden AC_DEFUN([AC_DATAROOTDIR_CHECKED])
 AC_CONFIG_AUX_DIR($top_srcdir/config)
 
 # This substitution is wrong and bogus!  Don't use it in your own code!
@@ -690,6 +692,14 @@
 which seems to be undefined.  Please make sure it is defined.
 ])
 AT_CHECK([grep datarootdir Foo], 1, [])
+
+rm configure
+sed '/AC_DEFUN/s/^d@&address@hidden //' configure.ac >t
+mv t configure.ac
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
 AT_CLEANUP
 
 




reply via email to

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