-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExtUtils::MakeMaker.3pm.html
1865 lines (1864 loc) · 97.9 KB
/
ExtUtils::MakeMaker.3pm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file. Do not edit.
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
Standard preamble:
========================================================================
Vertical space (when we can't use .PP)
-->
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>ExtUtils::MakeMaker(3pm)</title>
</head>
<body>
<table class="head">
<tr>
<td class="head-ltitle">ExtUtils::MakeMaker(3pm)</td>
<td class="head-vol">Perl Programmers Reference Guide</td>
<td class="head-rtitle">ExtUtils::MakeMaker(3pm)</td>
</tr>
</table>
<div class="manual-text">
<br/>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp">ExtUtils::MakeMaker - Create a module Makefile</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<pre> use ExtUtils::MakeMaker;
WriteMakefile(
NAME => "Foo::Bar",
VERSION_FROM => "lib/Foo/Bar.pm",
);
</pre>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">This utility is designed to write a Makefile for an extension
module from a Makefile.PL. It is based on the Makefile.SH model provided by
Andy Dougherty and the perl5-porters.</p>
<p class="Pp">It splits the task of generating the Makefile into several
subroutines that can be individually overridden. Each subroutine returns the
text it wishes to have written to the Makefile.</p>
<p class="Pp">As there are various Make programs with incompatible syntax, which
use operating system shells, again with incompatible syntax, it is important
for users of this module to know which flavour of Make a Makefile has been
written for so they'll use the correct one and won't have to face the
possibly bewildering errors resulting from using the wrong one.</p>
<p class="Pp">On POSIX systems, that program will likely be GNU Make; on
Microsoft Windows, it will be either Microsoft NMake, DMake or GNU Make. See
the section on the "MAKE" parameter for details.</p>
<p class="Pp">ExtUtils::MakeMaker (EUMM) is object oriented. Each directory
below the current directory that contains a Makefile.PL is treated as a
separate object. This makes it possible to write an unlimited number of
Makefiles with a single invocation of <b>WriteMakefile()</b>.</p>
<p class="Pp">All inputs to WriteMakefile are Unicode characters, not just
octets. EUMM seeks to handle all of these correctly. It is currently still
not possible to portably use Unicode characters in module names, because
this requires Perl to handle Unicode filenames, which is not yet the case on
Windows.</p>
<p class="Pp">See ExtUtils::MakeMaker::FAQ for details of the design and
usage.</p>
<section class="Ss">
<h2 class="Ss" id="How_To_Write_A_Makefile.PL"><a class="permalink" href="#How_To_Write_A_Makefile.PL">How
To Write A Makefile.PL</a></h2>
<p class="Pp">See ExtUtils::MakeMaker::Tutorial.</p>
<p class="Pp">The long answer is the rest of the manpage :-)</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Default_Makefile_Behaviour"><a class="permalink" href="#Default_Makefile_Behaviour">Default
Makefile Behaviour</a></h2>
<p class="Pp">The generated Makefile enables the user of the extension to
invoke</p>
<p class="Pp"></p>
<pre> perl Makefile.PL # optionally "perl Makefile.PL verbose"
make
make test # optionally set TEST_VERBOSE=1
make install # See below
</pre>
<p class="Pp">The Makefile to be produced may be altered by adding arguments of
the form <span class="Li">"KEY=VALUE"</span>. E.g.</p>
<p class="Pp"></p>
<pre> perl Makefile.PL INSTALL_BASE=~
</pre>
<p class="Pp">Other interesting targets in the generated Makefile are</p>
<p class="Pp"></p>
<pre> make config # to check if the Makefile is up-to-date
make clean # delete local temp files (Makefile gets renamed)
make realclean # delete derived files (including ./blib)
make ci # check in all the files in the MANIFEST file
make dist # see below the Distribution Support section
</pre>
</section>
<section class="Ss">
<h2 class="Ss" id="make_test"><a class="permalink" href="#make_test">make
test</a></h2>
<p class="Pp">MakeMaker checks for the existence of a file named <i>test.pl</i>
in the current directory, and if it exists it executes the script with the
proper set of perl <span class="Li">"-I"</span> options.</p>
<p class="Pp">MakeMaker also checks for any files matching
glob("t/*.t"). It will execute all matching files in alphabetical
order via the Test::Harness module with the
<span class="Li">"-I"</span> switches set correctly.</p>
<p class="Pp">You can also organize your tests within subdirectories in the
<i>t/</i> directory. To do so, use the <i>test</i> directive in your
<i>Makefile.PL</i>. For example, if you had tests in:</p>
<p class="Pp"></p>
<pre> t/foo
t/foo/bar
</pre>
<p class="Pp">You could tell make to run tests in both of those directories with
the following directives:</p>
<p class="Pp"></p>
<pre> test => {TESTS => 't/*/*.t t/*/*/*.t'}
test => {TESTS => 't/foo/*.t t/foo/bar/*.t'}
</pre>
<p class="Pp">The first will run all test files in all first-level
subdirectories and all subdirectories they contain. The second will run
tests in only the <i>t/foo</i> and <i>t/foo/bar</i>.</p>
<p class="Pp">If you'd like to see the raw output of your tests, set the
<span class="Li">"TEST_VERBOSE"</span> variable to true.</p>
<p class="Pp"></p>
<pre> make test TEST_VERBOSE=1
</pre>
<p class="Pp">If you want to run particular test files, set the
<span class="Li">"TEST_FILES"</span> variable. It is possible to
use globbing with this mechanism.</p>
<p class="Pp"></p>
<pre> make test TEST_FILES='t/foobar.t t/dagobah*.t'
</pre>
<p class="Pp">Windows users who are using
<span class="Li">"nmake"</span> should note that due to a bug in
<span class="Li">"nmake"</span>, when specifying
<span class="Li">"TEST_FILES"</span> you must use back-slashes
instead of forward-slashes.</p>
<p class="Pp"></p>
<pre> nmake test TEST_FILES='t\foobar.t t\dagobah*.t'
</pre>
</section>
<section class="Ss">
<h2 class="Ss" id="make_testdb"><a class="permalink" href="#make_testdb">make
testdb</a></h2>
<p class="Pp">A useful variation of the above is the target
<span class="Li">"testdb"</span>. It runs the test under the Perl
debugger (see perldebug). If the file <i>test.pl</i> exists in the current
directory, it is used for the test.</p>
<p class="Pp">If you want to debug some other testfile, set the
<span class="Li">"TEST_FILE"</span> variable thusly:</p>
<p class="Pp"></p>
<pre> make testdb TEST_FILE=t/mytest.t
</pre>
<p class="Pp">By default the debugger is called using
<span class="Li">"-d"</span> option to perl. If you want to
specify some other option, set the
<span class="Li">"TESTDB_SW"</span> variable:</p>
<p class="Pp"></p>
<pre> make testdb TESTDB_SW=-Dx
</pre>
</section>
<section class="Ss">
<h2 class="Ss" id="make_install"><a class="permalink" href="#make_install">make
install</a></h2>
<p class="Pp">make alone puts all relevant files into directories that are named
by the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and
INST_MAN3DIR. All these default to something below ./blib if you are
<i>not</i> building below the perl source directory. If you <i>are</i>
building below the perl source, INST_LIB and INST_ARCHLIB default to
../../lib, and INST_SCRIPT is not defined.</p>
<p class="Pp">The <i>install</i> target of the generated Makefile copies the
files found below each of the INST_* directories to their INSTALL*
counterparts. Which counterparts are chosen depends on the setting of
INSTALLDIRS according to the following table:</p>
<p class="Pp"></p>
<pre> INSTALLDIRS set to
perl site vendor
PERLPREFIX SITEPREFIX VENDORPREFIX
INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN
INST_SCRIPT INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT
INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR
INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR
</pre>
<p class="Pp">The INSTALL... macros in turn default to their
<span class="Li">%Config</span> ($Config{installprivlib},
<span class="Li">$Config</span>{installarchlib}, etc.) counterparts.</p>
<p class="Pp">You can check the values of these variables on your system
with</p>
<p class="Pp"></p>
<pre> perl '-V:install.*'
</pre>
<p class="Pp">And to check the sequence in which the library directories are
searched by perl, run</p>
<p class="Pp"></p>
<pre> perl -le 'print join $/, @INC'
</pre>
<p class="Pp">Sometimes older versions of the module you're installing live in
other directories in <span class="Li">@INC</span>. Because Perl loads the
first version of a module it finds, not the newest, you might accidentally
get one of these older versions even after installing a brand new version.
To delete <i>all other</i> <i>versions of the module you're installing</i>
(not simply older ones) set the <span class="Li">"UNINST"</span>
variable.</p>
<p class="Pp"></p>
<pre> make install UNINST=1
</pre>
</section>
<section class="Ss">
<h2 class="Ss">INSTALL_BASE</h2>
<p class="Pp">INSTALL_BASE can be passed into Makefile.PL to change where your
module will be installed. INSTALL_BASE is more like what everyone else calls
"prefix" than PREFIX is.</p>
<p class="Pp">To have everything installed in your home directory, do the
following.</p>
<p class="Pp"></p>
<pre> # Unix users, INSTALL_BASE=~ works fine
perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir
</pre>
<p class="Pp">Like PREFIX, it sets several INSTALL* attributes at once. Unlike
PREFIX it is easy to predict where the module will end up. The installation
pattern looks like this:</p>
<p class="Pp"></p>
<pre> INSTALLARCHLIB INSTALL_BASE/lib/perl5/$Config{archname}
INSTALLPRIVLIB INSTALL_BASE/lib/perl5
INSTALLBIN INSTALL_BASE/bin
INSTALLSCRIPT INSTALL_BASE/bin
INSTALLMAN1DIR INSTALL_BASE/man/man1
INSTALLMAN3DIR INSTALL_BASE/man/man3
</pre>
<p class="Pp">INSTALL_BASE in MakeMaker and
<span class="Li">"--install_base"</span> in Module::Build (as of
0.28) install to the same location. If you want MakeMaker and Module::Build
to install to the same location simply set INSTALL_BASE and
<span class="Li">"--install_base"</span> to the same location.</p>
<p class="Pp">INSTALL_BASE was added in 6.31.</p>
</section>
<section class="Ss">
<h2 class="Ss">PREFIX and LIB attribute</h2>
<p class="Pp">PREFIX and LIB can be used to set several INSTALL* attributes in
one go. Here's an example for installing into your home directory.</p>
<p class="Pp"></p>
<pre> # Unix users, PREFIX=~ works fine
perl Makefile.PL PREFIX=/path/to/your/home/dir
</pre>
<p class="Pp">This will install all files in the module under your home
directory, with man pages and libraries going into an appropriate place
(usually ~/man and ~/lib). How the exact location is determined is
complicated and depends on how your Perl was configured. INSTALL_BASE works
more like what other build systems call "prefix" than PREFIX and
we recommend you use that instead.</p>
<p class="Pp">Another way to specify many INSTALL directories with a single
parameter is LIB.</p>
<p class="Pp"></p>
<pre> perl Makefile.PL LIB=~/lib
</pre>
<p class="Pp">This will install the module's architecture-independent files into
~/lib, the architecture-dependent files into ~/lib/$archname.</p>
<p class="Pp">Note, that in both cases the tilde expansion is done by MakeMaker,
not by perl by default, nor by make.</p>
<p class="Pp">Conflicts between parameters LIB, PREFIX and the various INSTALL*
arguments are resolved so that:</p>
<ul class="Bl-bullet">
<li>setting LIB overrides any setting of INSTALLPRIVLIB, INSTALLARCHLIB,
INSTALLSITELIB, INSTALLSITEARCH (and they are not affected by
PREFIX);</li>
<li>without LIB, setting PREFIX replaces the initial
<span class="Li">$Config{prefix}</span> part of those INSTALL* arguments,
even if the latter are explicitly set (but are set to still start with
<span class="Li">$Config{prefix}</span>).</li>
</ul>
<p class="Pp">If the user has superuser privileges, and is not working on AFS or
relatives, then the defaults for INSTALLPRIVLIB, INSTALLARCHLIB,
INSTALLSCRIPT, etc. will be appropriate, and this incantation will be the
best:</p>
<p class="Pp"></p>
<pre> perl Makefile.PL;
make;
make test
make install
</pre>
<p class="Pp">make install by default writes some documentation of what has been
done into the file
<span class="Li">"$(INSTALLARCHLIB)/perllocal.pod"</span>. This
feature can be bypassed by calling make pure_install.</p>
</section>
<section class="Ss">
<h2 class="Ss">AFS users</h2>
<p class="Pp">will have to specify the installation directories as these most
probably have changed since perl itself has been installed. They will have
to do this by calling</p>
<p class="Pp"></p>
<pre> perl Makefile.PL INSTALLSITELIB=/afs/here/today \
INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages
make
</pre>
<p class="Pp">Be careful to repeat this procedure every time you recompile an
extension, unless you are sure the AFS installation directories are still
valid.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Static_Linking_of_a_new_Perl_Binary"><a class="permalink" href="#Static_Linking_of_a_new_Perl_Binary">Static
Linking of a new Perl Binary</a></h2>
<p class="Pp">An extension that is built with the above steps is ready to use on
systems supporting dynamic loading. On systems that do not support dynamic
loading, any newly created extension has to be linked together with the
available resources. MakeMaker supports the linking process by creating
appropriate targets in the Makefile whenever an extension is built. You can
invoke the corresponding section of the makefile with</p>
<p class="Pp"></p>
<pre> make perl
</pre>
<p class="Pp">That produces a new perl binary in the current directory with all
extensions linked in that can be found in INST_ARCHLIB, SITELIBEXP, and
PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on UNIX, this is
called <i>Makefile.aperl</i> (may be system dependent). If you want to force
the creation of a new perl, it is recommended that you delete this
<i>Makefile.aperl</i>, so the directories are searched through for linkable
libraries again.</p>
<p class="Pp">The binary can be installed into the directory where perl normally
resides on your machine with</p>
<p class="Pp"></p>
<pre> make inst_perl
</pre>
<p class="Pp">To produce a perl binary with a different name than
<span class="Li">"perl"</span>, either say</p>
<p class="Pp"></p>
<pre> perl Makefile.PL MAP_TARGET=myperl
make myperl
make inst_perl
</pre>
<p class="Pp">or say</p>
<p class="Pp"></p>
<pre> perl Makefile.PL
make myperl MAP_TARGET=myperl
make inst_perl MAP_TARGET=myperl
</pre>
<p class="Pp">In any case you will be prompted with the correct invocation of
the <span class="Li">"inst_perl"</span> target that installs the
new binary into INSTALLBIN.</p>
<p class="Pp">make inst_perl by default writes some documentation of what has
been done into the file
<span class="Li">"$(INSTALLARCHLIB)/perllocal.pod"</span>. This
can be bypassed by calling make pure_inst_perl.</p>
<p class="Pp">Warning: the inst_perl: target will most probably overwrite your
existing perl binary. Use with care!</p>
<p class="Pp">Sometimes you might want to build a statically linked perl
although your system supports dynamic loading. In this case you may
explicitly set the linktype with the invocation of the Makefile.PL or
make:</p>
<p class="Pp"></p>
<pre> perl Makefile.PL LINKTYPE=static # recommended
</pre>
<p class="Pp">or</p>
<p class="Pp"></p>
<pre> make LINKTYPE=static # works on most systems
</pre>
</section>
<section class="Ss">
<h2 class="Ss" id="Determination_of_Perl_Library_and_Installation_Locations"><a class="permalink" href="#Determination_of_Perl_Library_and_Installation_Locations">Determination
of Perl Library and Installation Locations</a></h2>
<p class="Pp">MakeMaker needs to know, or to guess, where certain things are
located. Especially INST_LIB and INST_ARCHLIB (where to put the files during
the <b>make</b>(1) run), PERL_LIB and PERL_ARCHLIB (where to read existing
modules from), and PERL_INC (header files and
<span class="Li">"libperl*.*"</span>).</p>
<p class="Pp">Extensions may be built either using the contents of the perl
source directory tree or from the installed perl library. The recommended
way is to build extensions after you have run 'make install' on perl itself.
You can do that in any directory on your hard disk that is not below the
perl source tree. The support for extensions below the ext directory of the
perl distribution is only good for the standard extensions that come with
perl.</p>
<p class="Pp">If an extension is being built below the
<span class="Li">"ext/"</span> directory of the perl source then
MakeMaker will set PERL_SRC automatically (e.g.,
<span class="Li">"../.."</span>). If PERL_SRC is defined and the
extension is recognized as a standard extension, then other variables
default to the following:</p>
<p class="Pp"></p>
<pre> PERL_INC = PERL_SRC
PERL_LIB = PERL_SRC/lib
PERL_ARCHLIB = PERL_SRC/lib
INST_LIB = PERL_LIB
INST_ARCHLIB = PERL_ARCHLIB
</pre>
<p class="Pp">If an extension is being built away from the perl source then
MakeMaker will leave PERL_SRC undefined and default to using the installed
copy of the perl library. The other variables default to the following:</p>
<p class="Pp"></p>
<pre> PERL_INC = $archlibexp/CORE
PERL_LIB = $privlibexp
PERL_ARCHLIB = $archlibexp
INST_LIB = ./blib/lib
INST_ARCHLIB = ./blib/arch
</pre>
<p class="Pp">If perl has not yet been installed then PERL_SRC can be defined on
the command line as shown in the previous section.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Which_architecture_dependent_directory?"><a class="permalink" href="#Which_architecture_dependent_directory?">Which
architecture dependent directory?</a></h2>
<p class="Pp">If you don't want to keep the defaults for the INSTALL* macros,
MakeMaker helps you to minimize the typing needed: the usual relationship
between INSTALLPRIVLIB and INSTALLARCHLIB is determined by Configure at perl
compilation time. MakeMaker supports the user who sets INSTALLPRIVLIB. If
INSTALLPRIVLIB is set, but INSTALLARCHLIB not, then MakeMaker defaults the
latter to be the same subdirectory of INSTALLPRIVLIB as Configure decided
for the counterparts in <span class="Li">%Config</span>, otherwise it
defaults to INSTALLPRIVLIB. The same relationship holds for INSTALLSITELIB
and INSTALLSITEARCH.</p>
<p class="Pp">MakeMaker gives you much more freedom than needed to configure
internal variables and get different results. It is worth mentioning that
<b>make</b>(1) also lets you configure most of the variables that are used
in the Makefile. But in the majority of situations this will not be
necessary, and should only be done if the author of a package recommends it
(or you know what you're doing).</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Using_Attributes_and_Parameters"><a class="permalink" href="#Using_Attributes_and_Parameters">Using
Attributes and Parameters</a></h2>
<p class="Pp">The following attributes may be specified as arguments to
<b>WriteMakefile()</b> or as NAME=VALUE pairs on the command line.
Attributes that became available with later versions of MakeMaker are
indicated.</p>
<p class="Pp">In order to maintain portability of attributes with older versions
of MakeMaker you may want to use App::EUMM::Upgrade with your
<span class="Li">"Makefile.PL"</span>.</p>
<dl class="Bl-tag">
<dt id="ABSTRACT"><a class="permalink" href="#ABSTRACT">ABSTRACT</a></dt>
<dd>One line description of the module. Will be included in PPD file.</dd>
<dt id="ABSTRACT_FROM"><a class="permalink" href="#ABSTRACT_FROM">ABSTRACT_FROM</a></dt>
<dd>Name of the file that contains the package description. MakeMaker looks
for a line in the POD matching /^($package\s-\s)(.*)/. This is typically
the first line in the "=head1 NAME" section.
<span class="Li">$2</span> becomes the abstract.</dd>
<dt id="AUTHOR"><a class="permalink" href="#AUTHOR">AUTHOR</a></dt>
<dd>Array of strings containing name (and email address) of package author(s).
Is used in CPAN Meta files (META.yml or META.json) and PPD (Perl Package
Description) files for PPM (Perl Package Manager).</dd>
<dt id="BINARY_LOCATION"><a class="permalink" href="#BINARY_LOCATION">BINARY_LOCATION</a></dt>
<dd>Used when creating PPD files for binary packages. It can be set to a full
or relative path or URL to the binary archive for a particular
architecture. For example:
<p class="Pp"></p>
<pre> perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz
</pre>
<p class="Pp">builds a PPD package that references a binary of the
<span class="Li">"Agent"</span> package, located in the
<span class="Li">"x86"</span> directory relative to the PPD
itself.</p>
</dd>
<dt id="BUILD_REQUIRES"><a class="permalink" href="#BUILD_REQUIRES">BUILD_REQUIRES</a></dt>
<dd>Available in version 6.55_03 and above.
<p class="Pp">A hash of modules that are needed to build your module but not
run it.</p>
<p class="Pp">This will go into the
<span class="Li">"build_requires"</span> field of your
<i>META.yml</i> and the <span class="Li">"build"</span> of the
<span class="Li">"prereqs"</span> field of your
<i>META.json</i>.</p>
<p class="Pp">Defaults to <span class="Li">"{
"ExtUtils::MakeMaker" => 0 }"</span> if this attribute
is not specified.</p>
<p class="Pp">The format is the same as PREREQ_PM.</p>
</dd>
<dt id="C"><a class="permalink" href="#C">C</a></dt>
<dd>Ref to array of *.c file names. Initialised from a directory scan and the
values portion of the XS attribute hash. This is not currently used by
MakeMaker but may be handy in Makefile.PLs.</dd>
<dt id="CCFLAGS"><a class="permalink" href="#CCFLAGS">CCFLAGS</a></dt>
<dd>String that will be included in the compiler call command line between the
arguments INC and OPTIMIZE.</dd>
<dt id="CONFIG"><a class="permalink" href="#CONFIG">CONFIG</a></dt>
<dd>Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
config.sh. MakeMaker will add to CONFIG the following values anyway: ar cc
cccdlflags ccdlflags dlext dlsrc ld lddlflags ldflags libc lib_ext obj_ext
ranlib sitelibexp sitearchexp so</dd>
<dt id="CONFIGURE"><a class="permalink" href="#CONFIGURE">CONFIGURE</a></dt>
<dd>CODE reference. The subroutine should return a hash reference. The hash
may contain further attributes, e.g. {LIBS => ...}, that have to be
determined by some evaluation method.</dd>
<dt id="CONFIGURE_REQUIRES"><a class="permalink" href="#CONFIGURE_REQUIRES">CONFIGURE_REQUIRES</a></dt>
<dd>Available in version 6.52 and above.
<p class="Pp">A hash of modules that are required to run Makefile.PL itself,
but not to run your distribution.</p>
<p class="Pp">This will go into the
<span class="Li">"configure_requires"</span> field of your
<i>META.yml</i> and the <span class="Li">"configure"</span> of
the <span class="Li">"prereqs"</span> field of your
<i>META.json</i>.</p>
<p class="Pp">Defaults to <span class="Li">"{
"ExtUtils::MakeMaker" => 0 }"</span> if this attribute
is not specified.</p>
<p class="Pp">The format is the same as PREREQ_PM.</p>
</dd>
<dt id="DEFINE"><a class="permalink" href="#DEFINE">DEFINE</a></dt>
<dd>Something like <span class="Li">"-DHAVE_UNISTD_H"</span></dd>
<dt id="DESTDIR"><a class="permalink" href="#DESTDIR">DESTDIR</a></dt>
<dd>This is the root directory into which the code will be installed. It
<i>prepends itself to the normal prefix</i>. For example, if your code
would normally go into <i>/usr/local/lib/perl</i> you could set
DESTDIR=~/tmp/ and installation would go into
<i>~/tmp/usr/local/lib/perl</i>.
<p class="Pp">This is primarily of use for people who repackage Perl
modules.</p>
<p class="Pp">NOTE: Due to the nature of make, it is important that you put
the trailing slash on your DESTDIR. <i>~/tmp/</i> not <i>~/tmp</i>.</p>
</dd>
<dt id="DIR"><a class="permalink" href="#DIR">DIR</a></dt>
<dd>Ref to array of subdirectories containing Makefile.PLs e.g. ['sdbm'] in
ext/SDBM_File</dd>
<dt id="DISTNAME"><a class="permalink" href="#DISTNAME">DISTNAME</a></dt>
<dd>A safe filename for the package.
<p class="Pp">Defaults to NAME below but with :: replaced with -.</p>
<p class="Pp">For example, Foo::Bar becomes Foo-Bar.</p>
</dd>
<dt id="DISTVNAME"><a class="permalink" href="#DISTVNAME">DISTVNAME</a></dt>
<dd>Your name for distributing the package with the version number included.
This is used by 'make dist' to name the resulting archive file.
<p class="Pp">Defaults to DISTNAME-VERSION.</p>
<p class="Pp">For example, version 1.04 of Foo::Bar becomes
Foo-Bar-1.04.</p>
<p class="Pp">On some OS's where . has special meaning VERSION_SYM may be
used in place of VERSION.</p>
</dd>
<dt id="DLEXT"><a class="permalink" href="#DLEXT">DLEXT</a></dt>
<dd>Specifies the extension of the module's loadable object. For example:
<p class="Pp"></p>
<pre> DLEXT => 'unusual_ext', # Default value is $Config{so}
</pre>
<p class="Pp">NOTE: When using this option to alter the extension of a
module's loadable object, it is also necessary that the module's pm file
specifies the same change:</p>
<p class="Pp"></p>
<pre> local $DynaLoader::dl_dlext = 'unusual_ext';
</pre>
</dd>
<dt id="DL_FUNCS"><a class="permalink" href="#DL_FUNCS">DL_FUNCS</a></dt>
<dd>Hashref of symbol names for routines to be made available as universal
symbols. Each key/value pair consists of the package name and an array of
routine names in that package. Used only under AIX, OS/2, VMS and Win32 at
present. The routine names supplied will be expanded in the same way as
XSUB names are expanded by the <b>XS()</b> macro. Defaults to
<p class="Pp"></p>
<pre> {"$(NAME)" => ["boot_$(NAME)" ] }
</pre>
<p class="Pp">e.g.</p>
<p class="Pp"></p>
<pre> {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )],
"NetconfigPtr" => [ 'DESTROY'] }
</pre>
<p class="Pp">Please see the ExtUtils::Mksymlists documentation for more
information about the DL_FUNCS, DL_VARS and FUNCLIST attributes.</p>
</dd>
<dt id="DL_VARS"><a class="permalink" href="#DL_VARS">DL_VARS</a></dt>
<dd>Array of symbol names for variables to be made available as universal
symbols. Used only under AIX, OS/2, VMS and Win32 at present. Defaults to
[]. (e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ])</dd>
<dt id="EXCLUDE_EXT"><a class="permalink" href="#EXCLUDE_EXT">EXCLUDE_EXT</a></dt>
<dd>Array of extension names to exclude when doing a static build. This is
ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more details.
(e.g. [ qw( Socket POSIX ) ] )
<p class="Pp">This attribute may be most useful when specified as a string
on the command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'</p>
</dd>
<dt id="EXE_FILES"><a class="permalink" href="#EXE_FILES">EXE_FILES</a></dt>
<dd>Ref to array of executable files. The files will be copied to the
INST_SCRIPT directory. Make realclean will delete them from there again.
<p class="Pp">If your executables start with something like #!perl or
#!/usr/bin/perl MakeMaker will change this to the path of the perl
'Makefile.PL' was invoked with so the programs will be sure to run
properly even if perl is not in /usr/bin/perl.</p>
</dd>
<dt id="FIRST_MAKEFILE"><a class="permalink" href="#FIRST_MAKEFILE">FIRST_MAKEFILE</a></dt>
<dd>The name of the Makefile to be produced. This is used for the second
Makefile that will be produced for the MAP_TARGET.
<p class="Pp">Defaults to 'Makefile' or 'Descrip.MMS' on VMS.</p>
<p class="Pp">(Note: we couldn't use MAKEFILE because dmake uses this for
something else).</p>
</dd>
<dt id="FULLPERL"><a class="permalink" href="#FULLPERL">FULLPERL</a></dt>
<dd>Perl binary able to run this extension, load XS modules, etc...</dd>
<dt id="FULLPERLRUN"><a class="permalink" href="#FULLPERLRUN">FULLPERLRUN</a></dt>
<dd>Like PERLRUN, except it uses FULLPERL.</dd>
<dt id="FULLPERLRUNINST"><a class="permalink" href="#FULLPERLRUNINST">FULLPERLRUNINST</a></dt>
<dd>Like PERLRUNINST, except it uses FULLPERL.</dd>
<dt id="FUNCLIST"><a class="permalink" href="#FUNCLIST">FUNCLIST</a></dt>
<dd>This provides an alternate means to specify function names to be exported
from the extension. Its value is a reference to an array of function names
to be exported by the extension. These names are passed through unaltered
to the linker options file.</dd>
<dt id="H"><a class="permalink" href="#H">H</a></dt>
<dd>Ref to array of *.h file names. Similar to C.</dd>
<dt id="IMPORTS"><a class="permalink" href="#IMPORTS">IMPORTS</a></dt>
<dd>This attribute is used to specify names to be imported into the extension.
Takes a hash ref.
<p class="Pp">It is only used on OS/2 and Win32.</p>
</dd>
<dt id="INC"><a class="permalink" href="#INC">INC</a></dt>
<dd>Include file dirs eg: <span class="Li">"-I/usr/5include
-I/path/to/inc"</span></dd>
<dt id="INCLUDE_EXT"><a class="permalink" href="#INCLUDE_EXT">INCLUDE_EXT</a></dt>
<dd>Array of extension names to be included when doing a static build.
MakeMaker will normally build with all of the installed extensions when
doing a static build, and that is usually the desired behavior. If
INCLUDE_EXT is present then MakeMaker will build only with those
extensions which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ])
<p class="Pp">It is not necessary to mention DynaLoader or the current
extension when filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned
but is empty then only DynaLoader and the current extension will be
included in the build.</p>
<p class="Pp">This attribute may be most useful when specified as a string
on the command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket
Devel::Peek'</p>
</dd>
<dt id="INSTALLARCHLIB"><a class="permalink" href="#INSTALLARCHLIB">INSTALLARCHLIB</a></dt>
<dd>Used by 'make install', which copies files from INST_ARCHLIB to this
directory if INSTALLDIRS is set to perl.</dd>
<dt id="INSTALLBIN"><a class="permalink" href="#INSTALLBIN">INSTALLBIN</a></dt>
<dd>Directory to install binary files (e.g. tkperl) into if
INSTALLDIRS=perl.</dd>
<dt id="INSTALLDIRS"><a class="permalink" href="#INSTALLDIRS">INSTALLDIRS</a></dt>
<dd>Determines which of the sets of installation directories to choose: perl,
site or vendor. Defaults to site.</dd>
<dt id="INSTALLMAN1DIR"><a class="permalink" href="#INSTALLMAN1DIR">INSTALLMAN1DIR</a></dt>
<dd></dd>
<dt id="INSTALLMAN3DIR"><a class="permalink" href="#INSTALLMAN3DIR">INSTALLMAN3DIR</a></dt>
<dd>These directories get the man pages at 'make install' time if
INSTALLDIRS=perl. Defaults to
<span class="Li">$Config</span>{installman*dir}.
<p class="Pp">If set to 'none', no man pages will be installed.</p>
</dd>
<dt id="INSTALLPRIVLIB"><a class="permalink" href="#INSTALLPRIVLIB">INSTALLPRIVLIB</a></dt>
<dd>Used by 'make install', which copies files from INST_LIB to this directory
if INSTALLDIRS is set to perl.
<p class="Pp">Defaults to
<span class="Li">$Config</span>{installprivlib}.</p>
</dd>
<dt id="INSTALLSCRIPT"><a class="permalink" href="#INSTALLSCRIPT">INSTALLSCRIPT</a></dt>
<dd>Available in version 6.30_02 and above.
<p class="Pp">Used by 'make install' which copies files from INST_SCRIPT to
this directory if INSTALLDIRS=perl.</p>
</dd>
<dt id="INSTALLSITEARCH"><a class="permalink" href="#INSTALLSITEARCH">INSTALLSITEARCH</a></dt>
<dd>Used by 'make install', which copies files from INST_ARCHLIB to this
directory if INSTALLDIRS is set to site (default).</dd>
<dt id="INSTALLSITEBIN"><a class="permalink" href="#INSTALLSITEBIN">INSTALLSITEBIN</a></dt>
<dd>Used by 'make install', which copies files from INST_BIN to this directory
if INSTALLDIRS is set to site (default).</dd>
<dt id="INSTALLSITELIB"><a class="permalink" href="#INSTALLSITELIB">INSTALLSITELIB</a></dt>
<dd>Used by 'make install', which copies files from INST_LIB to this directory
if INSTALLDIRS is set to site (default).</dd>
<dt id="INSTALLSITEMAN1DIR"><a class="permalink" href="#INSTALLSITEMAN1DIR">INSTALLSITEMAN1DIR</a></dt>
<dd></dd>
<dt id="INSTALLSITEMAN3DIR"><a class="permalink" href="#INSTALLSITEMAN3DIR">INSTALLSITEMAN3DIR</a></dt>
<dd>These directories get the man pages at 'make install' time if
INSTALLDIRS=site (default). Defaults to $(SITEPREFIX)/man/man$(MAN*EXT).
<p class="Pp">If set to 'none', no man pages will be installed.</p>
</dd>
<dt id="INSTALLSITESCRIPT"><a class="permalink" href="#INSTALLSITESCRIPT">INSTALLSITESCRIPT</a></dt>
<dd>Used by 'make install' which copies files from INST_SCRIPT to this
directory if INSTALLDIRS is set to site (default).</dd>
<dt id="INSTALLVENDORARCH"><a class="permalink" href="#INSTALLVENDORARCH">INSTALLVENDORARCH</a></dt>
<dd>Used by 'make install', which copies files from INST_ARCHLIB to this
directory if INSTALLDIRS is set to vendor. Note that if you do not set
this, the value of INSTALLVENDORLIB will be used, which is probably not
what you want.</dd>
<dt id="INSTALLVENDORBIN"><a class="permalink" href="#INSTALLVENDORBIN">INSTALLVENDORBIN</a></dt>
<dd>Used by 'make install', which copies files from INST_BIN to this directory
if INSTALLDIRS is set to vendor.</dd>
<dt id="INSTALLVENDORLIB"><a class="permalink" href="#INSTALLVENDORLIB">INSTALLVENDORLIB</a></dt>
<dd>Used by 'make install', which copies files from INST_LIB to this directory
if INSTALLDIRS is set to vendor.</dd>
<dt id="INSTALLVENDORMAN1DIR"><a class="permalink" href="#INSTALLVENDORMAN1DIR">INSTALLVENDORMAN1DIR</a></dt>
<dd></dd>
<dt id="INSTALLVENDORMAN3DIR"><a class="permalink" href="#INSTALLVENDORMAN3DIR">INSTALLVENDORMAN3DIR</a></dt>
<dd>These directories get the man pages at 'make install' time if
INSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT).
<p class="Pp">If set to 'none', no man pages will be installed.</p>
</dd>
<dt id="INSTALLVENDORSCRIPT"><a class="permalink" href="#INSTALLVENDORSCRIPT">INSTALLVENDORSCRIPT</a></dt>
<dd>Available in version 6.30_02 and above.
<p class="Pp">Used by 'make install' which copies files from INST_SCRIPT to
this directory if INSTALLDIRS is set to vendor.</p>
</dd>
<dt id="INST_ARCHLIB"><a class="permalink" href="#INST_ARCHLIB">INST_ARCHLIB</a></dt>
<dd>Same as INST_LIB for architecture dependent files.</dd>
<dt id="INST_BIN"><a class="permalink" href="#INST_BIN">INST_BIN</a></dt>
<dd>Directory to put real binary files during 'make'. These will be copied to
INSTALLBIN during 'make install'</dd>
<dt id="INST_LIB"><a class="permalink" href="#INST_LIB">INST_LIB</a></dt>
<dd>Directory where we put library files of this extension while building
it.</dd>
<dt id="INST_MAN1DIR"><a class="permalink" href="#INST_MAN1DIR">INST_MAN1DIR</a></dt>
<dd>Directory to hold the man pages at 'make' time</dd>
<dt id="INST_MAN3DIR"><a class="permalink" href="#INST_MAN3DIR">INST_MAN3DIR</a></dt>
<dd>Directory to hold the man pages at 'make' time</dd>
<dt id="INST_SCRIPT"><a class="permalink" href="#INST_SCRIPT">INST_SCRIPT</a></dt>
<dd>Directory where executable files should be installed during 'make'.
Defaults to "./blib/script", just to have a dummy location
during testing. make install will copy the files in INST_SCRIPT to
INSTALLSCRIPT.</dd>
<dt id="LD"><a class="permalink" href="#LD">LD</a></dt>
<dd>Program to be used to link libraries for dynamic loading.
<p class="Pp">Defaults to <span class="Li">$Config</span>{ld}.</p>
</dd>
<dt id="LDDLFLAGS"><a class="permalink" href="#LDDLFLAGS">LDDLFLAGS</a></dt>
<dd>Any special flags that might need to be passed to ld to create a shared
library suitable for dynamic loading. It is up to the makefile to use it.
(See "lddlflags" in Config)
<p class="Pp">Defaults to <span class="Li">$Config</span>{lddlflags}.</p>
</dd>
<dt id="LDFROM"><a class="permalink" href="#LDFROM">LDFROM</a></dt>
<dd>Defaults to "$(OBJECT)" and is used in the ld command to specify
what files to link/load from (also see dynamic_lib below for how to
specify ld flags)</dd>
<dt id="LIB"><a class="permalink" href="#LIB">LIB</a></dt>
<dd>LIB should only be set at <span class="Li">"perl
Makefile.PL"</span> time but is allowed as a MakeMaker argument. It
has the effect of setting both INSTALLPRIVLIB and INSTALLSITELIB to that
value regardless any explicit setting of those arguments (or of PREFIX).
INSTALLARCHLIB and INSTALLSITEARCH are set to the corresponding
architecture subdirectory.</dd>
<dt id="LIBPERL_A"><a class="permalink" href="#LIBPERL_A">LIBPERL_A</a></dt>
<dd>The filename of the perllibrary that will be used together with this
extension. Defaults to libperl.a.</dd>
<dt id="LIBS"><a class="permalink" href="#LIBS">LIBS</a></dt>
<dd>An anonymous array of alternative library specifications to be searched
for (in order) until at least one library is found. E.g.
<p class="Pp"></p>
<pre> 'LIBS' => ["-lgdbm", "-ldbm -lfoo", "-L/path -ldbm.nfs"]
</pre>
<p class="Pp">Mind, that any element of the array contains a complete set of
arguments for the ld command. So do not specify</p>
<p class="Pp"></p>
<pre> 'LIBS' => ["-ltcl", "-ltk", "-lX11"]
</pre>
<p class="Pp">See ODBM_File/Makefile.PL for an example, where an array is
needed. If you specify a scalar as in</p>
<p class="Pp"></p>
<pre> 'LIBS' => "-ltcl -ltk -lX11"
</pre>
<p class="Pp">MakeMaker will turn it into an array with one element.</p>
</dd>
<dt>LICENSE</dt>
<dd>Available in version 6.31 and above.
<p class="Pp">The licensing terms of your distribution. Generally it's
"perl_5" for the same license as Perl itself.</p>
<p class="Pp">See CPAN::Meta::Spec for the list of options.</p>
<p class="Pp">Defaults to "unknown".</p>
</dd>
<dt id="LINKTYPE"><a class="permalink" href="#LINKTYPE">LINKTYPE</a></dt>
<dd>'static' or 'dynamic' (default unless usedl=undef in config.sh). Should
only be used to force static linking (also see linkext below).</dd>
<dt id="MAGICXS"><a class="permalink" href="#MAGICXS">MAGICXS</a></dt>
<dd>Available in version 6.8305 and above.
<p class="Pp">When this is set to <span class="Li">1</span>,
<span class="Li">"OBJECT"</span> will be automagically derived
from <span class="Li">"O_FILES"</span>.</p>
</dd>
<dt id="MAKE"><a class="permalink" href="#MAKE">MAKE</a></dt>
<dd>Available in version 6.30_01 and above.
<p class="Pp">Variant of make you intend to run the generated Makefile with.
This parameter lets Makefile.PL know what make quirks to account for
when generating the Makefile.</p>
<p class="Pp">MakeMaker also honors the MAKE environment variable. This
parameter takes precedence.</p>
<p class="Pp">Currently the only significant values are 'dmake' and 'nmake'
for Windows users, instructing MakeMaker to generate a Makefile in the
flavour of DMake ("Dennis Vadura's Make") or Microsoft NMake
respectively.</p>
<p class="Pp">Defaults to <span class="Li">$Config</span>{make}, which may
go looking for a Make program in your environment.</p>
<p class="Pp">How are you supposed to know what flavour of Make a Makefile
has been generated for if you didn't specify a value explicitly? Search
the generated Makefile for the definition of the MAKE variable, which is
used to recursively invoke the Make utility. That will tell you what
Make you're supposed to invoke the Makefile with.</p>
</dd>
<dt id="MAKEAPERL"><a class="permalink" href="#MAKEAPERL">MAKEAPERL</a></dt>
<dd>Boolean which tells MakeMaker that it should include the rules to make a
perl. This is handled automatically as a switch by MakeMaker. The user
normally does not need it.</dd>
<dt id="MAKEFILE_OLD"><a class="permalink" href="#MAKEFILE_OLD">MAKEFILE_OLD</a></dt>
<dd>When 'make clean' or similar is run, the $(FIRST_MAKEFILE) will be backed
up at this location.
<p class="Pp">Defaults to $(FIRST_MAKEFILE).old or $(FIRST_MAKEFILE)_old on
VMS.</p>
</dd>
<dt id="MAN1PODS"><a class="permalink" href="#MAN1PODS">MAN1PODS</a></dt>
<dd>Hashref of pod-containing files. MakeMaker will default this to all
EXE_FILES files that include POD directives. The files listed here will be
converted to man pages and installed as was requested at Configure time.
<p class="Pp">This hash should map POD files (or scripts containing POD) to
the man file names under the
<span class="Li">"blib/man1/"</span> directory, as in the
following example:</p>
<p class="Pp"></p>
<pre> MAN1PODS => {
'doc/command.pod' => 'blib/man1/command.1',
'scripts/script.pl' => 'blib/man1/script.1',
}
</pre>
</dd>
<dt id="MAN3PODS"><a class="permalink" href="#MAN3PODS">MAN3PODS</a></dt>
<dd>Hashref that assigns to *.pm and *.pod files the files into which the
manpages are to be written. MakeMaker parses all *.pod and *.pm files for
POD directives. Files that contain POD will be the default keys of the
MAN3PODS hashref. These will then be converted to man pages during
<span class="Li">"make"</span> and will be installed during
<span class="Li">"make install"</span>.
<p class="Pp">Example similar to MAN1PODS.</p>
</dd>
<dt id="MAP_TARGET"><a class="permalink" href="#MAP_TARGET">MAP_TARGET</a></dt>
<dd>If it is intended that a new perl binary be produced, this variable may
hold a name for that binary. Defaults to perl</dd>
<dt id="META_ADD"><a class="permalink" href="#META_ADD">META_ADD</a></dt>
<dd></dd>
<dt id="META_MERGE"><a class="permalink" href="#META_MERGE">META_MERGE</a></dt>
<dd>Available in version 6.46 and above.
<p class="Pp">A hashref of items to add to the CPAN Meta file
(<i>META.yml</i> or <i>META.json</i>).</p>
<p class="Pp">They differ in how they behave if they have the same key as
the default metadata. META_ADD will override the default value with its
own. META_MERGE will merge its value with the default.</p>
<p class="Pp">Unless you want to override the defaults, prefer META_MERGE so
as to get the advantage of any future defaults.</p>
<p class="Pp">Where prereqs are concerned, if META_MERGE is used,
prerequisites are merged with their counterpart
<span class="Li">"WriteMakefile()"</span> argument (PREREQ_PM
is merged into {prereqs}{runtime}{requires}, BUILD_REQUIRES into
<span class="Li">"{prereqs}{build}{requires}"</span>,
CONFIGURE_REQUIRES into
<span class="Li">"{prereqs}{configure}{requires}"</span>, and
TEST_REQUIRES into
<span class="Li">"{prereqs}{test}{requires})"</span>. When
prereqs are specified with META_ADD, the only prerequisites added to the
file come from the metadata, not
<span class="Li">"WriteMakefile()"</span> arguments.</p>
<p class="Pp">Note that these configuration options are only used for
generating <i>META.yml</i> and <i>META.json</i> -- they are NOT used for
<i>MYMETA.yml</i> and <i>MYMETA.json</i>. Therefore data in these fields
should NOT be used for dynamic (user-side) configuration.</p>
<p class="Pp">By default CPAN Meta specification <span class="Li">1.4</span>
is used. In order to use CPAN Meta specification
<span class="Li">2.0</span>, indicate with
<span class="Li">"meta-spec"</span> the version you want to
use.</p>
<p class="Pp"></p>
<pre> META_MERGE => {
"meta-spec" => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'git://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker.git',
web => 'https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker',
},
},
},
</pre>
</dd>
<dt id="MIN_PERL_VERSION"><a class="permalink" href="#MIN_PERL_VERSION">MIN_PERL_VERSION</a></dt>
<dd>Available in version 6.48 and above.
<p class="Pp">The minimum required version of Perl for this
distribution.</p>
<p class="Pp">Either the 5.006001 or the 5.6.1 format is acceptable.</p>
</dd>
<dt id="MYEXTLIB"><a class="permalink" href="#MYEXTLIB">MYEXTLIB</a></dt>
<dd>If the extension links to a library that it builds, set this to the name
of the library (see SDBM_File)</dd>
<dt>NAME</dt>
<dd>The package representing the distribution. For example,
<span class="Li">"Test::More"</span> or
<span class="Li">"ExtUtils::MakeMaker"</span>. It will be used
to derive information about the distribution such as the
"DISTNAME", installation locations within the Perl library and
where XS files will be looked for by default (see "XS").
<p class="Pp"><span class="Li">"NAME"</span> <i>must</i> be a
valid Perl package name and it <i>must</i> have an associated
<span class="Li">".pm"</span> file. For example,
<span class="Li">"Foo::Bar"</span> is a valid
<span class="Li">"NAME"</span> and there must exist
<i>Foo/Bar.pm</i>. Any XS code should be in <i>Bar.xs</i> unless stated
otherwise.</p>
<p class="Pp">Your distribution <b>must</b> have a
<span class="Li">"NAME"</span>.</p>
</dd>
<dt id="NEEDS_LINKING"><a class="permalink" href="#NEEDS_LINKING">NEEDS_LINKING</a></dt>
<dd>MakeMaker will figure out if an extension contains linkable code anywhere
down the directory tree, and will set this variable accordingly, but you
can speed it up a very little bit if you define this boolean variable
yourself.</dd>
<dt id="NOECHO"><a class="permalink" href="#NOECHO">NOECHO</a></dt>
<dd>Command so make does not print the literal commands it's running.
<p class="Pp">By setting it to an empty string you can generate a Makefile
that prints all commands. Mainly used in debugging MakeMaker itself.</p>
<p class="Pp">Defaults to <span class="Li">"@"</span>.</p>
</dd>
<dt id="NORECURS"><a class="permalink" href="#NORECURS">NORECURS</a></dt>
<dd>Boolean. Attribute to inhibit descending into subdirectories.</dd>
<dt id="NO_META"><a class="permalink" href="#NO_META">NO_META</a></dt>
<dd>When true, suppresses the generation and addition to the MANIFEST of the
META.yml and META.json module meta-data files during 'make distdir'.
<p class="Pp">Defaults to false.</p>
</dd>
<dt id="NO_MYMETA"><a class="permalink" href="#NO_MYMETA">NO_MYMETA</a></dt>
<dd>Available in version 6.57_02 and above.
<p class="Pp">When true, suppresses the generation of MYMETA.yml and
MYMETA.json module meta-data files during 'perl Makefile.PL'.</p>
<p class="Pp">Defaults to false.</p>
</dd>
<dt id="NO_PACKLIST"><a class="permalink" href="#NO_PACKLIST">NO_PACKLIST</a></dt>
<dd>Available in version 6.7501 and above.
<p class="Pp">When true, suppresses the writing of
<span class="Li">"packlist"</span> files for installs.</p>
<p class="Pp">Defaults to false.</p>
</dd>
<dt id="NO_PERLLOCAL"><a class="permalink" href="#NO_PERLLOCAL">NO_PERLLOCAL</a></dt>
<dd>Available in version 6.7501 and above.
<p class="Pp">When true, suppresses the appending of installations to
<span class="Li">"perllocal"</span>.</p>
<p class="Pp">Defaults to false.</p>
</dd>
<dt id="NO_VC"><a class="permalink" href="#NO_VC">NO_VC</a></dt>
<dd>In general, any generated Makefile checks for the current version of
MakeMaker and the version the Makefile was built under. If NO_VC is set,
the version check is neglected. Do not write this into your Makefile.PL,
use it interactively instead.</dd>
<dt id="OBJECT"><a class="permalink" href="#OBJECT">OBJECT</a></dt>
<dd>List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a
long string or an array containing all object files, e.g. "tkpBind.o
tkpButton.o tkpCanvas.o" or ["tkpBind.o",
"tkpButton.o", "tkpCanvas.o"]
<p class="Pp">(Where BASEEXT is the last component of NAME, and OBJ_EXT is
<span class="Li">$Config</span>{obj_ext}.)</p>
</dd>
<dt id="OPTIMIZE"><a class="permalink" href="#OPTIMIZE">OPTIMIZE</a></dt>
<dd>Defaults to <span class="Li">"-O"</span>. Set it to
<span class="Li">"-g"</span> to turn debugging on. The flag is
passed to subdirectory makes.</dd>
<dt id="PERL"><a class="permalink" href="#PERL">PERL</a></dt>
<dd>Perl binary for tasks that can be done by miniperl. If it contains spaces
or other shell metacharacters, it needs to be quoted in a way that
protects them, since this value is intended to be inserted in a shell
command line in the Makefile. E.g.:
<p class="Pp"></p>
<pre> # Perl executable lives in "C:/Program Files/Perl/bin"
# Normally you don't need to set this yourself!
$ perl Makefile.PL PERL='"C:/Program Files/Perl/bin/perl.exe" -w'
</pre>
</dd>
<dt id="PERL_CORE"><a class="permalink" href="#PERL_CORE">PERL_CORE</a></dt>
<dd>Set only when MakeMaker is building the extensions of the Perl core
distribution.</dd>
<dt id="PERLMAINCC"><a class="permalink" href="#PERLMAINCC">PERLMAINCC</a></dt>
<dd>The call to the program that is able to compile perlmain.c. Defaults to
$(CC).</dd>
<dt id="PERL_ARCHLIB"><a class="permalink" href="#PERL_ARCHLIB">PERL_ARCHLIB</a></dt>
<dd>Same as for PERL_LIB, but for architecture dependent files.
<p class="Pp">Used only when MakeMaker is building the extensions of the
Perl core distribution (because normally $(PERL_ARCHLIB) is
automatically in <span class="Li">@INC</span>, and adding it would get
in the way of PERL5LIB).</p>
</dd>
<dt id="PERL_LIB"><a class="permalink" href="#PERL_LIB">PERL_LIB</a></dt>
<dd>Directory containing the Perl library to use.
<p class="Pp">Used only when MakeMaker is building the extensions of the
Perl core distribution (because normally $(PERL_LIB) is automatically in
<span class="Li">@INC</span>, and adding it would get in the way of
PERL5LIB).</p>
</dd>
<dt id="PERL_MALLOC_OK"><a class="permalink" href="#PERL_MALLOC_OK">PERL_MALLOC_OK</a></dt>
<dd>defaults to 0. Should be set to TRUE if the extension can work with the
memory allocation routines substituted by the Perl <b>malloc()</b>
subsystem. This should be applicable to most extensions with exceptions of
those</dd>
</dl>
<div class="Bd-indent">
<ul class="Bl-bullet">
<li>with bugs in memory allocations which are caught by Perl's
<b>malloc()</b>;</li>
<li>which interact with the memory allocator in other ways than via
<b>malloc()</b>, <b>realloc()</b>, <b>free()</b>, <b>calloc()</b>,
<b>sbrk()</b> and <b>brk()</b>;</li>
<li>which rely on special alignment which is not provided by Perl's
<b>malloc()</b>.</li>
</ul>
</div>
<div class="Bd-indent">
<p class="Pp"><b>NOTE.</b> Neglecting to set this flag in <i>any one</i> of the
loaded extension nullifies many advantages of Perl's <b>malloc()</b>, such
as better usage of system resources, error detection, memory usage
reporting, catchable failure of memory allocations, etc.</p>
</div>
<dl class="Bl-tag">
<dt id="PERLPREFIX"><a class="permalink" href="#PERLPREFIX">PERLPREFIX</a></dt>
<dd>Directory under which core modules are to be installed.