.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Module::Build::Compat 3pm" .TH Module::Build::Compat 3pm 2025-12-14 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Module::Build::Compat \- Compatibility with ExtUtils::MakeMaker .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 7 \& # In a Build.PL : \& use Module::Build; \& my $build = Module::Build\->new \& ( module_name => \*(AqFoo::Bar\*(Aq, \& license => \*(Aqperl\*(Aq, \& create_makefile_pl => \*(Aqtraditional\*(Aq ); \& ... .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Because \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR has been the standard way to distribute modules for a long time, many tools (CPAN.pm, or your system administrator) may expect to find a working \fIMakefile.PL\fR in every distribution they download from CPAN. If you want to throw them a bone, you can use \f(CW\*(C`Module::Build::Compat\*(C'\fR to automatically generate a \&\fIMakefile.PL\fR for you, in one of several different styles. .PP \&\f(CW\*(C`Module::Build::Compat\*(C'\fR also provides some code that helps out the \&\fIMakefile.PL\fR at runtime. .SH WARNING .IX Header "WARNING" Note that \f(CW\*(C`Module::Build::Compat\*(C'\fR more often causes installation issues than solves them, and each of the three \fIMakefile.PL\fR generation styles has unique compatibility or functionality issues that are unlikely to be fixed. Thus, the use of this module and \f(CW\*(C`create_makefile_pl\*(C'\fR is discouraged. .SH METHODS .IX Header "METHODS" .ie n .IP "create_makefile_pl($style, $build)" 4 .el .IP "create_makefile_pl($style, \f(CW$build\fR)" 4 .IX Item "create_makefile_pl($style, $build)" Creates a \fIMakefile.PL\fR in the current directory in one of several styles, based on the supplied \f(CW\*(C`Module::Build\*(C'\fR object \f(CW$build\fR. This is typically controlled by passing the desired style as the \&\f(CW\*(C`create_makefile_pl\*(C'\fR parameter to \f(CW\*(C`Module::Build\*(C'\fR\*(Aqs \f(CWnew()\fR method; the \fIMakefile.PL\fR will then be automatically created during the \&\f(CW\*(C`distdir\*(C'\fR action. .Sp The currently supported styles are: .RS 4 .IP traditional 4 .IX Item "traditional" A \fIMakefile.PL\fR will be created in the "traditional" style, i.e. it will use \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR and won\*(Aqt rely on \f(CW\*(C`Module::Build\*(C'\fR at all. In order to create the \fIMakefile.PL\fR, we\*(Aqll include the \f(CW\*(C`requires\*(C'\fR and \&\f(CW\*(C`build_requires\*(C'\fR dependencies as the \f(CW\*(C`PREREQ_PM\*(C'\fR parameter. .Sp You don\*(Aqt want to use this style if during the \f(CW\*(C`perl Build.PL\*(C'\fR stage you ask the user questions, or do some auto\-sensing about the user\*(Aqs environment, or if you subclass \f(CW\*(C`Module::Build\*(C'\fR to do some customization, because the vanilla \fIMakefile.PL\fR won\*(Aqt do any of that. Many standard \f(CW\*(C`Module::Build\*(C'\fR features such as \f(CW\*(C`test_requires\*(C'\fR are also not supported. .IP small 4 .IX Item "small" A small \fIMakefile.PL\fR will be created that passes all functionality through to the \fIBuild.PL\fR script in the same directory. The user must already have \f(CW\*(C`Module::Build\*(C'\fR installed in order to use this, or else they\*(Aqll get a module\-not\-found error. .Sp This style attempts (with varying success) to translate the \fIMakefile.PL\fR protocol to \fIBuild.PL\fR, and is unnecessary on any modern toolchain that recognizes \f(CW\*(C`configure_requires\*(C'\fR metadata described below, as \fIBuild.PL\fR will be run by default in this case. See for an example of the issues it may cause. .IP "passthrough (DEPRECATED)" 4 .IX Item "passthrough (DEPRECATED)" This is just like the \f(CW\*(C`small\*(C'\fR option above, but if \f(CW\*(C`Module::Build\*(C'\fR is not already installed on the user\*(Aqs system, the script will offer to use \f(CW\*(C`CPAN.pm\*(C'\fR to download it and install it before continuing with the build. .Sp This option has been deprecated and may be removed in a future version of Module::Build. Modern CPAN.pm and CPANPLUS will recognize the \&\f(CW\*(C`configure_requires\*(C'\fR metadata property and install Module::Build before running Build.PL if Module::Build is listed and Module::Build now adds itself to configure_requires by default. .Sp Perl 5.10.1 includes \f(CW\*(C`configure_requires\*(C'\fR support. In the future, when \&\f(CW\*(C`configure_requires\*(C'\fR support is deemed sufficiently widespread, the \&\f(CW\*(C`passthrough\*(C'\fR style will be removed. .RE .RS 4 .RE .IP "run_build_pl(args => \e@ARGV)" 4 .IX Item "run_build_pl(args => @ARGV)" This method runs the \fIBuild.PL\fR script, passing it any arguments the user may have supplied to the \f(CW\*(C`perl Makefile.PL\*(C'\fR command. Because \&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR and \f(CW\*(C`Module::Build\*(C'\fR accept different arguments, this method also performs some translation between the two. .Sp \&\f(CWrun_build_pl()\fR accepts the following named parameters: .RS 4 .IP args 4 .IX Item "args" The \f(CW\*(C`args\*(C'\fR parameter specifies the parameters that would usually appear on the command line of the \f(CW\*(C`perl Makefile.PL\*(C'\fR command \- typically you\*(Aqll just pass a reference to \f(CW@ARGV\fR. .IP script 4 .IX Item "script" This is the filename of the script to run \- it defaults to \f(CW\*(C`Build.PL\*(C'\fR. .RE .RS 4 .RE .IP \fBwrite_makefile()\fR 4 .IX Item "write_makefile()" This method writes a \*(Aqdummy\*(Aq \fIMakefile\fR that will pass all commands through to the corresponding \f(CW\*(C`Module::Build\*(C'\fR actions. .Sp \&\f(CWwrite_makefile()\fR accepts the following named parameters: .RS 4 .IP makefile 4 .IX Item "makefile" The name of the file to write \- defaults to the string \f(CW\*(C`Makefile\*(C'\fR. .RE .RS 4 .RE .SH SCENARIOS .IX Header "SCENARIOS" So, some common scenarios are: .IP 1. 4 Just include a \fIBuild.PL\fR script (without a \fIMakefile.PL\fR script), and give installation directions in a \fIREADME\fR or \fIINSTALL\fR document explaining how to install the module. In particular, explain that the user must install \f(CW\*(C`Module::Build\*(C'\fR before installing your module. .Sp Note that if you do this, you may make things easier for yourself, but harder for people with older versions of CPAN or CPANPLUS on their system, because those tools generally only understand the \&\fIMakefile.PL\fR/\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR way of doing things. .IP 2. 4 Include a \fIBuild.PL\fR script and a "traditional" \fIMakefile.PL\fR, created either manually or with \f(CWcreate_makefile_pl()\fR. Users won\*(Aqt ever have to install \f(CW\*(C`Module::Build\*(C'\fR if they use the \fIMakefile.PL\fR, but they won\*(Aqt get to take advantage of \f(CW\*(C`Module::Build\*(C'\fR\*(Aqs extra features either. .Sp For good measure, of course, test both the \fIMakefile.PL\fR and the \&\fIBuild.PL\fR before shipping. .IP 3. 4 Include a \fIBuild.PL\fR script and a "pass\-through" \fIMakefile.PL\fR built using \f(CW\*(C`Module::Build::Compat\*(C'\fR. This will mean that people can continue to use the "old" installation commands, and they may never notice that it\*(Aqs actually doing something else behind the scenes. It will also mean that your installation process is compatible with older versions of tools like CPAN and CPANPLUS. .SH AUTHOR .IX Header "AUTHOR" Ken Williams .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2001\-2006 Ken Williams. All rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Module::Build(3), ExtUtils::MakeMaker(3)