From 9546995bd3a54e299df1a02ca6be6136080ad917 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 25 Mar 1998 22:42:04 +0000 Subject: [PATCH] fixed bugs with versions in AUTOMAKE_OPTIONS --- ChangeLog | 2 ++ automake.in | 17 ++++++++++------- tests/ChangeLog | 5 +++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/badopt.test | 12 ++++++++++++ tests/version3.test | 12 ++++++++++++ 7 files changed, 43 insertions(+), 9 deletions(-) create mode 100755 tests/badopt.test create mode 100755 tests/version3.test diff --git a/ChangeLog b/ChangeLog index edd74397..4ca14d5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Wed Mar 25 15:09:56 1998 Tom Tromey + * 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. diff --git a/automake.in b/automake.in index 2b49d472..41ce3d5f 100755 --- a/automake.in +++ b/automake.in @@ -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"); } } } diff --git a/tests/ChangeLog b/tests/ChangeLog index 846304e7..d1e5caa1 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 25 15:30:39 1998 Tom Tromey + + * badopt.test: new file. + * version3.test: New file. + Mon Mar 23 10:52:36 1998 Tom Tromey * libobj8.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index e5f60220..704e0ba9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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) diff --git a/tests/Makefile.in b/tests/Makefile.in index 7a36f4a3..f3d0b3b6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 00000000..8a5b8864 --- /dev/null +++ b/tests/badopt.test @@ -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 index 00000000..4d5476c8 --- /dev/null +++ b/tests/version3.test @@ -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 -- 2.43.5