automake-patches
[Top][All Lists]
Advanced

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

Patch: FYI: PR 211


From: Tom Tromey
Subject: Patch: FYI: PR 211
Date: 30 Dec 2001 18:11:36 -0700

I'm checking this in.
This is a test and a fix for PR 211.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>
        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.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1249
diff -u -r1.1249 automake.in
--- automake.in 2001/12/31 00:16:37 1.1249
+++ automake.in 2001/12/31 01:00:01
@@ -236,6 +236,11 @@
 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.
@@ -551,6 +556,12 @@
 # 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;
@@ -725,6 +736,7 @@
     @dist_sources = ();
 
     %object_map = ();
+    %object_compilation_map = ();
 
     %directory_map = ();
 
@@ -1966,6 +1978,20 @@
                 am_error ("object `$object' created by `$full' and 
`$object_map{$object}'");
             }
         }
+
+       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.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.362
diff -u -r1.362 Makefile.am
--- tests/Makefile.am 2001/12/30 23:46:27 1.362
+++ tests/Makefile.am 2001/12/31 01:00:01
@@ -240,6 +240,7 @@
 pluseq8.test \
 ppf77.test \
 pr2.test \
+pr211.test \
 pr220.test \
 pr243.test \
 pr266.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.469
diff -u -r1.469 Makefile.in
--- tests/Makefile.in 2001/12/30 23:46:28 1.469
+++ tests/Makefile.in 2001/12/31 01:00:01
@@ -313,6 +313,7 @@
 pluseq8.test \
 ppf77.test \
 pr2.test \
+pr211.test \
 pr220.test \
 pr243.test \
 pr266.test \
Index: tests/pr211.test
===================================================================
RCS file: pr211.test
diff -N pr211.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ tests/pr211.test Sun Dec 30 17:00:02 2001
@@ -0,0 +1,26 @@
+#! /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



reply via email to

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