On Mon, Apr 05, 2004 at 11:30:19AM -0700, Stas Bekman wrote:
> Joe Orton wrote:
> >Great.  It looks like mod_perl is not pulling in all the right variables
> >from apxs though still.  APR HEAD will break if -D_LARGEFILE64_SOURCE is
> >not defined when including apr.h on many platforms.  On Linux you get
> >away with it because Perl defines -D_GNU_SOURCE which implies
> >-D_LARGEFILE64_SOURCE, but this won't happen on Solaris etc.
> >
> >I can fix it by continuing the copy'n'paste-fest as below, but I had to
> >change the apxs function to not give errors for a -q output which was
> >empty, which is not an error in some cases, e.g. -q NOTEST_CFLAGS,
> >though is an error in others I suppose, -q INCLUDEDIR etc.
> 
> Why isn't -D_LARGEFILE64_SOURCE in the normal flags? Asking for obscure 
> NOTEST_* flags doesn't sound very obvious.

Sorry, I wasn't clear about this.  For reference, here's what I get from
a HEAD build (which used --enable-maintainer-mode, hence has lots of
-Wfoo)

$ for f in CFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS NOTEST_CFLAGS NOTEST_CPPFLAGS; do echo 
$f = `bin/apxs -q $f`; done
CFLAGS = -g -O2 -Wall -I/usr/kerberos/include
EXTRA_CFLAGS = -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread
EXTRA_CPPFLAGS = -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DAP_DEBUG
NOTEST_CFLAGS =
NOTEST_CPPFLAGS = -DAP_HAVE_DESIGNATED_INITIALIZER

at the moment, mod_perl is not using *any* of those variables in
ap_ccopts, which is bad; in fact the apxs_cflags function in Build.pm
seems to be completely unused.

If you want to be conservative, just stick with EXTRA_CPPFLAGS; this
should be sufficient to make sure apr.h can be safely included.  The
problem is if you use EXTRA_CFLAGS you need NOTEST_CPPFLAGS normally,
since the latter prevents some GCC warnings which the former will
induce.

Any modules which build using "apxs -c" already use most of the above:

my $CFG_CFLAGS     = join ' ', map { get_vars($_) }
  qw(SHLTCFLAGS CFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);

(SHLTCFLAGS is inappropriate for mod_perl as it's libtool-specific)

> >Finally the ccopts function could do with doing some normalization of
> >the union of the perl/Apache CFLAGS now since "-g -O2 -D_GNU_SOURCE" etc
> >will be used twice otherwise.  
> 
> Sure, I'll do that. But is there any harm in those duplicates?

Probably not, no.  It's just a cosmetic thing really.

joe


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to