Dist::Build::XS(3pm)
π NAME π
Okay bestie, welcome to the Dist::Build::XS(3pm) page from the User Contributed Perl Documentation β yes, that's the manual-name moment folded right in here. π
Dist::Build::XS β an XS implementation for Dist::Build. That's the name and the one-line lore. β¨
β¨ VERSION β¨
Version 0.028. Lock it in, no cap. π
π SYNOPSIS π
# planner/xs.pl
load_extension('Dist::Build::XS');
add_xs(
module => 'Foo::Bar',
extra_sources => [ glob 'src/*.c' ],
libraries => [ 'foo' ],
);
π§ DESCRIPTION π§
This module implements support for XS for Dist::Build. It's giving "the XS-support bestie for Dist::Build," and she is iconic. π₯
π METHODS π
π add_xs π
This method takes the following named arguments, and every single one is optional:
moduleβ The name of the module to be compiled. This defaults to$main_moduleunless"file"is given, in which case the name is derived from the path.versionβ The version of the module, defaulting to the dist version.fileβ The name of the XS file. By default it's derived from the$module_name, e.g.lib/Foo/Bar.xsforFoo::Bar.definesβ This hash contains defines for the C files. E.g.{ DEBUG => 1 }.include_dirsβ A list of directories to add to the include path. For the xs file the directory it is in is automatically added to this list.extra_sourcesβ A list of C files to compile with this module. Instead of just a name, entries can also be a hash with the following entries:sourceβ The name of the input file. Mandatory.objectβ The name of the object that will be compiled. Will be derived from the source name by default.include_dirsβ An array containing additional include directories for this object.definesβ A hash containing additional defines for this object.flagsβ An array containing additional flags for this compilation.dependenciesβ An array containing additional dependencies for this compilation.
extra_objectsβ A list of object files to link with the module.extra_compiler_flagsβ Additional flags to feed to the compiler. This can either be an array or a (shell-quoted) string.extra_sourcesβ Extra C files to compile with this module.library_dirsβ Extra libraries to find libraries in.librariesβ Libraries to link to.extra_linker_flagsβ Additional flags to feed to the compiler. This can either be an array or a (shell-quoted) string.
π¦ auto_xs π¦
This method is like add_xs, except that instead of taking module or file named arguments, it takes a dir argument (defaulting to 'lib'). It will search that directory for all XS files, and build them with the other arguments passed to this function. Bestie, it's the "find all the XS files and build them" button. π«Ά
πΈ EXTENSIONS πΈ
Various extensions exist that modify the behavior of add_xs. Among these are:
Dist::Build::XS::Importβ This adds animportargument β it brings in include directories and compilation flags exported by other modules usingDist::Build::XS::Export.Dist::Build::XS::WriteConstantsβ This adds awrite_constantsargument, integratingExtUtils::Constant.Dist::Build::XS::Alienβ This adds analienargument to link to libraries usingAlien::Base.Dist::Build::XS::PkgConfigβ This adds apkg_configargument to link to libraries usingpkg-configfiles.
π AUTHOR π
Leon Timmermans <fawaka@gmail.com> β the author, the icon. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2024 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Cute sign-off time: this Dist::Build::XS(3pm) page is from the User Contributed Perl Documentation, with perl v5.40.1 and the date 2026-03-21 on the footer. Build those XS files, bestie β periodt. ππ¦β¨
π¦ where this page comes from
- ubuntu stonking: libdist-build-perl 0.028-1 Β· 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