1Apache2::Build(3) User Contributed Perl Documentation Apache2::Build(3)
2
3
4
6 Apache2::Build - Methods for locating and parsing bits of Apache source
7 code
8
10 use Apache2::Build ();
11 my $build = Apache2::Build->new;
12
13 # rebuild mod_perl with build opts from the previous build
14 % cd modperl-2.0
15 % perl -MApache2::Build -e rebuild
16
18 This module provides methods for locating and parsing bits of Apache
19 source code.
20
21 Since mod_perl remembers what build options were used to build it, you
22 can use this knowledge to rebuild it using the same options. Simply
23 chdir to the mod_perl source directory and run:
24
25 % cd modperl-2.0
26 % perl -MApache2::Build -e rebuild
27
28 If you want to rebuild not yet installed, but already built mod_perl,
29 run from its root directory:
30
31 % perl -Ilib -MApache2::Build -e rebuild
32
34 new Create an object blessed into the Apache2::Build class.
35
36 my $build = Apache2::Build->new;
37
38 dir Top level directory where source files are located.
39
40 my $dir = $build->dir;
41 -d $dir or die "can't stat $dir $!\n";
42
43 find
44 Searches for apache source directories, return a list of those
45 found.
46
47 Example:
48
49 for my $dir ($build->find) {
50 my $yn = prompt "Configure with $dir ?", "y";
51 ...
52 }
53
54 inc Print include paths for MakeMaker's INC argument to
55 "WriteMakefile".
56
57 Example:
58
59 use ExtUtils::MakeMaker;
60
61 use Apache2::Build ();
62
63 WriteMakefile(
64 'NAME' => 'Apache2::Module',
65 'VERSION' => '0.01',
66 'INC' => Apache2::Build->new->inc,
67 );
68
69 module_magic_number
70 Return the MODULE_MAGIC_NUMBER defined in the apache source.
71
72 Example:
73
74 my $mmn = $build->module_magic_number;
75
76 httpd_version
77 Return the server version.
78
79 Example:
80
81 my $v = $build->httpd_version;
82
83 otherldflags
84 Return other ld flags for MakeMaker's dynamic_lib argument to
85 "WriteMakefile". This might be needed on systems like AIX that need
86 special flags to the linker to be able to reference mod_perl or
87 httpd symbols.
88
89 Example:
90
91 use ExtUtils::MakeMaker;
92
93 use Apache2::Build ();
94
95 WriteMakefile(
96 'NAME' => 'Apache2::Module',
97 'VERSION' => '0.01',
98 'INC' => Apache2::Build->new->inc,
99 'dynamic_lib' => {
100 'OTHERLDFLAGS' => Apache2::Build->new->otherldflags,
101 },
102 );
103
105 Doug MacEachern
106
107
108
109perl v5.32.1 2021-01-26 Apache2::Build(3)