From: Karl Berry Date: Mon, 30 Oct 2023 17:14:51 +0000 (-0700) Subject: doc: user conditional for dependency tracking. X-Git-Tag: v1.16i~29 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d91e57be98691c058a1d9f705986b480896225b;p=thirdparty%2Fautomake.git doc: user conditional for dependency tracking. * 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. --- diff --git a/HACKING b/HACKING index bb6b21c06..39e31204b 100644 --- a/HACKING +++ b/HACKING @@ -310,7 +310,7 @@ * 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 diff --git a/doc/automake.texi b/doc/automake.texi index 09a5fcc11..60a516fea 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -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