fixed bugs with versions in AUTOMAKE_OPTIONS
authorTom Tromey <tromey@redhat.com>
Wed, 25 Mar 1998 22:42:12 +0000 (22:42 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 25 Mar 1998 22:42:12 +0000 (22:42 +0000)
ChangeLog
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/badopt.test [new file with mode: 0755]
tests/version3.test [new file with mode: 0755]

index edd7439..4ca14d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 Wed Mar 25 15:09:56 1998  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (handle_options): Support alpha version numbers.
+
        * lisp.am (install-@DIR@LISP): Allow .el files to appear in build
        directory.  From Gary V Vaughan.
 
index 2b49d47..41ce3d5 100755 (executable)
@@ -666,26 +666,29 @@ sub handle_options
            {
                $use_dependencies = 0;
            }
-           elsif (/([0-9]+)\.([0-9]+)/)
+           elsif (/([0-9]+)\.([0-9]+)([a-z])?/)
            {
                # Got a version number.  Note that alpha releases
                # count as the next higher release.  Note also that we
                # assume there will be a maximum of 100 minor releases
                # for any given major release.
 
-               local ($rmajor, $rminor) = ($1, $2);
+               local ($rmajor, $rminor, $ralpha) = ($1, $2);
                if ($VERSION !~ /([0-9]+)\.([0-9]+)([a-z])?/)
                {
                    print STDERR
                        "automake: programming error: version is incorrect\n";
                    exit 1;
                }
-               local ($tmajor, $tminor) = ($1, $2);
-               # Handle alpha versions.
-               ++$tminor if defined $3;
+               local ($tmajor, $tminor, $talpha) = ($1, $2, $3);
 
+               # 2.0 is better than 1.0.
+               # 1.2 is better than 1.1.
+               # 1.2a is better than 1.2.
                if ($rmajor > $tmajor
-                   || ($rmajor == $tmajor && $rminor > $tminor))
+                   || ($rmajor == $tmajor && $rminor > $tminor)
+                   || ($rminor == $tminor && $rminor == $tminor
+                       && $ralpha > $talpha))
                {
                    &am_line_error ('AUTOMAKE_OPTIONS',
                                    "require version $_, only have $VERSION");
@@ -695,7 +698,7 @@ sub handle_options
            else
            {
                &am_line_error ('AUTOMAKE_OPTIONS',
-                               'option ', $_, 'not recognized');
+                               "option \`" . $_ . "\' not recognized");
            }
        }
     }
index 846304e..d1e5caa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Mar 25 15:30:39 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * badopt.test: new file.
+       * version3.test: New file.
+
 Mon Mar 23 10:52:36 1998  Tom Tromey  <tromey@cygnus.com>
 
        * libobj8.test: New file.
index e5f6022..704e0ba 100644 (file)
@@ -30,7 +30,7 @@ install.test libobj7.test objc.test cond3.test cxxcpp.test \
 aclocal.test alpha.test whoami.test unused.test condman.test \
 texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \
 java.test sinclude.test javaprim.test javasubst.test aclocalii.test \
-lex2.test libobj8.test
+lex2.test libobj8.test version3.test
 
 EXTRA_DIST = defs $(TESTS)
 
index 7a36f4a..f3d0b3b 100644 (file)
@@ -93,7 +93,7 @@ install.test libobj7.test objc.test cond3.test cxxcpp.test \
 aclocal.test alpha.test whoami.test unused.test condman.test \
 texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \
 java.test sinclude.test javaprim.test javasubst.test aclocalii.test \
-lex2.test libobj8.test
+lex2.test libobj8.test version3.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/badopt.test b/tests/badopt.test
new file mode 100755 (executable)
index 0000000..8a5b886
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# Test to make sure bad options cause error.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = zardoz
+END
+
+$AUTOMAKE && exit 1
+exit 0
diff --git a/tests/version3.test b/tests/version3.test
new file mode 100755 (executable)
index 0000000..4d5476c
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# Test to make sure version in AUTOMAKE_OPTIONS works.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = 1.3x
+END
+
+$AUTOMAKE && exit 1
+exit 0