Apache2::Build(3pm)

πŸ’– Apache2::Build πŸ’–

okay bestie, so this is Apache2::Build, a page from the User Contributed Perl Documentation collection (yes, that's the manual fam it lives in 🫢). It's giving "Methods for locating and parsing bits of Apache source code" and honestly? iconic.


✨ NAME ✨

Apache2::Build β€” methods for locating and parsing bits of Apache source code. no cap, that's literally the whole job description πŸ’…


🌸 SYNOPSIS 🌸

use Apache2::Build ();
my $build = Apache2::Build->new;

# rebuild mod_perl with build opts from the previous build
% cd modperl-2.0
% perl -MApache2::Build -e rebuild

πŸ¦‹ DESCRIPTION πŸ¦‹

This module hands you methods for locating and parsing bits of Apache source code. that's it, that's the vibe ✨

And here's the part that lowkey ate: since mod_perl remembers what build options were used to build it, you can use that knowledge to rebuild it using the exact same options. fr fr, it kept receipts.

So just chdir over to the mod_perl source directory and run:

% cd modperl-2.0
% perl -MApache2::Build -e rebuild

And if you wanna rebuild mod_perl that isn't installed yet but is already built, run this from its root directory instead:

% perl -Ilib -MApache2::Build -e rebuild
okay but real talk, peep the difference: that second one has -Ilib in it because you're pointing at the lib dir instead of an installed copy. main character detail πŸ’…

πŸ‘‘ METHODS πŸ‘‘

new

Create an object blessed into the Apache2::Build class. a whole new build object, born fresh, glowing ✨

my $build = Apache2::Build->new;

dir

Top level directory where source files are located. like, the mothership directory 🌈

my $dir = $build->dir;
-d $dir or die "can't stat $dir $!\n";

find

Searches for apache source directories, and returns a list of all the ones it found. a lil scavenger hunt πŸ”

Example:

for my $dir ($build->find) {
   my $yn = prompt "Configure with $dir ?", "y";
   ...
}

inc

Print include paths for MakeMaker's INC argument to "WriteMakefile". this is the "where are my headers bestie" method πŸŽ€

Example:

use ExtUtils::MakeMaker;

use Apache2::Build ();

WriteMakefile(
    'NAME'    => 'Apache2::Module',
    'VERSION' => '0.01',
    'INC'     => Apache2::Build->new->inc,
);

module_magic_number

Return the MODULE_MAGIC_NUMBER defined in the apache source. it's mysterious, it's magic, it's a number πŸ’€βœ¨

Example:

my $mmn = $build->module_magic_number;

httpd_version

Return the server version. simple, stunning, slaying πŸ’…

Example:

my $v = $build->httpd_version;

otherldflags

Return other ld flags for MakeMaker's dynamic_lib argument to "WriteMakefile". This might be needed on systems like AIX that need special flags to the linker to be able to reference mod_perl or httpd symbols. so like, AIX girlies, this one's for you 🫢

Example:

use ExtUtils::MakeMaker;

use Apache2::Build ();

WriteMakefile(
    'NAME'        => 'Apache2::Module',
    'VERSION'     => '0.01',
    'INC'         => Apache2::Build->new->inc,
    'dynamic_lib' => {
        'OTHERLDFLAGS' => Apache2::Build->new->otherldflags,
    },
);

🌟 AUTHOR 🌟

Doug MacEachern β€” the original icon, the blueprint, the moment πŸ‘‘


and that's the whole page bestie!! πŸ’– this was Apache2::Build(3pm) from the User Contributed Perl Documentation, documented at perl v5.42.3, dated 2026-08-20. periodt. go rebuild something slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from