Greets,
Nick Wellnhofer pointed out off-list that a recent commit of mine made it
impossible to pass compiler flags on the command line via Module::Build's
`--extra_compiler_flags` param.
http://s.apache.org/TIj
That's an undesirable side effect, but let me explain the rationale behind the
recent set of changes.
The goal of the chaz_compiler_flags branch is to consolidate as much as
possible of the compiler flag probing code into charmonizer so that it can be
shared across all host bindings -- decreasing the amount of build code which
must be written for each host. When I set out, I had hoped to separate the
compilation of our C code into two silos:
Host-agnostic files:
* All .c files under core/
* autogen/source/parcel.c
Host-specific files (i.e. those which pound-include host-specific headers like
"XSUB.h"):
* All .c files under perl/xs/
* perl/lib/Lucy.xs (autogenerated, contains all source fragments from
perl/buildlib/Lucy/Build/Binding/*.pm)
* autogen/source/callbacks.c
* autogen/source/lucy_boot.c
Ideally, the host-agnostic files would be compiled using flags specified using
charmonizer that the host wouldn't know anything about, and the host-specific
files would all be compiled using the defaults for building host extensions --
thus simplifying all host build scripts. Things didn't work out perfectly
because it turns out MSVC needs `-TP` and `-DHAS_BOOL` when building our
extensions, but for the most part I think the initiative was a success.
The next logical step is to consolidate the compilation commands for building
the host-agnostic files, but this is annoying because the most obvious way to
do it is via Makefile proliferation. (; Extending Charmonizer to handle
compilation might actually be the most elegant approach -- we've already
abstracted the compiler and the shell to an extent -- but heads may explode if
I propose writing build scripts in C so I'll save that for later. ;)
In any case, I'm still planning to merge the chaz_compiler_flags branch into
master. If the ability to pass extra_compiler_flags via the command line is
important, we can hack it back in; it just means a small setback with regards
to the the task of simplifying host build files.
Marvin Humphrey