start page | rating of books | rating of authors | reviews | copyrights

Book HomeJava and XSLTSearch this book

8.85. ExtUtils::MM_Unix

Provides methods for MakeMaker to handle portability issues. You never need to require this module, but you might want to if you are working on improving MakeMaker's portability

Provides methods for both Unix and non-Unix systems; on non-Unix systems, they can be overridden by methods defined in other MM_* modules. The methods are the following.

catdir

catdir list

Concatenates a list of directory names to form a complete path ending with a directory. On Unix, joins the names with /.

catfile

catfile list

Concatenates one or more directory names and a filename to form a complete path ending with a filename. On Unix, joins the names with /.

dir_target

dir_target array

Takes an array of required directory names and returns a Makefile entry to create an .exists file in the directories. Returns nothing if the entry has already been processed.

file_name_is_absolute

file_name_is_absolute filename

Takes a path as argument and returns true if it is an absolute path.

find_perl

find_perl version, \names, \dirs, trace

Searches for an executable Perl. Takes the following arguments:

version
The executable must be at least the version given by version.

\names
Array reference. The name of the executable must be an entry in the array.

\dirs
Array reference. The executable must be in a directory that is one of the entries in the array.

trace
If true, prints debugging information.

guess_name

guess_name

Guesses the name of the package based on the working directory's name. Called only if the NAME attribute is missing.

has_link_code

has_link_code

Returns true if there are C, XS, MYEXTLIB, or similar objects in this object that need a compiler. Does not descend into subdirectories.

libscan

libscan filename

Uses init_dirscan to find a file; returns false if the file should not be included in the library. Used primarily to keep revision-control directories from being installed.

lsdir

lsdir dir, regexp

Returns all entries in the specified directory that match the regular expression. Takes the following arguments:

dir
Name of the directory

regexp
Regular expression to match the entries against

maybe_command

maybe_command filename

Returns true if filename is likely to be a command.

maybe_command_in_dirs

maybe_command_in_dirs

For future use.

needs_linking

needs_linking

Returns true if the module needs linking. Searches subdirectories.

nicetext

nicetext target

The MM_Unix version returns the argument with no processing.

path

path

Returns PATH environment variable as an array.

perl_script

perl_script filename

Returns true if filename is likely to be a Perl script. With MM_Unix, this is true for any ordinary, readable file.

prefixify

prefixify attrname, oldprefix, newprefix

Processes a path attribute in $self->{ attrname }. Looks up the attribute in %Config if it doesn't have a value. Takes the following arguments:

attrname
Name of the attribute to be processed

oldprefix
Prefix to be replaced

newprefix
New prefix, replaced in-place

replace_manpage_separator

replace_manpage_separator filename

Takes the filename of a package and replaces the subdirectory delimiter (/ in Unix) with ::. Returns the altered name.

8.85.1. Methods to Produce the Makefile

ExtUtils::MM_Unix has some additional methods that are called in sequence to produce a Makefile. The list of methods is specified in the array @ExtUtils::MakeMaker::MM_Sections, one method per section. The routines are all called the same way and so are just listed here. Each method returns the string to be put into its section of the Makefile.

The methods are called in the order that they are listed in the following table, reading down the columns:

post_initialize

top_targets

realclean

const_config

linkext

dist_basics

constants

dlsyms

dist_core

const_loadlibs

dynamic

dist_dir

const_cccmd

dynamic_bs

dist_test

tool_autosplit

dynamic_lib

dist_ci

tool_xsubpp

static

install

tools_other

static_lib

force

dist

installpm

perldepend

macro

installpm_x

makefile

depend

manifypods

staticmake

post_constants

processPL

test

pasthru

installbin

test_via_harness

c_o

subdirs

test_via_script

xs_c

subdir_x

postamble

xs_o

clean

 

Finally, there are two special methods: post_initialize and postamble. They each return an empty string by default and can be defined in Makefile.PL to insert customized text near the beginning or end of the Makefile.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.