diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-02-04 06:26:47 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-02-04 06:26:47 +0000 |
commit | f9c5c5c7a25a3c549cbbc523bf2c8f4e895c20b6 (patch) | |
tree | f82420872cbc648dab7c2c983b0b163655b62dc3 /autoconf | |
parent | fe9388ccb4d2449e8e6a62053479a0ba74ae0b2d (diff) | |
download | llvm-f9c5c5c7a25a3c549cbbc523bf2c8f4e895c20b6.tar.gz llvm-f9c5c5c7a25a3c549cbbc523bf2c8f4e895c20b6.tar.bz2 llvm-f9c5c5c7a25a3c549cbbc523bf2c8f4e895c20b6.tar.xz |
Reapply patch from r62553, with a fix to avoid looking for an ffi.h that isn't
there.
This changes the interpreter to use libffi. After this patch, the interpreter
will barely be able to call any external functions if built on a system without
libffi installed (just enough to pass 'make check' really). But with libffi,
we can now call any function that isn't variadic or taking a struct or vector
parameter (but pointer to struct is fine). Patch by Alexei Svitkine!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63723 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 680cc1ddd9..83d54681ac 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -735,6 +735,10 @@ AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1], [Define if dlopen() is available on this platform.]), AC_MSG_WARN([dlopen() not found - disabling plugin support])) +dnl libffi is optional; used to call external functions from the interpreter +AC_CHECK_LIB(ffi,ffi_call,[have_libffi=1], + AC_MSG_WARN([libffi not found - disabling external calls from interpreter])) + dnl mallinfo is optional; the code can compile (minus features) without it AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1], [Define if mallinfo() is available on this platform.])) @@ -791,12 +795,17 @@ AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h]) AC_CHECK_HEADERS([sys/types.h malloc/malloc.h mach/mach.h]) if test "$ENABLE_THREADS" -eq 1 ; then AC_CHECK_HEADERS(pthread.h, - AC_SUBST(HAVE_PTHREAD, 1), - AC_SUBST(HAVE_PTHREAD, 0)) + AC_SUBST(HAVE_PTHREAD, 1), + AC_SUBST(HAVE_PTHREAD, 0)) else AC_SUBST(HAVE_PTHREAD, 0) fi +dnl Once we know we have libffi, try to find ffi.h. +if test -n "$have_libffi" ; then + AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [AC_SUBST(HAVE_FFI, 1)]) +fi + dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 7: Check for types and structures @@ -954,7 +963,7 @@ AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", [Time at which LLVM was configured]) AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host", - [Host triple we were built on]) + [Host triple we were built on]) # Determine which bindings to build. if test "$BINDINGS_TO_BUILD" = auto ; then |