apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@ebuilt.com>
Subject Re: FreeBSD and gnu m4
Date Fri, 02 Mar 2001 05:35:36 GMT
> Changing from "1" and "0" to def, undef wouldn't change anything at all.
> The exact same logic is required, and the same general variables are
> required.  The differences between the two are incredibly minor, because
> we want to use namespace protected macros.

If we changed to def/undef and we used the standard autoconf macros
with the default behavior, then we don't need namespace protected symbols.
Defining them as "0" or "1" doesn't allow us to use

   #ifndef HAVE_UNISTD_H
   #undef HAVE_UNISTD_H
   #endif

as the template for the generated file, which gets translated to

   #ifndef HAVE_UNISTD_H
   #define HAVE_UNISTD_H 1
   #endif

by configure if AC_CHECK_HEADERS(unistd.h) succeeds, which won't result
in errors if the same symbol is defined by includes in other packages,
which was the original justification for the APR_ prefix on those symbols.

Of course, this means we'd have to use a template instead of autoheader,
but that is how I prefer to set up autoconf in any case, since it also
allows us to add documentation to the generated file.  Doing it this way
has the nice side-effect of allowing the user to override a configure
definition by simply doing a

   env CFLAGS="-DHAVE_UNISTD_H=1" make

I wasn't kidding when I said that our problems with autoconf
are due to the way we are using it.

....Roy


Mime
View raw message