autoconf-patches
[Top][All Lists]
Advanced

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

Re: AC_CONFIG_SUBDIRS and subdirs


From: Ralf Corsepius
Subject: Re: AC_CONFIG_SUBDIRS and subdirs
Date: 09 Mar 2002 07:07:40 +0100

Am Fre, 2002-03-08 um 13.13 schrieb Akim Demaille:
> >>>>> "Ralf" == Ralf Corsepius <address@hidden> writes:
> 
> Ralf> Hmm. It is just inconsistent with handling of CONFIG_SUBDIRS at
> Ralf> all other places I am aware about.
> 
> Ralf> autoreconf treats them conditionally, 
> 
> Of course: it has no enough choice.  Dynamic vs Static, Runtime
> vs. Compile time.   Similarly you could say autoconf considers them
> conditionally.
> 
I see.

> Ralf> _AC_OUTPUT_SUBDIRS does so, 
> 
> Nope, it does not, as it loops over the shell variable that
> AC_CONFIG_SUBDIRS sets at runtime.
Right, but .. 

if AC_CONFIG_SUBDIRS requires hard-coded subdirs, @subdirs@ is available
to _AC_OUTPUT_SUBDIRS and friends, i.e. there is no need to treat them
conditionally.

i.e. the "test -d" from _AC_OUTPUT_SUBDIRS (cf. below) is at least
unnecessary, rsp. if subdirs are supposed to be present, then it's even
bogus.
[..]
  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    test -d $srcdir/$ac_dir || continue
[..]


> 
> Ralf> the documentation does so, 
> 
> Arg, that is true :(
> 
> Ralf> it's just AC_CONFIG_SUBDIRS which doesn't.
> 
> 
> 
> Ralf> Well, I agree wrt. the restrictions which have been set upon
> Ralf> AC_CONFIG_FILES with autoconf-2.5x, but it is not _consistent_
> Ralf> with regard to handling of config-subdirs at other places of
> Ralf> autoconf.
> 
> Ralf> But, config-subdirs have been documented to be
> Ralf> optional. Therefore, I do not understand why AC_CONFIG_SUBDIRS
> Ralf> should not treat them optional.
> 
> Agreed, one of them is bogus.  But the documentation is in a worse
> situation as it is not self consistent:
I am not trying to nit-pick on the docs, but am interested in "having a
feature" or "not having a feature".

>     @example
>     if test "$package_foo_enabled" = yes; then
>       AC_CONFIG_SUBDIRS(foo)
>     fi
>     @end example
>     
> 
> The last example emphasizes my point.
No actual problem with that, but a minor convenience problem.

One has to use something like this:

if test -d "${srcdir}/pkg1"; then
AC_CONFIG_SUBDIRS(pkg1)
fi
..
if test -d ${srcdir}/pkgN"; then
AC_CONFIG_SUBDIRS(pkgN)
fi

Instead of 
AC_CONFIG_SUBDIRS(pkg1 ... pkgN)

for conditional/optional subdirs.

It voids the plural in SUBDIR*S* wrt. conditional/optional subdirs!!

Just a thought: 

Why not implementing something similar to this:

AC_DEFUN([AC_CONFIG_SUBDIR],
[if test -d "${srcdir)/$1"; then
  AC_CONFIG_SUBDIRS([$1])
 fi])

IMHO, this would reflect the actual meaning of the current
AC_CONFIG_SUBDIRS better than it currently does.

Ralf





reply via email to

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