From: Alexandre Duret-Lutz Date: Tue, 17 Sep 2002 20:53:08 +0000 (+0000) Subject: 2002-09-17 Assar Westerlund X-Git-Tag: Release-1-6d~5 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=8c233813a95878e51287546a2f3d6767b19e8a24;p=automake.git 2002-09-17 Assar Westerlund Alexandre Duret-Lutz * automake.in (handle_programs, handle_libraries, handle_ltlibraries): Maintain $seen_libobjs on a per-program/per-library basis, instead of globally to each of these functions. * tests/libobj12.test, tests/libobj12b.test: New files. * tests/Makefile.am (TESTS): Add libobj12.test and libobj12b.test. --- diff --git a/ChangeLog b/ChangeLog index a7246782..bff6e4f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-09-17 Assar Westerlund + Alexandre Duret-Lutz + + * automake.in (handle_programs, handle_libraries, + handle_ltlibraries): Maintain $seen_libobjs on a + per-program/per-library basis, instead of globally to each + of these functions. + * tests/libobj12.test, tests/libobj12b.test: New files. + * tests/Makefile.am (TESTS): Add libobj12.test and libobj12b.test. + 2002-09-17 Alexandre Duret-Lutz * tests/defs.in (configure.in): Don't call AC_PROG_INSTALL and diff --git a/automake.in b/automake.in index 85f3e718..7aa655a4 100755 --- a/automake.in +++ b/automake.in @@ -2201,10 +2201,10 @@ sub handle_languages # do this check. sub check_libobjs_sources { - my ($one_file, $unxformed) = @_; + my ($one_file, $unxformed) = @_; - foreach my $prefix ('', 'EXTRA_', 'dist_', 'nodist_', - 'dist_EXTRA_', 'nodist_EXTRA_') + foreach my $prefix ('', 'EXTRA_', 'dist_', 'nodist_', + 'dist_EXTRA_', 'nodist_EXTRA_') { my @files; if (variable_defined ($prefix . $one_file . '_SOURCES')) @@ -3090,108 +3090,95 @@ sub handle_libtool # Handle C programs. sub handle_programs { - my @proglist = &am_install_var ('progs', 'PROGRAMS', - 'bin', 'sbin', 'libexec', 'pkglib', - 'noinst', 'check'); - return if ! @proglist; + my @proglist = &am_install_var ('progs', 'PROGRAMS', + 'bin', 'sbin', 'libexec', 'pkglib', + 'noinst', 'check'); + return if ! @proglist; - my $seen_libobjs = 0; - foreach my $one_file (@proglist) + my $seen_global_libobjs = + variable_defined ('LDADD') && &handle_lib_objects ('', 'LDADD'); + + foreach my $one_file (@proglist) { - my $obj = &get_object_extension ($one_file); + my $seen_libobjs = 0; + my $obj = &get_object_extension ($one_file); - # Canonicalize names and check for misspellings. - my $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS', - '_SOURCES', '_OBJECTS', - '_DEPENDENCIES'); + # Canonicalize names and check for misspellings. + my $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS', + '_SOURCES', '_OBJECTS', + '_DEPENDENCIES'); - my $linker = &handle_source_transform ($xname, $one_file, $obj); + my $linker = &handle_source_transform ($xname, $one_file, $obj); - my $xt = ''; - if (variable_defined ($xname . "_LDADD")) + my $xt = ''; + if (variable_defined ($xname . "_LDADD")) { - if (&handle_lib_objects ($xname, $xname . '_LDADD')) - { - $seen_libobjs = 1; - } - $xt = '_LDADD'; + $seen_libobjs = &handle_lib_objects ($xname, $xname . '_LDADD'); + $xt = '_LDADD'; } - else + else { - # User didn't define prog_LDADD override. So do it. - &define_variable ($xname . '_LDADD', '$(LDADD)'); + # User didn't define prog_LDADD override. So do it. + &define_variable ($xname . '_LDADD', '$(LDADD)'); - # This does a bit too much work. But we need it to - # generate _DEPENDENCIES when appropriate. - if (variable_defined ('LDADD')) + # This does a bit too much work. But we need it to + # generate _DEPENDENCIES when appropriate. + if (variable_defined ('LDADD')) { - if (&handle_lib_objects ($xname, 'LDADD')) - { - $seen_libobjs = 1; - } + $seen_libobjs = $seen_global_libobjs; } - elsif (! variable_defined ($xname . '_DEPENDENCIES')) + elsif (! variable_defined ($xname . '_DEPENDENCIES')) { - &define_variable ($xname . '_DEPENDENCIES', ''); + &define_variable ($xname . '_DEPENDENCIES', ''); } - $xt = '_SOURCES' + $xt = '_SOURCES'; } - reject_var ($xname . '_LIBADD', - "use `${xname}_LDADD', not `${xname}_LIBADD'"); + reject_var ($xname . '_LIBADD', + "use `${xname}_LDADD', not `${xname}_LIBADD'"); - if (! variable_defined ($xname . '_LDFLAGS')) + if (! variable_defined ($xname . '_LDFLAGS')) { - # Define the prog_LDFLAGS variable. - &define_variable ($xname . '_LDFLAGS', ''); + # Define the prog_LDFLAGS variable. + &define_variable ($xname . '_LDFLAGS', ''); } - # Determine program to use for link. - my $xlink; - if (variable_defined ($xname . '_LINK')) + # Determine program to use for link. + my $xlink; + if (variable_defined ($xname . '_LINK')) { - $xlink = $xname . '_LINK'; + $xlink = $xname . '_LINK'; } - else + else { - $xlink = $linker ? $linker : 'LINK'; + $xlink = $linker ? $linker : 'LINK'; } - # If the resulting program lies into a subdirectory, - # make sure this directory will exist. - my $dirstamp = require_build_directory_maybe ($one_file); + # If the resulting program lies into a subdirectory, + # make sure this directory will exist. + my $dirstamp = require_build_directory_maybe ($one_file); - # Don't add $(EXEEXT) if user already did. - my $extension = ($one_file !~ /\$\(EXEEXT\)$/ - ? "\$(EXEEXT)" - : ''); + # Don't add $(EXEEXT) if user already did. + my $extension = ($one_file !~ /\$\(EXEEXT\)$/ + ? "\$(EXEEXT)" + : ''); - $output_rules .= &file_contents ('program', - ('PROGRAM' => $one_file, - 'XPROGRAM' => $xname, - 'XLINK' => $xlink, - 'DIRSTAMP' => $dirstamp, - 'EXEEXT' => $extension)); - } + $output_rules .= &file_contents ('program', + ('PROGRAM' => $one_file, + 'XPROGRAM' => $xname, + 'XLINK' => $xlink, + 'DIRSTAMP' => $dirstamp, + 'EXEEXT' => $extension)); - if (variable_defined ('LDADD') && &handle_lib_objects ('', 'LDADD')) - { - $seen_libobjs = 1; - } - - if ($seen_libobjs) - { - foreach my $one_file (@proglist) + if ($seen_libobjs || $seen_global_libobjs) { - my $xname = &canonicalize ($one_file); - - if (variable_defined ($xname . '_LDADD')) + if (variable_defined ($xname . '_LDADD')) { - &check_libobjs_sources ($xname, $xname . '_LDADD'); + &check_libobjs_sources ($xname, $xname . '_LDADD'); } - elsif (variable_defined ('LDADD')) + elsif (variable_defined ('LDADD')) { - &check_libobjs_sources ($xname, 'LDADD'); + &check_libobjs_sources ($xname, 'LDADD'); } } } @@ -3203,80 +3190,76 @@ sub handle_programs # Handle libraries. sub handle_libraries { - my @liblist = &am_install_var ('libs', 'LIBRARIES', - 'lib', 'pkglib', 'noinst', 'check'); - return if ! @liblist; + my @liblist = &am_install_var ('libs', 'LIBRARIES', + 'lib', 'pkglib', 'noinst', 'check'); + return if ! @liblist; - my @prefix = am_primary_prefixes ('LIBRARIES', 0, 'lib', 'pkglib', - 'noinst', 'check'); + my @prefix = am_primary_prefixes ('LIBRARIES', 0, 'lib', 'pkglib', + 'noinst', 'check'); - require_variables_for_macro ($prefix[0] . '_LIBRARIES', - 'library used', 'RANLIB') - if (@prefix); + require_variables_for_macro ($prefix[0] . '_LIBRARIES', + 'library used', 'RANLIB') + if (@prefix); - my $seen_libobjs = 0; - foreach my $onelib (@liblist) + foreach my $onelib (@liblist) { - # Check that the library fits the standard naming convention. - if (basename ($onelib) !~ /^lib.*\.a/) - { - # FIXME should put line number here. That means mapping - # from library name back to variable name. - err_am "`$onelib' is not a standard library name"; - } + my $seen_libobjs = 0; + # Check that the library fits the standard naming convention. + if (basename ($onelib) !~ /^lib.*\.a/) + { + # FIXME should put line number here. That means mapping + # from library name back to variable name. + err_am "`$onelib' is not a standard library name"; + } - my $obj = &get_object_extension ($onelib); + my $obj = &get_object_extension ($onelib); - # Canonicalize names and check for misspellings. - my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES', - '_OBJECTS', '_DEPENDENCIES', - '_AR'); + # Canonicalize names and check for misspellings. + my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES', + '_OBJECTS', '_DEPENDENCIES', + '_AR'); - if (! variable_defined ($xlib . '_AR')) + if (! variable_defined ($xlib . '_AR')) { - &define_variable ($xlib . '_AR', '$(AR) cru'); + &define_variable ($xlib . '_AR', '$(AR) cru'); } - if (variable_defined ($xlib . '_LIBADD')) + if (variable_defined ($xlib . '_LIBADD')) { - if (&handle_lib_objects ($xlib, $xlib . '_LIBADD')) + if (&handle_lib_objects ($xlib, $xlib . '_LIBADD')) { - $seen_libobjs = 1; + $seen_libobjs = 1; } } - else + else { - # Generate support for conditional object inclusion in - # libraries. - &define_variable ($xlib . "_LIBADD", ''); + # Generate support for conditional object inclusion in + # libraries. + &define_variable ($xlib . "_LIBADD", ''); } - reject_var ($xlib . '_LDADD', - "use `${xlib}_LIBADD', not `${xlib}_LDADD'"); + reject_var ($xlib . '_LDADD', + "use `${xlib}_LIBADD', not `${xlib}_LDADD'"); - # Make sure we at look at this. - &examine_variable ($xlib . '_DEPENDENCIES'); + # Make sure we at look at this. + &examine_variable ($xlib . '_DEPENDENCIES'); - &handle_source_transform ($xlib, $onelib, $obj); + &handle_source_transform ($xlib, $onelib, $obj); - # If the resulting library lies into a subdirectory, - # make sure this directory will exist. - my $dirstamp = require_build_directory_maybe ($onelib); + # If the resulting library lies into a subdirectory, + # make sure this directory will exist. + my $dirstamp = require_build_directory_maybe ($onelib); - $output_rules .= &file_contents ('library', - ('LIBRARY' => $onelib, - 'XLIBRARY' => $xlib, - 'DIRSTAMP' => $dirstamp)); - } + $output_rules .= &file_contents ('library', + ('LIBRARY' => $onelib, + 'XLIBRARY' => $xlib, + 'DIRSTAMP' => $dirstamp)); - if ($seen_libobjs) - { - foreach my $onelib (@liblist) + if ($seen_libobjs) { - my $xlib = &canonicalize ($onelib); - if (variable_defined ($xlib . '_LIBADD')) + if (variable_defined ($xlib . '_LIBADD')) { - &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); + &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); } } } @@ -3288,142 +3271,138 @@ sub handle_libraries # Handle shared libraries. sub handle_ltlibraries { - my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES', - 'noinst', 'lib', 'pkglib', 'check'); - return if ! @liblist; + my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES', + 'noinst', 'lib', 'pkglib', 'check'); + return if ! @liblist; - my %instdirs; - my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib', - 'noinst', 'check'); + my %instdirs; + my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib', + 'noinst', 'check'); - require_variables_for_macro ($prefix[0] . '_KTLIBRARIES', - 'Libtool library used', 'LIBTOOL') - if (@prefix); + require_variables_for_macro ($prefix[0] . '_KTLIBRARIES', + 'Libtool library used', 'LIBTOOL') + if (@prefix); - foreach my $key (@prefix) - { - # Get the installation directory of each library. - (my $dir = $key) =~ s/^nobase_//; - for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all')) - { - if ($instdirs{$_}) - { - err_am ("`$_' is already going to be installed in " - . "`$instdirs{$_}'"); - } - else - { - $instdirs{$_} = $dir; - } - } - } + foreach my $key (@prefix) + { + # Get the installation directory of each library. + (my $dir = $key) =~ s/^nobase_//; + for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all')) + { + if ($instdirs{$_}) + { + err_am ("`$_' is already going to be installed in " + . "`$instdirs{$_}'"); + } + else + { + $instdirs{$_} = $dir; + } + } + } - my $seen_libobjs = 0; - foreach my $onelib (@liblist) + foreach my $onelib (@liblist) { - my $obj = &get_object_extension ($onelib); + my $seen_libobjs = 0; + my $obj = &get_object_extension ($onelib); - # Canonicalize names and check for misspellings. - my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS', - '_SOURCES', '_OBJECTS', - '_DEPENDENCIES'); + # Canonicalize names and check for misspellings. + my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS', + '_SOURCES', '_OBJECTS', + '_DEPENDENCIES'); - if (! variable_defined ($xlib . '_LDFLAGS')) + if (! variable_defined ($xlib . '_LDFLAGS')) { - # Define the lib_LDFLAGS variable. - &define_variable ($xlib . '_LDFLAGS', ''); + # Define the lib_LDFLAGS variable. + &define_variable ($xlib . '_LDFLAGS', ''); } - # Check that the library fits the standard naming convention. - my $libname_rx = "^lib.*\.la"; - if ((variable_defined ($xlib . '_LDFLAGS') - && grep (/-module/, &variable_value_as_list_recursive ( - $xlib . '_LDFLAGS', 'all'))) - || (variable_defined ('LDFLAGS') - && grep (/-module/, &variable_value_as_list_recursive ( - 'LDFLAGS', 'all')))) + # Check that the library fits the standard naming convention. + my $libname_rx = "^lib.*\.la"; + if ((variable_defined ($xlib . '_LDFLAGS') + && grep (/-module/, + &variable_value_as_list_recursive ($xlib . '_LDFLAGS', + 'all'))) + || (variable_defined ('LDFLAGS') + && grep (/-module/, + &variable_value_as_list_recursive ('LDFLAGS', 'all')))) { - # Relax name checking for libtool modules. - $libname_rx = "\.la"; + # Relax name checking for libtool modules. + $libname_rx = "\.la"; + } + if (basename ($onelib) !~ /$libname_rx$/) + { + # FIXME should put line number here. That means mapping + # from library name back to variable name. + msg_am ('error-gnu/warn', + "`$onelib' is not a standard libtool library name"); } - if (basename ($onelib) !~ /$libname_rx$/) - { - # FIXME should put line number here. That means mapping - # from library name back to variable name. - msg_am ('error-gnu/warn', - "`$onelib' is not a standard libtool library name"); - } - if (variable_defined ($xlib . '_LIBADD')) + if (variable_defined ($xlib . '_LIBADD')) { - if (&handle_lib_objects ($xlib, $xlib . '_LIBADD')) + if (&handle_lib_objects ($xlib, $xlib . '_LIBADD')) { - $seen_libobjs = 1; + $seen_libobjs = 1; } } - else + else { - # Generate support for conditional object inclusion in - # libraries. - &define_variable ($xlib . "_LIBADD", ''); + # Generate support for conditional object inclusion in + # libraries. + &define_variable ($xlib . "_LIBADD", ''); } - reject_var ("${xlib}_LDADD", - "use `${xlib}_LIBADD', not `${xlib}_LDADD'"); + reject_var ("${xlib}_LDADD", + "use `${xlib}_LIBADD', not `${xlib}_LDADD'"); - # Make sure we at look at this. - &examine_variable ($xlib . '_DEPENDENCIES'); + # Make sure we at look at this. + &examine_variable ($xlib . '_DEPENDENCIES'); - my $linker = &handle_source_transform ($xlib, $onelib, $obj); + my $linker = &handle_source_transform ($xlib, $onelib, $obj); - # Determine program to use for link. - my $xlink; - if (variable_defined ($xlib . '_LINK')) + # Determine program to use for link. + my $xlink; + if (variable_defined ($xlib . '_LINK')) { - $xlink = $xlib . '_LINK'; + $xlink = $xlib . '_LINK'; } - else + else { - $xlink = $linker ? $linker : 'LINK'; + $xlink = $linker ? $linker : 'LINK'; } - my $rpath; - if ($instdirs{$onelib} eq 'EXTRA' - || $instdirs{$onelib} eq 'noinst' - || $instdirs{$onelib} eq 'check') + my $rpath; + if ($instdirs{$onelib} eq 'EXTRA' + || $instdirs{$onelib} eq 'noinst' + || $instdirs{$onelib} eq 'check') { - # It's an EXTRA_ library, so we can't specify -rpath, - # because we don't know where the library will end up. - # The user probably knows, but generally speaking automake - # doesn't -- and in fact configure could decide - # dynamically between two different locations. - $rpath = ''; + # It's an EXTRA_ library, so we can't specify -rpath, + # because we don't know where the library will end up. + # The user probably knows, but generally speaking automake + # doesn't -- and in fact configure could decide + # dynamically between two different locations. + $rpath = ''; } - else + else { - $rpath = ('-rpath $(' . $instdirs{$onelib} . 'dir)'); + $rpath = ('-rpath $(' . $instdirs{$onelib} . 'dir)'); } - # If the resulting library lies into a subdirectory, - # make sure this directory will exist. - my $dirstamp = require_build_directory_maybe ($onelib); + # If the resulting library lies into a subdirectory, + # make sure this directory will exist. + my $dirstamp = require_build_directory_maybe ($onelib); - $output_rules .= &file_contents ('ltlibrary', - ('LTLIBRARY' => $onelib, - 'XLTLIBRARY' => $xlib, - 'RPATH' => $rpath, - 'XLINK' => $xlink, - 'DIRSTAMP' => $dirstamp)); - } - - if ($seen_libobjs) - { - foreach my $onelib (@liblist) + $output_rules .= &file_contents ('ltlibrary', + ('LTLIBRARY' => $onelib, + 'XLTLIBRARY' => $xlib, + 'RPATH' => $rpath, + 'XLINK' => $xlink, + 'DIRSTAMP' => $dirstamp)); + if ($seen_libobjs) { - my $xlib = &canonicalize ($onelib); - if (variable_defined ($xlib . '_LIBADD')) + if (variable_defined ($xlib . '_LIBADD')) { - &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); + &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); } } } diff --git a/tests/Makefile.am b/tests/Makefile.am index d3efb409..c58aac13 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -218,6 +218,8 @@ libobj7.test \ libobj8.test \ libobj10.test \ libobj11.test \ +libobj12.test \ +libobj12b.test \ library.test \ library2.test \ libtool.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 942ffbcc..c24cce76 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -309,6 +309,8 @@ libobj7.test \ libobj8.test \ libobj10.test \ libobj11.test \ +libobj12.test \ +libobj12b.test \ library.test \ library2.test \ libtool.test \ diff --git a/tests/libobj12.test b/tests/libobj12.test new file mode 100755 index 00000000..0e4ef9c3 --- /dev/null +++ b/tests/libobj12.test @@ -0,0 +1,74 @@ +#! /bin/sh +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + + +# Test if a file can be mentioned in LIBOBJS and explicitly. +# (See libobj12b.test for the LTLIBRARIES check.) + +. $srcdir/defs || exit 1 +set -e + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_LIBOBJ([foo]) +AC_LIBOBJ([bar]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libfoo.a libbar.a +noinst_PROGRAMS = p1 p2 + +libfoo_a_SOURCES = +libfoo_a_LIBADD = @LIBOBJS@ + +libbar_a_SOURCES = foo.c + +p1_SOURCES = +p1_LDADD = @LIBOBJS@ + +p2_SOURCES = bar.c +END + +: > foo.c +: > bar.c + +$ACLOCAL +$AUTOMAKE + +# This however should be diagnosed, since foo.c and bar.c are in @LIBOBJS@. +echo 'libfoo_a_SOURCES += foo.c' >> Makefile.am +echo 'p1_SOURCES += bar.c' >> Makefile.am +$AUTOMAKE 2>stderr && exit 1 +cat stderr +$FGREP foo.c stderr +$FGREP bar.c stderr + +# Global `LDADD' can also come into play. +cat > Makefile.am << 'END' +noinst_PROGRAMS = a b +LDADD = @LIBOBJS@ +END +$AUTOMAKE +echo 'a_SOURCES = foo.c' >> Makefile.am +$AUTOMAKE 2>stderr && exit 1 +cat stderr +$FGREP foo.c stderr diff --git a/tests/libobj12b.test b/tests/libobj12b.test new file mode 100755 index 00000000..2b697022 --- /dev/null +++ b/tests/libobj12b.test @@ -0,0 +1,54 @@ +#! /bin/sh +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + + +# Test if a file can be mentioned in LTLIBOBJS and explicitly. +# (Like libobj12.test, but for Libtool libraries.) + +required='libtoolize' +. $srcdir/defs || exit 1 +set -e + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_LIBTOOL +AC_LIBOBJ([foo]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +noinst_LTLIBRARIES = libfoo.la libbar.la + +libfoo_la_SOURCES = +libfoo_la_LIBADD = @LTLIBOBJS@ + +libbar_la_SOURCES = foo.c +END + +: > foo.c + +$ACLOCAL +$AUTOMAKE --add-missing + +# This however should be diagnosed, since foo.c is in @LIBOBJS@. +echo 'libfoo_la_SOURCES += foo.c' >> Makefile.am +$AUTOMAKE 2>stderr && exit 1 +cat stderr +$FGREP foo.c stderr