ingydotnet / inline-c-pm

10 stars 19 forks source link

Inline::Struct buggy #14

Closed mohawk2 closed 9 years ago

mohawk2 commented 10 years ago

I've asked the author of Inline::Struct for co-maint, which he's given me. It appears the I::S support code is buggy. From a 2006 bug report (on https://rt.cpan.org/Ticket/Display.html?id=19624):

Config for Inline C of LIB or INC parameters are ignored if the STRUCT config parameter is stated afterwards. If STRUCT is specified before then the STRUCT parameter is ignored. If stated in the same configuration section then LIB and INC are ignored.

The STRUCT is used and the structure methods are properly created, but the INC configuration is ignored:

use Inline C => Config =>
    BUILD_NOISY => 1,
    STRUCTS => ['Cstruct'],
    LIBS => '-L/src/libdir1 -L/src/libdir2 -L/src/libdir3 -llib1 -llib2 -llib3',
    INC => '-I/include/dir1 \ -I/include/dir2 \ -I/include/dir3';

while this apparently works:

use Inline C => Config =>
    BUILD_NOISY => 1,
    STRUCTS => ['Cstruct'],
    LIBS => '-L/src/libdir1 -L/src/libdir2 -L/src/libdir3 -llib1 -llib2 -llib3',
    CCFLAGS => '-I/include/dir1 \ -I/include/dir2 \ -I/include/dir3';
mohawk2 commented 9 years ago

This is now trackable here: https://github.com/mohawk2/Inline-Struct/issues/1