Compatibility with recent: automake-1.10-5
[macros.git] / AutoGen.pm
index e2829e5..861177e 100644 (file)
@@ -498,7 +498,6 @@ my($class,%options)=@_;
                          "clean"    ,\$Options{"ARGV_clean"},
                          "fullclean",\$Options{"ARGV_fullclean"},
                        "h|help"     ,sub { print _help(); exit 0; },
-                       $Options{"GetOptions_args"},
                        ) || @ARGV;
 
        for my $subdir (map((!$_ ? () : @$_),$Options{"subdirs"})) {
@@ -587,9 +586,29 @@ my($class,%options)=@_;
        # "ChangeLog" is reqd by automake(1)
        # Don't remove it afterwards as it may still be needed during automatic automake Makefile rebuilds
        File::Touch->new("atime_only"=>1)->touch("ChangeLog") if !$Options{"ChangeLog"};
-       _system qw(automake --add-missing),@copy_arg;
+       _system qw(automake --add-missing -Wno-portability),@copy_arg;
        _system qw(autoconf);
-       _writefile "| patch configure",<<'CONFIGURE_SUBST_X_EOF';
+       for my $patch (
+                       <<'CONFIGURE_SUBST_X_EOF',
+--- configure-orig     2007-03-27 01:13:44.000000000 +0200
++++ configure  2007-03-27 01:17:07.000000000 +0200
+@@ -3749,7 +3749,13 @@
+   rm -f "$tmp/stdin"
+   case $ac_file in
+   -) cat "$tmp/out"; rm -f "$tmp/out";;
+-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
++  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file
++     for f in $ac_file_inputs; do
++       if test -x $f; then
++         chmod +x $ac_file
++       fi
++     done
++     ;;
+   esac
+  ;;
+CONFIGURE_SUBST_X_EOF
+                       <<'CONFIGURE_SUBST_X_EOF',
 --- configure-orig     Wed Aug 20 12:10:37 2003
 +++ configure  Wed Aug 20 13:22:51 2003
 @@ -21590,6 +21590,11 @@
@@ -605,6 +624,15 @@ my($class,%options)=@_;
      cat $tmp/out
      rm -f $tmp/out
 CONFIGURE_SUBST_X_EOF
+                       undef(),
+                       ) {
+               confess if !$patch;
+               last if eval {
+                       _writefile "| patch configure",$patch;
+                       1;
+                       };
+               _remove "nocheck","./configure.rej";
+               }
        _remove "nocheck","./configure.orig";   # It is usually produced by 'CONFIGURE_SUBST_X'.
        # Why it is left there after RedHat autoconf-2.53-8 ?
        _remove "nocheck",\1,"autom4te-*.cache";