diff options
author | Johan Dahlin <johan@gnome.org> | 2008-07-20 12:31:30 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-07-20 12:31:30 +0000 |
commit | 723d35fc2d1f65e3d040c3b61ada66d45b84a481 (patch) | |
tree | a8845a4c2cc09b5f0d60c0063264b8515c37ad4f /configure.ac | |
parent | 46a755b0216287884aab41654fa68a7541d25a79 (diff) | |
download | pygobject-723d35fc2d1f65e3d040c3b61ada66d45b84a481.tar.gz |
Use pkg-config to check for libffi again.
2008-07-20 Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject/Makefile.am:
Use pkg-config to check for libffi again.
svn path=/trunk/; revision=841
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac index 239c44bb..d9762fa8 100644 --- a/configure.ac +++ b/configure.ac @@ -151,37 +151,24 @@ AC_SUBST([pygobject_CODEGEN_DEFINES]) AS_AC_EXPAND(DATADIR, $datadir) dnl libffi -AC_MSG_CHECKING(for ffi.h) -AC_ARG_WITH(libffi, +AC_MSG_CHECKING(for ffi) +AC_ARG_WITH(ffi, 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 + with_libffi=$withval, + with_libffi=auto) +if test x"$with_libffi" = xno ; then + have_libffi=false 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 + PKG_CHECK_MODULES(FFI, libffi >= 3.0, have_libffi=true, have_libffi=false) fi -if test x"$with_ffi" != xauto && test x"$pygobject_ffi_h" != xyes ; then - AC_MSG_ERROR([libffi requested, but ffi.h not found]) +if test x"$with_libffi" == xyes && test x"$have_libffi" != xyes ; then + AC_MSG_ERROR([ffi requested, but not found]) +else + AC_DEFINE(HAVE_FFI_H,1,[Have libffi include files]) fi -AC_MSG_RESULT([$pygobject_ffi_h]) -AM_CONDITIONAL(HAVE_LIBFFI, test "$pygobject_ffi_h" = "yes") +AC_MSG_RESULT([$have_libffi]) +AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "true") +AC_SUBST(FFI_CFLAGS) AC_SUBST(FFI_LIBS) dnl gio @@ -237,5 +224,5 @@ AC_CONFIG_FILES( AC_OUTPUT echo -echo "libffi support: $pygobject_ffi_h" +echo "libffi support: $have_libffi" echo |