autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ac_top_srcdir not set


From: Christian Cornelssen
Subject: Re: ac_top_srcdir not set
Date: Thu, 20 Feb 2003 16:15:26 +0100 (CET)

Hi,

On Wed, 19 Feb 2003, Pavel Roskin wrote:

> Autoconf 2.57 as well as CVS autoconf doesn't set ac_top_srcdir and
> several other variables in packages with just one configure.ac.

Well, I guess it's used on an "as needed" basis: Whoever needs a valid
$ac_top_srcdir calls _AC_SRCPATHS for that.  To me it seems that
_AC_SRCPATHS is mainly used for `config.status' fragments.  If you
need it in your `configure.ac' then I'd recommend calling _AC_SRCPATHS
yourself.

> The reason is because _AC_SRCPATHS is only used in general.m4 like this:

... and in `status.m4' for CONFIG_COMMANDS fragments written to
`config.status'.

> _AC_SRCPATHS is the only place where ac_top_srcdir is set.  ac_top_srcdir
> is documented and there is no mention that it may not be set under certain
> conditions.

Do you mean the node "Preset Output Variables"?  If so, this does not
imply that these are valid within `configure.ac'.

> What's even worth, we may have some variables like ac_srcdir left from the
> last subdirectory.

As long as updates are not needed by the Autoconf macros, that's OK I
guess.  And the Autoconf macros call _AC_SRCPATHS when needed.

> It appears that the error messages reported by Christian Cornelssen in
> http://mail.gnu.org/archive/html/autoconf-patches/2003-01/msg00003.html
> may be a result of ac_srcdir not being set.

Not really.  The error messages resulted from _AC_SRCPATHS being
called (and improperly assuming that for every build subdir there is a
corresponding src subdir), not from _AC_SRCPATHS being _not_ called.

> Following patch fixes the problem.  It has been tested both for local and
> srcdir builds.  I haven't worked on Autoconf for some time, so I need
> somebody to look at this patch to make sure that I'm not doing anything
> stupid.
[...]
> --- lib/autoconf/general.m4
> +++ lib/autoconf/general.m4
> @@ -1067,6 +1067,8 @@
>    done
>  fi
>
> +_AC_SRCPATHS(["."])
> +
>  test -n "$ac_init_help" && exit 0
>  m4_divert_pop([HELP_END])dnl
>  ])# _AC_INIT_HELP

I'm not an Autoconf wizard and cannot approve this.  The patch looks
harmless, but actually every cd would invalidate the variables set by
the latest _AC_SRCPATHS call, and there would be quite a lot of cds in
the Autoconf macro definitions to check (at least those which cd and
subsequently use user-supplied stuff.)  Therefore I'd rather suggest
clarifying that certain output variables need not be valid for the
actual "configure" run, and perhaps specifying macros to get them set
properly.

Regards,

Christian Cornelssen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]