On 01/06/2016 17:04, Nick Wellnhofer wrote:
On 26/05/2016 04:12, Marvin Humphrey wrote:
With Python distutils as with Perl's Module::Build, it is at least
theoretically possible to provide a list of object files to be linked into the
host extension.
I'm leaning towards the "list of object files" approach for the Perl bindings.
Unless static libraries are really used as intended, they seem to create more
problems than they solve.
I submitted a new pull request the makes the Perl bindings use "make" to build
the core object files.
Some open questions:
Do we want the tests in a separate binary, or do we want a second binary
containing both core and test code? The latter allows to integrate the test
code more tightly, the former requires to make some test-only symbols visible.
An advanced solution would even allow both approaches.
Currently, we pass parcel privacy defines like CFP_CFISH as command-line
arguments to the compiler. If we start to build separate binaries, this
requires to put the test code in a separate directory and use special Makefile
rules that add some per-directory flags. I think this can be done in a
cross-platform way but it's a little complicated. Another approach is to move
the #defines directly into the source files. This is more flexible with regard
to directory layout, but less flexible when changing configurations. Different
host languages might even need different settings.
It's probably a good idea to move the test code into a separate directory
regardless of the issue above. Marvin suggested to name it "test". The only
problem I can see is that this directory must be moved into the host language
subdirectory when bundling host language distributions like CPAN tarballs.
"test" is a pretty generic name that might cause clashes, but the same is true
for "core".
Nick