ExtUti...mlists(3perl)
π ExtUtils::Mksymlists β from the Perl Programmers Reference Guide, section 3perl β¨
okay bestie, gather round, because this one is a build-system baddie π It's ExtUtils::Mksymlists, and its whole job is writing linker options files for dynamic extension. Lowkey niche, highkey essential. Let's get into it π
πΈ NAME πΈ
ExtUtils::Mksymlists β write linker options files for dynamic extension. she does exactly what it says on the tin, periodt π
π¦ SYNOPSIS π¦
use ExtUtils::Mksymlists;
Mksymlists( NAME => $name ,
DL_VARS => [ $var1, $var2, $var3 ],
DL_FUNCS => { $pkg1 => [ $func1, $func2 ],
$pkg2 => [ $func3 ] );
(yes the paren situation is exactly like that, don't come for me, I'm just the messenger π«Ά)
β¨ DESCRIPTION β¨
So ExtUtils::Mksymlists produces files that the linker uses under some OSs while shared libraries are being created for dynamic extensions. Some OSs β not all, don't @ me, that's just the vibe π
Normally it gets called from a MakeMaker-generated Makefile when the extension is built. It does its thing by calling the function Mksymlists, which is exported by default from ExtUtils::Mksymlists (no Exporter gymnastics required, you're welcome π).
It takes one argument: a list of key-value pairs. And here are the keys it recognizes, one by one π
π DLBASE
This one specifies the name by which the linker knows the extension. Plot twist: that name can be different from the name of the extension itself β for instance, some linkers just casually add an '_' to the name of the extension π
If you don't specify it, it gets derived from the NAME attribute. And it's presently used only by OS2 and Win32. only. OS2. and. Win32. iykyk.
π DL_FUNCS
This is identical to the DL_FUNCS attribute you can get via MakeMaker, and honestly that's usually where it comes from. Its value is a reference to an associative array, where:
- each key is the name of a package π¦
- each value is a reference to an array of function names that should be exported by the extension π
For instance, one might say:
DL_FUNCS => { Homer::Iliad => [ qw(trojans greeks) ],
Homer::Odyssey => [ qw(travellers family suitors) ] }
(iconic naming, no notes π)
The function names should be identical to those in the XSUB code. Mksymlists will alter the names written to the linker option file so they match the changes made by xsubpp. She's got you, she handles the glow-up β¨
Also! 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. And if a boot_<pkg> function is present in the list, it gets passed through unchanged β no touchy, she leaves it alone π«Ά
If DL_FUNCS isn't specified, it defaults to the bootstrap function for the extension specified in NAME.
π DL_VARS
Identical to the DL_VARS attribute available via MakeMaker, and just like DL_FUNCS, it's usually specified via MakeMaker. Its value is a reference to an array of variable names that should be exported by the extension. simple. clean. slay π
π FILE
Use this key when you want to specify the name of the linker option file (minus the OS-specific extension) because for some reason you do not want the default. And the default is the last word of the NAME attribute β e.g. for Tk::Canvas, FILE defaults to Canvas. cute, right? π
π FUNCLIST
This gives you 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 get passed through unaltered to the linker options file β no edits, no notes, straight through π
β οΈ okay important: 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 => [] } );
(empty array, that's the move, don't forget it bestie π)
π IMPORTS
This attribute is used to specify names to be imported into the extension. It is currently only used by OS/2 and Win32. that's it, that's the whole thing π
π NAME
This gives the name of the extension (e.g. Tk::Canvas) for which the linker option file will be produced. the main character of the attribute list, honestly π
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. so like, start with NAME, and only pull out the extras if your extension is being extra π
π«Ά AUTHOR π«Ά
Charles Bailey <bailey@newman.upenn.edu> β thank you for your service, king π
π REVISION π
Last revised 14-Feb-1996, for Perl 5.002.
and that's the whole page bestie!! π this one's from perl v5.44.0, dated 2026-10-17, in the ExtUti...mlists(3perl) section of the manual. go forth and link your dynamic extensions, mwah πβ¨π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms