--- pygobject-2.14.0/configure.ac	2007/11/12 00:09:09	1.1
+++ pygobject-2.14.0/configure.ac	2007/11/12 00:22:35
@@ -129,10 +129,21 @@ AC_SUBST([pygobject_CODEGEN_DEFINES])
 
 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_ENABLE(libffi,
+  AC_HELP_STRING([--disable-ffi], [Disable libffi support]),
+  enable_ffi=$enableval,
+  enable_ffi=auto)
+if test x"$enable_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])
+     FFI_LIBS="-lffi"
+  fi
+fi
+if test x"$enable_ffi" = xyes && 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")
