Alexandre Duret-Lutz wrote: > >> but CVS Autoconf defines @datadir@ as ${datarootdir} which is not > >> defined by po/Makefile.in.in. > > Bruno> This is obviously a bug in autoconf: It breaks a working > Bruno> Makefile.in. > > Actually, it's a change of the GNU Coding Standard.
Yes, but the GNU standards don't mandate that programs that adhere to older GNU standards must break. > Bruno> There are lots of hand-built Makefile.in. > > Those people will have to update their Makefile.in when > upgrading Autoconf. I agree it's unfortunate, but I can't think > of any other solution. But you can do better by 1. reverting to the old behaviour of autoconf <= 2.59 when you see that you are substituting a value into a Makefile.in that doesn't know about datarootdir, 2. emitting a warning in this case, to remind the maintainer to update his Makefile.in. config.status can do this. It already has special magic for @[EMAIL PROTECTED] It can also add a little bit of magic for @datadir@ and similar. Here is a rough, completely untested patch, so you see what I propose. Bruno diff -c -3 -r1.49 status.m4 *** lib/autoconf/status.m4 2 Feb 2005 23:31:17 -0000 1.49 --- lib/autoconf/status.m4 15 Mar 2005 16:10:16 -0000 *************** *** 951,956 **** --- 951,1001 ---- AS_MKDIR_P(["$ac_dir"]) _AC_SRCDIRS(["$ac_dir"]) + # Compute @datadir@, @docdir@, @infodir@, @localedir@, @mandir@ substitution + # value depending on whether the file has a definition for ${datarootdir} + # (i.e. obeys the GNU standards as of autoconf-2.60) or not (i.e. obeys the + # GNU standards as of autoconf <= 2.59). + if grep datarootdir "$ac_file_in" > /dev/null; then + ac_datadir=$datadir + ac_docdir=$docdir + ac_infodir=$infodir + ac_localedir=$localedir + ac_mandir=$mandir + else + if grep @datadir@ "$ac_file_in" > /dev/null || + grep @docdir@ "$ac_file_in" > /dev/null || + grep @infodir@ "$ac_file_in" > /dev/null || + grep @localedir@ "$ac_file_in" > /dev/null || + grep @mandir@ "$ac_file_in" > /dev/null; then + echo "$as_me: warning: $ac_file ignores the --datarootdir setting" + fi + if expr "$datadir" : '${datarootdir}' > /dev/null; then + ac_datadir='${prefix}/share' + else + ac_datadir=$datadir + fi + if expr "$docdir" : '${datarootdir}' > /dev/null; then + ac_docdir=`echo "$docdir" | sed -e 's,{datarootdir},{datadir},'` + else + ac_docdir=$docdir + fi + if expr "$infodir" : '${datarootdir}' > /dev/null; then + ac_infodir='${datadir}/info' + else + ac_infodir=$infodir + fi + if expr "$localedir" : '${datarootdir}' > /dev/null; then + ac_localedir='${datadir}/locale' + else + ac_localedir=$localedir + fi + if expr "$mandir" : '${datarootdir}' > /dev/null; then + ac_mandir='${datadir}/man' + else + ac_mandir=$mandir + fi + fi + AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [ case $INSTALL in [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;; *************** *** 1016,1021 **** --- 1061,1071 ---- s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t + s,@datadir@,$ac_datadir,;t t + s,@docdir@,$ac_docdir,;t t + s,@infodir@,$ac_infodir,;t t + s,@localedir@,$ac_localedir,;t t + s,@mandir@,$ac_mandir,;t t AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$ac_INSTALL,;t t ])dnl dnl The parens around the eval prevent an "illegal io" in Ultrix sh.