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