started using libffi in mod/ffi.c if it's available. work in progress

This commit is contained in:
hyunghwan.chung
2019-08-09 18:19:13 +00:00
parent 58b41bc2a5
commit 70c97f5ab5
14 changed files with 552 additions and 170 deletions

65
moo/configure vendored
View File

@ -678,6 +678,7 @@ UNICOWS_LIBS
SOCKET_LIBS
TERMINAL_LIBS
UNWIND_LIBS
FFI_LIBS
DYNCALL_LIBS
LTDL_LIBS
DL_LIBS
@ -792,6 +793,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -891,6 +893,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1143,6 +1146,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1280,7 +1292,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1433,6 +1445,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -18304,7 +18317,7 @@ fi
done
for ac_header in dyncall.h libunwind.h
for ac_header in ffi.h dyncall.h libunwind.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@ -18608,6 +18621,54 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffi_call in -lffi" >&5
$as_echo_n "checking for ffi_call in -lffi... " >&6; }
if ${ac_cv_lib_ffi_ffi_call+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lffi $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ffi_call ();
int
main ()
{
return ffi_call ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ffi_ffi_call=yes
else
ac_cv_lib_ffi_ffi_call=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_call" >&5
$as_echo "$ac_cv_lib_ffi_ffi_call" >&6; }
if test "x$ac_cv_lib_ffi_ffi_call" = xyes; then :
FFI_LIBS="-lffi"
$as_echo "#define HAVE_FFI_LIB 1" >>confdefs.h
fi
if test "x${ac_cv_header_libunwind_h}" = "xyes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_backtrace in -lunwind" >&5