From: Tom Tromey Date: Wed, 25 Mar 1998 22:42:12 +0000 (+0000) Subject: fixed bugs with versions in AUTOMAKE_OPTIONS X-Git-Tag: Release-1-3~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=663ab7c8ebb111eb9905c6e7a8205fad4d43a552;p=thirdparty%2Fautomake.git fixed bugs with versions in AUTOMAKE_OPTIONS --- diff --git a/ChangeLog b/ChangeLog index edd743975..4ca14d5aa 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 2b49d4729..41ce3d5fa 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 846304e7d..d1e5caa14 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 e5f602204..704e0ba95 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 7a36f4a3c..f3d0b3b60 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 000000000..8a5b88643 --- /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 000000000..4d5476c85 --- /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