maint: it seems APIVERSION only changes for minor/major releases.
[automake.git] / m4 / depout.m4
blob9870f52c6ddad28f56d73e30503295476faad2f6
1 # Generate code to set up dependency tracking.              -*- Autoconf -*-
3 # Copyright (C) 1999-2024 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # _AM_OUTPUT_DEPENDENCY_COMMANDS
10 # ------------------------------
11 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
13   # Older Autoconf quotes --file arguments for eval, but not when files
14   # are listed without --file.  Let's play safe and only enable the eval
15   # if we detect the quoting.
16   # TODO: see whether this extra hack can be removed once we start
17   # requiring Autoconf 2.70 or later.
18   AS_CASE([$CONFIG_FILES],
19           [*\'*], [eval set x "$CONFIG_FILES"],
20           [*], [set x $CONFIG_FILES])
21   shift
22   # Used to flag and report bootstrapping failures.
23   am_rc=0
24   for am_mf
25   do
26     # Strip MF so we end up with the name of the file.
27     am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
28     # Check whether this is an Automake generated Makefile which includes
29     # dependency-tracking related rules and includes.
30     # Grep'ing the whole file directly is not great: AIX grep has a line
31     # limit of 2048, but all sed's we know have understand at least 4000.
32     sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
33       || continue
34     am_dirpart=`AS_DIRNAME(["$am_mf"])`
35     am_filepart=`AS_BASENAME(["$am_mf"])`
36     AM_RUN_LOG([cd "$am_dirpart" \
37       && sed -e '/# am--include-marker/d' "$am_filepart" \
38         | $MAKE -f - am--depfiles]) || am_rc=$?
39   done
40   if test $am_rc -ne 0; then
41     AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
42     for automatic dependency tracking.  If GNU make was not used, consider
43     re-running the configure script with MAKE="gmake" (or whatever is
44     necessary).  You can also try re-running configure with the
45     '--disable-dependency-tracking' option to at least be able to build
46     the package (albeit without support for automatic dependency tracking).])
47   fi
48   AS_UNSET([am_dirpart])
49   AS_UNSET([am_filepart])
50   AS_UNSET([am_mf])
51   AS_UNSET([am_rc])
52   rm -f conftest-deps.mk
54 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
57 # AM_OUTPUT_DEPENDENCY_COMMANDS
58 # -----------------------------
59 # This macro should only be invoked once -- use via AC_REQUIRE.
61 # This code is only required when automatic dependency tracking is enabled.
62 # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
63 # order to bootstrap the dependency handling code.
64 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
65 [AC_CONFIG_COMMANDS([depfiles],
66      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
67      [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])