From 5874aab2926c00b7f11b72ff5a7fd550a04cfe79 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 1 Jun 1999 04:32:50 +0000 Subject: [PATCH] * depend.am: Add @AMDEP@ before `include', so that dependency tracking can be disabled. * depend2.am: Ditto, before all lines related with dependency tracking. * m4/depend.m4 (AM_DEP_TRACK): New macro, that documents --enable/disable-dependency-tracking and sets AMDEP accordingly. It is implicitly disabled if depcomp is missing. (AM_DEPENDENCIES): Disable dependency tracking unless it can be generated by side-effect. * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_DEP_TRACK. * automake.in (handle_dependencies): Add @AMDEP@ before the value of DEP_FILES. * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Handle DEP_FILES starting with `#'. --- ChangeLog | 15 +++++++++++++++ automake.in | 3 ++- depend.am | 2 +- depend2.am | 21 ++++++++++----------- m4/depend.m4 | 30 +++++++++++++++++++++++++++--- m4/depout.m4 | 2 +- m4/init.m4 | 1 + 7 files changed, 57 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 216c14c0f..b98b85d07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 1999-06-01 Alexandre Oliva + * depend.am: Add @AMDEP@ before `include', so that dependency + tracking can be disabled. + * depend2.am: Ditto, before all lines related with dependency + tracking. + * m4/depend.m4 (AM_DEP_TRACK): New macro, that documents + --enable/disable-dependency-tracking and sets AMDEP accordingly. + It is implicitly disabled if depcomp is missing. + (AM_DEPENDENCIES): Disable dependency tracking unless it can be + generated by side-effect. + * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_DEP_TRACK. + * automake.in (handle_dependencies): Add @AMDEP@ before the value + of DEP_FILES. + * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Handle DEP_FILES + starting with `#'. + * depcomp: Support -xM for dependency generation, for Sun CC. Reported by Alex Hornby * m4/depend.m4: Extract the list of supported dependency-tracking diff --git a/automake.in b/automake.in index e90edfc02..a1e3bf6c2 100755 --- a/automake.in +++ b/automake.in @@ -2650,7 +2650,8 @@ sub handle_dependencies '$(SHELL) $(top_srcdir)/depcomp'); } - &define_pretty_variable ('DEP_FILES', '', sort keys %dep_files); + &define_pretty_variable ('DEP_FILES', '', ('@AMDEP@', + sort keys %dep_files)); $output_rules .= &file_contents ('depend'); push (@clean, 'depend'); &push_phony_cleaners ('depend'); diff --git a/depend.am b/depend.am index b94f1d63f..49b5d82a3 100644 --- a/depend.am +++ b/depend.am @@ -16,7 +16,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -include $(DEP_FILES) +@AMDEP@include $(DEP_FILES) mostlyclean-depend: diff --git a/depend2.am b/depend2.am index 1067eb522..114adb5ac 100644 --- a/depend2.am +++ b/depend2.am @@ -21,23 +21,22 @@ ## can use to run a compilation. You should set the shell variables ## `file' and `compile' first. -@FPFX@DEPMODE = @@FPFX@DEPMODE@ +@AMDEP@@FPFX@DEPMODE = @@FPFX@DEPMODE@ @EXT@.o: - source='$<' object='$@' \ - depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ - $(@FPFX@DEPMODE) $(depcomp) \ +@AMDEP@ source='$<' object='$@' \ +@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ +@AMDEP@ $(@FPFX@DEPMODE) $(depcomp) \ $(@PFX@COMPILE) -c@MINUSO@ $< LIBTOOL@EXT@.lo: -LIBTOOL source='$<' object='$@' \ -LIBTOOL depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \ -LIBTOOL $(@FPFX@DEPMODE) $(depcomp) \ +LIBTOOL@AMDEP@ source='$<' object='$@' \ +LIBTOOL@AMDEP@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \ +LIBTOOL@AMDEP@ $(@FPFX@DEPMODE) $(depcomp) \ LIBTOOL $(LT@PFX@COMPILE) -c -o $@ $< OBJEXT@EXT@.obj: -OBJEXT source='$<' object='$@' \ -OBJEXT depfile='$(DEPDIR)/$*.Pobj' tmpdepfile='$(DEPDIR)/$*.TPobj' \ -OBJEXT $(@FPFX@DEPMODE) $(depcomp) \ +OBJEXT@AMDEP@ source='$<' object='$@' \ +OBJEXT@AMDEP@ depfile='$(DEPDIR)/$*.Pobj' tmpdepfile='$(DEPDIR)/$*.TPobj' \ +OBJEXT@AMDEP@ $(@FPFX@DEPMODE) $(depcomp) \ OBJEXT $(@PFX@COMPILE) -c@MINUSO@ `cygpath -w $<` - diff --git a/m4/depend.m4 b/m4/depend.m4 index 23cdadccd..23ba0bf3a 100644 --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -23,15 +23,22 @@ depcc="$[$1]" depcpp=""]) AC_MSG_CHECKING([dependency style of $depcc]) AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[ -am_depcomp=${am_depcomp-"$ac_aux_dir/depcomp"} -if test -f "$am_depcomp"; then +if test -z "$AMDEP"; then echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h am_cv_[$1]_dependencies_compiler_type=none for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do case "$depmode" in - nosideeffect) continue ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; none) break ;; esac if depmode="$depmode" \ @@ -65,3 +72,20 @@ else fi AC_SUBST(DEPDIR) ]) + +AC_DEFUN(AM_DEP_TRACK,[ +AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" = xno; then + AMDEP="#" +else + am_depcomp="$ac_aux_dir/depcomp" + if test ! -f "$am_depcomp"; then + AMDEP="#" + else + AMDEP= + fi +fi +AC_SUBST(AMDEP) +]) diff --git a/m4/depout.m4 b/m4/depout.m4 index f4d821c94..069921c08 100644 --- a/m4/depout.m4 +++ b/m4/depout.m4 @@ -15,7 +15,7 @@ for mf in $CONFIG_FILES; do */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac - grep '^DEP_FILES = ..*' < "$mf" > /dev/null || continue + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` diff --git a/m4/init.m4 b/m4/init.m4 index 7943c1e36..205859747 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -33,6 +33,7 @@ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AM_MISSING_PROG(AMTAR, tar, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET]) +AC_REQUIRE([AM_DEP_TRACK]) AC_REQUIRE([AM_SET_DEPDIR]) ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [ define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])]) -- 2.47.2