libtool
[Top][All Lists]
Advanced

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

Re: compile problem


From: Alexandre Duret-Lutz
Subject: Re: compile problem
Date: Tue, 07 Sep 2004 23:03:10 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Gary" == Gary V Vaughan <address@hidden> writes:

[...]

 >>> On Mon, Aug 23, 2004 at 08:29:07PM +0100, Patrick Welche wrote:
 >>> 
 >>>> I just tried to build cvs libtool with cvs auto* all from today, and get:
 >>>> 
 >>>> make  all-recursive
 >>>> Making all in .
>>> cd . && /bin/ksh /usr/src/local/libtool/config/missing --run automake-1.9a 
>>> --gnits 
 >>>> libltdl/Makefile.am: C objects with per-target flags but `AM_PROG_CC_C_O' 
 >>>> not in `configure.ac'

[...]

 Gary> Libtool has a non compiler specific version of that macro called
 Gary> _LT_COMPILER_C_O which is automatically called by LT_INIT.

 Gary> Do we need to patch automake to accept LT_INIT for
 Gary> subdir-objects projects, or do you think AC_PROG_CC_C_O
 Gary> should be merged with _LT_COMPILER_C_O?

It's AM_PROG_CC_C_O Automake needs, not AC_PROG_CC_C_O.

I'm installing the following.

2004-09-07  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (lang_c_rewrite): Do not require AM_PROG_CC_C_O for
        libtool objects.
        (handle_single_transform): Pass nonansi_obj to &$subr so
        lang_c_rewrite can distinguish libtool objects.
        * tests/libtool7.test: Use subdir-objects without using AM_PROG_CC_C_O.
        Report from Gary V. Vaughan and Patrick Welche.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1578
diff -u -r1.1578 automake.in
--- automake.in 7 Sep 2004 19:52:47 -0000       1.1578
+++ automake.in 7 Sep 2004 21:00:34 -0000
@@ -1576,7 +1576,8 @@
             # further.
             my $subr = \&{'lang_' . $lang->name . '_rewrite'};
             my ($r, $source_extension)
-               = &$subr ($directory, $base, $extension, $have_per_exec_flags);
+               = &$subr ($directory, $base, $extension,
+                         $nonansi_obj, $have_per_exec_flags);
             # Skip this entry if we were asked not to process it.
             next if $r == LANG_IGNORE;
 
@@ -5079,7 +5080,7 @@
 # Rewrite a single C source file.
 sub lang_c_rewrite
 {
-  my ($directory, $base, $ext, $have_per_exec_flags) = @_;
+  my ($directory, $base, $ext, $nonansi_obj, $have_per_exec_flags) = @_;
 
   if (option 'ansi2knr' && $base =~ /_$/)
     {
@@ -5091,13 +5092,17 @@
   if (option 'subdir-objects')
     {
       $r = LANG_SUBDIR;
-      $base = $directory . '/' . $base
-       unless $directory eq '.' || $directory eq '';
+      if ($directory && $directory ne '.')
+       {
+         $base = $directory . '/' . $base;
 
-      err_am ("C objects in subdir but `AM_PROG_CC_C_O' "
-             . "not in `$configure_ac'",
-             uniq_scope => US_GLOBAL)
-       unless $seen_cc_c_o;
+         # libtool is always able to put the object at the proper place,
+         # so we do not have to require AM_PROG_CC_C_O when building .lo files.
+         err_am ("C objects in subdir but `AM_PROG_CC_C_O' "
+                 . "not in `$configure_ac'",
+                 uniq_scope => US_GLOBAL)
+           unless $seen_cc_c_o || $nonansi_obj eq '.lo';
+       }
 
       # In this case we already have the directory information, so
       # don't add it again.
@@ -5110,7 +5115,10 @@
                               : "$directory/");
     }
 
-  if (! $seen_cc_c_o && $have_per_exec_flags && ! option 'subdir-objects')
+  if (! $seen_cc_c_o
+      && $have_per_exec_flags
+      && ! option 'subdir-objects'
+      && $nonansi_obj ne '.lo')
     {
       err_am ("C objects with per-target flags but `AM_PROG_CC_C_O' "
              . "not in `$configure_ac'",
Index: tests/libtool7.test
===================================================================
RCS file: /cvs/automake/automake/tests/libtool7.test,v
retrieving revision 1.1
diff -u -r1.1 libtool7.test
--- tests/libtool7.test 31 Jan 2003 23:40:58 -0000      1.1
+++ tests/libtool7.test 7 Sep 2004 21:00:34 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -33,8 +33,9 @@
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 lib_LTLIBRARIES = libmod1.la mod2.la
-libmod1_la_SOURCES = mod1.c
+libmod1_la_SOURCES = sub/mod1.c
 libmod1_la_LDFLAGS = -module
 libmod1_la_LIBADD = -dlopen mod2.la
 mod2_la_SOURCES = mod2.c
@@ -50,9 +51,9 @@
 
 END
 
-mkdir liba
+mkdir sub liba
 
-cat > mod1.c << 'END'
+cat > sub/mod1.c << 'END'
 int
 mod1 ()
 {

-- 
Alexandre Duret-Lutz





reply via email to

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