]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
doc: user conditional for dependency tracking.
authorKarl Berry <karl@freefriends.org>
Mon, 30 Oct 2023 17:14:51 +0000 (10:14 -0700)
committerKarl Berry <karl@freefriends.org>
Mon, 30 Oct 2023 17:14:51 +0000 (10:14 -0700)
* doc/automake.texi (Automatic dependency tracking): Describe
basing a conditional for dependency tracking on the shell variable
enable_dependency_tracking. Mentioned by Nick Bowler.
https://lists.gnu.org/archive/html/automake/2023-09/msg00004.html

* HACKING: Capitalization.

HACKING
doc/automake.texi

diff --git a/HACKING b/HACKING
index bb6b21c067bfe4021dbc7e0af62f747c21c4dccf..39e31204b6e32f4c378cbb22ec001a90a0dc797d 100644 (file)
--- a/HACKING
+++ b/HACKING
     * t/foo.sh: New test.
     * t/list-of-tests.mk (handwritten_TESTS): Add it.
     * doc/automake.texi (Some Node): Document it.
-    * NEWS: mention it.
+    * NEWS: Mention it.
 
 * If your commit fixes an automake bug registered in the tracker (say
   numbered 1234), you should put the following line after the summary
index 09a5fcc118b803775b2923aac2732165c1bb07a3..60a516fea0fbf3b24d35435bde6b862197a5aee7 100644 (file)
@@ -230,7 +230,7 @@ Building Programs and Libraries
 * Fortran 9x Support::          Compiling Fortran 9x sources
 * Java Support with gcj::       Compiling Java sources using gcj
 * Vala Support::                Compiling Vala sources
-* Support for Other Languages::  Compiling other languages
+* Support for Other Languages:: Compiling other languages
 * Dependencies::                Automatic dependency tracking
 * EXEEXT::                      Support for executable extensions
 
@@ -7091,7 +7091,7 @@ of Automake}) taught us that it is not reliable to generate dependencies
 only on the maintainer's system, as configurations vary too much.  So
 instead Automake implements dependency tracking at build time.
 
-Automatic dependency tracking can be suppressed by putting
+This automatic dependency tracking can be suppressed by putting
 @option{no-dependencies} in the variable @code{AUTOMAKE_OPTIONS}, or
 passing @option{no-dependencies} as an argument to @code{AM_INIT_AUTOMAKE}
 (this should be the preferred way).  Or, you can invoke @command{automake}
@@ -7100,12 +7100,34 @@ with the @option{-i} option.  Dependency tracking is enabled by default.
 @vindex AUTOMAKE_OPTIONS
 @opindex no-dependencies
 
+@cindex Disabling dependency tracking
+@cindex Dependency tracking, disabling
 The person building your package also can choose to disable dependency
 tracking by configuring with @option{--disable-dependency-tracking}.
 
-@cindex Disabling dependency tracking
-@cindex Dependency tracking, disabling
+@cindex Conditional for dependency tracking
+If, as the package maintainer, you wish to conditionalize your
+@code{Makefile.am} according to whether dependency tracking is
+enabled, the best way is to define your own conditional in
+@code{configure.ac} according to the shell variable
+@code{$enable_dependency_tracking} (all
+@code{--enable}/@code{--disable} options are available as shell
+variables; @pxref{Package Options,,,autoconf,GNU Autoconf}):
 
+@example
+AM_CONDITIONAL([NO_DEP_TRACKING],
+               [test x"$enable_dependency_tracking" = x"no"])
+@end example
+
+And then in your @code{Makefile.am}:
+
+@example
+if NO_DEP_TRACKING
+# stuff to do when dependency tracking is disabled
+else
+# stuff to do when it's enabled
+endif
+@end example
 
 @node EXEEXT
 @section Support for executable extensions