]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Single suffix rules and seperated dependencies are not portable.
authorAkim Demaille <akim@epita.fr>
Thu, 26 Sep 2002 11:57:28 +0000 (11:57 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 26 Sep 2002 11:57:28 +0000 (11:57 +0000)
* doc/autoconf.texi (Installation Directory Variables): Update.
(Limitations of Make): Some about `Single Suffix Rules and
Separated Dependencies'.
* bin/Makefile.am (autoconf, autoheader, autoreconf, autoupdate)
(ifnames, autoscan, autom4te): Un-factor into several rules.

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

index 571414c63610e49a070ba86beaa50421a9819a15..93e37700b1ee1eac305f856c57ed7f2d0c8f1a6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-09-26  Akim Demaille  <akim@epita.fr>
+
+       Single suffix rules and seperated dependencies are not portable.
+
+       * doc/autoconf.texi (Installation Directory Variables): Update.
+       (Limitations of Make): Some about `Single Suffix Rules and
+       Separated Dependencies'.
+       * bin/Makefile.am (autoconf, autoheader, autoreconf, autoupdate)
+       (ifnames, autoscan, autom4te): Un-factor into several rules.
+
 2002-09-25  Paul Eggert  <eggert@twinsun.com>
 
        * BUGS (Interoperability bugs): New section.  Mention libtool
diff --git a/NEWS b/NEWS
index 5cfae623ddef02bceb9aeb20b0727283f385aaf2..de6cd09b48c206118bf3581e218f18219d9179b8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
 * Major changes in Autoconf 2.54a                       -*- outline -*-
 \f
+
+** Bug Fixes
+
+- Portability of the Autoconf package to Solaris.
+
 * Major changes in Autoconf 2.54
 
   Released September 13th, 2002.
index a734e912a1dac42a334e9dc801832b3b6c8bf8a4..61b7534746963936fa7a950592f816e5ed91a0fe 100644 (file)
@@ -54,11 +54,47 @@ $(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
 
 ## All the files below depend on Makefile so that they are rebuilt
 ## when the prefix etc. changes.
-autoconf autoheader autoreconf autoupdate ifnames autoscan autom4te: Makefile
-       rm -f $@ $@.tmp
-       $(edit) $@.in >$@.tmp
-       chmod +x $@.tmp
-       mv $@.tmp $@
+autoconf: autoconf.in Makefile
+       rm -f autoconf autoconf.tmp
+       $(edit) autoconf.in >autoconf.tmp
+       chmod +x autoconf.tmp
+       mv autoconf.tmp autoconf
+
+autoheader: autoheader.in Makefile
+       rm -f autoheader autoheader.tmp
+       $(edit) autoheader.in >autoheader.tmp
+       chmod +x autoheader.tmp
+       mv autoheader.tmp autoheader
+
+autom4te: autom4te.in Makefile
+       rm -f autom4te autom4te.tmp
+       $(edit) autom4te.in >autom4te.tmp
+       chmod +x autom4te.tmp
+       mv autom4te.tmp autom4te
+
+autoreconf: autoreconf.in Makefile
+       rm -f autoreconf autoreconf.tmp
+       $(edit) autoreconf.in >autoreconf.tmp
+       chmod +x autoreconf.tmp
+       mv autoreconf.tmp autoreconf
+
+autoscan: autoscan.in Makefile
+       rm -f autoscan autoscan.tmp
+       $(edit) autoscan.in >autoscan.tmp
+       chmod +x autoscan.tmp
+       mv autoscan.tmp autoscan
+
+autoupdate: autoupdate.in Makefile
+       rm -f autoupdate autoupdate.tmp
+       $(edit) autoupdate.in >autoupdate.tmp
+       chmod +x autoupdate.tmp
+       mv autoupdate.tmp autoupdate
+
+ifnames: ifnames.in Makefile
+       rm -f ifnames ifnames.tmp
+       $(edit) ifnames.in >ifnames.tmp
+       chmod +x ifnames.tmp
+       mv ifnames.tmp ifnames
 
 
 
index dacecbd64329be6c9939f5c2afb4b72ec4284dc3..9fa24ada35a214c6a210643b15455ac8b4ca9cd9 100644 (file)
@@ -121,8 +121,6 @@ edit = sed \
 # autoconf is written in M4sh.
 AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh
 
-SUFFIXES = .in
-
 TAGS_DEPENDENCIES = $(EXTRA_DIST)
 
 letters = abcdefghijklmnopqrstuvwxyz
@@ -147,7 +145,6 @@ 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
@@ -346,12 +343,48 @@ uninstall-am: uninstall-binSCRIPTS uninstall-info-am
 
 $(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
        $(AUTOM4SH) $(srcdir)/autoconf.as -o $@
-autoconf autoheader autoreconf autoupdate ifnames autoscan autom4te: Makefile
-.in:
-       rm -f $@ $@.tmp
-       $(edit) $< >$@.tmp
-       chmod +x $@.tmp
-       mv $@.tmp $@
+
+autoconf: autoconf.in Makefile
+       rm -f autoconf autoconf.tmp
+       $(edit) autoconf.in >autoconf.tmp
+       chmod +x autoconf.tmp
+       mv autoconf.tmp autoconf
+
+autoheader: autoheader.in Makefile
+       rm -f autoheader autoheader.tmp
+       $(edit) autoheader.in >autoheader.tmp
+       chmod +x autoheader.tmp
+       mv autoheader.tmp autoheader
+
+autom4te: autom4te.in Makefile
+       rm -f autom4te autom4te.tmp
+       $(edit) autom4te.in >autom4te.tmp
+       chmod +x autom4te.tmp
+       mv autom4te.tmp autom4te
+
+autoreconf: autoreconf.in Makefile
+       rm -f autoreconf autoreconf.tmp
+       $(edit) autoreconf.in >autoreconf.tmp
+       chmod +x autoreconf.tmp
+       mv autoreconf.tmp autoreconf
+
+autoscan: autoscan.in Makefile
+       rm -f autoscan autoscan.tmp
+       $(edit) autoscan.in >autoscan.tmp
+       chmod +x autoscan.tmp
+       mv autoscan.tmp autoscan
+
+autoupdate: autoupdate.in Makefile
+       rm -f autoupdate autoupdate.tmp
+       $(edit) autoupdate.in >autoupdate.tmp
+       chmod +x autoupdate.tmp
+       mv autoupdate.tmp autoupdate
+
+ifnames: ifnames.in Makefile
+       rm -f ifnames ifnames.tmp
+       $(edit) ifnames.in >ifnames.tmp
+       chmod +x ifnames.tmp
+       mv ifnames.tmp ifnames
 # 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 78602f868f34e9fb53a91dc32b03e3f98b9ce33e..ae543974a70a2347736cc6787ec21a0403fd33e8 100644 (file)
@@ -2245,17 +2245,24 @@ edit = sed \
         -e 's,@@prefix\@@,$(prefix),g'
 @end group
 
-autoconf autoheader: Makefile
 @group
-.in:
-        rm -f $@@ $@@.tmp
-        $(edit) $< >$@@.tmp
-        chmod +x $@@.tmp
-        mv $@@.tmp $@@
+autoconf: Makefile autoconf.in
+        rm -f autoconf autoconf.tmp
+        $(edit) $< >autoconf.tmp
+        chmod +x autoconf.tmp
+        mv autoconf.tmp autoconf
+@end group
+
+@group
+autoheader: Makefile autoheader.in
+        rm -f autoheader autoheader.tmp
+        $(edit) $< >autoheader.tmp
+        chmod +x autoheader.tmp
+        mv autoheader.tmp autoheader
 @end group
 @end example
 
-Five details are noteworthy:
+Some details are noteworthy:
 
 @table @samp
 @item @@datadir\@@
@@ -2276,16 +2283,22 @@ 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
+@item Separated dependencies and Single Suffix Rules
+You can't use them!  The above snippet cannot be (portably) rewritten
+as:
 
 @example
-.in: Makefile
-        @dots{}
+autoconf autoheader: Makefile
+@group
+.in:
+        rm -f $@@ $@@.tmp
+        $(edit) $< >$@@.tmp
+        chmod +x $@@.tmp
+        mv $@@.tmp $@@
+@end group
 @end example
 
-@noindent
-unless you really mean to create the file @file{.in} from @file{Makefile}.
+@xref{Limitations of Make}, for details.
 @end table
 
 
@@ -2395,15 +2408,16 @@ configuration-related dependencies.
 @cindex Configuration Header
 @cindex @file{config.h}
 
-When a package contains more than a few tests that define C preprocessor symbols, the command
-lines to pass @option{-D} options to the compiler can get quite long.
-This causes two problems.  One is that the @command{make} output is hard to
-visually scan for errors.  More seriously, the command lines can exceed
-the length limits of some operating systems.  As an alternative to
-passing @option{-D} options to the compiler, @command{configure} scripts can
-create a C header file containing @samp{#define} directives.  The
-@code{AC_CONFIG_HEADERS} macro selects this kind of output.  It should
-be called right after @code{AC_INIT}.
+When a package contains more than a few tests that define C preprocessor
+symbols, the command lines to pass @option{-D} options to the compiler
+can get quite long.  This causes two problems.  One is that the
+@command{make} output is hard to visually scan for errors.  More
+seriously, the command lines can exceed the length limits of some
+operating systems.  As an alternative to passing @option{-D} options to
+the compiler, @command{configure} scripts can create a C header file
+containing @samp{#define} directives.  The @code{AC_CONFIG_HEADERS}
+macro selects this kind of output.  It should be called right after
+@code{AC_INIT}.
 
 The package should @samp{#include} the configuration header file before
 any other header files, to prevent inconsistencies in declarations (for
@@ -10957,8 +10971,71 @@ cp ../bar.x bar.y
 % @kbd{pmake}       # BSD make
 cp ../bar.x bar.y
 @end example
-
 @end table
+@c end item about VPATH
+
+@item Single Suffix Rules and Separated Dependencies
+@cindex Single Suffix Inference Rule
+@cindex Rule, Single Suffix Inference
+A @dfn{Single Suffix Rule} is basically a usual suffix (inference) rule
+(@samp{.from.to:}), but which @emph{destination} suffix is empty
+(@samp{.from:}).
+
+@cindex Separated Dependencies
+@dfn{Separated dependencies} simply refers to listing the prerequisite
+of a target, without defining a rule.  Usually one can list on the one
+hand side, the rules, and on the other hand side, the dependencies.
+
+Solaris @command{make} does not support separated dependencies for
+targets defined by single suffix rules:
+
+@example
+$ @kbd{cat Makefile}
+.SUFFIXES: .in
+foo: foo.in
+.in:
+        cp $< $@
+$ @kbd{touch foo.in}
+$ @kbd{make}
+$ @kbd{ls}
+Makefile  foo.in
+@end example
+
+@noindent
+while @acronym{GNU} Make does:
+
+@example
+$ @kbd{gmake}
+cp foo.in foo
+$ @kbd{ls}
+Makefile  foo       foo.in
+@end example
+
+Note it works without the @samp{foo: foo.in} dependency.
+
+@example
+$ @kbd{cat Makefile}
+.SUFFIXES: .in
+.in:
+        cp $< $@
+$ @kbd{make foo}
+cp foo.in foo
+@end example
+
+@noindent
+and it works with double suffix inference rules:
+
+@example
+$ @kbd{cat Makefile}
+foo.out: foo.in
+.SUFFIXES: .in .out
+.in.out:
+        cp $< $@
+$ @kbd{make}
+cp foo.in foo.out
+@end example
+
+As a result, in such a case, you have to write target rules.
 @end table