1 # Generate code to set up dependency tracking. -*- Autoconf -*-
3 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
4 # Free Software Foundation, Inc.
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
12 # _AM_OUTPUT_DEPENDENCY_COMMANDS
13 # ------------------------------
14 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
16 # Autoconf 2.62 quotes --file arguments for eval, but not when files
17 # are listed without --file. Let's play safe and only enable the eval
18 # if we detect the quoting.
20 *\'*) eval set x "$CONFIG_FILES" ;;
21 *) set x $CONFIG_FILES ;;
26 # Strip MF so we end up with the name of the file.
27 mf=`echo "$mf" | sed -e 's/:.*$//'`
28 # Check whether this is an Automake generated Makefile or not.
29 # We used to match only the files named `Makefile.in', but
30 # some people rename them; so instead we look at the file content.
31 # Grep'ing the first line is not enough: some people post-process
32 # each Makefile.in and add a new line on top of each file to say so.
33 # Grep'ing the whole file is not good either: AIX grep has a line
34 # limit of 2048, but all sed's we know have understand at least 4000.
35 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36 dirpart=`AS_DIRNAME("$mf")`
40 # Extract the definition of DEPDIR, am__include, and am__quote
41 # from the Makefile without running `make'.
42 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
43 test -z "$DEPDIR" && continue
44 am__include=`sed -n 's/^am__include = //p' < "$mf"`
45 test -z "am__include" && continue
46 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
47 # When using ansi2knr, U may be empty or an underscore; expand it
48 U=`sed -n 's/^U = //p' < "$mf"`
49 # Find all dependency output files, they are included files with
50 # $(DEPDIR) in their names. We invoke sed twice because it is the
51 # simplest approach to changing $(DEPDIR) to its actual value in the
54 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
55 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
56 # Make sure the directory exists.
57 test -f "$dirpart/$file" && continue
58 fdir=`AS_DIRNAME(["$file"])`
59 AS_MKDIR_P([$dirpart/$fdir])
60 # echo "creating $dirpart/$file"
61 echo '# dummy' > "$dirpart/$file"
65 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
68 # AM_OUTPUT_DEPENDENCY_COMMANDS
69 # -----------------------------
70 # This macro should only be invoked once -- use via AC_REQUIRE.
72 # This code is only required when automatic dependency tracking
73 # is enabled. FIXME. This creates each `.P' file that we will
74 # need in order to bootstrap the dependency handling code.
75 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
76 [AC_CONFIG_COMMANDS([depfiles],
77 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
78 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])