On Wed, Nov 29, 2000 at 08:08:54AM -0800, [EMAIL PROTECTED] wrote:
> On Wed, 29 Nov 2000, Greg Stein wrote:
> > On Tue, Nov 28, 2000 at 09:31:54PM -0000, [EMAIL PROTECTED] wrote:
>...
> > >...
> > > +dnl
> > > +dnl APR_DOEXTRA
> > > +dnl
> > > +dnl Handle the use of EXTRA_* variables.
> > > +dnl Basically, EXTRA_* vars are added to the
> > > +dnl current settings of their "parents". We
> > > +dnl can expand as needed. This is ugly
> > > +dnl
> > > +AC_DEFUN(APR_DOEXTRA, [
> > > + for i in CFLAGS LDFLAGS LIBS
> > > + do
> > > + eval APR_TMP=\$EXTRA_$i
> > > + if test -n "$APR_TMP"; then
> > > + eval $i=\"\$$i $APR_TMP\"
> > > + eval export $i
> > > + eval unset EXTRA_${i}
> > > + eval export EXTRA_${i}
> > > + fi
> > > + done
> > > +])
> >
> > I see that this came from apr/hints.m4, but I don't understand what it is
> > really doing here. What is this extra magic?
> >
> > AFAIK, all we need to do is set the variables, and that is that. No fancy
> > export or anything.
>
> Unfortunately, as Jim found when he first did this stuff, Autoconf doesn't
> use the EXTRA_* variables, so this is a bit of a hack.
Ah. I think I understand. Wouldn't the above be simpler and more obvious if
we wrote it like:
AC_DEFIN(APR_DOEXTRA, [
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
EXTRA_CFLAGS=""
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
EXTRA_LDFLAGS=""
LIBS="$LIBS $EXTRA_LIBS"
EXTRA_LIBS=""
])
Presuming the above works as expected, then I'd like to change the code.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/