Problems compiling Apache 2.2.6 on FreeBSD 6.2

Trying to update one of Apache installations got following error:

[...]
/usr/local/src/httpd-2.2.6/srclib/apr-util/libaprutil-1.la -lexpat -liconv /usr/local/src/httpd-2.2.6/srclib/apr/libapr-1.la -lcrypt -lpthread
/usr/bin/ld: cannot find -lexpat

Thats amazing because i never had any problems with pure apache custom builds. I have checked if system had expat installed and …

it installed!

# pkg_info | grep expat
expat-2.0.0_1 XML 1.0 parser written in C

Checked if lib really exist and it’s available to ldconfig

# ldconfig -r | grep expat
146:-lexpat.6 => /usr/local/lib/libexpat.so.6
# file /usr/local/lib/libexpat.so.6
/usr/local/lib/libexpat.so.6: ELF 64-bit LSB shared object, AMD x86-64, version 1 (FreeBSD), not stripped

Next thing I try to tell to Apache path, where library can be found:

--with-expat=/usr/local

And got same result! Building of old sources (2.2.3) was successful.
Totally I’ve spent around 20 minutes to find “solution”. But I can’t really call it _solution_, because it looks like workaround.
So, if you have same issue, just try configure Apache with following parameter:

--with-expat=builtin

I think this is layout specific “feature” and it should be added to FreeBSD layout or, at least, documented.

Prev Post: mpt0: QUEUE FULL EVENT on DELL/SAS 5iR
Next Post: Problem compiling GeoIP PHP extension on FreeBSD
Main Page: ZulusTips index

One Response to “Problems compiling Apache 2.2.6 on FreeBSD 6.2”

  1. Anthony Bortolotto Says:

    Thanks for this blog! Fixed my exact problem which only started this week, I am the same and have been configuring Apache from source on FreeBSD for years and only stumbled onto this right now. Fixed my problems on FreeBSD 6.2 running apache 2.2.6 in a jail.

Leave a Reply

You must be logged in to post a comment.