depout.m4 2.9 KB

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