---
name: "Apache::Build"
section: "3pm"
platform: "linux"
package: "libapache2-mod-perl2"
version: "1.999.21-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/Apache::Build"
---

# Apache::Build(3pm)

Methods for locating and parsing bits of Apache source code

## NAME

Apache::Build - Methods for locating and parsing bits of Apache source code

## SYNOPSIS

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

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

## DESCRIPTION

This module provides methods for locating and parsing bits of Apache source code.

Since mod\_perl remembers what build options were used to build it, you can use this knowledge to rebuild it using the same options. Simply chdir to the mod\_perl source directory and run:

```
  % cd modperl-2.0
  % perl -MApache::Build -e rebuild
```

If you want to rebuild not yet installed, but already built mod\_perl, run from its root directory:

```
  % perl -Ilib -MApache::Build -e rebuild
```

## METHODS

- new

  Create an object blessed into the **Apache::Build** class.

  ```
   my $build = Apache::Build->new;
  ```

- dir

  Top level directory where source files are located.

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

- find

  Searches for apache source directories, return a list of those found.

  Example:

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

- inc

  Print include paths for MakeMaker's **INC** argument to `"WriteMakefile"`.

  Example:

  ```
   use ExtUtils::MakeMaker;
  ```

  ```
   use Apache::Build ();
  ```

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

- module\_magic\_number

  Return the **MODULE\_MAGIC\_NUMBER** defined in the apache source.

  Example:

  ```
   my $mmn = $build->module_magic_number;
  ```

- httpd\_version

  Return the server version.

  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.

  Example:

  ```
   use ExtUtils::MakeMaker;
  ```

  ```
   use Apache::Build ();
  ```

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

## AUTHOR

Doug MacEachern
