From 73c3333694a8c7826161178896a56c639efa84df Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 1 Jan 2004 21:57:23 +0000 Subject: [PATCH] * automake.in (handle_languages): Do not define DEP_FILES. * m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Extract included files with $(DEPDIR) in their name instead of DEP_FILES. * tests/depend.test, tests/depend4.test, tests/exsource.test: Adjust. Suggested by Tom Tromey. --- ChangeLog | 7 +++++++ automake.in | 8 -------- m4/depout.m4 | 31 +++++++++++++------------------ tests/depend.test | 12 ++++++------ tests/depend4.test | 14 +++++++------- tests/exsource.test | 15 ++++++--------- 6 files changed, 39 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22fc55f9..2ea6f49e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-01-01 Alexandre Duret-Lutz + * automake.in (handle_languages): Do not define DEP_FILES. + * m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Extract included + files with $(DEPDIR) in their name instead of DEP_FILES. + * tests/depend.test, tests/depend4.test, tests/exsource.test: + Adjust. + Suggested by Tom Tromey. + Do not output .lo rules for programs and static libraries objects, and do not output .o/.obj rules for libtool libraries. This is about explicit rules only, not inference rules. diff --git a/automake.in b/automake.in index ff444148..dc54b445 100755 --- a/automake.in +++ b/automake.in @@ -1005,14 +1005,6 @@ sub handle_languages require_conf_file ("$am_file.am", FOREIGN, 'depcomp'); my @deplist = sort keys %dep_files; - - # We define this as a conditional variable because BSD - # make can't handle backslashes for continuing comments on - # the following line. - define_pretty_variable ('DEP_FILES', - new Automake::Condition ('AMDEP_TRUE'), - INTERNAL, @deplist); - # Generate each `include' individually. Irix 6 make will # not properly include several files resulting from a # variable expansion; generating many separate includes diff --git a/m4/depout.m4 b/m4/depout.m4 index 7d899f0c..27cf6abc 100644 --- a/m4/depout.m4 +++ b/m4/depout.m4 @@ -1,6 +1,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -36,27 +37,21 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], else continue fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue + am__include=`sed -n -e '/^am__include = / s///p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n -e '/^am__quote = / s///p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n -e " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue diff --git a/tests/depend.test b/tests/depend.test index 99862007..99e1ccb9 100755 --- a/tests/depend.test +++ b/tests/depend.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 1997, 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -24,6 +24,8 @@ . ./defs || exit 1 +set -e + echo AC_PROG_CC >> configure.in cat > Makefile.am << 'END' @@ -32,9 +34,7 @@ fred_SOURCES = \ fred.c END -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +$ACLOCAL +$AUTOMAKE -# In this case we no longer expect to find DEP_FILES. -grep '^DEP_FILES = *$' Makefile.in && exit 1 -exit 0 +test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l` diff --git a/tests/depend4.test b/tests/depend4.test index 4a1d4f80..6f156f06 100755 --- a/tests/depend4.test +++ b/tests/depend4.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -18,13 +18,15 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -# check that 'DEP_FILES' is defined when there are many header files +# Check that dependencies are included when there are many header files. . ./defs || exit 1 +set -e + echo AC_PROG_CC >> configure.in -$ACLOCAL || exit 1 +$ACLOCAL headers= for header in one.h two.h three.h four.h five.h six.h @@ -35,9 +37,7 @@ bin_PROGRAMS = fred fred_SOURCES = fred1.c $headers END - $AUTOMAKE || exit 1 + $AUTOMAKE - $EGREP '^(@[^@]+@)*DEP_FILES = ' Makefile.in || exit 1 + test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l` done - -exit 0 diff --git a/tests/exsource.test b/tests/exsource.test index 46f7a230..44737ec9 100755 --- a/tests/exsource.test +++ b/tests/exsource.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2004 # Free Software Foundation, Inc. # # This file is part of GNU Automake. @@ -22,26 +22,23 @@ # Test to make sure EXTRA_..._SOURCES actually works. # Bug report from Henrik Frystyk Nielsen. -required=GNUmake . ./defs || exit 1 -cat >> configure.in << 'END' -AC_PROG_CC -END +set -e + +echo AC_PROG_CC >> configure.in cat > Makefile.am << 'END' bin_PROGRAMS = www www_SOURCES = www.c EXTRA_www_SOURCES = xtra.c www_LDADD = @extra_stuff@ -magic: - @echo $(DEP_FILES) END : > www.c : > xtra.c -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +$ACLOCAL +$AUTOMAKE grep '@am__include@ .*/xtra\.P' Makefile.in -- 2.43.5