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






Short Cuts



The Apache Software Foundation



Sister Sites



The mod_perl Developer's Cookbook

The mod_perl Developer's Cookbook

By Geoffrey Young, Paul Lindner, Randy Kobes


mod_perl Pocket Reference

mod_perl Pocket Reference

By Andrew Ford


Writing Apache Modules with Perl and C

Writing Apache Modules with Perl and C

By Lincoln Stein, Doug MacEachern


Embedding Perl in HTML with Mason

Embedding Perl in HTML with Mason

By Dave Rolsky, Ken Williams


mod_perl2 User's Guide

mod_perl2 User's Guide

By Stas Bekman, Jim Brandt


Practical mod_perl

Practical mod_perl

By Stas Bekman, Eric Cholet



Table of Contents

Synopsis

 use Apache::src ();
 my $src = Apache::src->new;


TOP

Description

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



TOP

Methods

  • new

    Create an object blessed into the Apache::src class.

     my $src = Apache::src->new;
  • dir

    Top level directory where source files are located.

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

    Apache's source tree was reorganized during development of version 1.3. So, common header files such as httpd.h are in different directories between versions less than 1.3 and those equal to or greater. This method will return the right directory.

    Example:

     -e join "/", $src->main, "httpd.h" or die "can't stat httpd.h\n";
  • find

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

    Example:

     for my $dir ($src->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::src ();
     WriteMakefile(
     'NAME' => 'Apache::Module',
     'VERSION' => '0.01',
     'INC' => Apache::src->new->inc, 
     );
  • module_magic_number

    Return the MODULE_MAGIC_NUMBER defined in the apache source.

    Example:

     my $mmn = $src->module_magic_number;
  • httpd_version

    Return the server version.

    Example:

     my $v = $src->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::src ();
     WriteMakefile(
     'NAME' => 'Apache::Module',
     'VERSION' => '0.01',
     'INC' => Apache::src->new->inc, 
     'dynamic_lib' => {
     'OTHERLDFLAGS' => Apache::src->new->otherldflags,
     },
     );


TOP

Author

Doug MacEachern






TOP
previous page: Apache::Symdump - Symbol table snapshots page up: mod_perl 1.0 API next page: Apache::Leak - Module for tracking memory leaks in mod_perl code

Last modified Sat Feb 15 17:38:38 2014

Changes file

Have comments? Please send them to the modperl users mailing list.

Use of the Camel for Perl is a trademark of O'Reilly & Associates, and is used by permission.



AltStyle によって変換されたページ (->オリジナル) /