ExtUtil...ymlists(3pm)
π ExtUtils::Mksymlists β Perl Programmers Reference Guide π
okay bestie, so this is a Perl Programmers Reference Guide page for ExtUtils::Mksymlists, and it's genuinely one of those backstage-pass modules that does the invisible glue work so your dynamic extension actually links. it's giving "stage crew in all black" energy β nobody claps for it, but the show does not happen without it. π¦
β¨ NAME β¨
ExtUtils::Mksymlists β write linker options files for dynamic extension
πΈ SYNOPSIS πΈ
use ExtUtils::Mksymlists;
Mksymlists( NAME => $name ,
DL_VARS => [ $var1, $var2, $var3 ],
DL_FUNCS => { $pkg1 => [ $func1, $func2 ],
$pkg2 => [ $func3 ] );
(and yes, that synopsis is exactly as the page gives it β we do not editorialize, we do not "fix" the braces, we simply vibe. π)
π DESCRIPTION π
so ExtUtils::Mksymlists produces files used by the linker under some OSs during the creation of shared libraries for dynamic extensions. no cap β that's the whole job. π
it is normally called from a MakeMaker-generated Makefile when the extension is built. the linker option file is generated by calling the function Mksymlists, which is exported by default from ExtUtils::Mksymlists.
Mksymlists takes one argument β a list of key-value pairs β and in that list, these keys are the ones it recognizes: π
π₯ The Keys π₯
DLBASEβ this item specifies the name by which the linker knows the extension, which may be different from the name of the extension itself. (for instance, some linkers add an_to the name of the extension β iconic of them, honestly.) if it is not specified, it is derived from theNAMEattribute. it is presently used only by OS2 and Win32. π«ΆDL_FUNCSβ this is identical to theDL_FUNCSattribute available via MakeMaker, from which it is usually taken. its value is a reference to an associative array, in which each key is the name of a package, and each value is an a reference to an array of function names which should be exported by the extension. for instance, one might say:
DL_FUNCS => { Homer::Iliad => [ qw(trojans greeks) ],
Homer::Odyssey => [ qw(travellers family suitors) ] }
the function names should be identical to those in the XSUB code; Mksymlists will alter the names written to the linker option file to match the changes made by xsubpp. in addition, if none of the functions in a list begin with the string boot_, Mksymlists will add a bootstrap function for that package, just as xsubpp does. (if a boot_<pkg> function is present in the list, it is passed through unchanged β no touchy, no changey. π§) if DL_FUNCS is not specified, it defaults to the bootstrap function for the extension specified in NAME.
DL_VARSβ this is identical to theDL_VARSattribute available via MakeMaker, and, likeDL_FUNCS, it is usually specified via MakeMaker. its value is a reference to an array of variable names which should be exported by the extension. πFILEβ this key can be used to specify the name of the linker option file (minus the OS-specific extension), if for some reason you do not want to use the default value, which is the last word of theNAMEattribute (e.g. forTk::Canvas,FILEdefaults toCanvas). slay, that's a cute default.FUNCLISTβ 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. specifying a value for theFUNCLISTattribute suppresses automatic generation of the bootstrap function for the package. to still create the bootstrap name you have to specify the package name in theDL_FUNCShash:
Mksymlists( NAME => $name ,
FUNCLIST => [ $func1, $func2 ],
DL_FUNCS => { $pkg => [] } );
IMPORTSβ this attribute is used to specify names to be imported into the extension. it is currently only used by OS/2 and Win32. πNAMEβ this gives the name of the extension (e.g.Tk::Canvas) for which the linker option file will be produced. the main character, lowkey. π
π¦ The Big Rule π¦
when calling Mksymlists, one should always specify the NAME attribute. in most cases, this is all that's necessary. in the case of unusual extensions, however, the other attributes can be used to provide additional information to the linker.
fr fr: NAME is non-negotiable. the rest are situational. know the difference, bestie. π
π AUTHOR π
Charles Bailey <bailey@newman.upenn.edu>
β REVISION β
Last revised 14-Feb-1996, for Perl 5.002.
and that's the whole page, periodt. π
this lovely little doc shipped with perl v5.42.3, dated 2026-11-03 β so go forth, write your linker options files, and remember who told you to always pass NAME. π«Άβ¨ππ
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms