You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tim Bray <Ti...@Sun.COM> on 2008/01/11 21:20:05 UTC
Hard to build httpd & APR on OS X Leopard
Disclosure: My autotools expertise is not that great. In fact, since
I've been in Ruby & Java mostly the last few years, I may be missing
something obvious at the ld or gcc level. This is all with a fresh
2.2.6 tarball downloaded earlier this week. This note to both
dev@httpd & dev@apr because the problem seems to be in the crack
between them.
I got here because apr_global_mutex_create() was acting weird, so I
wanted to step into it with the debugger. So I went to apr and did
CFLAGS=-g ./configure
make
Oops...
network_io/unix/sendrecv.c:967:2: error: #error APR has detected
sendfile on your system, but nobody has written a
network_io/unix/sendrecv.c:968:2: error: #error version of it for APR
yet. To get past this, either write
network_io/unix/sendrecv.c:969:2: error: #error apr_socket_sendfile or
change APR_HAS_SENDFILE in apr.h to 0.
Hmph. So I tried changing APR_HAS_SENDFILE in apr.h to 0 and make/
make install worked.
But... I couldn't get httpd to build with my new APR living in /usr/
local/apr. I think this is because httpd's configure writes build/
config_vars.mk including this:
LDFLAGS = -L/usr/lib -L/usr/local/apr/lib
So, it's irrelevant how you go about building APR, you're gonna get
the one that Leopard ships in /usr/lib (and hey, it's nice that
Leopard ships with APR).
I tried a few ./configure options but couldn't find one to force it to
change the -L, so I eventually went and edited build/config_vars.mk,
blecch.
But then httpd wouldn't build, on the final "-o httpd" step I got
Undefined symbols:
"_apr_socket_sendfile", referenced from:
_ap_hack_apr_socket_sendfile in libmain.a(exports.o)
_sendfile_it_all in libmain.a(core_filters.o)
ld: symbol(s) not found
Hokay... I suspect it's most likely that's I'm just ignorant of
something obvious that Everybody Knows. If so, what is it?
It does seem like it shouldn't be this hard. -Tim
Re: Hard to build httpd & APR on OS X Leopard
Posted by Jeff Trawick <tr...@gmail.com>.
On Jan 11, 2008 3:20 PM, Tim Bray <Ti...@sun.com> wrote:
> I got here because apr_global_mutex_create() was acting weird, so I
> wanted to step into it with the debugger. So I went to apr and did
>
> CFLAGS=-g ./configure
> make
you had already built httpd 2.2.6 at this point, and it was using the
bundled apr? if so, I would have done
2.2.6 $ make distclean && ./configure --enable-maintainer-mode
--your-other-httpd-configure-opts && make
>
> Oops...
> network_io/unix/sendrecv.c:967:2: error: #error APR has detected
> sendfile on your system, but nobody has written a
> network_io/unix/sendrecv.c:968:2: error: #error version of it for APR
> yet. To get past this, either write
> network_io/unix/sendrecv.c:969:2: error: #error apr_socket_sendfile or
> change APR_HAS_SENDFILE in apr.h to 0.
>
> Hmph. So I tried changing APR_HAS_SENDFILE in apr.h to 0 and make/
> make install worked.
fixed in apr-1.2.current, which will be bundled with upcoming httpd-2.2.8...
-/-
I've built some levels of httpd and apr on leopard, but I think it was
always using explicit --with-apr= and --with-apr-util= flags to
configure.
Re: Hard to build httpd & APR on OS X Leopard
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Henry Jen wrote:
>
> My guess is that you are not using the matching header files, perhaps
> you only fixed the -L option, but not the -I option for the header
> file.
The other obvious question, did you also rebuild aprutil after you
./configure --with-apr=/usr/local/apr --prefix=/usr/local/apr
and then httpd
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
Re: Hard to build httpd & APR on OS X Leopard
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Henry Jen wrote:
>
> My guess is that you are not using the matching header files, perhaps
> you only fixed the -L option, but not the -I option for the header
> file.
The other obvious question, did you also rebuild aprutil after you
./configure --with-apr=/usr/local/apr --prefix=/usr/local/apr
and then httpd
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
Re: Hard to build httpd & APR on OS X Leopard
Posted by Henry Jen <he...@ztune.net>.
On Jan 11, 2008 12:20 PM, Tim Bray <Ti...@sun.com> wrote:
>
> But... I couldn't get httpd to build with my new APR living in /usr/
> local/apr. I think this is because httpd's configure writes build/
> config_vars.mk including this:
>
> LDFLAGS = -L/usr/lib -L/usr/local/apr/lib
>
> So, it's irrelevant how you go about building APR, you're gonna get
> the one that Leopard ships in /usr/lib (and hey, it's nice that
> Leopard ships with APR).
>
> I tried a few ./configure options but couldn't find one to force it to
> change the -L, so I eventually went and edited build/config_vars.mk,
> blecch.
>
> But then httpd wouldn't build, on the final "-o httpd" step I got
>
> Undefined symbols:
> "_apr_socket_sendfile", referenced from:
> _ap_hack_apr_socket_sendfile in libmain.a(exports.o)
> _sendfile_it_all in libmain.a(core_filters.o)
> ld: symbol(s) not found
>
> Hokay... I suspect it's most likely that's I'm just ignorant of
> something obvious that Everybody Knows. If so, what is it?
>
My guess is that you are not using the matching header files, perhaps
you only fixed the -L option, but not the -I option for the header
file.
HTH,
Henry
> It does seem like it shouldn't be this hard. -Tim
>
>
>
>
Re: Hard to build httpd & APR on OS X Leopard
Posted by Jeff Trawick <tr...@gmail.com>.
On Jan 11, 2008 3:20 PM, Tim Bray <Ti...@sun.com> wrote:
> I got here because apr_global_mutex_create() was acting weird, so I
> wanted to step into it with the debugger. So I went to apr and did
>
> CFLAGS=-g ./configure
> make
you had already built httpd 2.2.6 at this point, and it was using the
bundled apr? if so, I would have done
2.2.6 $ make distclean && ./configure --enable-maintainer-mode
--your-other-httpd-configure-opts && make
>
> Oops...
> network_io/unix/sendrecv.c:967:2: error: #error APR has detected
> sendfile on your system, but nobody has written a
> network_io/unix/sendrecv.c:968:2: error: #error version of it for APR
> yet. To get past this, either write
> network_io/unix/sendrecv.c:969:2: error: #error apr_socket_sendfile or
> change APR_HAS_SENDFILE in apr.h to 0.
>
> Hmph. So I tried changing APR_HAS_SENDFILE in apr.h to 0 and make/
> make install worked.
fixed in apr-1.2.current, which will be bundled with upcoming httpd-2.2.8...
-/-
I've built some levels of httpd and apr on leopard, but I think it was
always using explicit --with-apr= and --with-apr-util= flags to
configure.
Re: Hard to build httpd & APR on OS X Leopard
Posted by Paul Querna <ch...@force-elite.com>.
Tim Bray wrote:
> Disclosure: My autotools expertise is not that great. In fact, since
> I've been in Ruby & Java mostly the last few years, I may be missing
> something obvious at the ld or gcc level. This is all with a fresh
> 2.2.6 tarball downloaded earlier this week. This note to both dev@httpd
> & dev@apr because the problem seems to be in the crack between them.
....
> Hokay... I suspect it's most likely that's I'm just ignorant of
> something obvious that Everybody Knows. If so, what is it?
>
> It does seem like it shouldn't be this hard. -Tim
As far as I know, this is all fixed in 2.2.8, which is currently being
voted on to be released.
Pre-release version is available from:
http://httpd.apache.org/dev/dist/
The root cause is that Apple bundles a modified APR to support Sendfile
on Leopard, but we didn't get the patches until after Leopard came out.
APR 1.2.12, released on November 27, 2007, fixes these and a few other
issues on Leopard:
http://apr.apache.org/
httpd 2.2.8, is the first version of httpd to bundle the upgraded APR.
Re: Hard to build httpd & APR on OS X Leopard
Posted by Paul Querna <ch...@force-elite.com>.
Tim Bray wrote:
> Disclosure: My autotools expertise is not that great. In fact, since
> I've been in Ruby & Java mostly the last few years, I may be missing
> something obvious at the ld or gcc level. This is all with a fresh
> 2.2.6 tarball downloaded earlier this week. This note to both dev@httpd
> & dev@apr because the problem seems to be in the crack between them.
....
> Hokay... I suspect it's most likely that's I'm just ignorant of
> something obvious that Everybody Knows. If so, what is it?
>
> It does seem like it shouldn't be this hard. -Tim
As far as I know, this is all fixed in 2.2.8, which is currently being
voted on to be released.
Pre-release version is available from:
http://httpd.apache.org/dev/dist/
The root cause is that Apple bundles a modified APR to support Sendfile
on Leopard, but we didn't get the patches until after Leopard came out.
APR 1.2.12, released on November 27, 2007, fixes these and a few other
issues on Leopard:
http://apr.apache.org/
httpd 2.2.8, is the first version of httpd to bundle the upgraded APR.