[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integration of a Perl XS module with an Automake build system

From: Gavin Smith
Subject: Re: Integration of a Perl XS module with an Automake build system
Date: Fri, 10 Jul 2015 17:13:05 +0100

On 3 July 2015 at 20:31, Russ Allbery <address@hidden> wrote:
> You can see the approach that I took in various of my packages, such as:
> Search for BINDINGS to see the key components of this approach.  Also of
> interest are the Perl-related stuff in
> and the Build.PL file:
> which is extremely simple.  Note that this project (like all of my
> projects) uses a non-recursive make configuration.

Thanks for replying.

I've been trying to use Libtool as Bob hoped would be possible. I
haven't studied the build system in WebAuth that you linked to in
detail (or that in GraphicsMagick), but may do so if our current
approach doesn't work out.

> The key parts of this approach are:
> - Use Module::Build, not ExtUtils::MakeMaker.  It's significantly easier
>   to deal with and supports a lot of options that make this much easier.
> - Perl's module build system does not handle VPATH properly, so if you
>   want to support out-of-tree builds, the simplest approach is to just
>   copy the Perl module source into the build directory before doing the
>   build.

In the current Texinfo "make distcheck" does a VPATH build, and works
for me, at least (until we get a test failure due to different
behaviour from the XS module).

> - Let Perl handle its own compiler options and flags and only pass in
>   things discovered by Autoconf that you know you need.  You'll have the
>   least problems if you keep the Perl build as close to native as
>   possible.  If you try to reinvent the Perl build system, you'll be in
>   for a lot more work over time, since the build system changes a lot.

Alas, I fear I may have been doing exactly this. It didn't seem that
difficult really to replicate what ExtUtils::MakeMaker's Makefile did.
One rule to generate a .c file from a .xs file, plus some CFLAGS and
LDFLAGS obtained from the Perl "Config" module.

Hopefully it doesn't rely on anything undocumented or unstable.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]