Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson uses cc.compiles incorrectly #1235

Closed
dcbaker opened this issue Nov 13, 2020 · 0 comments · Fixed by #1245
Closed

meson uses cc.compiles incorrectly #1235

dcbaker opened this issue Nov 13, 2020 · 0 comments · Fixed by #1245

Comments

@dcbaker
Copy link

dcbaker commented Nov 13, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant