automake-patches
[Top][All Lists]
Advanced

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

perl <5.8.2 Getopt::Long


From: Ralf Wildenhues
Subject: perl <5.8.2 Getopt::Long
Date: Sun, 30 Apr 2006 09:15:51 +0200
User-agent: Mutt/1.5.11+cvs20060403

On a powerpc-ibm-aix5.1.0.0 system, automake.test failed because
Getopt::Long fails to treat arguments starting with "--" as non-option
ones if passed after "--":

| + AUTOMAKE_fails -- --voo
| automake: unrecognized option `--voo'.
| automake: Try `/tmp/build-powerpc-ibm-aix5.1.0.0/automake --help' for more 
information.
| + grep input file.*--voo stderr
| FAIL: automake.test

with /bin/perl which is
| This is perl, v5.6.0 built for aix

but passes with
| This is perl, v5.8.2 built for aix-thread-multi

as the older one apparently has a bug in Getopt::Long with regard to
reordering long options from after `--'.


I can reproduce this bug on many systems:

powerpc-ibm-aix5.2.0.0, v5.8.0 built for aix-thread-multi
sparc-sun-solaris2.9,   v5.6.1 built for sun4-solaris-64int
i386-unknown-netbsdelf3.0, v5.8.0 built for i386-netbsd
alphaev68-dec-osf5.1b, 5.8.0

which all have in common that Getopt/Long.pm version is <= 2.32.

perl-5.8.2 has Getopt/Long.pm version 2.34 and seems to have this bug
fixed.  I assume this change (Getopt/Long/CHANGES):
| * Fix a pass_through bug where the options terminator (normally "--")
|   was not passed through in @ARGV.
|   Thanks to Philippe Verdret.

can be attributed to it.

I don't know if it's too strict to require perl-5.8.2, given the
systems that have an older native versions.  So, how about this?
Would you rather have two tests and warn also users with perl x,
5.6 <= x < 5.8.2, in configure.ac?

Cheers,
Ralf

        * configure.ac: Recommend perl-5.8.2.
        * tests/automake.test: Do not fail because of buggy Getopt::Long
        in perl < 5.8.2.

Index: configure.ac
===================================================================
RCS file: /cvs/automake/automake/configure.ac,v
retrieving revision 1.26
diff -u -r1.26 configure.ac
--- configure.ac        14 May 2005 20:28:50 -0000      1.26
+++ configure.ac        30 Apr 2006 07:13:17 -0000
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+# 2004, 2006  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -58,8 +58,9 @@
 fi
 $PERL -e 'require 5.006;' || {
    AC_MSG_ERROR(
-[perl 5.6 or better is required.  If you have several perl
-versions installed, select the one Automake should use using
+[perl 5.6 or better is required; perl 5.8.2 or better
+is recommended.  If you have several perl versions
+installed, select the one Automake should use using
   ./configure PERL=/path/to/perl])
 }
 
Index: tests/automake.test
===================================================================
RCS file: /cvs/automake/automake/tests/automake.test,v
retrieving revision 1.3
diff -u -r1.3 automake.test
--- tests/automake.test 14 May 2005 20:28:54 -0000      1.3
+++ tests/automake.test 30 Apr 2006 07:11:14 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -27,8 +27,11 @@
 $AUTOMAKE --version
 AUTOMAKE_fails --voo
 grep 'unrecognized option.*--voo' stderr
-AUTOMAKE_fails -- --voo
-grep 'input file.*--voo' stderr
+# older perl has a buggy Getopt::Long which makes this fail.
+if $PERL -e 'require 5.8.2;'; then
+  AUTOMAKE_fails -- --voo
+  grep 'input file.*--voo' stderr
+fi
 AUTOMAKE_fails ''
 grep 'empty argument' stderr
 AUTOMAKE_fails -W




reply via email to

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