diff options
author | Johan Dahlin <johan@gnome.org> | 2008-01-11 21:41:44 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-01-11 21:41:44 +0000 |
commit | 23df5efb74f6b9b6c5da7a8db89ccd612533327d (patch) | |
tree | 60a7b06245ca7a558b3b7e606f2c5ecbbf97a0b2 /configure.ac | |
parent | 432a5572136309185baa37d8280966092842a047 (diff) | |
download | pygobject-23df5efb74f6b9b6c5da7a8db89ccd612533327d.tar.gz |
Don't link against libffi if we cannot find libffi on the system.
2008-01-11 Johan Dahlin <johan@gnome.org>
* configure.ac: Don't link against libffi if we cannot find libffi
on the system. (#496006, Ed Catmur)
svn path=/trunk/; revision=729
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index fa76bf5c..bd5f27de 100644 --- a/configure.ac +++ b/configure.ac @@ -145,10 +145,33 @@ AS_AC_EXPAND(DATADIR, $datadir) dnl libffi AC_MSG_CHECKING(for ffi.h) -AC_TRY_CPP([#include <ffi.h>], pygobject_ffi_h=yes, pygobject_ffi_h=no) -if test $pygobject_ffi_h = yes; then - AC_DEFINE(HAVE_FFI_H,1,[Have ffi.h include file]) - FFI_LIBS="-lffi" +AC_ARG_WITH(libffi, + AC_HELP_STRING([--without-ffi], [Disable libffi support]), + with_ffi=$withval, + with_ffi=auto) +if test x"$with_ffi" = xno ; then + pygobject_ffi_h=disabled +else + AC_TRY_CPP([#include <ffi.h>], pygobject_ffi_h=yes, pygobject_ffi_h=no) + if test $pygobject_ffi_h = yes; then + AC_DEFINE(HAVE_FFI_H,1,[Have ffi.h include file]) + save_LIBS=$LIBS + if test x"$with_ffi" = xyes || test x"$with_ffi" = xauto; then + other_LIBS= + else + other_LIBS=$with_ffi + fi + AC_SEARCH_LIBS(ffi_call,ffi,,AC_MSG_ERROR([libffi not found]),$other_LIBS) + if test x$"ac_cv_search_ffi_call" = x"none required" ; then + FFI_LIBS=$other_LIBS + else + FFI_LIBS="$ac_cv_search_ffi_call $other_LIBS" + fi + LIBS=$save_LIBS + fi +fi +if test x"$with_ffi" != xauto && test x"$pygobject_ffi_h" != xyes ; then + AC_MSG_ERROR([libffi requested, but ffi.h not found]) fi AC_MSG_RESULT([$pygobject_ffi_h]) AM_CONDITIONAL(HAVE_LIBFFI, test "$pygobject_ffi_h" = "yes") |