libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 1.5] testsuite failures: missing AM_PROG_CC_C_O


From: Ralf Wildenhues
Subject: Re: [PATCH 1.5] testsuite failures: missing AM_PROG_CC_C_O
Date: Fri, 10 Sep 2004 11:04:09 +0200
User-agent: Mutt/1.4.1i

* Alexandre Duret-Lutz wrote on Fri, Sep 10, 2004 at 09:34:06AM CEST:
> >>> "Ralf" == Ralf Wildenhues <address@hidden> writes:
> 
>  >> Makefile.am: C objects with per-target flags but `AM_PROG_CC_C_O' not in 
> `configure.ac'
> 
>  Ralf> So then this must be a bug in Automake, right?
> 
> No.  Your patch and initial explanation look correct to me.
> 
> Another way (untested) to fix {,p}demo/Makefile.am would be to rename
> libhell0_a_CFLAGS = $(AM_CFLAGS)
> into 
> libhell1_la_CFLAGS = $(AM_CFLAGS)
> so that per-targets flags apply to libtool objects (which won't
> need AM_PROG_CC_C_O).

Thank you very much.  The patch below fixes the complaint for good
(tested!).  That should be sufficient for the testsuite, since it is not
to be expected that someone runs several of the demo-*.tests at the same
time.

But: there's a potential problem here for end-users:  Say, someone wants
some file.c compiled into a LTLIBRARY as well as into a (completely
unrelated non-libtool-using) binary.  Now Automake warns about `objects
created both with libtool and without', so he gives at least one of them
per-target flags.  which should fix just this.

Now what happens?  Will `compile' be used? [*]

Because then, since the file will be compiled in two different ways (one
with Libtool and one without), AND since `compile' and `libtool' have
different locking schemes, there is a potential for silent breakage in
parallel builds, iff the compiler does not understand -c -o.

I see two ways out: either make both use the same locking scheme,
or tell users not to do that.  But I might have just missed an obvious
protection against this.

Cheers,
Ralf

[*] A quick test showed that in the demo/ example, `compile' will not be
used, even if ac_cv_compiler_c_o=no, because some macro overwrites CC
within the configure run (and does not reset it).  Seems broken to me.
I can provide more details on this if this seems to be non-intended, but
I would first like to understand the issue better.


2004-09-10  Alexandre Duret-Lutz  <address@hidden>,
            Ralf Wildenhues  <address@hidden>
        * demo/Makefile.am, pdemo/Makefile.am: Use per-target CFLAGS
        only for the Libtool-built objects, so that automake won't
        complain about missing AM_PROG_CC_C_O but still compile Libtool-
        and non-Libtool objects into different names.
 

Index: demo/Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/demo/Attic/Makefile.am,v
retrieving revision 1.29.2.1
diff -u -r1.29.2.1 Makefile.am
--- demo/Makefile.am    12 Aug 2004 14:41:57 -0000      1.29.2.1
+++ demo/Makefile.am    10 Sep 2004 07:52:40 -0000
@@ -7,6 +7,7 @@
 # Build a libtool library, libhello.la for installation in libdir.
 lib_LTLIBRARIES = libhello.la
 libhello_la_SOURCES = hello.c foo.c
+libhello_la_CFLAGS = $(AM_CFLAGS)
 libhello_la_LIBADD = $(LIBM)
 libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
 
@@ -123,7 +124,6 @@
 # If this one passes with pass_all, it is likely that pass_all works
 EXTRA_LIBRARIES = libhell0.a
 libhell0_a_SOURCES = hello.c foo.c
-libhell0_a_CFLAGS = $(AM_CFLAGS)
 EXTRA_LTLIBRARIES = libhell1.la libhell2.la
 libhell1_la_SOURCES = hell1.c
 libhell1_la_LIBADD = -L. -lhell0
Index: pdemo/Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/pdemo/Attic/Makefile.am,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 Makefile.am
--- pdemo/Makefile.am   12 Aug 2004 14:41:57 -0000      1.6.2.1
+++ pdemo/Makefile.am   10 Sep 2004 07:52:40 -0000
@@ -7,6 +7,7 @@
 # Build a libtool library, libhello.la for installation in libdir.
 lib_LTLIBRARIES = libhello.la
 libhello_la_SOURCES = longer_file_name_hello.c longer_file_name_foo.c 
longer_file_name_foo2.c
+libhello_la_CFLAGS = $(AM_CFLAGS)
 libhello_la_LIBADD = $(LIBM)
 libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
 
@@ -123,7 +124,6 @@
 # If this one passes with pass_all, it is likely that pass_all works
 EXTRA_LIBRARIES = libhell0.a
 libhell0_a_SOURCES = longer_file_name_hello.c longer_file_name_foo.c
-libhell0_a_CFLAGS = $(AM_CFLAGS)
 EXTRA_LTLIBRARIES = libhell1.la libhell2.la
 libhell1_la_SOURCES = longer_file_name_hell1.c
 libhell1_la_LIBADD = -L. -lhell0




reply via email to

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