Re: Detect --disable-dependency-tracking in Makefile.am

Dave Hart <[email protected]>
Newsgroups gmane.comp.sysutils.automake.general
Message-ID <CAMbSiYBBQoPkHOU0LjMr9Uctp1dwdEucCwN5RLrDkciGQTKG_A@mail.gmail.com>
On Sun, 1 Oct 2023 at 00:59, Nick Bowler <[email protected]> wrote:

> Suggestion 2) All explicit --enable-foo/--disable-foo arguments to
> a configure script are available in shell variables; in the case of
> --disable-dependency-tracking you can do something like this in
> configure.ac:
>
>   AM_CONDITIONAL([NO_DEPS], [test x"$enable_dependency_tracking" = x"no"])
>
> then in Makefile.am:
>
>   if NO_DEPS
>   # stuff to do when dependency tracking is disabled
>   else
>   # stuff to do otherwise
>   endif
>
> Note that these approaches are different in the case where dependency
> tracking is disabled because it is not supported by the user's tools,
> rather than by explicit request.  This may or may not matter for your
> use case.


Thanks, Nick, Youi've made it easy for me without spelunking and trying to
guess what's documented.  I think I'll go with the documented approach as I
am not concerned about the corner case.  I don't know what tool deficiency
might trigger it, but I'm going to assume for now that it's good enough to
optimize build time only when --disable-depedency-tracking is used.

Cheers,
Dave Hart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.