NAME
Alien::ckdl - Build and install ckdl, a C library for KDL documents
SYNOPSIS
In a consumer XS distribution's Makefile.PL:
use ExtUtils::MakeMaker;
use Alien::Build::MM;
my $abmm = Alien::Build::MM->new;
WriteMakefile($abmm->mm_args(
NAME => 'Text::KDL::XS',
PREREQ_PM => { 'Alien::ckdl' => 0 },
CONFIGURE_REQUIRES => {
'Alien::Build::MM' => '0.32',
'Alien::ckdl' => 0,
},
));
sub MY::postamble { $abmm->mm_postamble }
Or, to query the install paths directly:
use Alien::ckdl;
print Alien::ckdl->cflags, "\n"; # e.g. -I/.../include
print Alien::ckdl->libs, "\n"; # e.g. -L/.../lib -lkdl
DESCRIPTION
This distribution downloads, builds, and installs ckdl, a C11 library for reading and writing the KDL Document Language (KDL v1 and v2). It exposes the result to Perl XS modules through the standard Alien::Base interface.
The Alien tracks the upstream main branch rather than a tagged release, and always installs from source as a static library. The upstream CMake build is intentionally bypassed: only the C source files that make up libkdl are compiled, omitting the upstream test suite, the Python bindings, and the C++ bindings. As a result the build has no Python, Cython, or CMake dependency.
The primary consumer is Text::KDL::XS. End users who only want to parse or emit KDL from Perl should install Text::KDL::XS directly and let it pull in this Alien as a build-time dependency.
METHODS
This class inherits from Alien::Base; see that module for the full list of methods. The ones most useful to a consumer are:
Alien::ckdl->cflags-
Compiler flags needed to find the bundled kdl/kdl.h header. Returns a string suitable for inclusion in a C compiler command line, for example
-I/path/to/share/include. Alien::ckdl->libs-
Linker flags needed to statically link
libkdl. Returns a string suitable for inclusion in a linker command line, for example-L/path/to/share/lib -lkdl. Alien::ckdl->install_type-
Always returns
share. This Alien does not detect or use a system installation ofckdl; it always builds from source into a private share directory.
When used through Alien::Build::MM, the cflags and libs strings are spliced into the generated Makefile automatically, so a consumer's XS code can simply #include <kdl/kdl.h> and link against libkdl with no extra configuration.
SEE ALSO
Text::KDL::XS, the Perl XS binding that consumes this Alien.
Alien::Base and Alien::Build, the framework this distribution plugs into.
https://github.com/tjol/ckdl, the upstream C library.
https://github.com/kdl-org/kdl, the KDL specification.
LICENSE
This Perl distribution is licensed under the same terms as Perl itself.
The bundled ckdl library is distributed under the MIT license. Its COPYING file is installed into the Alien share directory under share/doc/ckdl/ for license compliance.