From: Alexandre Duret-Lutz Date: Tue, 7 Sep 2004 21:03:32 +0000 (+0000) Subject: * automake.in (lang_c_rewrite): Do not require AM_PROG_CC_C_O for X-Git-Tag: Release-1-9b~310 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc0c91c3f36df359d41f3f7862360ea01104a202;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 6f1f8ff7c..227842a0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-09-07 Alexandre Duret-Lutz + + * 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 * automake.in ($PATH_PATTERN): Add `+'. @@ -69,7 +78,7 @@ 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 @@ -82,7 +91,7 @@ * 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. diff --git a/automake.in b/automake.in index d89eca5d7..f799689d2 100755 --- a/automake.in +++ b/automake.in @@ -1576,7 +1576,8 @@ sub handle_single_transform ($$$$$%) # 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 @@ sub lang_sub_obj # 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 @@ sub lang_c_rewrite 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 @@ sub lang_c_rewrite : "$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'", diff --git a/tests/libtool7.test b/tests/libtool7.test index 29b4d9191..c40a3f089 100755 --- a/tests/libtool7.test +++ b/tests/libtool7.test @@ -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 @@ AC_OUTPUT 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 @@ print: END -mkdir liba +mkdir sub liba -cat > mod1.c << 'END' +cat > sub/mod1.c << 'END' int mod1 () {