1ExtUtils::MM_Unix(3)  User Contributed Perl Documentation ExtUtils::MM_Unix(3)
2
3
4

NAME

6       ExtUtils::MM_Unix - methods used by ExtUtils::MakeMaker
7

SYNOPSIS

9       "require ExtUtils::MM_Unix;"
10

DESCRIPTION

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

METHODS

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_tools
267           Initializes tools to use their common (and faster) Unix commands.
268
269       init_linker
270           Unix has no need of special linker flags.
271
272       init_PERL
273               $mm->init_PERL;
274
275           Called by init_main.  Sets up ABSPERL, PERL, FULLPERL and all the
276           *PERLRUN* permutations.
277
278               PERL is allowed to be miniperl
279               FULLPERL must be a complete perl
280
281               ABSPERL is PERL converted to an absolute path
282
283               *PERLRUN contains everything necessary to run perl, find it's
284                    libraries, etc...
285
286               *PERLRUNINST is *PERLRUN + everything necessary to find the
287                    modules being built.
288
289       init_platform
290       platform_constants
291           Add MM_Unix_VERSION.
292
293       init_PERM
294             $mm->init_PERM
295
296           Called by init_main.  Initializes PERL_*
297
298       init_xs
299               $mm->init_xs
300
301           Sets up macros having to do with XS code.  Currently just
302           INST_STATIC, INST_DYNAMIC and INST_BOOT.
303
304       install (o)
305           Defines the install target.
306
307       installbin (o)
308           Defines targets to make and to install EXE_FILES.
309
310       linkext (o)
311           Defines the linkext target which in turn defines the LINKTYPE.
312
313       lsdir
314           Takes as arguments a directory name and a regular expression.
315           Returns all entries in the directory that match the regular
316           expression.
317
318       macro (o)
319           Simple subroutine to insert the macros defined by the macro
320           attribute into the Makefile.
321
322       makeaperl (o)
323           Called by staticmake. Defines how to write the Makefile to produce
324           a static new perl.
325
326           By default the Makefile produced includes all the static extensions
327           in the perl library. (Purified versions of library files, e.g.,
328           DynaLoader_pure_p1_c0_032.a are automatically ignored to avoid link
329           errors.)
330
331       makefile (o)
332           Defines how to rewrite the Makefile.
333
334       maybe_command
335           Returns true, if the argument is likely to be a command.
336
337       needs_linking (o)
338           Does this module need linking? Looks into subdirectory objects (see
339           also has_link_code())
340
341       parse_abstract
342           parse a file and return what you think is the ABSTRACT
343
344       parse_version
345               my $version = MM->parse_version($file);
346
347           Parse a $file and return what $VERSION is set to by the first
348           assignment.  It will return the string "undef" if it can't figure
349           out what $VERSION is. $VERSION should be for all to see, so "our
350           $VERSION" or plain $VERSION are okay, but "my $VERSION" is not.
351
352           "<package Foo VERSION"> is also checked for.  The first version
353           declaration found is used, but this may change as it differs from
354           how Perl does it.
355
356           parse_version() will try to "use version" before checking for
357           $VERSION so the following will work.
358
359               $VERSION = qv(1.2.3);
360
361       pasthru (o)
362           Defines the string that is passed to recursive make calls in
363           subdirectories.
364
365       perl_script
366           Takes one argument, a file name, and returns the file name, if the
367           argument is likely to be a perl script. On MM_Unix this is true for
368           any ordinary, readable file.
369
370       perldepend (o)
371           Defines the dependency from all *.h files that come with the perl
372           distribution.
373
374       pm_to_blib
375           Defines target that copies all files in the hash PM to their
376           destination and autosplits them. See "DESCRIPTION" in
377           ExtUtils::Install
378
379       post_constants (o)
380           Returns an empty string per default. Dedicated to overrides from
381           within Makefile.PL after all constants have been defined.
382
383       post_initialize (o)
384           Returns an empty string per default. Used in Makefile.PLs to add
385           some chunk of text to the Makefile after the object is initialized.
386
387       postamble (o)
388           Returns an empty string. Can be used in Makefile.PLs to write some
389           text to the Makefile at the end.
390
391       ppd Defines target that creates a PPD (Perl Package Description) file
392           for a binary distribution.
393
394       prefixify
395             $MM->prefixify($var, $prefix, $new_prefix, $default);
396
397           Using either $MM->{uc $var} || $Config{lc $var}, it will attempt to
398           replace it's $prefix with a $new_prefix.
399
400           Should the $prefix fail to match AND a PREFIX was given as an
401           argument to WriteMakefile() it will set it to the $new_prefix +
402           $default.  This is for systems whose file layouts don't neatly fit
403           into our ideas of prefixes.
404
405           This is for heuristics which attempt to create directory structures
406           that mirror those of the installed perl.
407
408           For example:
409
410               $MM->prefixify('installman1dir', '/usr', '/home/foo', 'man/man1');
411
412           this will attempt to remove '/usr' from the front of the
413           $MM->{INSTALLMAN1DIR} path (initializing it to
414           $Config{installman1dir} if necessary) and replace it with
415           '/home/foo'.  If this fails it will simply use
416           '/home/foo/man/man1'.
417
418       processPL (o)
419           Defines targets to run *.PL files.
420
421       quote_paren
422           Backslashes parentheses "()" in command line arguments.  Doesn't
423           handle recursive Makefile "$(...)" constructs, but handles simple
424           ones.
425
426       replace_manpage_separator
427             my $man_name = $MM->replace_manpage_separator($file_path);
428
429           Takes the name of a package, which may be a nested package, in the
430           form 'Foo/Bar.pm' and replaces the slash with "::" or something
431           else safe for a man page file name.  Returns the replacement.
432
433       cd
434       oneliner
435       quote_literal
436       escape_newlines
437       max_exec_len
438           Using POSIX::ARG_MAX.  Otherwise falling back to 4096.
439
440       static (o)
441           Defines the static target.
442
443       static_lib (o)
444           Defines how to produce the *.a (or equivalent) files.
445
446       staticmake (o)
447           Calls makeaperl.
448
449       subdir_x (o)
450           Helper subroutine for subdirs
451
452       subdirs (o)
453           Defines targets to process subdirectories.
454
455       test (o)
456           Defines the test targets.
457
458       test_via_harness (override)
459           For some reason which I forget, Unix machines like to have
460           PERL_DL_NONLAZY set for tests.
461
462       test_via_script (override)
463           Again, the PERL_DL_NONLAZY thing.
464
465       tool_xsubpp (o)
466           Determines typemaps, xsubpp version, prototype behaviour.
467
468       all_target
469           Build man pages, too
470
471       top_targets (o)
472           Defines the targets all, subdirs, config, and O_FILES
473
474       writedoc
475           Obsolete, deprecated method. Not used since Version 5.21.
476
477       xs_c (o)
478           Defines the suffix rules to compile XS files to C.
479
480       xs_cpp (o)
481           Defines the suffix rules to compile XS files to C++.
482
483       xs_o (o)
484           Defines suffix rules to go from XS to object files directly. This
485           is only intended for broken make implementations.
486

SEE ALSO

488       ExtUtils::MakeMaker
489
490
491
492perl v5.16.3                      2014-06-10              ExtUtils::MM_Unix(3)
Impressum