summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-10 16:04:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-10 16:04:48 -0700
commit430e4c7082f89b75ca9fc5af11674392aaefdffb (patch)
tree5e6f6b57bb722362008e461de306ba0d1e85cadf /configure
parent8720c828d956fd29d9266d0e06cb7ead69d5ab95 (diff)
downloadtxr-430e4c7082f89b75ca9fc5af11674392aaefdffb.tar.gz
txr-430e4c7082f89b75ca9fc5af11674392aaefdffb.tar.bz2
txr-430e4c7082f89b75ca9fc5af11674392aaefdffb.zip
ffi: retain some functionality if libffi missing.
The FFI module is more than just foreign calls and callbacks; it provides a type system and operations for working with binary data. None of it depends on libffi being present and so shouldn't be disabled if libffi is not available. * Makefile (ffi.o): Unconditionally link this object file, not subject to the have_libffi variable. * configure (have_libffi): Variable removed. (gen_config_make): Do not generate a have_libffi variable into config.make, since nothing needs it. * ffi.c (ffi_type): Fake ffi_type defined if libffi is missing. (FFI_TYPE_STRUCT): Fake macro. (ffi_type ffi_type_void, ffi_type_pointer, ffi_type_sint, ffi_type ffi_type_schar, ffi_type_uchar, ffi_type ffi_type_sshort, ffi_type_ushort, ffi_type ffi_type_sint, ffi_type_uint, ffi_type ffi_type_slong, ffi_type_ulong, ffi_type ffi_type_sint8, ffi_type_uint8, ffi_type ffi_type_sint16, ffi_type_uint16, ffi_type ffi_type_sint32, ffi_type_uint32, ffi_type ffi_type_sint64, ffi_type_uint64, ffi_type ffi_type_float, ffi_type_double): Fake libffi type objects, so that code which references these things will build without modification. (ffi_get_type): Function only defined if we have libffi. (ffi_type_struct_destroy_op, ffi_struct_clone, make_ffi_type_struct, ffi_array_clone, make_ffi_type_array): Don't work with ffi_type's element array if we don't have libffi; our fake ffi_type doesn't have such an array. (struct txr_ffi_closure): Type only defined if we have libffi. (ffi_closure_struct, ffi_closure_struct_checked, ffi_closure_print_op, ffi_closure_destroy_op, ffi_closure_mark_op, ffi_closure_put): Functions only defined if we have libffi. (ffi_closure_ops): Static structure only defined if we have libffi. (ffi_init_types): Don't register a closure type if we don't have libffi. (struct txr_ffi_call_desc): Don't define type if we don't have libffi. (ffi_call_desc, ffi_call_desc_checked, ffi_call_desc_print_op, ffi_call_desc_destroy_op, ffi_call_desc_mark_op, ffi_make_call_desc, ffi_call_wrap, ffi_closure_dispatch, ffi_closure_dispatch_safe, ffi_make_closure, ffi_closure_get_fptr): Functions only defined if we have libffi. (ffi_call_desc_ops): Static structure only defined if we have libffi. (ffi_init): Only register ffi-make-call-desc, ffi-call, and ffi-make-closure if we have libffi. * lib.c: Include "ffi.h" header unconditionally. (generic_funcall, ref, refset, int): Remove #if HAVE_LIBFFI.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure5
1 files changed, 0 insertions, 5 deletions
diff --git a/configure b/configure
index 91228283..bf9d07fc 100755
--- a/configure
+++ b/configure
@@ -143,7 +143,6 @@ have_alloca=
have_termios=
have_winsize=
termios_define=
-have_libffi=
#
# Parse configuration variables
@@ -679,8 +678,6 @@ have_sockets := $have_sockets
have_termios := $have_termios
termios_define := $termios_define
-have_libffi := $have_libffi
-
# do we compile in debug support?
debug_support := $debug_support
@@ -2852,11 +2849,9 @@ int main(void)
if conftest ; then
printf "yes\n"
printf "#define HAVE_LIBFFI 1\n" >> config.h
- have_libffi=y
elif conftest EXTRA_LDFLAGS=-lffi ; then
printf "yes\n"
printf "#define HAVE_LIBFFI 1\n" >> config.h
- have_libffi=y
conf_ldflags="${conf_ldflags:+"$conf_ldflags "}-lffi"
else
printf "no\n"