]> sourceware.org Git - automake.git/commitdiff
* tests/version4.test: New file.
authorTom Tromey <tromey@redhat.com>
Sat, 9 Jun 2001 00:34:28 +0000 (00:34 +0000)
committerTom Tromey <tromey@redhat.com>
Sat, 9 Jun 2001 00:34:28 +0000 (00:34 +0000)
* automake.in (version_check): New sub.
(handle_options): Use it.
* tests/Makefile.am (AUTOMAKE_OPTIONS): Removed.
(TESTS): Added version4.test.
* m4/Makefile.am (AUTOMAKE_OPTIONS): Removed.
* Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits'.

ChangeLog
Makefile.am
Makefile.in
automake.in
m4/Makefile.am
m4/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/version4.test [new file with mode: 0755]

index 9ceb31d41f52a954a4ec3fd692e90ee4ea06d92a..15d1bb602483e08c9cdea32c3c5a9c3d58d6f7eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-06-08  Tom Tromey  <tromey@redhat.com>
+
+       * tests/version4.test: New file.
+       * automake.in (version_check): New sub.
+       (handle_options): Use it.
+       * tests/Makefile.am (AUTOMAKE_OPTIONS): Removed.
+       (TESTS): Added version4.test.
+       * m4/Makefile.am (AUTOMAKE_OPTIONS): Removed.
+       * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits'.
+
 2001-06-04  Kevin Dalley  <kevind@rahul.net>
 
        * lib/am/dejagnu.am (site.exp): Fix typo.
index 2323573cdbbaac16c3de18893b184c62aa1db56d..ca90339688664dab43482f3f96ea8c8b9b8758fb 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = gnits 1.4 dist-bzip2
+AUTOMAKE_OPTIONS = 1.4 dist-bzip2
 
 ## We need `.' in SUBDIRS because we want `check' to build `.' before
 ## tests.
index 7e904aad0fa5658a799a103a5b4c07f1f8472dda..9f19b74e67afb08c874d66b58ffb2f8f79bbc7cb 100644 (file)
@@ -66,7 +66,7 @@ _am_include = @_am_include@
 _am_quote = @_am_quote@
 install_sh = @install_sh@
 
-AUTOMAKE_OPTIONS = gnits 1.4 dist-bzip2
+AUTOMAKE_OPTIONS = 1.4 dist-bzip2
 
 SUBDIRS = . m4 lib tests
 
index 2a6df3c8e0a597aeb99984e2ca19281d1fefac7c..d7d7feb76c496a04d672a22cdc5a3b10d3a33499 100755 (executable)
@@ -1324,6 +1324,69 @@ sub generate_makefile
 
 ################################################################
 
+# A helper which handles the logic of requiring a version number in
+# AUTOMAKE_OPTIONS.  Return 1 on error, 0 on success.
+sub version_check ($$$$)
+{
+    my ($rmajor, $rminor, $ralpha, $rfork) = ($1, $2, $3, $4);
+
+    &prog_error ("version is incorrect: $VERSION")
+       if $VERSION !~ /(\d+)\.(\d+)([a-z]?)-?([A-Za-z0-9]+)?/;
+
+    my ($tmajor, $tminor, $talpha, $tfork) = ($1, $2, $3, $4);
+
+    $rfork ||= '';
+    $tfork ||= '';
+
+    my $rminorminor = 0;
+    my $tminorminor = 0;
+
+    # Some versions were labelled like `1.4-p3a'.  This is the same as
+    # an alpha release labelled `1.4.3a'.  However, a version like
+    # `1.4g' is the same as `1.4.99g'.  Yes, this sucks.  Moral:
+    # always listen to the users.
+    if ($rfork =~ /p([0-9]+)([a-z]?)/)
+    {
+       $rminorminor = $1;
+       # `1.4a-p3b' never existed.  But we'll accept it anyway.
+       $ralpha = $ralpha || $2 || '';
+       $rfork = '';
+    }
+    if ($tfork =~ /p([0-9]+)([a-z]?)/)
+    {
+       $tminorminor = $1;
+       # `1.4a-p3b' never existed.  But we'll accept it anyway.
+       $talpha = $talpha || $2 || '';
+       $tfork = '';
+    }
+
+    $rminorminor = 99 if $ralpha ne '' && $rminorminor == 0;
+    $tminorminor = 99 if $talpha ne '' && $tminorminor == 0;
+
+    # 2.0 is better than 1.0.
+    # 1.2 is better than 1.1.
+    # 1.2a is better than 1.2.
+    # If we require 3.4n-foo then we require something
+    # >= 3.4n, with the `foo' fork identifier.
+    # The $r* variables are what the user specified.
+    # The $t* variables denote automake itself.
+    if ($rmajor > $tmajor
+       || ($rmajor == $tmajor && $rminor > $tminor)
+       || ($rminor == $tminor && $rminor == $tminor
+           && $rminorminor > $tminorminor)
+       || ($rminor == $tminor && $rminor == $tminor
+           && $rminorminor == $tminorminor
+           && $ralpha gt $talpha)
+       || ($rfork ne '' && $rfork ne $tfork))
+    {
+       &am_line_error ('AUTOMAKE_OPTIONS',
+                       "require version $_, but have $VERSION");
+       return 1;
+    }
+
+    return 0;
+}
+
 # Handle AUTOMAKE_OPTIONS variable.  Return 1 on error, 0 otherwise.
 sub handle_options
 {
@@ -1364,32 +1427,10 @@ sub handle_options
            elsif (/(\d+)\.(\d+)([a-z]?)(-[A-Za-z0-9]+)?/)
            {
                # Got a version number.
-
-               my ($rmajor, $rminor, $ralpha, $rfork) = ($1, $2, $3, $4);
-
-               &prog_error ("version is incorrect: $VERSION")
-                 if $VERSION !~ /(\d+)\.(\d+)([a-z]?)(-[A-Za-z0-9]+)?/;
-
-               my ($tmajor, $tminor, $talpha, $tfork) = ($1, $2, $3, $4);
-
-               $rfork ||= '';
-               $tfork ||= '';
-
-               # 2.0 is better than 1.0.
-               # 1.2 is better than 1.1.
-               # 1.2a is better than 1.2.
-               # If we require 3.4n-foo then we require something
-               # >= 3.4n, with the `foo' fork identifier.
-               if ($rmajor > $tmajor
-                   || ($rmajor == $tmajor && $rminor > $tminor)
-                   || ($rminor == $tminor && $rminor == $tminor
-                       && $ralpha gt $talpha)
-                   || ($rfork ne '' && $rfork ne $tfork))
-                 {
-                   &am_line_error ('AUTOMAKE_OPTIONS',
-                                   "require version $_, but have $VERSION");
+               if (version_check ($1, $2, $3, $4))
+               {
                    return 1;
-                 }
+               }
            }
            else
            {
index 4c016886b29c8e82f16a6527cc76023ee099af83..3825b3e216bd67e8d17958889bd173400429960c 100644 (file)
@@ -1,7 +1,5 @@
 ## Process this file with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = gnits
-
 m4datadir = $(datadir)/aclocal
 m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
index c69295cdb57931a0b0fe4cc32653835a146b7b6c..40ed2c9d221a13ce15ccc3a56ad56311bb037c0f 100644 (file)
@@ -66,8 +66,6 @@ _am_include = @_am_include@
 _am_quote = @_am_quote@
 install_sh = @install_sh@
 
-AUTOMAKE_OPTIONS = gnits
-
 m4datadir = $(datadir)/aclocal
 m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
index 96e633b40b6fee42ec5a49fccd376d1cd26d24ff..ba99fc02b00d061fadcf077c735ad2d574c5eb28 100644 (file)
@@ -1,7 +1,5 @@
 ## Process this file with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = gnits
-
 XFAIL_TESTS = subdir5.test
 
 TESTS =        \
@@ -285,6 +283,7 @@ vartar.test \
 version.test \
 version2.test \
 version3.test \
+version4.test \
 vpath.test \
 vtexi.test \
 vtexi2.test \
index 4a9574a7a9ed48be1f7139565e4c726d52ea746c..f88d16ba5ce9f037307ddb35e6636df8e18caa74 100644 (file)
@@ -66,8 +66,6 @@ _am_include = @_am_include@
 _am_quote = @_am_quote@
 install_sh = @install_sh@
 
-AUTOMAKE_OPTIONS = gnits
-
 XFAIL_TESTS = subdir5.test
 
 TESTS = \
@@ -351,6 +349,7 @@ vartar.test \
 version.test \
 version2.test \
 version3.test \
+version4.test \
 vpath.test \
 vtexi.test \
 vtexi2.test \
diff --git a/tests/version4.test b/tests/version4.test
new file mode 100755 (executable)
index 0000000..9744b59
--- /dev/null
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+# Test to make sure we are compatible with the 1.4-p1 series.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = 1.4-p3
+END
+
+$AUTOMAKE
This page took 0.050141 seconds and 5 git commands to generate.