	* (configure): Fix handling of --without-libffi

	* Fixes build with --disable-thread
	Submitted at: http://bugzilla.gnome.org/show_bug.cgi?id=374603

--- gobject/gobjectmodule.c.old	2006-11-12 13:45:27.445909011 +0100
+++ gobject/gobjectmodule.c	2006-11-12 13:46:36.515561908 +0100
@@ -1942,13 +1942,19 @@ pyg_enable_threads (void)
 static int
 pyg_gil_state_ensure_py23 (void)
 {
+#ifdef DISABLE_THREADING
+    return 0;
+#else
     return PyGILState_Ensure();
+#endif
 }
 
 static void
 pyg_gil_state_release_py23 (int flag)
 {
+#ifndef DISABLE_THREADING
     PyGILState_Release(flag);
+#endif
 }
 
 static PyObject *
--- gobject/pygobject-private.h.old	2006-11-12 13:46:59.546112716 +0100
+++ gobject/pygobject-private.h	2006-11-12 13:51:23.940955354 +0100
@@ -21,12 +21,18 @@ extern struct _PyGObject_Functions pygob
 
 #define pyg_threads_enabled (pygobject_api_functions.threads_enabled)
 
+#ifdef DISABLE_THREADING
+#define pyg_gil_state_ensure() 0
+#define pyg_gil_state_release(state) G_STMT_START {     \
+    } G_STMT_END
 
+#else
 #define pyg_gil_state_ensure() (pygobject_api_functions.threads_enabled? (PyGILState_Ensure()) : 0)
 #define pyg_gil_state_release(state) G_STMT_START {     \
     if (pygobject_api_functions.threads_enabled)        \
         PyGILState_Release(state);                      \
     } G_STMT_END
+#endif
 
 #define pyg_begin_allow_threads                         \
     G_STMT_START {                                      \
--- gobject/pygobject.h.old	2006-11-12 13:47:06.629974549 +0100
+++ gobject/pygobject.h	2006-11-12 13:50:38.854834887 +0100
@@ -244,6 +244,12 @@ struct _PyGObject_Functions *_PyGObject_
 
 #define pyg_threads_enabled (_PyGObject_API->threads_enabled)
 
+#ifdef DISABLE_THREADING
+#define pyg_gil_state_ensure() 0
+#define pyg_gil_state_release(state) G_STMT_START {     \
+    } G_STMT_END
+
+#else
 #define pyg_gil_state_ensure() \
     (_PyGObject_API->threads_enabled ? \
       (PyGILState_Ensure()) : 0)
@@ -251,6 +257,7 @@ struct _PyGObject_Functions *_PyGObject_
     if (_PyGObject_API->threads_enabled)                \
         PyGILState_Release(state);                      \
     } G_STMT_END
+#endif
 
 #define pyg_begin_allow_threads                 \
     G_STMT_START {                              \
--- configure.old	2008-10-29 05:01:47.822672000 -0400
+++ configure	2008-10-29 05:02:19.743263000 -0400
@@ -11322,7 +11322,7 @@ fi
     LIBS=$save_LIBS
   fi
 fi
-if test x"$with_ffi" != xauto && test x"$pygobject_ffi_h" != xyes ; then
+if test x"$with_ffi" = xyes && test x"$pygobject_ffi_h" != xyes ; then
   { { echo "$as_me:$LINENO: error: libffi requested, but ffi.h not found" >&5
 echo "$as_me: error: libffi requested, but ffi.h not found" >&2;}
    { (exit 1); exit 1; }; }
