{
    "mode": "perldoc",
    "parameter": "ExtUtils::MM_Unix",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/ExtUtils%3A%3AMM_Unix/json",
    "generated": "2026-06-03T01:22:42Z",
    "synopsis": "require ExtUtils::MMUnix;",
    "sections": {
        "NAME": {
            "content": "ExtUtils::MMUnix - methods used by ExtUtils::MakeMaker\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "require ExtUtils::MMUnix;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The methods provided by this package are designed to be used in conjunction with\nExtUtils::MakeMaker. When MakeMaker writes a Makefile, it creates one or more objects that\ninherit their methods from a package MM. MM itself doesn't provide any methods, but it ISA\nExtUtils::MMUnix class. The inheritance tree of MM lets operating specific packages take the\nresponsibility for all the methods provided by MMUnix. We are trying to reduce the number of\nthe necessary overrides by defining rather primitive operations within ExtUtils::MMUnix.\n\nIf you are going to write a platform specific MM package, please try to limit the necessary\noverrides to primitive methods, and if it is not possible to do so, let's work out how to\nachieve that gain.\n\nIf you are overriding any of these methods in your Makefile.PL (in the MY class), please report\nthat to the makemaker mailing list. We are trying to minimize the necessary method overrides and\nswitch to data driven Makefile.PLs wherever possible. In the long run less methods will be\noverridable via the MY class.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "The following description of methods is still under development. Please refer to the code for\nnot suitably documented sections and complain loudly to the makemaker@perl.org mailing list.\nBetter yet, provide a patch.\n\nNot all of the methods below are overridable in a Makefile.PL. Overridable methods are marked as\n(o). All methods are overridable by a platform specific MM*.pm file.\n\nCross-platform methods are being moved into MMAny. If you can't find something that used to be\nin here, look in MMAny.\n",
            "subsections": [
                {
                    "name": "Methods",
                    "content": "osflavor\nSimply says that we're Unix.\n\nco (o)\nDefines the suffix rules to compile different flavors of C files to object files.\n\nxsobjopt\nTakes the object file as an argument, and returns the portion of compile command-line that\nwill output to the specified object file.\n\ndbgoutflag\nReturns a CC flag that tells the CC to emit a separate debugging symbol file when compiling\nan object file.\n\ncflags (o)\nDoes very much the same as the cflags script in the perl distribution. It doesn't return the\nwhole compiler command line, but initializes all of its parts. The constcccmd method then\nactually returns the definition of the CCCMD macro which uses these parts.\n\nconstcccmd (o)\nReturns the full compiler call for C programs and stores the definition in CONSTCCCMD.\n\nconstconfig (o)\nSets SHELL if needed, then defines a couple of constants in the Makefile that are imported\nfrom %Config.\n\nconstloadlibs (o)\nDefines EXTRALIBS, LDLOADLIBS, BSLOADLIBS, LDRUNPATH. See ExtUtils::Liblist for details.\n\nconstants (o)\nmy $makefrag = $mm->constants;\n\nPrints out macros for lots of constants.\n\ndepend (o)\nSame as macro for the depend attribute.\n\ninitDEST\n$mm->initDEST\n\nDefines the DESTDIR and DEST* variables paralleling the INSTALL*.\n\ninitdist\n$mm->initdist;\n\nDefines a lot of macros for distribution support.\n\nmacro         description                     default\n\nTAR           tar command to use              tar\nTARFLAGS      flags to pass to TAR            cvf\n\nZIP           zip command to use              zip\nZIPFLAGS      flags to pass to ZIP            -r\n\nCOMPRESS      compression command to          gzip --best\nuse for tarfiles\nSUFFIX        suffix to put on                .gz\ncompressed files\n\nSHAR          shar command to use             shar\n\nPREOP         extra commands to run before\nmaking the archive\nPOSTOP        extra commands to run after\nmaking the archive\n\nTOUNIX       a command to convert linefeeds\nto Unix style in your archive\n\nCI            command to checkin your         ci -u\nsources to version control\nRCSLABEL     command to label your sources   rcs -Nv$(VERSIONSYM): -q\njust after CI is run\n\nDISTCP       $how argument to manicopy()     best\nwhen the distdir is created\n\nDISTDEFAULT  default target to use to        tardist\ncreate a distribution\n\nDISTVNAME     name of the resulting archive   $(DISTNAME)-$(VERSION)\n(minus suffixes)\n\ndist (o)\nmy $distmacros = $mm->dist(%overrides);\n\nGenerates a make fragment defining all the macros initialized in initdist.\n\n%overrides can be used to override any of the above.\n\ndistbasics (o)\nDefines the targets distclean, distcheck, skipcheck, manifest, veryclean.\n\ndistci (o)\nDefines a check in target for RCS.\n\ndistcore (o)\nmy $distmakefragment = $MM->distcore;\n\nPuts the targets necessary for 'make dist' together into one make fragment.\n\ndisttarget\nmy $makefrag = $MM->disttarget;\n\nReturns the 'dist' target to make an archive for distribution. This target simply checks to\nmake sure the Makefile is up-to-date and depends on $(DISTDEFAULT).\n\ntardisttarget\nmy $makefrag = $MM->tardisttarget;\n\nReturns the 'tardist' target which is simply so 'make tardist' works. The real work is done\nby the dynamically named tardistfiletarget() method, tardist should have that as a\ndependency.\n\nzipdisttarget\nmy $makefrag = $MM->zipdisttarget;\n\nReturns the 'zipdist' target which is simply so 'make zipdist' works. The real work is done\nby the dynamically named zipdistfiletarget() method, zipdist should have that as a\ndependency.\n\ntarfiletarget\nmy $makefrag = $MM->tarfiletarget;\n\nThe name of this target is the name of the tarball generated by tardist. This target does\nthe actual work of turning the distdir into a tarball.\n\nzipfiletarget\nmy $makefrag = $MM->zipfiletarget;\n\nThe name of this target is the name of the zip file generated by zipdist. This target does\nthe actual work of turning the distdir into a zip file.\n\nuutardisttarget\nmy $makefrag = $MM->uutardisttarget;\n\nConverts the tarfile into a uuencoded file\n\nshdisttarget\nmy $makefrag = $MM->shdisttarget;\n\nConverts the distdir into a shell archive.\n\ndlsyms (o)\nUsed by some OS' to define DLFUNCS and DLVARS and write the *.exp files.\n\nNormally just returns an empty string.\n\ndynamicbs (o)\nDefines targets for bootstrap files.\n\ndynamiclib (o)\nDefines how to produce the *.so (or equivalent) files.\n\nxsdynamiclibmacros\nDefines the macros for the \"dynamiclib\" section.\n\nxsmakedynamiclib\nDefines the recipes for the \"dynamiclib\" section.\n\nexescan\nDeprecated method. Use libscan instead.\n\nextliblist\nCalled by initothers, and calls ext ExtUtils::Liblist. See ExtUtils::Liblist for details.\n\nfindperl\nFinds the executables PERL and FULLPERL\n\nfixin\n$mm->fixin(@files);\n\nInserts the sharpbang or equivalent magic number to a set of @files.\n\nforce (o)\nWrites an empty FORCE: target.\n\nguessname\nGuess the name of this package by examining the working directory's name. MakeMaker calls\nthis only if the developer has not supplied a NAME attribute.\n\nhaslinkcode\nReturns true if C, XS, MYEXTLIB or similar objects exist within this object that need a\ncompiler. Does not descend into subdirectories as needslinking() does.\n\ninitdirscan\nScans the directory structure and initializes DIR, XS, XSFILES, C, CFILES, OFILES, H,\nHFILES, PLFILES, EXEFILES.\n\nCalled by initmain.\n\ninitMANPODS\nDetermines if man pages should be generated and initializes MAN1PODS and MAN3PODS as\nappropriate.\n\ninitMAN1PODS\nInitializes MAN1PODS from the list of EXEFILES.\n\ninitMAN3PODS\nInitializes MAN3PODS from the list of PM files.\n\ninitPM\nInitializes PMLIBDIRS and PM from PMLIBDIRS.\n\ninitDIRFILESEP\nUsing / for Unix. Called by initmain.\n\ninitmain\nInitializes AR, ARSTATICARGS, BASEEXT, CONFIG, DISTNAME, DLBASE, EXEEXT, FULLEXT,\nFULLPERL, FULLPERLRUN, FULLPERLRUNINST, INST*, INSTALL*, INSTALLDIRS, LIBEXT, LIBPERLA,\nMAPTARGET, NAME, OBJEXT, PARENTNAME, PERL, PERLARCHLIB, PERLINC, PERLLIB, PERLSRC,\nPERLRUN, PERLRUNINST, PREFIX, VERSION, VERSIONSYM, XSVERSION.\n\ninittools\nInitializes tools to use their common (and faster) Unix commands.\n\ninitlinker\nUnix has no need of special linker flags.\n\ninitPERL\n$mm->initPERL;\n\nCalled by initmain. Sets up ABSPERL, PERL, FULLPERL and all the *PERLRUN* permutations.\n\nPERL is allowed to be miniperl\nFULLPERL must be a complete perl\n\nABSPERL is PERL converted to an absolute path\n\n*PERLRUN contains everything necessary to run perl, find it's\nlibraries, etc...\n\n*PERLRUNINST is *PERLRUN + everything necessary to find the\nmodules being built.\n\ninitplatform\nplatformconstants\nAdd MMUnixVERSION.\n\ninitPERM\n$mm->initPERM\n\nCalled by initmain. Initializes PERL*\n\ninitxs\n$mm->initxs\n\nSets up macros having to do with XS code. Currently just INSTSTATIC, INSTDYNAMIC and\nINSTBOOT.\n\ninstall (o)\nDefines the install target.\n\ninstallbin (o)\nDefines targets to make and to install EXEFILES.\n\nlinkext (o)\nDefines the linkext target which in turn defines the LINKTYPE.\n\nlsdir\nTakes as arguments a directory name and a regular expression. Returns all entries in the\ndirectory that match the regular expression.\n\nmacro (o)\nSimple subroutine to insert the macros defined by the macro attribute into the Makefile.\n\nmakeaperl (o)\nCalled by staticmake. Defines how to write the Makefile to produce a static new perl.\n\nBy default the Makefile produced includes all the static extensions in the perl library.\n(Purified versions of library files, e.g., DynaLoaderpurep1c0032.a are automatically\nignored to avoid link errors.)\n\nxsstaticlibisxs (o)\nCalled by a utility method of makeaperl. Checks whether a given file is an XS library by\nseeing whether it defines any symbols starting with \"boot\" (with an optional leading\nunderscore - needed on MacOS).\n\nmakefile (o)\nDefines how to rewrite the Makefile.\n\nmaybecommand\nReturns true, if the argument is likely to be a command.\n\nneedslinking (o)\nDoes this module need linking? Looks into subdirectory objects (see also haslinkcode())\n\nparseabstract\nparse a file and return what you think is the ABSTRACT\n\nparseversion\nmy $version = MM->parseversion($file);\n\nParse a $file and return what $VERSION is set to by the first assignment. It will return the\nstring \"undef\" if it can't figure out what $VERSION is. $VERSION should be for all to see,\nso \"our $VERSION\" or plain $VERSION are okay, but \"my $VERSION\" is not.\n\n\"package Foo VERSION\" is also checked for. The first version declaration found is used, but\nthis may change as it differs from how Perl does it.\n\nparseversion() will try to \"use version\" before checking for $VERSION so the following will\nwork.\n\n$VERSION = qv(1.2.3);\n\npasthru (o)\nDefines the string that is passed to recursive make calls in subdirectories. The variables\nlike \"PASTHRUDEFINE\" are used in each level, and passed downwards on the command-line with\ne.g. the value of that level's DEFINE. Example:\n\n# Level 0 has DEFINE = -Dfunky\n# This code will define level 0's PASTHRU=PASTHRUDEFINE=\"$(DEFINE)\n#     $(PASTHRUDEFINE)\"\n# Level 0's $(CCCMD) will include macros $(DEFINE) and $(PASTHRUDEFINE)\n# So will level 1's, so when level 1 compiles, it will get right values\n# And so ad infinitum\n\nperlscript\nTakes one argument, a file name, and returns the file name, if the argument is likely to be\na perl script. On MMUnix this is true for any ordinary, readable file.\n\nperldepend (o)\nDefines the dependency from all *.h files that come with the perl distribution.\n\npmtoblib\nDefines target that copies all files in the hash PM to their destination and autosplits\nthem. See \"DESCRIPTION\" in ExtUtils::Install\n\nppd Defines target that creates a PPD (Perl Package Description) file for a binary distribution.\n\nprefixify\n$MM->prefixify($var, $prefix, $newprefix, $default);\n\nUsing either $MM->{uc $var} || $Config{lc $var}, it will attempt to replace it's $prefix\nwith a $newprefix.\n\nShould the $prefix fail to match *AND* a PREFIX was given as an argument to WriteMakefile()\nit will set it to the $newprefix + $default. This is for systems whose file layouts don't\nneatly fit into our ideas of prefixes.\n\nThis is for heuristics which attempt to create directory structures that mirror those of the\ninstalled perl.\n\nFor example:\n\n$MM->prefixify('installman1dir', '/usr', '/home/foo', 'man/man1');\n\nthis will attempt to remove '/usr' from the front of the $MM->{INSTALLMAN1DIR} path\n(initializing it to $Config{installman1dir} if necessary) and replace it with '/home/foo'.\nIf this fails it will simply use '/home/foo/man/man1'.\n\nprocessPL (o)\nDefines targets to run *.PL files.\n\nspecifyshell\nSpecify SHELL if needed - not done on Unix.\n\nquoteparen\nBackslashes parentheses \"()\" in command line arguments. Doesn't handle recursive Makefile\n\"$(...)\" constructs, but handles simple ones.\n\nreplacemanpageseparator\nmy $manname = $MM->replacemanpageseparator($filepath);\n\nTakes the name of a package, which may be a nested package, in the form 'Foo/Bar.pm' and\nreplaces the slash with \"::\" or something else safe for a man page file name. Returns the\nreplacement.\n\ncd\noneliner\nquoteliteral\nQuotes macro literal value suitable for being used on a command line so that when expanded\nby make, will be received by command as given to this method:\n\nmy $quoted = $mm->quoteliteral(q{it isn't});\n# returns:\n#   'it isn'\\''t'\nprint MAKEFILE \"target:\\n\\techo $quoted\\n\";\n# when run \"make target\", will output:\n#   it isn't\n\nescapenewlines\nmaxexeclen\nUsing POSIX::ARGMAX. Otherwise falling back to 4096.\n\nstatic (o)\nDefines the static target.\n\nxsmakestaticlib\nDefines the recipes for the \"staticlib\" section.\n\nstaticlibclosures\nRecords \"$(EXTRALIBS)\" in extralibs.ld and $(PERLSRC)/ext.libs.\n\nstaticlibfixtures\nHandles copying \"$(MYEXTLIB)\" as starter for final static library that then gets added to.\n\nstaticlibpurecmd\nDefines how to run the archive utility.\n\nstaticmake (o)\nCalls makeaperl.\n\nsubdirx (o)\nHelper subroutine for subdirs\n\nsubdirs (o)\nDefines targets to process subdirectories.\n\ntest (o)\nDefines the test targets.\n\ntestviaharness (override)\nFor some reason which I forget, Unix machines like to have PERLDLNONLAZY set for tests.\n\ntestviascript (override)\nAgain, the PERLDLNONLAZY thing.\n\ntoolxsubpp (o)\nDetermines typemaps, xsubpp version, prototype behaviour.\n\nalltarget\nBuild man pages, too\n\ntoptargets (o)\nDefines the targets all, subdirs, config, and OFILES\n\nwritedoc\nObsolete, deprecated method. Not used since Version 5.21.\n\nxsc (o)\nDefines the suffix rules to compile XS files to C.\n\nxscpp (o)\nDefines the suffix rules to compile XS files to C++.\n\nxso (o)\nDefines suffix rules to go from XS to object files directly. This was originally only\nintended for broken make implementations, but is now necessary for per-XS file under\n\"XSMULTI\", since each XS file might have an individual \"$(VERSION)\".\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "ExtUtils::MakeMaker\n",
            "subsections": []
        }
    },
    "summary": "ExtUtils::MMUnix - methods used by ExtUtils::MakeMaker",
    "flags": [],
    "examples": [],
    "see_also": []
}