1ExtUtils::MM_Unix(3pm) Perl Programmers Reference Guide ExtUtils::MM_Unix(3pm)
2
3
4
6 ExtUtils::MM_Unix - methods used by ExtUtils::MakeMaker
7
9 "require ExtUtils::MM_Unix;"
10
12 The methods provided by this package are designed to be used in
13 conjunction with ExtUtils::MakeMaker. When MakeMaker writes a Makefile,
14 it creates one or more objects that inherit their methods from a
15 package "MM". MM itself doesn't provide any methods, but it ISA
16 ExtUtils::MM_Unix class. The inheritance tree of MM lets operating
17 specific packages take the responsibility for all the methods provided
18 by MM_Unix. We are trying to reduce the number of the necessary
19 overrides by defining rather primitive operations within
20 ExtUtils::MM_Unix.
21
22 If you are going to write a platform specific MM package, please try to
23 limit the necessary overrides to primitive methods, and if it is not
24 possible to do so, let's work out how to achieve that gain.
25
26 If you are overriding any of these methods in your Makefile.PL (in the
27 MY class), please report that to the makemaker mailing list. We are
28 trying to minimize the necessary method overrides and switch to data
29 driven Makefile.PLs wherever possible. In the long run less methods
30 will be overridable via the MY class.
31
33 The following description of methods is still under development. Please
34 refer to the code for not suitably documented sections and complain
35 loudly to the makemaker@perl.org mailing list. Better yet, provide a
36 patch.
37
38 Not all of the methods below are overridable in a Makefile.PL.
39 Overridable methods are marked as (o). All methods are overridable by a
40 platform specific MM_*.pm file.
41
42 Cross-platform methods are being moved into MM_Any. If you can't find
43 something that used to be in here, look in MM_Any.
44
45 Methods
46 os_flavor
47 Simply says that we're Unix.
48
49 c_o (o)
50 Defines the suffix rules to compile different flavors of C files to
51 object files.
52
53 cflags (o)
54 Does very much the same as the cflags script in the perl
55 distribution. It doesn't return the whole compiler command line,
56 but initializes all of its parts. The const_cccmd method then
57 actually returns the definition of the CCCMD macro which uses these
58 parts.
59
60 const_cccmd (o)
61 Returns the full compiler call for C programs and stores the
62 definition in CONST_CCCMD.
63
64 const_config (o)
65 Defines a couple of constants in the Makefile that are imported
66 from %Config.
67
68 const_loadlibs (o)
69 Defines EXTRALIBS, LDLOADLIBS, BSLOADLIBS, LD_RUN_PATH. See
70 ExtUtils::Liblist for details.
71
72 constants (o)
73 my $make_frag = $mm->constants;
74
75 Prints out macros for lots of constants.
76
77 depend (o)
78 Same as macro for the depend attribute.
79
80 init_DEST
81 $mm->init_DEST
82
83 Defines the DESTDIR and DEST* variables paralleling the INSTALL*.
84
85 init_dist
86 $mm->init_dist;
87
88 Defines a lot of macros for distribution support.
89
90 macro description default
91
92 TAR tar command to use tar
93 TARFLAGS flags to pass to TAR cvf
94
95 ZIP zip command to use zip
96 ZIPFLAGS flags to pass to ZIP -r
97
98 COMPRESS compression command to gzip --best
99 use for tarfiles
100 SUFFIX suffix to put on .gz
101 compressed files
102
103 SHAR shar command to use shar
104
105 PREOP extra commands to run before
106 making the archive
107 POSTOP extra commands to run after
108 making the archive
109
110 TO_UNIX a command to convert linefeeds
111 to Unix style in your archive
112
113 CI command to checkin your ci -u
114 sources to version control
115 RCS_LABEL command to label your sources rcs -Nv$(VERSION_SYM): -q
116 just after CI is run
117
118 DIST_CP $how argument to manicopy() best
119 when the distdir is created
120
121 DIST_DEFAULT default target to use to tardist
122 create a distribution
123
124 DISTVNAME name of the resulting archive $(DISTNAME)-$(VERSION)
125 (minus suffixes)
126
127 dist (o)
128 my $dist_macros = $mm->dist(%overrides);
129
130 Generates a make fragment defining all the macros initialized in
131 init_dist.
132
133 %overrides can be used to override any of the above.
134
135 dist_basics (o)
136 Defines the targets distclean, distcheck, skipcheck, manifest,
137 veryclean.
138
139 dist_ci (o)
140 Defines a check in target for RCS.
141
142 dist_core (o)
143 my $dist_make_fragment = $MM->dist_core;
144
145 Puts the targets necessary for 'make dist' together into one make
146 fragment.
147
148 dist_target
149 my $make_frag = $MM->dist_target;
150
151 Returns the 'dist' target to make an archive for distribution.
152 This target simply checks to make sure the Makefile is up-to-date
153 and depends on $(DIST_DEFAULT).
154
155 tardist_target
156 my $make_frag = $MM->tardist_target;
157
158 Returns the 'tardist' target which is simply so 'make tardist'
159 works. The real work is done by the dynamically named
160 tardistfile_target() method, tardist should have that as a
161 dependency.
162
163 zipdist_target
164 my $make_frag = $MM->zipdist_target;
165
166 Returns the 'zipdist' target which is simply so 'make zipdist'
167 works. The real work is done by the dynamically named
168 zipdistfile_target() method, zipdist should have that as a
169 dependency.
170
171 tarfile_target
172 my $make_frag = $MM->tarfile_target;
173
174 The name of this target is the name of the tarball generated by
175 tardist. This target does the actual work of turning the distdir
176 into a tarball.
177
178 zipfile_target
179 my $make_frag = $MM->zipfile_target;
180
181 The name of this target is the name of the zip file generated by
182 zipdist. This target does the actual work of turning the distdir
183 into a zip file.
184
185 uutardist_target
186 my $make_frag = $MM->uutardist_target;
187
188 Converts the tarfile into a uuencoded file
189
190 shdist_target
191 my $make_frag = $MM->shdist_target;
192
193 Converts the distdir into a shell archive.
194
195 dlsyms (o)
196 Used by some OS' to define DL_FUNCS and DL_VARS and write the *.exp
197 files.
198
199 Normally just returns an empty string.
200
201 dynamic_bs (o)
202 Defines targets for bootstrap files.
203
204 dynamic_lib (o)
205 Defines how to produce the *.so (or equivalent) files.
206
207 exescan
208 Deprecated method. Use libscan instead.
209
210 extliblist
211 Called by init_others, and calls ext ExtUtils::Liblist. See
212 ExtUtils::Liblist for details.
213
214 find_perl
215 Finds the executables PERL and FULLPERL
216
217 fixin
218 $mm->fixin(@files);
219
220 Inserts the sharpbang or equivalent magic number to a set of
221 @files.
222
223 force (o)
224 Writes an empty FORCE: target.
225
226 guess_name
227 Guess the name of this package by examining the working directory's
228 name. MakeMaker calls this only if the developer has not supplied a
229 NAME attribute.
230
231 has_link_code
232 Returns true if C, XS, MYEXTLIB or similar objects exist within
233 this object that need a compiler. Does not descend into
234 subdirectories as needs_linking() does.
235
236 init_dirscan
237 Scans the directory structure and initializes DIR, XS, XS_FILES, C,
238 C_FILES, O_FILES, H, H_FILES, PL_FILES, EXE_FILES.
239
240 Called by init_main.
241
242 init_MANPODS
243 Determines if man pages should be generated and initializes
244 MAN1PODS and MAN3PODS as appropriate.
245
246 init_MAN1PODS
247 Initializes MAN1PODS from the list of EXE_FILES.
248
249 init_MAN3PODS
250 Initializes MAN3PODS from the list of PM files.
251
252 init_PM
253 Initializes PMLIBDIRS and PM from PMLIBDIRS.
254
255 init_DIRFILESEP
256 Using / for Unix. Called by init_main.
257
258 init_main
259 Initializes AR, AR_STATIC_ARGS, BASEEXT, CONFIG, DISTNAME, DLBASE,
260 EXE_EXT, FULLEXT, FULLPERL, FULLPERLRUN, FULLPERLRUNINST, INST_*,
261 INSTALL*, INSTALLDIRS, LIB_EXT, LIBPERL_A, MAP_TARGET, NAME,
262 OBJ_EXT, PARENT_NAME, PERL, PERL_ARCHLIB, PERL_INC, PERL_LIB,
263 PERL_SRC, PERLRUN, PERLRUNINST, PREFIX, VERSION, VERSION_SYM,
264 XS_VERSION.
265
266 init_others
267 Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH,
268 LD, OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, SHELL, NOOP,
269 FIRST_MAKEFILE, MAKEFILE_OLD, NOECHO, RM_F, RM_RF, TEST_F, TOUCH,
270 CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N
271
272 init_linker
273 Unix has no need of special linker flags.
274
275 init_PERL
276 $mm->init_PERL;
277
278 Called by init_main. Sets up ABSPERL, PERL, FULLPERL and all the
279 *PERLRUN* permutations.
280
281 PERL is allowed to be miniperl
282 FULLPERL must be a complete perl
283
284 ABSPERL is PERL converted to an absolute path
285
286 *PERLRUN contains everything necessary to run perl, find it's
287 libraries, etc...
288
289 *PERLRUNINST is *PERLRUN + everything necessary to find the
290 modules being built.
291
292 init_platform
293 platform_constants
294 Add MM_Unix_VERSION.
295
296 init_PERM
297 $mm->init_PERM
298
299 Called by init_main. Initializes PERL_*
300
301 init_xs
302 $mm->init_xs
303
304 Sets up macros having to do with XS code. Currently just
305 INST_STATIC, INST_DYNAMIC and INST_BOOT.
306
307 install (o)
308 Defines the install target.
309
310 installbin (o)
311 Defines targets to make and to install EXE_FILES.
312
313 linkext (o)
314 Defines the linkext target which in turn defines the LINKTYPE.
315
316 lsdir
317 Takes as arguments a directory name and a regular expression.
318 Returns all entries in the directory that match the regular
319 expression.
320
321 macro (o)
322 Simple subroutine to insert the macros defined by the macro
323 attribute into the Makefile.
324
325 makeaperl (o)
326 Called by staticmake. Defines how to write the Makefile to produce
327 a static new perl.
328
329 By default the Makefile produced includes all the static extensions
330 in the perl library. (Purified versions of library files, e.g.,
331 DynaLoader_pure_p1_c0_032.a are automatically ignored to avoid link
332 errors.)
333
334 makefile (o)
335 Defines how to rewrite the Makefile.
336
337 maybe_command
338 Returns true, if the argument is likely to be a command.
339
340 needs_linking (o)
341 Does this module need linking? Looks into subdirectory objects (see
342 also has_link_code())
343
344 parse_abstract
345 parse a file and return what you think is the ABSTRACT
346
347 parse_version
348 my $version = MM->parse_version($file);
349
350 Parse a $file and return what $VERSION is set to by the first
351 assignment. It will return the string "undef" if it can't figure
352 out what $VERSION is. $VERSION should be for all to see, so "our
353 $VERSION" or plain $VERSION are okay, but "my $VERSION" is not.
354
355 parse_version() will try to "use version" before checking for
356 $VERSION so the following will work.
357
358 $VERSION = qv(1.2.3);
359
360 pasthru (o)
361 Defines the string that is passed to recursive make calls in
362 subdirectories.
363
364 perl_script
365 Takes one argument, a file name, and returns the file name, if the
366 argument is likely to be a perl script. On MM_Unix this is true for
367 any ordinary, readable file.
368
369 perldepend (o)
370 Defines the dependency from all *.h files that come with the perl
371 distribution.
372
373 pm_to_blib
374 Defines target that copies all files in the hash PM to their
375 destination and autosplits them. See "DESCRIPTION" in
376 ExtUtils::Install
377
378 post_constants (o)
379 Returns an empty string per default. Dedicated to overrides from
380 within Makefile.PL after all constants have been defined.
381
382 post_initialize (o)
383 Returns an empty string per default. Used in Makefile.PLs to add
384 some chunk of text to the Makefile after the object is initialized.
385
386 postamble (o)
387 Returns an empty string. Can be used in Makefile.PLs to write some
388 text to the Makefile at the end.
389
390 ppd Defines target that creates a PPD (Perl Package Description) file
391 for a binary distribution.
392
393 prefixify
394 $MM->prefixify($var, $prefix, $new_prefix, $default);
395
396 Using either $MM->{uc $var} || $Config{lc $var}, it will attempt to
397 replace it's $prefix with a $new_prefix.
398
399 Should the $prefix fail to match AND a PREFIX was given as an
400 argument to WriteMakefile() it will set it to the $new_prefix +
401 $default. This is for systems whose file layouts don't neatly fit
402 into our ideas of prefixes.
403
404 This is for heuristics which attempt to create directory structures
405 that mirror those of the installed perl.
406
407 For example:
408
409 $MM->prefixify('installman1dir', '/usr', '/home/foo', 'man/man1');
410
411 this will attempt to remove '/usr' from the front of the
412 $MM->{INSTALLMAN1DIR} path (initializing it to
413 $Config{installman1dir} if necessary) and replace it with
414 '/home/foo'. If this fails it will simply use
415 '/home/foo/man/man1'.
416
417 processPL (o)
418 Defines targets to run *.PL files.
419
420 quote_paren
421 Backslashes parentheses "()" in command line arguments. Doesn't
422 handle recursive Makefile "$(...)" constructs, but handles simple
423 ones.
424
425 replace_manpage_separator
426 my $man_name = $MM->replace_manpage_separator($file_path);
427
428 Takes the name of a package, which may be a nested package, in the
429 form 'Foo/Bar.pm' and replaces the slash with "::" or something
430 else safe for a man page file name. Returns the replacement.
431
432 cd
433 oneliner
434 quote_literal
435 escape_newlines
436 max_exec_len
437 Using POSIX::ARG_MAX. Otherwise falling back to 4096.
438
439 static (o)
440 Defines the static target.
441
442 static_lib (o)
443 Defines how to produce the *.a (or equivalent) files.
444
445 staticmake (o)
446 Calls makeaperl.
447
448 subdir_x (o)
449 Helper subroutine for subdirs
450
451 subdirs (o)
452 Defines targets to process subdirectories.
453
454 test (o)
455 Defines the test targets.
456
457 test_via_harness (override)
458 For some reason which I forget, Unix machines like to have
459 PERL_DL_NONLAZY set for tests.
460
461 test_via_script (override)
462 Again, the PERL_DL_NONLAZY thing.
463
464 tool_xsubpp (o)
465 Determines typemaps, xsubpp version, prototype behaviour.
466
467 all_target
468 Build man pages, too
469
470 top_targets (o)
471 Defines the targets all, subdirs, config, and O_FILES
472
473 writedoc
474 Obsolete, deprecated method. Not used since Version 5.21.
475
476 xs_c (o)
477 Defines the suffix rules to compile XS files to C.
478
479 xs_cpp (o)
480 Defines the suffix rules to compile XS files to C++.
481
482 xs_o (o)
483 Defines suffix rules to go from XS to object files directly. This
484 is only intended for broken make implementations.
485
487 ExtUtils::MakeMaker
488
489
490
491perl v5.10.1 2017-03-22 ExtUtils::MM_Unix(3pm)