2001-12-30 Tom Tromey <tromey@redhat.com>
+ For PR automake/211:
+ * automake.in (object_compilation_map): New global.
+ (initialize_per_input): Initialize it.
+ (COMPILE_LIBTOOL): New constant.
+ (COMPILE_ORDINARY): Likewise.
+ * tests/Makefile.am (TESTS): Added pr211.test.
+ * tests/pr211.test: New file.
+
For PR automake/215:
* configure.in: Use AM_AUTOMAKE_OPTIONS.
* Makefile.am (AUTOMAKE_OPTIONS): Removed.
my $LANG_PROCESS = 1;
my $LANG_SUBDIR = 2;
+# These are used when keeping track of whether an object can be built
+# by two different paths.
+my $COMPILE_LIBTOOL = 1;
+my $COMPILE_ORDINARY = 2;
+
# Map from obsolete macros to hints for new macros.
# If you change this, change the corresponding list in aclocal.in.
# FIXME: should just put this into a single file.
# by a single source file.
my %object_map;
+# This hash maps object file names onto an integer value representing
+# whether this object has been built via ordinary compilation or
+# libtool compilation (the COMPILE_* constants).
+my %object_compilation_map;
+
+
# This keeps track of the directories for which we've already
# created `.dirstamp' code.
my %directory_map;
@dist_sources = ();
%object_map = ();
+ %object_compilation_map = ();
%directory_map = ();
}
}
+ my $comp_val = (($object =~ /\.lo$/)
+ ? $COMPILE_LIBTOOL : $COMPILE_ORDINARY);
+ (my $comp_obj = $object) =~ s/\.lo$/.\$(OBJEXT)/;
+ if (defined $object_compilation_map{$comp_obj}
+ && $object_compilation_map{$comp_obj} != 0
+ # Only see the error once.
+ && ($object_compilation_map{$comp_obj}
+ != ($COMPILE_LIBTOOL | $COMPILE_ORDINARY))
+ && $object_compilation_map{$comp_obj} != $comp_val)
+ {
+ am_error ("object `$object' created both with libtool and without");
+ }
+ $object_compilation_map{$comp_obj} |= $comp_val;
+
if (defined $lang) {
# Let the language do some special magic if required.
$lang->target_hook ($aggregate, $object, $full);
--- /dev/null
+#! /bin/sh
+
+# Test for PR 211.
+
+requires=libtoolize
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(Makefile.am)
+AM_INIT_AUTOMAKE(hello,0.23)
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = helldl
+lib_LTLIBRARIES = libfoo.la
+helldl_SOURCES = foo.c
+libfoo_la_SOURCES = foo.c
+END
+
+libtoolize || exit 1
+$ACLOCAL || exit 1
+$AUTOMAKE -a && exit 1
+exit 0