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 πŸ™ˆ.

$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 ✨).

$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:

like, four whole places to find stuff. we're so spoiled πŸ“


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