[tex-k] Autoconf-2.13 vs. 2.59
Peter Breitenlohner
peb at mppmu.mpg.de
Fri Feb 18 09:14:26 CET 2005
On Mon, 31 Jan 2005, Karl Berry wrote:
> > ......... The final alternative is to replicate these makefile
> > bits in all the texk/*/Makefile.in, and maintain the result in all of
> > these files, instead of one place.
>
> What a nightmare for the maintainer(s).
>
> It could be automated (even if the fragments are physically present in
> all the files). E.g.,
> ### ac_included foo begins here
> ... foo content here ...
> ### ac_included foo ends here
>
> And a script could check/replace what's between the ### lines with the
> content of the foo master file.
>
> But it's certainly something to avoid if possible. Your splitting the
> Makefile seems clean in comparison :).
Hi everybody,
meanwhile it occured to me, that the present autoconf-2.59 provides
everything we need for ac_include without any need to split the Makefiles.
And no need to argue with the autoconf people about new features.
Attached is a foo-1.0.tar.gz tarball demonstrating most things. Unpack it,
cd to foo-1.0, and run 'autoreconf -vf' (of course with V2.5x). Then
configure with or without VPATH and run make.
This should create a Makefile and two shell scripts foo and bar, where foo
and Makefile use ac_include substitutions.
You can then touch one or the other source files, rerun make, and look if
all dependencies are right (I sincerely hope they are).
========================
BTW: I have renamed ac_include into kpse_include, I think we should stop
stepping onto the autotools namespaces.
The basic idea is the following:
The last three lines of configure.ac
KPSE_CONFIG_FILES([foo Makefile], [chmod a+x foo])
AC_CONFIG_FILES([bar], [chmod a+x bar])
AC_OUTPUT
say that foo and Makefile are built with ac_include substitutions from
foo.in and Makefile.in respectively, and after creating them "chmod a+x foo"
is to be executed. On the other hand bar is built from bar.in without
ac_include substitutions, just the usual ones.
The definition of KPSE_CONFIG_FILES translates the first line above into
something like
AC_CONFIG_FILES([foo.aux:kpse_empty], [do_the substitutions(foo.aux,foo.in)])
AC_CONFIG_FILES([foo:foo.aux], [chmod a+x foo])
and the same for Makefile.
There is an empty file kpse_empty created by configure, and in a first step
config.status performs the ususal substitutions to create a fake foo.aux.
This foo.aux is then discarded, it's only purpose is to trigger the
execution of "do_the substitutions(foo.aux,foo.in)". Using essentially the
commands from the autoconf-2.13 version of ac_include this then converts
foo.in into the real foo.aux.
In a second step config.status performs the ususal substitutions in foo.aux
to create foo, and finally does "chmod a+x foo".
=================================
The makefile fragments make/xxx.mk and make/yyy.mk in the example are
modelled after texk/web2c/*texdir/*tex.mk, supplying dependencies such that
texk/web2c/Makefile is regenerated when they have changed. This may or may
not work for other makefile fragments, since they might be included with
different relative paths.
==============================
All this is still rather preliminary, just to see your reactions.
regards Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo-1.0.tar.gz
Type: application/octet-stream
Size: 3171 bytes
Desc:
Url : http://tug.org/pipermail/tex-k/attachments/20050218/0ff1eae7/foo-1.0.tar.obj
More information about the tex-k
mailing list