[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: Russ Allbery
Subject: Re: Integration of a Perl XS module with an Automake build system
Date: Fri, 03 Jul 2015 12:31:34 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Gavin Smith <address@hidden> writes:

> I wonder if anyone could give pointers to advice on how to integrate a
> Perl XS module with an Automake build system? Over at the Texinfo
> project we're starting to replace parts of makeinfo with loadable
> native-code modules, for speed.

You can see the approach that I took in various of my packages, such as:;a=blob;;h=2cc0aba845f450afcd60a6c01e02a33cb9bdc803;hb=9d3555c7f9047f5ac1c67237379072df5b864b82

Search for BINDINGS to see the key components of this approach.  Also of
interest are the Perl-related stuff in;a=blob;;h=0dab897ff18323271e7e0455eca881bccbf314c2;hb=9d3555c7f9047f5ac1c67237379072df5b864b82

and the Build.PL file:;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.

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

- 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.

> suggested not to
> use ExtUtils::MakeMaker at all.

Yeah, I still need to find time to do that writeup I promised I'd do.  :)

Russ Allbery (address@hidden)              <>

reply via email to

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