[tex-k] Autoconf-2.13 vs. 2.59

Peter Breitenlohner peb at mppmu.mpg.de
Tue Jan 25 17:11:03 CET 2005


Hi,

once teTeX-3.0 (and web2c-7.5.4 and TeX-Live-xx) are released, I think we
should try to switch to autoconf-2.59 (or whichever is the then current
version).

Some of you know that I have already done some experiments in that
direction. Based on this experience I think we should proceed as follows:

Step 1: add/modify some m4 macros in config/acsite.m4 and/or
etc/autoconf/acgeneral.m4 such that the current autoconf-2.13 accepts the
syntax expected by autoconf-2.54.

Step 2: adapt all configure.in's to the autoconf-2.54 syntax, e.g., replace
 	AC_OUTPUT(Makefile)
by
 	AC_CONFIG_FILES(Makefile)
 	AC_OUTPUT
replace
 	if ...
 	  subconfigures="$subconfigures FOO"
 	fi
 	...
 	AC_CONFIG_SUBDIRS($subconfigures)
by
 	if ...
 	  AC_CONFIG_SUBDIRS(FOO)
 	fi
 	...
and similar. Whenever a subconfigure needs the ac_include functionality add
 	KPSE_AC_INCLUDE
to configure.in (where KPSE_AC_INCLUDE is a noop for autoconf-2.13)

Step 3: get a hook into autoconf-2.59 that allows to insert the ac_include
functionality. The presence of KPSE_AC_INCLUDE activates that hook and
inserts the sed script for ac_include into the chain of commands used to
generate Makefile from Makefile.in (or similar).

Step 4: Switch to autoconf-2.5x

===================================

I have tested steps 1-4 (for web2c, but not yet for teTeX and TeX-Live) with
a locally patched version of autoconf's status.m4. Everything went rather
smooth, although I have not (yet) gotten rid of all autoconf warnings.

===================================

For step 3 above I'd like to request an enhancement (on the autoconf
discussion list) but before doing so I'd like to learn your reactions:

I intend to write something like this:

-------------- begin of text --------------

Request for an autoconf enhancement.

The TeX software (TeX-Live/teTeX/web2c) maintained by Sebastian Rahtz/Thomas
Esser/Olaf Weber is still stuck with (a patched version of) autoconf-2.13,
because that fairly large package requires the functionality to include
Makefile fragments at configure time. These fragments need not exist and the
inclusion has to be done at configure time because various sub-packages are
maintained by different people (thus a similar functionality provided by
automake is not an option).

In order to switch to autoconf-2.5x we would need the following enhancment:

A hook into status.m4 which allows to insert additional sed commands into the
chain of commands producing e.g., Makefile from Makefile.in.

Here is a patch for status.m4 (as in the autoconf-2.59 distribution) doing
what we would need.

-------------- begin of patch --------------

--- status.m4.orig	2004-01-17 16:20:36.000000000 +0100
+++ status.m4	2004-08-30 15:14:27.000000000 +0200
@@ -852,6 +852,18 @@
  m4_define([AC_LIST_FILES_COMMANDS])


+# AC_CONFIG_FILES_HOOK(COMMANDS)
+# ------------------------------
+# Specify additional commands to be executed for each output file
+# after ac_file_inputs has been set to the list of the input files
+# (in the build or source tree), but before applying any sed scripts.
+#
+# The purpose is to replace the variable ac_file_subs (='cat') by
+# a sed command to be applied before all others to the input files.
+AC_DEFUN([AC_CONFIG_FILES_HOOK],
+[m4_define([_AC_CONFIG_FILES_HOOK],[$1])
+])
+

  # _AC_OUTPUT_FILES
  # ----------------
@@ -997,10 +1009,14 @@
  	 fi;;
        esac
      done` || AS_EXIT([1])
+  ac_file_subs='cat'
+  m4_ifdef([_AC_CONFIG_FILES_HOOK],
+	   [_AC_CONFIG_FILES_HOOK])
+  (eval $ac_file_subs $ac_file_inputs) | sed "
  _ACEOF
  cat >>$CONFIG_STATUS <<_ACEOF
  dnl Neutralize VPATH when `$srcdir' = `.'.
-  sed "$ac_vpsub
+$ac_vpsub
  dnl Shell code in configure.ac might set extrasub.
  dnl FIXME: do we really want to maintain this feature?
  $extrasub
@@ -1020,7 +1036,7 @@
  AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s, at INSTALL@,$ac_INSTALL,;t t
  ])dnl
  dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+" | (eval "$ac_sed_cmds") >$tmp/out
    rm -f $tmp/stdin
  dnl This would break Makefile dependencies.
  dnl  if diff $ac_file $tmp/out >/dev/null 2>&1; then

--------------- end of patch ---------------

With this patch (and with suitable macros using that hook) it would then be
mostly straightforward to switch TeX-Live/teTeX/web2c from autoconf-2.13 to
autoconf-2.5x (or probably rather 2.6x).

regards
--------------- end of text ---------------

What's your opinion?

regards
Peter Breitenlohner <peb at mppmu.mpg.de>



More information about the tex-k mailing list