automake-patches
[Top][All Lists]
Advanced

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

getting rid of DEP_FILES


From: Alexandre Duret-Lutz
Subject: getting rid of DEP_FILES
Date: Thu, 01 Jan 2004 22:31:32 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Thomas" == Thomas Fitzsimmons <address@hidden> writes:

[...]

 Thomas> - Tom suggested that DEP_FILES may be redundant.  He suggested that
 Thomas> configure read the list of .Plo files from the am__include lines in
 Thomas> Makefile.in.

Is this close to what you had in mind?

2004-01-01  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1532
diff -u -r1.1532 automake.in
--- automake.in 1 Jan 2004 18:54:20 -0000       1.1532
+++ automake.in 1 Jan 2004 21:28:26 -0000
@@ -1005,14 +1005,6 @@
            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
Index: m4/depout.m4
===================================================================
RCS file: /cvs/automake/automake/m4/depout.m4,v
retrieving revision 1.15
diff -u -r1.15 depout.m4
--- m4/depout.m4        2 Jun 2003 07:08:40 -0000       1.15
+++ m4/depout.m4        1 Jan 2004 21:28:34 -0000
@@ -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 @@
   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
Index: tests/depend.test
===================================================================
RCS file: /cvs/automake/automake/tests/depend.test,v
retrieving revision 1.6
diff -u -r1.6 depend.test
--- tests/depend.test   14 Nov 2003 21:25:58 -0000      1.6
+++ tests/depend.test   1 Jan 2004 21:28:34 -0000
@@ -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.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 'address@hidden@@am__include@' Makefile.in | wc -l`
Index: tests/depend4.test
===================================================================
RCS file: /cvs/automake/automake/tests/depend4.test,v
retrieving revision 1.4
diff -u -r1.4 depend4.test
--- tests/depend4.test  14 Nov 2003 21:25:58 -0000      1.4
+++ tests/depend4.test  1 Jan 2004 21:28:34 -0000
@@ -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 @@
 fred_SOURCES = fred1.c $headers
 END
 
-    $AUTOMAKE || exit 1
+    $AUTOMAKE
 
-    $EGREP '^(@address@hidden@)*DEP_FILES = ' Makefile.in || exit 1
+    test 1 = `grep 'address@hidden@@am__include@' Makefile.in | wc -l`
 done
-
-exit 0
Index: tests/exsource.test
===================================================================
RCS file: /cvs/automake/automake/tests/exsource.test,v
retrieving revision 1.17
diff -u -r1.17 exsource.test
--- tests/exsource.test 14 Nov 2003 21:25:58 -0000      1.17
+++ tests/exsource.test 1 Jan 2004 21:28:34 -0000
@@ -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


-- 
Alexandre Duret-Lutz





reply via email to

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