[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:
>
> http://git.eyrie.org/?p=kerberos/webauth.git;a=blob;f=Makefile.am;h=2cc0aba845f450afcd60a6c01e02a33cb9bdc803;hb=9d3555c7f9047f5ac1c67237379072df5b864b82
>
> Search for BINDINGS to see the key components of this approach. Also of
> interest are the Perl-related stuff in configure.ac:
>
> http://git.eyrie.org/?p=kerberos/webauth.git;a=blob;f=configure.ac;h=0dab897ff18323271e7e0455eca881bccbf314c2;hb=9d3555c7f9047f5ac1c67237379072df5b864b82
>
> and the Build.PL file:
>
> http://git.eyrie.org/?p=kerberos/webauth.git;a=blob;f=perl/Build.PL;h=f5bdb86d34c2a35a344404d6b00f431dd2cf27c6;hb=9d3555c7f9047f5ac1c67237379072df5b864b82
>
> 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.
http://svn.savannah.gnu.org/viewvc/trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am?revision=6386&root=texinfo&view=markup
Hopefully it doesn't rely on anything undocumented or unstable.