[racket-dev] racket-5.1{, .0.6} not building foreign interface not supported

From: Marijn (hkBst at gentoo.org)
Date: Thu Apr 14 04:40:12 EDT 2011

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Matthew,

On 04/13/11 19:00, Matthew Flatt wrote:
> At Wed, 13 Apr 2011 11:54:44 +0200, Marijn wrote:
>>> Meanwhile, `configure' now detects when libffi is already installed and
>>> uses it (instead of building the version that is included with Racket).
>>
>> I am now able to build with the bundled libffi, but when I delete that
>> from the source and try to build it doesn't find the system library:
>>
>> x86_64-pc-linux-gnu-gcc -march=native -ggdb -O2 -pipe -DMZ_DONT_USE_JIT
>> -DMZ_USES_SHARED_LIB -I./../racket -I./../racket/include
>> -I./../racket/src -Ilibffi/include -c ./foreign.c  -fPIC -DPIC -o
>> .libs/foreign.o
>> ./foreign.c:73:17: error: ffi.h: No such file or directory
>>
>> libffi uses pkgconfig but I'd have to check up on how to use that again
> 
> I've pushed changed to make `configure' use `pkg-config' for libffi.

configure doesn't detect that I have a system libffi installed.
Specifically,

  AC_TRY_LINK([#include <ffi.h>],
              [ffi_cif cif; ]
              [ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
NULL);],
             have_libffi=yes,
             have_libffi=no)

seems to be failing. If I fool it by inserting

  have_libffi=yes

after that test, then everything seems to build fine. I'm not sure how
to debug that AC_TRY_LINK invocation or what kind of information would
help you to do it, so please tell me if you need anything.

Marijn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2msuwACgkQp/VmCx0OL2zUPACguYhksn5Xvg+epnKJfx76qU8a
I1oAoLEn7gfFfgw3KWQGclYgpCMT51FK
=45zy
-----END PGP SIGNATURE-----


Posted on the dev mailing list.