autoconf-patches
[Top][All Lists]
Advanced

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

FYI: 08-perl-is-required.patch


From: Akim Demaille
Subject: FYI: 08-perl-is-required.patch
Date: 30 Jul 2001 11:02:03 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * autoconf.in ($AWK): Remove, no longer used.
        * test/tools.at: Use AT_CHECK_AUTOCONF.
        (AWK portability): Remove, for autoconf no longer uses AWK.
        (Syntax of the Perl scripts): New.
        * configure.ac: autoconf no longer needs an AWK with a good
        regexp engine.
        Use a static test on AC_PACKAGE_VERSION.
        * autom4te.in (&up_to_date_p): Output depends on the arguments.
        * lib/autoconf/Makefile.am: Ship version.m4, maintainer file.
        * tests/atconfig.in (PERL): New.

Index: README
--- README Fri, 27 Jul 2001 20:21:13 +0200 akim (ace/30_README 1.5 644)
+++ README Sun, 29 Jul 2001 09:37:08 +0200 akim (ace/30_README 1.5 644)
@@ -10,16 +10,12 @@
 operating system features that the package can use, in the form of M4
 macro calls.

-Producing configuration scripts using Autoconf requires GNU M4.  You
-must install GNU M4 (version 1.4 or later) before configuring
-Autoconf, so that Autoconf's configure script can find it.  The
-configuration scripts produced by Autoconf are self-contained, so
-their users do not need to have Autoconf (or GNU M4).
-
-Some optional utilities that come with Autoconf (autoscan and
-autoupdate) use Perl 5.5.  However, it is not required in order to use
-the main Autoconf programs.  If it is not present, the affected
-Autoconf utilities will not be installed.
+Producing configuration scripts using Autoconf requires GNU M4 and
+Perl.  You must install GNU M4 (version 1.4 or later) and Perl (5.005
+or later) before configuring Autoconf, so that Autoconf's configure
+script can find them.  The configuration scripts produced by Autoconf
+are self-contained, so their users do not need to have Autoconf (or
+GNU M4, Perl etc.).

 The file INSTALL should be distributed with packages that use
 Autoconf-generated configure scripts and Makefiles that conform to the
@@ -28,7 +24,7 @@
 instructions on compilation and installation.  This removes the need
 to maintain many similar sets of installation instructions.

-Be sure to read BUGS (especially if this Autoconf is not an official
+Be sure to read BUGS (especially if this version is not an official
 release) and INSTALL.

 Mail suggestions to address@hidden, report bugs on
Index: autoconf.in
--- autoconf.in Thu, 26 Jul 2001 21:23:21 +0200 akim (ace/17_autoconf.s 
1.31.8.51 644)
+++ autoconf.in Sat, 28 Jul 2001 13:23:08 +0200 akim (ace/17_autoconf.s 
1.31.8.51 644)
@@ -119,15 +119,6 @@
 esac


-# Find a good AWK.
-: address@hidden@}
-if echo xfoo | $AWK '/foo|^bar$/ { print }' | grep xfoo >/dev/null; then :; 
else
-  echo "$me: the regex engine of $AWK is too broken to be used" >&2
-  echo "$me: you might want to install GNU AWK" >&2
-  exit 1
-fi
-
-
 # We test "$dir/autom4te" in case we are in the build tree, in which case
 # the names are not transformed yet.
 for autom4te in "$AUTOM4TE" \
Index: autom4te.in
--- autom4te.in Fri, 27 Jul 2001 20:21:13 +0200 akim (ace/c/10_autom4te.i 1.7 
644)
+++ autom4te.in Sun, 29 Jul 2001 09:30:46 +0200 akim (ace/c/10_autom4te.i 1.7 
644)
@@ -128,9 +128,12 @@ sub request
     {
       if (! exists ${$obj->macro}{$_})
         {
+         # FIXME: This is too rough an approximation: we should have
+         # a means to select only M4 builtins, but @m4_builtins is not
+         # visible here.
          s/^m4_//;
          ${$obj->macro}{$_} = 1;
-          ${$obj->macro}{"m4_$_"} = 1;
+         ${$obj->macro}{"m4_$_"} = 1;
           $obj->valid (0);
        }
     }
@@ -234,7 +237,7 @@ sub load
 my @required_trace =
   (
    # We need `include' to find the dependencies.
-   'include',
+   'include', 'm4_include',
    # These are wanted by autoheader.
    'AC_CONFIG_HEADERS',
    'AH_OUTPUT',
@@ -668,10 +671,10 @@ sub trace_requests
       $macro =~ s/^m4_//;
       # See &handle_traces for an explanation for this paragraph.
       if (grep /^$macro$/, @m4_builtins)
-       {
-         $res{$macro} = 1;
-         $res{"m4_$macro"} = 1;
-       }
+       {
+         $res{$macro} = 1;
+         $res{"m4_$macro"} = 1;
+       }
     }

   return %res;
@@ -966,10 +969,9 @@ sub up_to_date_p ($$)
   handle_traces ($req, "$tmp/dependencies",('include' => '$1'));
   my $mtime = (stat ($file))[9];
   my $deps = new IO::File ("$tmp/dependencies");
-  while ($_ = $deps->getline)
+  push @dep, map { chomp; find_file ($_) } $deps->getlines;
+  foreach (@dep)
     {
-      chop;
-      $_ = find_file ($_);
       verbose "$file depends on $_";
       if ($mtime < (stat ($_))[9])
        {
Index: configure.ac
--- configure.ac Fri, 27 Jul 2001 20:21:13 +0200 akim (ace/7_configure. 1.38 
644)
+++ configure.ac Sun, 29 Jul 2001 09:40:53 +0200 akim (ace/7_configure. 1.38 
644)
@@ -22,13 +22,8 @@
 # a AC-SUBST inside AC-PROG-GNU-M4.  Grmph!
 AC_SUBST(M4)

-# `autoconf' and `ifnames' use AWK.  And we need decent RE support.
+# `ifnames' uses AWK.
 AC_PROG_AWK
-# Some AWK fail
-if echo xfoo | $AWK '/foo|^bar$/ { print }' | grep xfoo >/dev/null; then :; 
else
-  AC_MSG_ERROR([the regex engine of $AWK is too broken to be used
-                you might want to install GNU AWK])
-fi

 # Generating man pages.
 AM_MISSING_PROG(HELP2MAN, help2man)
@@ -39,6 +34,9 @@
 if test "$PERL" = no; then
   AC_MSG_ERROR([perl is not found])
 fi
+$PERL -e 'require 5.005;' || {
+   AC_MSG_ERROR([perl 5.005 or better is required])
+}

 AC_PROG_INSTALL

@@ -55,11 +53,9 @@
                 tests/Makefile tests/atconfig)

 AC_OUTPUT
-
 # Report the state of this version of Autoconf if this is a beta.
-case AC_PACKAGE_VERSION in
-  *[[a-z]]*)
-    cat <<EOF
+m4_match(m4_defn([AC_PACKAGE_VERSION]),  [[a-z]],
+[    cat <<EOF

 You are about to use an experimental version of Autoconf.  Be sure to
 read the relevant mailing lists, most importantly <address@hidden>.
@@ -68,5 +64,5 @@


 EOF
-    sed -n '/^\* Status/,$p' $srcdir/BUGS;;
-esac
+    sed -n '/^\* Status/,$p' $srcdir/BUGS
+])
Index: lib/autoconf/Makefile.am
--- lib/autoconf/Makefile.am Fri, 27 Jul 2001 20:56:43 +0200 akim 
(ace/c/24_Makefile.a 1.4 664)
+++ lib/autoconf/Makefile.am Sat, 28 Jul 2001 13:02:05 +0200 akim 
(ace/c/24_Makefile.a 1.4 664)
@@ -9,7 +9,7 @@
 # The order matters: we need version.m4 to build autoconf.m4f.
 nodistautoconflib_DATA = version.m4 autoconf.m4f

-EXTRA_DIST = $(distautoconflib_DATA) version.in
+EXTRA_DIST = $(distautoconflib_DATA) version.in version.m4

 ## version.m4.  ##

Index: tests/atconfig.in
--- tests/atconfig.in Thu, 26 Jul 2001 21:23:21 +0200 akim (ace/b/18_atconfig.i 
1.11 644)
+++ tests/atconfig.in Sat, 28 Jul 2001 13:18:14 +0200 akim (ace/b/18_atconfig.i 
1.11 644)
@@ -63,8 +63,9 @@
 SHELL=${CONFIG_SHELL-'@SHELL@'}
 PATH_SEPARATOR='@PATH_SEPARATOR@'

-# We need GNU m4.
+# We need GNU m4, and Perl.
 M4='@M4@'
+PERL='@PERL@'

 # Be sure to use the non installed Perl modules.
 # We need no special protection for the subtools (e.g., autoheader runs
Index: tests/tools.at
--- tests/tools.at Thu, 26 Jul 2001 21:23:21 +0200 akim (ace/b/30_tools.m4 1.39 
644)
+++ tests/tools.at Sat, 28 Jul 2001 13:39:21 +0200 akim (ace/b/30_tools.m4 1.39 
644)
@@ -2,9 +2,9 @@

 AT_BANNER([Executables (autoheader, autoupdate...).])

-## -------------------------------------------------------- ##
-## Check that the shell scripts are syntactically correct.  ##
-## -------------------------------------------------------- ##
+## ----------------------------- ##
+## Syntax of the shell scripts.  ##
+## ----------------------------- ##

 # We use `/bin/sh -n script' to check that there are no syntax errors
 # in the scripts.  Although incredible, there are /bin/sh that go into
@@ -26,7 +26,7 @@
 # So before using `/bin/sh -n' to check our scripts, we first check
 # that `/bin/sh -n' is not broken to death.

-AT_SETUP([Syntax of the scripts])
+AT_SETUP([Syntax of the shell scripts])

 # A script that never returns.  We don't care that it never returns,
 # broken /bin/sh loop equally with `false', but it makes it easier to
@@ -69,29 +69,36 @@



+## ---------------------------- ##
+## Syntax of the Perl scripts.  ##
+## ---------------------------- ##
+
+AT_SETUP([Syntax of the Perl scripts])
+
+# Perl says things like:
+# | % perl -c ./autom4te
+# | ./autom4te syntax OK
+# Ignore it, it might change between releases.
+AT_CHECK([$PERL -c ../autom4te],   0, [], [ignore])
+AT_CHECK([$PERL -c ../autoupdate], 0, [], [ignore])
+
+AT_CLEANUP
+
+
+
 ## ----------------- ##
 ## AWK portability.  ##
 ## ----------------- ##

 AT_SETUP([AWK portability])

-AT_DATA([configure.ac],
-[])
-
 # Skip if we don't have GNU Awk.
 AT_CHECK([gawk --version || exit 77], 0, ignore, ignore)

-# Generation of the script.
-AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir ../lib -l $at_srcdir], 0,
-         [], [])
-# Tracing.
-AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir ../lib -l $at_srcdir -t 
AC_INIT], 0,
-         ignore, [])
 # Syntax correctness of ifnames.
-AT_CHECK([AWK='gawk --posix' ifnames /dev/null], 0,
-         [], [])
+AT_CHECK([AWK='gawk --posix' ifnames /dev/null])

-AT_CLEANUP(configure)
+AT_CLEANUP



@@ -118,7 +125,7 @@ m4_define([TRACE2], [[$2], $1])
 ]])

 # Several --traces.
-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir -t TRACE1 -t TRACE2], 0,
+AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
 [[configure.ac:4:TRACE1:foo:bar:baz
 configure.ac:4:TRACE2:bar:baz
 configure.ac:5:TRACE1:bar:baz
@@ -134,7 +141,7 @@ m4_define([TRACE2], [[$2], $1])
 ]])

 # Several line requests.
-AT_CHECK([[autoconf --autoconf-dir ../lib -l $at_srcdir -t TRACE1:'
+AT_CHECK_AUTOCONF([[-t TRACE1:'
 [$1], [$2], [$3].']], 0,
 [[
 [foo], [bar], [baz].
@@ -151,7 +158,7 @@ m4_define([TRACE2], [[$2], $1])
 ]])

 # address@hidden
-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir -t TRACE2:'${)===(}@'], 
0,
+AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
 [[[bar])===([baz]
 [baz]
 [])===([baz]
@@ -171,8 +178,7 @@ m4_define([TRACE2], [[$2], $1])
 [[define([active], [ACTIVE])
 ]])

-AT_CHECK([[autoconf --autoconf-dir ../lib -l $at_srcdir -t define |
-            sed -n '$p']],
+AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
          0,
 [[configure.ac:1:define:active:ACTIVE
 ]])
@@ -181,7 +187,7 @@ m4_define([TRACE2], [[$2], $1])
 # dive into obscure feature interaction...
 # Note that using `-i' means we need the *.m4 files, not the *.m4f files,
 # hence we need srcdir, not builddir.
-AT_CHECK([[autoconf --autoconf-dir $at_top_srcdir/lib -l $at_srcdir -t 
define:'$1' -i|
+AT_CHECK_AUTOCONF([[--autoconf-dir $at_top_srcdir/lib -t define:'$1' -i|
             sed -n '$p']],
          0,
 [[active
@@ -212,7 +218,7 @@ m4_define([TRACE2], [[$2], $1])
 _AS_BAR
 ]])

-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir], 1, [], [stderr])
+AT_CHECK_AUTOCONF([], 1, [], [stderr])
 # The output of autoconf is not deterministic here because it
 # uses `for (ind in array)'.  So be sure to have a unique representation.
 AT_CHECK([sort stderr], 0,
@@ -253,7 +259,7 @@ m4_define([TRACE2], [[$2], $1])
 It would be very bad if Autoconf forgot to expand [AC_]OUTPUT!
 ]])

-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir], 1, [], [stderr])
+AT_CHECK_AUTOCONF([], 1, [], [stderr])
 # The output of autoconf is not deterministic here because it
 # uses `for (ind in array)'.  So be sure to have a unique representation.
 AT_CHECK([sort stderr], 0,



reply via email to

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