]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/Makefile.am (autoconf, autoheader, autoreconf, autoupdate)
authorAkim Demaille <akim@epita.fr>
Thu, 5 Sep 2002 09:43:34 +0000 (09:43 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 5 Sep 2002 09:43:34 +0000 (09:43 +0000)
(ifnames, autoscan, autom4te): Since we don't only depend on
configure.ac variables (such as VERSION etc.), but also on prefix
and so forth, depend on Makefile, not configure.ac.
Reported by Alexandre Duret-Lutz.
* doc/autoconf.texi (Installation Directory Variables): Adjust.

ChangeLog
bin/Makefile.am
bin/Makefile.in
doc/autoconf.texi

index e0b25e9703f2f7c6abe42df9c6a9ee693b3513fc..02586e0bd93d2c1cedb07ca21c46080e2aea6a4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2002-09-05  Akim Demaille  <akim@epita.fr>
+
+       * bin/Makefile.am (autoconf, autoheader, autoreconf, autoupdate)
+       (ifnames, autoscan, autom4te): Since we don't only depend on
+       configure.ac variables (such as VERSION etc.), but also on prefix
+       and so forth, depend on Makefile, not configure.ac.
+       Reported by Alexandre Duret-Lutz.
+       * doc/autoconf.texi (Installation Directory Variables): Adjust.
+
 2002-09-05  Kevin Ryde  <user42@zip.com.au>
 
-       * hpmake/autoconf.texi (Limitations of Make): HP-UX trailing
-       backslashes doesn't seem to be confined to ia64, just say "some
-       versions".
+       * autoconf.texi (Limitations of Make): HP-UX trailing backslashes
+       doesn't seem to be confined to ia64, just say "some versions".
 
 2002-09-04  Akim Demaille  <akim@epita.fr>
 
index 16ec64c57fd1b7046037ab5be931ed72f9707100..2c7892bb1763891ad35df87d0e88ab9faca537d3 100644 (file)
@@ -52,52 +52,16 @@ AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh
 $(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
        $(AUTOM4SH) $(srcdir)/autoconf.as -o $@
 
-## All the files below depend on configure.ac so that they are rebuilt
-## when the Autoconf version changes. Unfortunately, suffix rules cannot
-## have additional dependencies, so we have to use explicit rules.
-
-
-autoconf: $(srcdir)/autoconf.in $(top_srcdir)/configure.ac
-       rm -f autoconf autoconf.tmp
-       $(edit) $(srcdir)/autoconf.in >autoconf.tmp
-       chmod +x autoconf.tmp
-       mv autoconf.tmp autoconf
-
-autoheader: $(srcdir)/autoheader.in $(top_srcdir)/configure.ac
-       rm -f autoheader autoheader.tmp
-       $(edit) $(srcdir)/autoheader.in >autoheader.tmp
-       chmod +x autoheader.tmp
-       mv autoheader.tmp autoheader
-
-autoreconf: $(srcdir)/autoreconf.in $(top_srcdir)/configure.ac
-       rm -f autoreconf autoreconf.tmp
-       $(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
-       chmod +x autoreconf.tmp
-       mv autoreconf.tmp autoreconf
-
-autoupdate: $(srcdir)/autoupdate.in $(top_srcdir)/configure.ac
-       rm -f autoupdate autoupdate.tmp
-       $(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
-       chmod +x autoupdate.tmp
-       mv autoupdate.tmp autoupdate
-
-ifnames: $(srcdir)/ifnames.in $(top_srcdir)/configure.ac
-       rm -f ifnames ifnames.tmp
-       $(edit) $(srcdir)/ifnames.in >ifnames.tmp
-       chmod +x ifnames.tmp
-       mv ifnames.tmp ifnames
-
-autoscan: $(srcdir)/autoscan.in $(top_srcdir)/configure.ac
-       rm -f autoscan autoscan.tmp
-       $(edit) $(srcdir)/autoscan.in >autoscan.tmp
-       chmod +x autoscan.tmp
-       mv autoscan.tmp autoscan
-
-autom4te: $(srcdir)/autom4te.in $(top_srcdir)/configure.ac
-       rm -f autom4te autom4te.tmp
-       $(edit) $(srcdir)/autom4te.in >autom4te.tmp
-       chmod +x autom4te.tmp
-       mv autom4te.tmp autom4te
+## All the files below depend on Makefile so that they are rebuilt
+## when the prefix etc. changes.
+SUFFIXES = .in
+autoconf autoheader autoreconf autoupdate ifnames autoscan autom4te: Makefile
+.in:
+       rm -f $@ $@.tmp
+       $(edit) $< >$@.tmp
+       chmod +x $@.tmp
+       mv $@.tmp $@
+
 
 
 ## --------------- ##
index 5388b031f9d3ac9417bec0f89b899e20c8519ce8..1c52d97718fefb8237eab3653d691a73a07f0e28 100644 (file)
@@ -120,6 +120,8 @@ edit = sed \
 # autoconf is written in M4sh.
 AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh
 
+SUFFIXES = .in
+
 TAGS_DEPENDENCIES = $(EXTRA_DIST)
 
 letters = abcdefghijklmnopqrstuvwxyz
@@ -144,6 +146,7 @@ DIST_COMMON = Makefile.am Makefile.in
 all: all-am
 
 .SUFFIXES:
+.SUFFIXES: .in
 $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  bin/Makefile
@@ -338,48 +341,12 @@ uninstall-am: uninstall-binSCRIPTS uninstall-info-am
 
 $(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
        $(AUTOM4SH) $(srcdir)/autoconf.as -o $@
-
-autoconf: $(srcdir)/autoconf.in $(top_srcdir)/configure.ac
-       rm -f autoconf autoconf.tmp
-       $(edit) $(srcdir)/autoconf.in >autoconf.tmp
-       chmod +x autoconf.tmp
-       mv autoconf.tmp autoconf
-
-autoheader: $(srcdir)/autoheader.in $(top_srcdir)/configure.ac
-       rm -f autoheader autoheader.tmp
-       $(edit) $(srcdir)/autoheader.in >autoheader.tmp
-       chmod +x autoheader.tmp
-       mv autoheader.tmp autoheader
-
-autoreconf: $(srcdir)/autoreconf.in $(top_srcdir)/configure.ac
-       rm -f autoreconf autoreconf.tmp
-       $(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
-       chmod +x autoreconf.tmp
-       mv autoreconf.tmp autoreconf
-
-autoupdate: $(srcdir)/autoupdate.in $(top_srcdir)/configure.ac
-       rm -f autoupdate autoupdate.tmp
-       $(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
-       chmod +x autoupdate.tmp
-       mv autoupdate.tmp autoupdate
-
-ifnames: $(srcdir)/ifnames.in $(top_srcdir)/configure.ac
-       rm -f ifnames ifnames.tmp
-       $(edit) $(srcdir)/ifnames.in >ifnames.tmp
-       chmod +x ifnames.tmp
-       mv ifnames.tmp ifnames
-
-autoscan: $(srcdir)/autoscan.in $(top_srcdir)/configure.ac
-       rm -f autoscan autoscan.tmp
-       $(edit) $(srcdir)/autoscan.in >autoscan.tmp
-       chmod +x autoscan.tmp
-       mv autoscan.tmp autoscan
-
-autom4te: $(srcdir)/autom4te.in $(top_srcdir)/configure.ac
-       rm -f autom4te autom4te.tmp
-       $(edit) $(srcdir)/autom4te.in >autom4te.tmp
-       chmod +x autom4te.tmp
-       mv autom4te.tmp autom4te
+autoconf autoheader autoreconf autoupdate ifnames autoscan autom4te: Makefile
+.in:
+       rm -f $@ $@.tmp
+       $(edit) $< >$@.tmp
+       chmod +x $@.tmp
+       mv $@.tmp $@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 40678941d22a4adf4fbb0901c773f70c51ffd6fd..862008523e782d47e53c7519d34770cfdb7dbbc1 100644 (file)
@@ -2232,18 +2232,27 @@ e.g. @samp{AC_DEFINE_UNQUOTED(DATADIR, "$datadir")}, you should add
 Similarly you should not rely on @code{AC_OUTPUT_FILES} to replace
 @code{datadir} and friends in your shell scripts and other files, rather
 let @command{make} manage their replacement.  For instance Autoconf
-ships templates of its shell scripts ending with @samp{.sh}, and uses
-this Makefile snippet:
+ships templates of its shell scripts ending with @samp{.in}, and uses a
+Makefile snippet similar to:
 
 @example
-.sh:
+@group
+edit = sed \
+       -e 's,@@datadir\@@,$(pkgdatadir),g' \
+       -e 's,@@prefix\@@,$(prefix),g'
+@end group
+
+autoconf autoheader: Makefile
+@group
+.in:
         rm -f $@@ $@@.tmp
-        sed 's,@@datadir\@@,$(pkgdatadir),g' $< >$@@.tmp
+        $(edit) $< >$@@.tmp
         chmod +x $@@.tmp
         mv $@@.tmp $@@
+@end group
 @end example
 
-Three things are noteworthy:
+Five details are noteworthy:
 
 @table @samp
 @item @@datadir\@@
@@ -2258,6 +2267,22 @@ instead.
 Don't use @samp{/} in the sed expression(s) since most probably the
 variables you use, such as @samp{$(pkgdatadir)}, will contain
 some.
+
+@item Dependency on @file{Makefile}
+Since @code{edit} uses values that depend on the configuration specific
+values (@code{prefix} etc.) and not only on @code{VERSION} and so forth,
+the output depends on @file{Makefile}, not @file{configure.ac}.
+
+@item Separated dependency
+Don't write
+
+@example
+.in: Makefile
+        @dots{}
+@end example
+
+@noindent
+unless you really mean to create the file @file{.in} from @file{Makefile}.
 @end table