ExtUti...uilder(3pm)
π ExtUtils::LibBuilder β the manual, but make it make sense
okay so bestie, real quick before we dive in: this is from User Contributed Perl Documentation (yes, the 3pm kind of page), and it's about a lil tool that builds C libraries. yes, C libraries. in Perl. we love a crossover episode π«Ά
β¨ NAME β¨
ExtUtils::LibBuilder β literally just a tool to build C libraries. that's it. that's the whole vibe. no cap.
πΈ SYNOPSIS πΈ
so you load it like this and then you make an object, periodt:
use ExtUtils::LibBuilder;
my $libbuilder = ExtUtils::LibBuilder->new( %options );
π¦ METHODS π¦
the tea β: it supports all the method from ExtUtils::CBuilder. like, all of them. but three of them got a little glow-up so they work for standalone C libraries instead of Perl-bundly stuff. those three are the ones below, iykyk.
π new π
this method creates a new ExtUtils::LibBuilder object. main character behavior honestly.
it supports all ExtUtils::CBuilder methods, but heads up β some might work slightly differently (namely the two below, and yes we're getting to them).
you can hand the constructor any option recognized by the ExtUtils::CBuilder constructor. plot twist though: none of them are actually used by LibBuilder. so like. you can. it just won't do anything π.
π link π
$libbuilder -> link( objects => [ "foo.o", "bar.o" ],
module_name => "foobar",
lib_file => "libfoobar$libbuilder->{libext}");
options to the link method are the same as the CBuilder counterpart. easy.
but bestie, listen β the result is a standalone C Library and not a bundle to be loaded by Perl. that distinction is the whole point, okay? don't forget it π«Ά
also!! you can use the libext key to retrieve, straight from the object, the common library extension on the running system (including the dot β yes, the dot is included, you're welcome β¨).
π₯ link_executable π₯
$libbuilder->link_executable( objects => ["main.o"],
extra_linker_flags => "-L. -lfoobar",
exe_file => "foobarcmd$libbuilder->{exeext}");
link_executable needs, as its extra_linker_flags options, the name of the library and the search path. that's just how it is rn. future versions might include better handling on the library files β so like, watch this space π
and again, same deal as above: you can use the exeext key to retrieve from the object the common executable extension on the running system (including the dot π).
π AUTHOR π
Alberto Simoes, "<ambs at cpan.org>" β absolute icon, we stan.
π BUGS π
found a bug or want a feature? please report it to "bug-extutils-libbuilder at rt.cpan.org", or slide into the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ExtUtils-LibBuilder>.
the way this works: I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. a whole communication pipeline. gorgeous. π
π§ SUPPORT π§
you can find documentation for this module with the perldoc command:
perldoc ExtUtils::LibBuilder
you can also look for information at:
- RT: CPAN's request tracker β <http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-LibBuilder>
- AnnoCPAN: Annotated CPAN documentation β <http://annocpan.org/dist/ExtUtils-LibBuilder>
- CPAN Ratings β <http://cpanratings.perl.org/d/ExtUtils-LibBuilder>
- Search CPAN β <http://search.cpan.org/dist/ExtUtils-LibBuilder/>
like, four whole places to find stuff. we're so spoiled π
β LICENSE AND COPYRIGHT β
Copyright 2010 Alberto Simoes.
this program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. pick your fighter π
see <http://dev.perl.org/licenses/> for more information.
lowkey important reminder: this is the ExtUtils::LibBuilder page from User Contributed Perl Documentation, and the source is perl v5.42.0, dated 2025-01-07. screenshot it, cite it, live your truth πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-ExtUtils-LibBuilder 0.90.0-160000.2.2 Β· Artistic-1.0 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