autoconf-patches
[Top][All Lists]
Advanced

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

Re: 2.54: fail to build with SunOS make


From: Akim Demaille
Subject: Re: 2.54: fail to build with SunOS make
Date: 26 Sep 2002 13:58:02 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| > From: Alexandre Duret-Lutz <address@hidden>
| > Date: Tue, 24 Sep 2002 11:12:56 +0200
| > 
| > ../../tests/autom4te: /tmp/adl/autoconf-2.54/bin/autom4te: not found
| > ...
| > One could probably claim it's not a bug in Solaris make
| 
| Yes, I tend to agree.  Thanks.  I tested the following patch on
| Solaris 8 and then installed it.

I'm not sure you two guys are ackowledging to the same thing.
Alexandre is tempted to call this a bug, as I am.  You seem to claim
the converse.

In any, POSIX is extremely confusing in the text Alexandre quotes,
since the name it chose (keep .s2, *not* .s1) seems to demonstrate
that it is .s1 which is null, i.e., it is the *source* that has an
empty suffix, while the text itself says ``A rule with one suffix .s2
is the definition of how to build target from target.s2''. i.e., it
would actually be the destination suffix which is empty:

   Alexandre> One could probably claim it's not a bug in Solaris make by
   Alexandre> reading POSIX as follows.
   
   |     Inference rules are formatted as follows:
   |
   | target:
   | <tab>command
   | [<tab>command]...
   | line that does not begin with <tab> or #
   |
   |     The application shall ensure that the target portion is a valid
   |     target name (see Target Rules ) of the form .s2 or .s1.s2 (where
   |     .s1 and .s2 are suffixes that have been given as prerequisites
   |     of the .SUFFIXES special target and s1 and s2 do not contain any
   |     slashes or periods.) If there is only one period in the target,
   |     it is a single-suffix inference rule. Targets with two periods
   |     are double-suffix inference rules.  Inference rules can have
   |     only one target before the colon.
   [...]
   |     If the target to be built does not contain a suffix and there is
   |     no rule for the target, the single suffix inference rules shall
   |     be checked. The single-suffix inference rules define how to
   |     build a target if a file is found with a name that matches the
   |     target name with one of the single suffixes appended. A rule
   |     with one suffix .s2 is the definition of how to build target
   |     from target.s2. The other suffix ( .s1) is treated as null.


| diff -pru autoconf-2.54/bin/Makefile.am autoconf-fix/bin/Makefile.am
| --- autoconf-2.54/bin/Makefile.am     2002-09-05 02:23:12.000000000 -0700
| +++ autoconf-fix/bin/Makefile.am      2002-09-24 17:16:26.662544994 -0700
| @@ -54,11 +54,9 @@ $(srcdir)/autoconf.in: $(srcdir)/autocon
|  
|  ## 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 $@ address@hidden
| -     $(edit) $< >address@hidden
| +     $(edit) address@hidden >address@hidden
|       chmod +x address@hidden
|       mv address@hidden $@

This patch does not maintain the dependencies on the .in guys!  So I'm
installing this:

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        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.

Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.258
diff -u -u -r1.258 NEWS
--- NEWS 13 Sep 2002 10:21:07 -0000 1.258
+++ NEWS 26 Sep 2002 11:56:33 -0000
@@ -1,5 +1,10 @@
 * Major changes in Autoconf 2.54a                       -*- outline -*-
 
+
+** Bug Fixes
+
+- Portability of the Autoconf package to Solaris.
+
 * Major changes in Autoconf 2.54
 
   Released September 13th, 2002.
Index: bin/Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/bin/Makefile.am,v
retrieving revision 1.9
diff -u -u -r1.9 Makefile.am
--- bin/Makefile.am 25 Sep 2002 00:25:11 -0000 1.9
+++ bin/Makefile.am 26 Sep 2002 11:56:34 -0000
@@ -54,11 +54,47 @@
 
 ## 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 $@ address@hidden
-       $(edit) address@hidden >address@hidden
-       chmod +x address@hidden
-       mv address@hidden $@
+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: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.678
diff -u -u -r1.678 autoconf.texi
--- doc/autoconf.texi 16 Sep 2002 08:38:45 -0000 1.678
+++ doc/autoconf.texi 26 Sep 2002 11:56:54 -0000
@@ -2245,17 +2245,24 @@
         -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
address@hidden group
+
address@hidden
+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 @@
 values (@code{prefix} etc.) and not only on @code{VERSION} and so forth,
 the output depends on @file{Makefile}, not @file{configure.ac}.
 
address@hidden Separated dependency
-Don't write
address@hidden 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
address@hidden
+.in:
+        rm -f $@@ $@@.tmp
+        $(edit) $< >$@@.tmp
+        chmod +x $@@.tmp
+        mv $@@.tmp $@@
address@hidden group
 @end example
 
address@hidden
-unless you really mean to create the file @file{.in} from @file{Makefile}.
address@hidden of Make}, for details.
 @end table
 
 
@@ -2395,15 +2408,16 @@
 @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
address@hidden 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
address@hidden 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
address@hidden
 
 The package should @samp{#include} the configuration header file before
 any other header files, to prevent inconsistencies in declarations (for
@@ -10957,8 +10971,71 @@
 % @kbd{pmake}       # BSD make
 cp ../bar.x bar.y
 @end example
-
 @end table
address@hidden end item about VPATH
+
address@hidden Single Suffix Rules and Separated Dependencies
address@hidden Single Suffix Inference Rule
address@hidden 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:}).
+
address@hidden Separated Dependencies
address@hidden 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:
+
address@hidden
+$ @kbd{cat Makefile}
+.SUFFIXES: .in
+foo: foo.in
+.in:
+        cp $< $@
+$ @kbd{touch foo.in}
+$ @kbd{make}
+$ @kbd{ls}
+Makefile  foo.in
address@hidden example
+
address@hidden
+while @acronym{GNU} Make does:
+
address@hidden
+$ @kbd{gmake}
+cp foo.in foo
+$ @kbd{ls}
+Makefile  foo       foo.in
address@hidden example
+
+Note it works without the @samp{foo: foo.in} dependency.
+
address@hidden
+$ @kbd{cat Makefile}
+.SUFFIXES: .in
+.in:
+        cp $< $@
+$ @kbd{make foo}
+cp foo.in foo
address@hidden example
+
address@hidden
+and it works with double suffix inference rules:
+
address@hidden
+$ @kbd{cat Makefile}
+foo.out: foo.in
+.SUFFIXES: .in .out
+.in.out:
+        cp $< $@
+$ @kbd{make}
+cp foo.in foo.out
address@hidden example
+
+As a result, in such a case, you have to write target rules.
 @end table
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]