Gavin Smith <gavinsmith0...@gmail.com> 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: 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. 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. - 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. > http://www.eyrie.org/~eagle/journal/2013-01/025.html 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 (ea...@eyrie.org) <http://www.eyrie.org/~eagle/>