+2004-09-07 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * 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.
+
2004-09-07 Andreas Schwab <schwab@suse.de>
* automake.in ($PATH_PATTERN): Add `+'.
Support AC_REQUIRE_AUX_FILE, and fix requirement of AM_PROG_CC_C_O.
* automake.in (%required_aux_file): New hash.
- (handle_single_transform, lang_c_rewrite): Do note explicitly
+ (handle_single_transform, lang_c_rewrite): Do not explicitly
require 'compile', this is now an internal detail of
AM_PROG_CC_C_O.
(scan_autoconf_traces): Trace AC_REQUIRE_AUX_FILE and fill
* configure.ac, m4/init.m4: Require Autoconf 2.59a.
* doc/automake.texi (Optional): Document AC_REQUIRE_AUX_FILE.
(Program and Library Variables, Options, Public macros):
- AC_PROG_CC_C_O is required when per-target flags or subdir-objects
+ AM_PROG_CC_C_O is required when per-target flags or subdir-objects
are used with C sources.
* m4/minuso.m4: Require `compile' using AC_REQUIRE_AUX_FILE.
* m4/missing.m4: Require `missing' similarly.
# 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;
# 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 =~ /_$/)
{
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.
: "$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'",
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
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
END
-mkdir liba
+mkdir sub liba
-cat > mod1.c << 'END'
+cat > sub/mod1.c << 'END'
int
mod1 ()
{