[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoreconf fails when LT_INIT and AC_SUBST are both present in confi
From: |
Christian Egli |
Subject: |
Re: autoreconf fails when LT_INIT and AC_SUBST are both present in configure.ac |
Date: |
Wed, 11 Nov 2009 12:31:23 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) |
Ralf Wildenhues <address@hidden> writes:
> * Ilker R Capoglu wrote on Tue, Nov 10, 2009 at 06:54:48PM CET:
>> When I have both LT_INIT and AC_SUBST macros inside my
>> "configure.ac", autoreconf fails:
>> $ autoreconf -vif
>> autoreconf: Entering directory `.'
>> autoreconf: configure.ac: not using Gettext
>> autoreconf: running: aclocal --force -I m4
>> Use of uninitialized value $msg in concatenation (.) or string at
>> /usr/bin/autom4te line 1038.
>
> This is very suspicious, more so since 2.64 has a comment in that line.
> Does Ubuntu have local patches in its Autoconf tree not in upstream?
The diffs can be found at
http://archive.ubuntu.com/ubuntu/pool/main/a/autoconf/autoconf_2.64-1ubuntu1.diff.gz.
There seems to be a packaging bug in that the diff contains itself, but
aside from that the changes seem pretty harmles. In particular the diff
contains no mentioning of the string '$msg', so I don't know if it is
really the cause of above error. Below are the relevant excerpts from
the diff.
Thanks
Christian
--- autoconf-2.64.orig/lib/Autom4te/C4che.pm
+++ autoconf-2.64/lib/Autom4te/C4che.pm
@@ -37,6 +37,8 @@
use Carp;
use strict;
+my $VERSION = 'Mon Jul 27 20:42:01 PDT 2009';
+
=over 4
=item @request
@@ -182,7 +184,7 @@
$file->seek (0, 0);
$file->truncate (0);
print $file
- "# This file was generated.\n",
+ "# This file was generated by Autom4te $VERSION.\n",
"# It contains the lists of macros which have been traced.\n",
"# It can be safely removed.\n",
"\n",
@@ -196,6 +198,16 @@
=cut
+#
+# GOOD_VERSION ($FILE)
+sub good_version ($$)
+{
+ my ($self, $file) = @_;
+ my ($line) = $file->getline;
+
+ return defined ($line) && scalar ($line =~ / $VERSION.$/);
+}
+
# LOAD ($FILE)
# ------------
sub load ($$)
--- autoconf-2.64.orig/bin/autom4te.in
+++ autoconf-2.64/bin/autom4te.in
@@ -545,13 +545,21 @@
# stdout is to be handled by hand :(. Don't use fdopen as it means
# we will close STDOUT, which we already do in END.
my $out = new Autom4te::XFile;
- if ($output eq '-')
+ my $atomic_replace;
+ if ($output eq '-' || (-e $output && ! -f $output))
{
$out->open (">$output");
+ $atomic_replace = 0;
}
else
{
- $out->open($output, O_CREAT | O_WRONLY | O_TRUNC, oct ($mode));
+ $out->open("$output.tmp", O_CREAT | O_WRONLY | O_TRUNC, oct ($mode));
+ if ($out) {
+ $atomic_replace = 1;
+ } else {
+ $out->open($output, O_CREAT | O_WRONLY | O_TRUNC, oct ($mode));
+ $atomic_replace = 0;
+ }
}
fatal "cannot create $output: $!"
unless $out;
@@ -590,6 +598,11 @@
$out->close();
+ if ($atomic_replace && !rename("$output.tmp", "$output")) {
+ move ("${output}.tmp", "$output")
+ or fatal "cannot rename ${output}.tmp as $output: $!";
+ }
+
# If no forbidden words, we're done.
return
if ! %prohibited;
@@ -987,7 +1000,8 @@
# If autom4te is younger, then some structures such as C4che might
# have changed, which would corrupt its processing.
Autom4te::C4che->load ($icache_file)
- if -f $icache && mtime ($icache) > mtime ($0);
+ if -f $icache && mtime ($icache) > mtime ($0)
+ && Autom4te::C4che->good_version ($icache_file);
# Add the new trace requests.
my $req = Autom4te::C4che->request ('input' => address@hidden,
--- autoconf-2.64.orig/bin/autoreconf.in
+++ autoconf-2.64/bin/autoreconf.in
@@ -125,6 +125,8 @@
my $aclocal_supports_force = 0;
# Does automake support --force-missing?
my $automake_supports_force_missing = 0;
+# Does libtoolize support --install?
+my $libtoolize_supports_install = 0;
my @prepend_include;
my @include;
@@ -185,6 +187,7 @@
$aclocal_supports_force = `$aclocal --help 2>/dev/null` =~ /--force/;
$automake_supports_force_missing = `$automake --help 2>/dev/null` =~
/--force-missing/;
+ $libtoolize_supports_install = `$libtoolize --help` =~ /--install/;
# Dispatch autoreconf's option to the tools.
# --include;
@@ -199,8 +202,9 @@
{
$automake .= ' --add-missing';
$automake .= ' --copy' unless $symlink;
- $libtoolize .= ' --copy' unless $symlink;
+ $libtoolize .= ' --install' if $libtoolize_supports_install;
}
+ $libtoolize .= ' --copy' unless $symlink;
# --force;
if ($force)
{
@@ -528,7 +532,7 @@
{
verb "$configure_ac: not using Libtool";
}
- elsif ($install)
+ elsif ($install || $libtoolize_supports_install)
{
if ($uses_libltdl)
{