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: Thu, 22 Jun 2006 20:03:08 +0200
User-agent: Mutt/1.5.11+cvs20060403

[ let's move to autoconf-patches ]

> * Paul Eggert wrote on Thu, Jun 22, 2006 at 01:36:20AM CEST:
> > Ralf Wildenhues <address@hidden> writes:
> > 
> > > Next, for the transition
> > > time, it's extremely helpful if the package bootstraps unchanged with
> > > both 2.59 and 2.60.  So far, I think all datarootdir induced changes can
> > > be written in a backwards compatible way (so they work with 2.59).
> > 
> > This needs documentation, surely.  Perhaps even a separate page in the
> > manual.  The issue is confusing, and this stuff needs to be explained
> > clearly.

Suggested patch for both my AC_DATAROOTDIR_CHECKED change and a new
documentation node below.  After discussing away the other changes,
this is the only remaining one on my list.  :-)

Not to pressure anyone, but if we can get through with this quickly,
I can still do the release in the next days; otherwise, it will have
to wait another week or so (unless somebody else jumps in).

Notes:
- I reformatted the warning in the @example in the documentation, to
  avoid line length issues.
- I did not add a note about how to suppress a warning for just one
  file (e.g., by adding a comment containing the string `datarootdir').
  Rationale: this is a dirty hack, and one of the warnings does more
  than just warn: it also changes the other variables to contain the
  expanded value of ${datarootdir}.  So really we want users to be
  conscious about it, audit all their files, and then define
  AC_DATAROOTDIR_CHECKED to announce that they checked them all.
- I hope to have addressed all other concerns of the thread around
  http://lists.gnu.org/archive/html/bug-autoconf/2006-06/msg00118.html

OK to apply and start the `Release Procedure'?  :-)

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        22 Jun 2006 17:44:03 -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   22 Jun 2006 17:44:13 -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,88 @@
 @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, some heuristics have been put in place that
+warn about files which seem to lack a definition of @code{datarootdir},
+and try to use an initialization not based on the new variable.
+The following shows such an 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
+
+The changes can usually be accomplished in a way that the resulting file
+remains compatible with previous Autoconf versions:
+
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.  Note that for your own
+macros, you should use a different prefix (@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      22 Jun 2006 17:44:15 -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
+])
 
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
@@ -550,14 +552,15 @@
                        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])
 " $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.])
+which seems to be undefined.  Please make sure it is defined.])])
 
   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    22 Jun 2006 17:44:15 -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,13 @@
 which seems to be undefined.  Please make sure it is defined.
 ])
 AT_CHECK([grep datarootdir Foo], 1, [])
+
+sed '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]