# Temporarily, you have to subclass both. Put MM_Any first.
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw(ExtUtils::MM_Any ExtUtils::Unix);
ExtUtils::MM_Any is a superclass for the ExtUtils::MM_* set of
modules. It contains methods which are either inherently
cross-platform or are written in a cross-platform manner.
Subclass off of ExtUtils::MM_Anyand ExtUtils::MM_Unix. This is a
temporary solution.
Most OS have a maximum command length they can execute at once. Large
modules can easily generate commands well past that limit. Its
necessary to split long commands up into a series of shorter commands.
split_command will return a series of @cmds each processing part of
the args. Collectively they will process all the arguments. Each
individual line in @cmds will not be longer than the
$self->max_exec_len being careful to take into account macro expansion.
$cmd should include any switches and repeated initial arguments.
If no @args are given, no @cmds will be returned.
Pairs of arguments will always be preserved in a single command, this
is a heuristic for things like pm_to_blib and pod2man which work on
pairs of arguments. This makes things like this safe:
my $oneliner = $MM->oneliner($perl_code);
my $oneliner = $MM->oneliner($perl_code, \@switches);
This will generate a perl one-liner safe for the particular platform
you're on based on the given $perl_code and @switches (a -e is
assumed) suitable for using in a make target. It will use the proper
shell quoting and escapes.
$(PERLRUN) will be used as perl.
Any newlines in $perl_code will be escaped. Leading and trailing
newlines will be stripped. Makes this idiom much easier:
my $code = $MM->oneliner(<<'CODE', [...switches...]);
some code here
another line here
CODE
All dollar signs must be doubled in the $perl_code if you expect them
to be interpreted normally, otherwise it will be considered a make
macro. Also remember to quote make macros else it might be used as a
bareword. For example:
# Assign the value of the $(VERSION_FROM) make macro to $vf.
$oneliner = $MM->oneliner('$$vf = "$(VERSION_FROM)"');
Its currently very simple and may be expanded sometime in the figure
to include more flexible code and switches.
Generates targets to create the specified directories and set its
permission to 0755.
Because depending on a directory to just ensure it exists doesn't work
too well (the modified time changes too often) dir_target() creates a
.exists file in the created directory. It is this you should depend on.
For portability purposes you should use the $(DIRFILESEP) macro rather
than a '/' to seperate the directory from the file.
Returns a make fragment with the makemakerdeflt_target specified.
This target is the first target in the Makefile, is the default target
and simply points off to 'all' just in case any make variant gets
confused or something gets snuck in before the real 'all' target.
Writes the file META.yml YAML encoded meta-data about the module in
the distdir. The format follows Module::Build's as closely as
possible. Additionally, we include:
Initializes the macro definitions used by tools_other() and places them
in the $MM object.
If there is no description, its the same as the parameter to
WriteMakefile() documented in ExtUtils::MakeMaker.
Defines at least these macros.
Macro Description
NOOP Do nothing
NOECHO Tell make not to display the command itself
MAKEFILE
FIRST_MAKEFILE
MAKEFILE_OLD
MAKE_APERL_FILE File used by MAKE_APERL
SHELL Program used to run
shell commands
ECHO Print text adding a newline on the end
RM_F Remove a file
RM_RF Remove a directory
TOUCH Update a file's timestamp
TEST_F Test for a file's existence
CP Copy a file
MV Move a file
CHMOD Change permissions on a
file
UMASK_NULL Nullify umask
DEV_NULL Supress all command output
$MM->init_DIRFILESEP;
my $dirfilesep = $MM->{DIRFILESEP};
Initializes the DIRFILESEP macro which is the seperator between the
directory and filename in a filepath. ie. / on Unix, \ on Win32 and
nothing on VMS.
For example:
# instead of $(INST_ARCHAUTODIR)/extralibs.ld
$(INST_ARCHAUTODIR)$(DIRFILESEP)extralibs.ld
Something of a hack but it prevents a lot of code duplication between
MM_* variants.
Do not use this as a seperator between directories. Some operating
systems use different seperators between subdirectories as between
directories and filenames (for example: VOLUME:[dir1.dir2]file on VMS).
PERL_ARCHIVE: path to libperl.a equivalent to be linked to dynamic
extensions.
PERL_ARCHIVE_AFTER: path to a library which should be put on the
linker command line after the external libraries to be linked to
dynamic extensions. This may be needed if the linker is one-pass, and
Perl includes some overrides for C RTL functions, such as malloc().
EXPORT_LIST: name of a file that is passed to linker to define symbols
to be exported.
Some OSes do not need these in which case leave it blank.
Returns a definition for the POD2MAN macro. This is a program
which emulates the pod2man utility. You can add more switches to the
command by simply appending them on the macro.
Takes a path to a file or dir and returns an empty string if we don't
want to include this file in the library. Otherwise it returns the
the $path unchanged.
Mainly used to exclude version control administrative directories from
installation.