[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I enable option-checking from configure.ac after it being de
From: |
Hans-Peter Nilsson |
Subject: |
Re: How can I enable option-checking from configure.ac after it being default-disabled? |
Date: |
Mon, 19 Mar 2012 16:05:34 +0100 |
> From: Nick Bowler <address@hidden>
> Date: Mon, 19 Mar 2012 14:51:25 +0100
> On 2012-03-18 18:24 +0100, Hans-Peter Nilsson wrote:
> > Hi. I don't see a way to turn on option-checking after it being
> > disabled-by-default due to AC_CONFIG_SUBDIRS.
> > have a look at its configure.ac), there's the hopefully
> > self-explanatory:
> >
> > # The directory test/installtest isn't configured until after
> > # installation, but to make autoreconf update this directory we
> > # have to mention it here
> > if false; then
> > AC_CONFIG_SUBDIRS([test/installtest])
> > fi
>
> It is actually the call to AC_CONFIG_SUBDIRS which disables option
> checking.
Are you re-stating what I mentioned above or does it disable
option-checking in a different way than I mentioned?
(I realise that "call" here is AC_CONFIG_SUBDIRS being expanded,
not the resulting shell-code being executed.)
> Since you're only doing this to make autoreconf recurse into
> the subdirectory, and don't actually care about the expansion of
> AC_CONFIG_SUBDIRS, you can fool autoreconf into thinking you called
> AC_CONFIG_SUBDIRS without actually doing so.
>
> For example:
>
> dnl Fool autoreconf into thinking we called AC_CONFIG_SUBDIRS here by
> dnl temporily suppressing its definition.
> m4_pushdef([AC_CONFIG_SUBDIRS], [])
> AC_CONFIG_SUBDIRS([test/installtest])
> m4_popdef([AC_CONFIG_SUBDIRS])
>
> This is (ab)using internal details of autoreconf, thus it might not be
> guaranteed to work in the future.
But is this considered a cleaner way than getting that effect
through the never-executed idiom I used above?
And more importantly, will your idiom have the desired effect:
not disable option-checking by default? (The answer may be
obvious to you autoconfers.)
I forgot to mention the fun-and-anecdotal part: stating
--enable-debugging instead of --enable-debug (not looking at the
build-log) and wondering why the debugging info was so
optimized-out; mis-remembering that I should be getting errors
for unsupported configure-options because of observations
*before* adding the non-call to AC_CONFIG_SUBDIRS. :) (Now I've
"solved" this supposedly-common mistake by erroring out for
AC_ARG_ENABLE([debugging]).)
brgds, H-P