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
- ubuntu stonking: libapache2-mod-perl2 2.0.13-2build3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms