autoconf-patches
[Top][All Lists]
Advanced

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

46-fyi-m4-prereq.patch


From: Akim Demaille
Subject: 46-fyi-m4-prereq.patch
Date: Mon, 27 Aug 2001 08:54:11 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        Provide a mean to ``AC_PREREQ'' for M4sugar, M4sh and Autotest.
        
        * lib/autoconf/version.in: Remove.
        * lib/m4sugar/version.in: New.
        * lib/m4sugar/m4sugar.m4 (m4_acversion, m4_version_prereq): New.
        Adjust callers.
        * bin/autoupdate.in: Distinguish M4sugar vs. Autoconf macros by
        the name of the directory they're in, instead of the filename,
        since version.m4 is now in m4sugar, but m4_acversion must not be
        classified as an Autoconf macro.
        ($input_m4): Don't qualify the path to m4sugar.
        Rather, pass autoconf_dir to m4.
        * tests/Makefile.am (testsuite): Remove -I top_srcdir, unneeded.
        * tests/suite.at: Require 2.52c.
        
        
Index: bin/autoupdate.in
--- bin/autoupdate.in Fri, 03 Aug 2001 20:59:48 +0200 akim
+++ bin/autoupdate.in Thu, 23 Aug 2001 23:02:39 +0200 akim
@@ -123,7 +123,7 @@ sub parse_args ()
   if (! @ARGV)
     {
       my $configure_ac = find_configure_ac;
-      die 'no input file'
+      die "$me: no input file\n"
        unless $configure_ac;
       push @ARGV, $configure_ac;
     }
@@ -177,14 +177,16 @@ sub parse_args ()
   {
     chomp;
     /^(AC|AU):(.*):([^:]*)$/ or next;
-    my $filename = basename ($2);
+    # ../lib/m4sugar/m4sugar.m4  -> m4sugar
+    # ../lib/autoconf/general.m4 -> autoconf
+    my $set = basename (dirname ($2));
     if ($1 eq "AC")
       {
-       $ac_macros{$3} = $filename;
+       $ac_macros{$3} = $set;
       }
     else
       {
-       $au_macros{$3} = $filename;
+       $au_macros{$3} = $set;
       }
   }
 close MACROS
@@ -219,7 +221,7 @@ sub parse_args ()
 foreach (sort keys %ac_macros)
   {
     print AC_M4      "_au_define([$_], [[\$0(\$\@)]])\n"
-      unless $ac_macros{$_} eq "m4sugar.m4";
+      unless $ac_macros{$_} eq 'm4sugar';
     print DISABLE_M4 "_au_undefine([$_])\n";
   }
 close DISABLE_M4
@@ -293,7 +295,7 @@ sub parse_args ()
 
       # Enable the m4 builtins, m4sugar and the autoquoting AC macros.
       _au_include([$tmp/m4.m4])
-      _au_include([$autoconf_dir/m4sugar/m4sugar.m4])
+      _au_include([m4sugar/m4sugar.m4])
       _au_include([$tmp/ac.m4])
 
       _au_divert(0)])
@@ -362,11 +364,11 @@ sub parse_args ()
     # Now ask m4 to perform the update.
     if ("$file" eq "$tmp/stdin")
        {
-        xsystem ("$m4 $tmp/input.m4");
+        xsystem ("$m4 -I $autoconf_dir $tmp/input.m4");
        }
     else
        {
-        xsystem ("$m4 $tmp/input.m4 >$tmp/updated");
+        xsystem ("$m4 -I $autoconf_dir $tmp/input.m4 >$tmp/updated");
         if (compare ("$tmp/updated", "$file") == 0)
           {
             # File didn't change, so don't update its mod time.
Index: lib/autoconf/Makefile.am
--- lib/autoconf/Makefile.am Tue, 21 Aug 2001 10:46:02 +0200 akim
+++ lib/autoconf/Makefile.am Thu, 23 Aug 2001 21:35:43 +0200 akim
@@ -23,22 +23,10 @@
                       lang.m4 c.m4 fortran.m4 \
                        functions.m4 headers.m4 types.m4 libs.m4 programs.m4
 nodistautoconflibdir = $(pkgdatadir)/autoconf
-# The order matters: we need version.m4 to build autoconf.m4f.
-nodistautoconflib_DATA = version.m4 autoconf.m4f
+nodistautoconflib_DATA = autoconf.m4f
 
-EXTRA_DIST = $(distautoconflib_DATA) version.in version.m4
+EXTRA_DIST = $(distautoconflib_DATA)
 
-## version.m4.  ##
-
-# - version.m4 needs to be updated only once, since it depends on
-#   configure.ac, not on the results of a 'configure' run.
-# - It is guaranteed (with GNU Make) that when the version in configure.ac
-#   is changed, version.m4 is built only after the new version number is
-#   propagated to the Makefile.  (Libtool uses the same guarantee.)
-
-$(srcdir)/version.m4: $(srcdir)/version.in $(top_srcdir)/configure.ac
-       sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/version.in >version.tm4
-       mv version.tm4 $(srcdir)/version.m4
 
 
 ## --------------- ##
Index: lib/autoconf/autoconf.m4
--- lib/autoconf/autoconf.m4 Tue, 21 Aug 2001 10:46:02 +0200 akim
+++ lib/autoconf/autoconf.m4 Thu, 23 Aug 2001 21:51:39 +0200 akim
@@ -1,4 +1,4 @@
-changequote()changequote([, ])include(m4sugar/m4sh.m4)#      -*- Autoconf -*-
+divert(-1)#                                                -*- Autoconf -*-
 # This file is part of Autoconf.
 # Driver that loads the Autoconf macro files.
 # Copyright 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
@@ -51,7 +51,9 @@
 # yet when Autoconf is frozen.
 # Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
 
-m4_include([autoconf/version.m4])
+changequote()
+changequote([, ])
+include([m4sugar/m4sh.m4])
 m4_include([autoconf/general.m4])
 m4_include([autoconf/programs.m4])
 m4_include([autoconf/lang.m4])
Index: lib/autoconf/general.m4
--- lib/autoconf/general.m4 Thu, 23 Aug 2001 21:34:53 +0200 akim
+++ lib/autoconf/general.m4 Thu, 23 Aug 2001 22:39:22 +0200 akim
@@ -509,24 +509,21 @@ m4_define([AC_REVISION],
 # Update this `AC_PREREQ' statement to require the current version of
 # Autoconf.  But fail if ever this autoupdate is too old.
 #
-# Note that `m4_defn([AC_ACVERSION])' below are expanded before calling
+# Note that `m4_defn([m4_acversion])' below are expanded before calling
 # `AU_DEFUN', i.e., it is hard coded.  Otherwise it would be quite
-# complex for autoupdate to import the value of `AC_ACVERSION'.  We
-# could `AU_DEFUN' `AC_ACVERSION', but this would replace all its
+# complex for autoupdate to import the value of `m4_acversion'.  We
+# could `AU_DEFUN' `m4_acversion', but this would replace all its
 # occurrences with the current version of Autoconf, which is certainly
-# not what mean the user.
+# not what meant the user.
 AU_DEFUN([AC_PREREQ],
-[m4_if(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
-    [m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
-[AC_PREREQ(]]m4_defn([AC_ACVERSION])[[)]])
+[m4_version_prereq([$1])[]dnl
+[AC_PREREQ(]]m4_defn([m4_acversion])[[)]])
 
 
 # AC_PREREQ(VERSION)
 # ------------------
 # Complain and exit if the Autoconf version is less than VERSION.
-m4_define([AC_PREREQ],
-[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
-     [AC_FATAL([Autoconf version $1 or higher is required for this script])])])
+m4_copy([m4_version_prereq], [AC_PREREQ])
 
 
 
@@ -548,7 +545,7 @@ m4_define([AC_PREREQ],
 m4_define([_AC_INIT_NOTICE],
 [m4_divert_text([HEADER-COMMENT],
 address@hidden:@ Guess values for system-dependent variables and create 
Makefiles.
address@hidden:@ Generated by Autoconf AC_ACVERSION[]dnl
address@hidden:@ Generated by Autoconf m4_acversion[]dnl
 m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
 
 m4_ifset([AC_PACKAGE_BUGREPORT],
@@ -1256,7 +1253,7 @@ m4_define([_AC_INIT_VERSION],
                          [dnl
 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-generated by GNU Autoconf AC_ACVERSION])])
+generated by GNU Autoconf m4_acversion])])
 m4_divert_text([VERSION_END],
 [_ACEOF
   exit 0
@@ -1277,7 +1274,7 @@ m4_define([_AC_INIT_CONFIG_LOG],
 
 It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
-generated by GNU Autoconf AC_ACVERSION.  Invocation command line was
+generated by GNU Autoconf m4_acversion.  Invocation command line was
 
   $ $[0] address@hidden
 
@@ -3225,7 +3222,7 @@ m4_define([_AC_OUTPUT_CONFIG_STATUS],
 
 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
-generated by GNU Autoconf AC_ACVERSION.  Invocation command line was
+generated by GNU Autoconf m4_acversion.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -3302,7 +3299,7 @@ Usage: $[0] [[OPTIONS]] [[FILE]]...
 ac_cs_version="\\
 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by [$]0, generated by GNU Autoconf AC_ACVERSION,
+configured by [$]0, generated by GNU Autoconf m4_acversion,
   with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\"
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Index: lib/autotest/autotest.m4
--- lib/autotest/autotest.m4 Thu, 23 Aug 2001 21:34:53 +0200 akim
+++ lib/autotest/autotest.m4 Thu, 23 Aug 2001 21:58:02 +0200 akim
@@ -47,5 +47,5 @@
 
 changequote()
 changequote([, ])
-include(m4sugar/m4sh.m4)
-m4_include(autotest/general.m4)
+include([m4sugar/m4sh.m4])
+m4_include([autotest/general.m4])
Index: lib/m4sugar/Makefile.am
--- lib/m4sugar/Makefile.am Sun, 19 Aug 2001 12:28:04 +0200 akim
+++ lib/m4sugar/Makefile.am Thu, 23 Aug 2001 22:05:33 +0200 akim
@@ -1,10 +1,28 @@
 ## Process this file with automake to create Makefile.in
 
-m4sugarlibdir = $(pkgdatadir)/m4sugar
+distm4sugarlibdir = $(pkgdatadir)/m4sugar
+# We ship version.m4 so that it's in src.  `autoconf' wants all the sources
+# at the same place...
+distm4sugarlib_DATA = version.m4 m4sugar.m4 m4sh.m4
+
+EXTRA_DIST = $(distm4sugarlib_DATA) version.in
+
+
+## ------------ ##
+## version.m4.  ##
+## ------------ ##
+
+# - version.m4 needs to be updated only once, since it depends on
+#   configure.ac, not on the results of a 'configure' run.
+# - It is guaranteed (with GNU Make) that when the version in configure.ac
+#   is changed, version.m4 is built only after the new version number is
+#   propagated to the Makefile.  (Libtool uses the same guarantee.)
+
+$(srcdir)/version.m4: $(srcdir)/version.in $(top_srcdir)/configure.ac
+       sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/version.in >version.tm4
+       mv version.tm4 $(srcdir)/version.m4
 
-m4sugarlib_DATA = m4sugar.m4 m4sh.m4
 
-EXTRA_DIST = $(m4sugarlib_DATA)
 
 
 ## --------------- ##
@@ -23,7 +41,7 @@
 
 check-local:
        if (cd $(srcdir) && \
-           egrep '^_?EOF' $(m4sugarlib_DATA)) >eof.log; then \
+           egrep '^_?EOF' $(distm4sugarlib_DATA)) >eof.log; then \
          echo "ERROR: user EOF tags were used:" >&2; \
          sed "s,^,$*.m4: ," <eof.log >&2; \
          echo >&2; \
Index: lib/m4sugar/m4sugar.m4
--- lib/m4sugar/m4sugar.m4 Thu, 23 Aug 2001 21:34:53 +0200 akim
+++ lib/m4sugar/m4sugar.m4 Thu, 23 Aug 2001 21:33:36 +0200 akim
@@ -1696,6 +1696,22 @@ m4_define([m4_version_compare],
              (m4_split(m4_version_unletter([$2]), [\.])))])
 
 
+# m4_acversion
+# ------------
+m4_include([m4sugar/version.m4])
+
+
+# m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL])
+# ----------------------------------------------------
+# Check this Autoconf version against VERSION.
+m4_define([m4_version_prereq],
+[m4_if(m4_version_compare(m4_defn([m4_acversion]), [$1]), -1,
+       [m4_default([$3],
+                   [m4_fatal([Autoconf version $1 or higher is required])])],
+       [$2])[]dnl
+])
+
+
 
 ## ------------------- ##
 ## 12. File handling.  ##
Index: tests/Makefile.am
--- tests/Makefile.am Thu, 23 Aug 2001 21:34:53 +0200 akim
+++ tests/Makefile.am Thu, 23 Aug 2001 22:04:32 +0200 akim
@@ -50,8 +50,7 @@ testsuite: $(top_srcdir)/lib/m4sugar/m4s
            $(top_srcdir)/lib/autotest/general.m4 \
           atspecific.m4 \
            $(SUITE)
-       $(AUTOM4TE) \
-         -I $(srcdir) -I $(top_srcdir) -I $(top_srcdir)/lib \
+       $(AUTOM4TE) -I $(srcdir) -I $(top_srcdir)/lib \
          autotest/autotest.m4 suite.at -o address@hidden
        chmod +x address@hidden
        mv address@hidden $@
Index: tests/suite.at
--- tests/suite.at Thu, 23 Aug 2001 21:34:53 +0200 akim
+++ tests/suite.at Thu, 23 Aug 2001 21:35:28 +0200 akim
@@ -17,6 +17,10 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
+# We need a very up to date version of Autotest, more recent than that
+# needed by configure.ac.
+m4_version_prereq([2.52c])
+
 # Macros specialized for Autoconf testing.
 m4_include([atspecific.m4])
 
Index: lib/m4sugar/version.in
--- 0.710/lib/m4sugar/version.in Thu, 23 Aug 2001 23:05:50 +0200 akim ()
+++ lib/m4sugar/version.in Thu, 23 Aug 2001 11:28:37 +0200 akim
@@ -0,0 +1,5 @@
+# This file is part of Autoconf.                             -*- Autoconf -*-
+# Version of Autoconf.
+# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+m4_define([m4_acversion], address@hidden@])
Index: lib/autoconf/version.in
--- lib/autoconf/version.in Mon, 04 Jun 2001 18:29:01 +0200 akim
+++ 0.710(w)/lib/autoconf/version.in Thu, 23 Aug 2001 23:05:50 +0200 akim ()
@@ -1,5 +0,0 @@
-# This file is part of Autoconf.                             -*- Autoconf -*-
-# Version of Autoconf.
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
-
-m4_define([AC_ACVERSION], address@hidden@])



reply via email to

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