Re: Broken makefile given Autoconf version mismatch

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

 



* Stepan Kasal wrote on Wed, Apr 12, 2006 at 02:17:53PM CEST:
> The proposal
> 
>    http://lists.gnu.org/archive/html/bug-autoconf/2005-03/msg00027.html
> 
> goes in this direction, but needs more work, as Bruno said.
> I might do that work when we come to an agreement what we want.

I know you won't like this ;-) but just to help the discussion,
here's a patch that I think does more or less what Bruno's patch
intends to do, against current CVS.  I'm unsure why he chose the 
replacements that he chose, so I left them that way.  And I would
certainly not mind a cleaner solution.
(The backslash quoting mess in the case patterns is because old
shells will mind different quoting.)

Note that it fails to do the complete work for the Autoconf package
itself, if that has been bootstrapped with CVS Automake: that uses
`${datarootdir}' for the value of `lispdir', too.  So wouldn't that
mean AM_PATH_LISPDIR needs increased Autoconf requirement, as in the
other patch below?

Cheers,
Ralf

Automake:
	* m4/lispdir.m4 (AM_PATH_LISPDIR): Require Autoconf 2.59c.

Index: m4/lispdir.m4
===================================================================
RCS file: /cvs/automake/automake/m4/lispdir.m4,v
retrieving revision 1.27
diff -u -r1.27 lispdir.m4
--- m4/lispdir.m4	27 Feb 2005 00:24:31 -0000	1.27
+++ m4/lispdir.m4	12 Apr 2006 18:39:31 -0000
@@ -15,7 +15,8 @@
 # AM_PATH_LISPDIR
 # ---------------
 AC_DEFUN([AM_PATH_LISPDIR],
-[ # If set to t, that means we are running in a shell under Emacs.
+[AC_PREREQ([2.59c])dnl
+ # If set to t, that means we are running in a shell under Emacs.
  # If you have an Emacs named "t", then use the full path.
  test x"$EMACS" = xt && EMACS=
  AC_CHECK_PROGS([EMACS], [emacs xemacs], [no])



Autoconf:
	* lib/autoconf/status.m4 (_AC_OUTPUT_CHECK_DATAROOTDIR):
	New macro, to be used..
	(_AC_OUTPUT_FILE): ..here, to output a warning and override
	those directory variables that contain `${datarootdir}' as per
	GCS change, when the instantiated file does not contain the
	plain string `datarootdir', indicating that it needs to be
	updated.
	<datadir, docdir, infodir, localedir, mandir>: Substitute these
	here.
	* NEWS: Update.
	Based on a patch by Bruno Haible.

Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.359
diff -u -r1.359 NEWS
--- NEWS	10 Apr 2006 17:57:17 -0000	1.359
+++ NEWS	12 Apr 2006 18:03:29 -0000
@@ -25,7 +25,10 @@
 
   This means that if you use any of `@datadir@', `@infodir@', or
   `@mandir@' in a file, you will have to ensure `${datarootdir}' is
-  defined in this file.
+  defined in this file.  As a temporary measure, if any of those are
+  found but no mention of `datarootdir', the substitutions will be
+  replaced with with values that do not contain `${datarootdir}',
+  and a warning will be issued.
 
 ** @top_builddir@ is now a dir name: it is always nonempty and doesn't have
   a trailing slash.  Similar change will be made to ac_top_builddir in a
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.94
diff -u -r1.94 status.m4
--- lib/autoconf/status.m4	6 Apr 2006 17:38:06 -0000	1.94
+++ lib/autoconf/status.m4	12 Apr 2006 18:22:07 -0000
@@ -475,6 +475,52 @@
 ])# _AC_OUTPUT_FILES_PREPARE
 
 
+# _AC_OUTPUT_CHECK_DATAROOTDIR
+# ----------------------------
+# 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).
+#
+# Remove this sometime after 2.61.
+m4_defun([_AC_OUTPUT_CHECK_DATAROOTDIR],
+[cat >>$CONFIG_STATUS <<_ACEOF
+if grep datarootdir \$ac_file_inputs >/dev/null; then
+  ac_datadir='$datadir'
+  ac_docdir='$docdir'
+  ac_infodir='$infodir'
+  ac_localedir='$localedir'
+  ac_mandir='$mandir'
+else
+  if test -n "\`sed -n '/@datadir@/p;/@datadir@/p;/@docdir@/p;/@infodir@/p
+		 /@localedir@/p;/@mandir@/p' \$ac_file_inputs\`"; then
+    AS_WARN([\$ac_file ignores the --datarootdir setting])
+  fi
+  case '$datadir' in
+  \\\$\\{datarootdir\\}*) ac_datadir='\${prefix}/share' ;;
+  *) ac_datadir='$datadir' ;;
+  esac
+  case '$docdir' in
+  \\\$\\{datarootdir\\}*)
+     ac_docdir=\`echo '$docdir' | sed 's,{datarootdir},{datadir},'\` ;;
+  *) ac_docdir='$docdir' ;;
+  esac
+  case '$infodir' in
+  \\\$\\{datarootdir\\}*) ac_infodir='\${datadir}/info' ;;
+  *) ac_infodir='$infodir' ;;
+  esac
+  case '$localedir' in
+  \\\$\\{datarootdir\\}*) ac_localedir='\${datadir}/locale' ;;
+  *) ac_localedir='$localedir' ;;
+  esac
+  case '$mandir' in
+  \\\$\\{datarootdir\\}*) ac_mandir='\${datadir}/man' ;;
+  *) ac_mandir='$mandir' ;;
+  esac
+fi
+_ACEOF
+])
+
 # _AC_OUTPUT_FILE
 # ---------------
 # Do the variable substitutions to create the Makefiles or whatever.
@@ -496,6 +542,8 @@
 ])
 _ACEOF
 
+_AC_OUTPUT_CHECK_DATAROOTDIR
+
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
 # FIXME: do we really want to maintain this feature?
@@ -512,7 +560,9 @@
 s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
 m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, abs_top_srcdir,
 			builddir, abs_builddir,
-			abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]]),
+			abs_top_builddir]AC_PROVIDE_IFELSE([_AC_OUTPUT_CHECK_DATAROOTDIR],
+			[[, datadir, docdir, infodir, localedir,
+			mandir]])AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]]),
 	   [s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var)
 ])dnl
 " $ac_file_inputs m4_defn([_AC_SED_CMDS])>$tmp/out


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux