On Sun, Apr 04, 2004 at 09:40:18PM -0700, Stas Bekman wrote:
> Joe Orton wrote:
> >OK, let's do the background... on Unix systems where by default off_t is
> >a "long", a 32-bit integer, there are two different ways to get "large
> >file" support, i.e. the ability to manipulate files bigger than 2Gb:
>
> Muchas Gracias, Joe. I've committed both your explanation and the logic
> which now works fine with both, 2.0 and 2.1.
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.
By picking up NOTEST_{C,CPP}FLAGS the code to add -DAP_DEBUG and
-DAP_HAVE_DESIGNATED_INITIALIZER could/should now be removed too.
AP_HAVE_DESIGNATED_INITIALIZER will be always added when appropriate
with this applied since it's in NOTEST_CPPFLAGS.
I'm not sure it's necessarily safe to add AP_DEBUG if httpd was not
itself built with AP_DEBUG; there were issues with this in the past.
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.
There, I think I've suggested enough work for other people to do now :)
Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.158
diff -u -r1.158 Build.pm
--- lib/Apache/Build.pm 5 Apr 2004 04:38:29 -0000 1.158
+++ lib/Apache/Build.pm 5 Apr 2004 08:49:46 -0000
@@ -167,7 +167,7 @@
my $val = qx($apxs @_ 2>$devnull);
chomp $val if defined $val; # apxs post-2.0.40 adds a new line
- unless ($val) {
+ unless ($val || $is_query) {
error "'$apxs @_' failed:";
if (my $error = qx($apxs @_ 2>&1)) {
@@ -199,6 +199,18 @@
$flags;
}
+sub apxs_notest_cflags {
+ my $flags = __PACKAGE__->apxs('-q' => 'NOTEST_CFLAGS');
+ $flags =~ s/\"/\\\"/g;
+ $flags;
+}
+
+sub apxs_notest_cppflags {
+ my $flags = __PACKAGE__->apxs('-q' => 'NOTEST_CPPFLAGS');
+ $flags =~ s/\"/\\\"/g;
+ $flags;
+}
+
my %threaded_mpms = map { $_ => 1}
qw(worker winnt beos mpmt_os2 netware leader perchild threadpool);
sub mpm_is_threaded {
@@ -372,6 +384,12 @@
sub ap_ccopts {
my($self) = @_;
my $ccopts = "-DMOD_PERL";
+
+ $ccopts .= " " . join(" ",
+ $self->apxs_cflags, $self->apxs_extra_cflags,
+ $self->apxs_extra_cppflags,
+ $self->apxs_notest_cflags,
+ $self->apxs_notest_cppflags);
if ($self->{MP_USE_GTOP}) {
$ccopts .= " -DMP_USE_GTOP";
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]