The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
Mac OS X 10.2
=============

On Mac OS X 10.2.x Jaguar, the C and Perl libraries must be installed
separately. Here's how to do it.

% cd libapreq-1.x
% sh BUILD.sh

Unpack the libapreq tarball, change into the source code diretory, and then
run the BUILD.sh script. This prepares the libapreq sources to build the C
library. Note that running BUILD.sh is actually optional if the libapreq
sources are freshly unpacked.

% ./configure --with-apache-includes=/usr/include/httpd
% make
% sudo make install

We need to tell configure where to find the apache includes directory. The
default Apple install of Apache puts these files in /usr/includ/httpd. If
you've compiled and installed your own Apache, you'll need to point to the
directory into which you have installed the include files, such as
/usr/local/apache/include. Once configure is done doing its thing, run "make"
and then "sudo make install" to install the C library.

Next, the normal Perl build of libapreq should work. Note that you'll need
libwwwperl and URI installed in order to run make test.

% perl Makefile.PL
% make
% make test
% sudo make install

Mac OS X 10.1
=============

On Mac OS X 10.1, the libapreq API must be statically compiled into the Apache
binary using the experimental patch in the patches directory. This means that
libapreq cannot be used with Apple's Apache install; a new Apache server must
be built from source, instead.

To apply the patch to the Apache sources (assuming the apache-1.3.XX source is
along side of the libapreq-1.x source):

% cd apache-1.3.xx
% patch -p0 < ../libapreq-1.x/patches/apache-1.3+apreq.patch
% cp ../libapreq-1.x/c/*.[ch] src/lib/apreq

If you've installed Perl and mod_perl in the default Darwin locations, you'll
next need to set the PER5LIB environment variable to "/Library/Perl" so that
the new mod_perl modules you install are preferred to the ones in
/System/Library/Perl when Apache compiles. Use "setenv" under tsch:

% setenv PERL5LIB /Library/Perl

Or "export" under bash or zsh:

% export PER5LIB=/Library/Perl

Now build and install Apache (+modperl) as normal. Make sure that you use
APACI, as the libapreq patch requires it. For example, if you're letting
mod_perl's Makefile build Apache, configure it like this:

% cd mod_perl-1.xx
% perl Makefile.PL USE_APACI=1  EVERYTHING=1

If you want to use Apache::Request and Apache::Cookie, you'll also need to
remove the -lapreq linking flags within Request/Makefile.PL and
Cookie/Makefile.PL, before doing the perl build of libapreq. The following
commands should do the trick:

% perl -pi.bak -e 's/-lapreq//' Request/Makefile.PL Cookie/Makefile.PL

And finally, the normal Perl build of libapreq should work. Note that you'll
need libwwwperl and URI installed in order to run make test.

% perl Makefile.PL
% make
% make test
% sudo make install