Skip to content

meson uses cc.compiles incorrectly #1235

@dcbaker

Description

@dcbaker

Hi, we got a bug report in upstream meson about meson 0.56 breaking irssi. What happened is we (meson) had a bug that resulted in us not adding check arguments to cc.compiles, when we fixed that it breaks this chunk:

  if not cc.compiles('''
#include <EXTERN.h>
#include <perl.h>
int main()
{
  perl_alloc();
  return 0;
}
''', args : perl_cflags + perl_ldflags + perl_rpath_flags,
     name : 'working Perl support')

because there are linker arguments, which are unused. there's two ways to fix this, you could change to cc.links(), which would make the arguments used; or you can remove the perl_ldflags and perl_rpath_flags. I've tested both approaches, and I'm happy to contribute a patch depending on which way you'd like to go.

On the same note, looking at this code made me realize that we really should be handling this in meson proper as a custom dependency: I've created an MR here: mesonbuild/meson#7981. I have a branch of irssi that uses this here: https://github.com/dcbaker/irssi/tree/use-perl-dep. But I basically just read the perlembed docs and wrote some code, so maybe someone here can point out something I'm doing wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions