On 30 June 2015 at 22:41, Bob Friesenhahn <bfrie...@simple.dallas.tx.us> wrote: >> as well as a heap of other variable definitions copied from the >> MakeMaker Makefile. Now I have to see how ExtUtils:MakeMaker knew what >> flags to use to see if I can replicate it. > > > These definitely come from how Perl was originally compiled and built. If a > different compiler sas used, the provided options may be completely > different and not work with the compiler you are currently using (even if > the generated code would interoperate). > > It would be good to find a way to tease these parameters out of the Perl > installation.
I discovered the parameters were from a file "/usr/lib/perl5/Config_heavy.pl" on my system, and they should be retrievable using the Config perl module. I have the idea to retrieve this information in configure.ac and substitute it into the Makefile. What you say about using a different compiler is worrying, though, and I hadn't thought about it before. So basically when compiling an XS module, you need to use whatever compiler was used to compile perl in the first place? I think we could retrieve this information and use it only when compiling the XS module, allowing the rest of the program to be compiled with the compiler that the configure script or user chooses. > Something else which changes is the identity of the target, which determines > where build products go in the build tree and when installed. What, you mean if cross-compiling? It seems impossible: how are we supposed to know what compiler flags to use? Some information might have to be provided manually. The same problem must have occurred with libtool as well, for cross-compiling shared libraries.