Index: configure
--- configure.orig	2008-03-11 01:41:11 +0100
+++ configure	2008-03-11 20:40:30 +0100
@@ -39397,7 +39397,7 @@
 	      add_thread_lib="-l$thread_lib"
 	      IN=" in -l$thread_lib"
 	    fi
-	    LIBS="$add_thread_lib $glib_save_LIBS"
+	    LIBS="$add_thread_lib `echo x$glib_save_LIBS | sed -e 's;^x;;' -e 's;-lrt;;'`"
 
             { echo "$as_me:$LINENO: checking for sched_get_priority_min$IN" >&5
 echo $ECHO_N "checking for sched_get_priority_min$IN... $ECHO_C" >&6; }
Index: glib-2.0.pc.in
--- glib-2.0.pc.in.orig	2008-03-11 01:32:01 +0100
+++ glib-2.0.pc.in	2008-03-11 20:40:30 +0100
@@ -9,6 +9,7 @@
 
 Name: GLib
 Description: C Utility Library
+Requires: libpcre
 Version: @VERSION@
 Libs: -L${libdir} -lglib-2.0 @INTLLIBS@ @ICONV_LIBS@
 Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include 
Index: gmodule/gmodule-dl.c
--- gmodule/gmodule-dl.c.orig	2008-03-11 01:31:51 +0100
+++ gmodule/gmodule-dl.c	2008-03-11 20:40:30 +0100
@@ -107,6 +107,7 @@
 static gpointer
 _g_module_self (void)
 {
+#ifndef __FreeBSD__
   gpointer handle;
   
   /* to query symbols from the program itself, special link options
@@ -118,6 +119,9 @@
     g_module_set_error (fetch_dlerror (TRUE));
   
   return handle;
+#else
+  return RTLD_DEFAULT;
+#endif
 }
 
 static void
Index: tests/errorcheck-mutex-test.c
--- tests/errorcheck-mutex-test.c.orig	2008-03-11 01:31:52 +0100
+++ tests/errorcheck-mutex-test.c	2008-03-11 20:40:30 +0100
@@ -1,3 +1,5 @@
+#ifdef G_THREADS_ENABLED
+
 #undef G_DISABLE_ASSERT
 #undef G_LOG_DOMAIN
 #define G_ERRORCHECK_MUTEXES
@@ -102,9 +104,12 @@
    timed_wait_on_otherwise_locked_mutex}
 };
 
+#endif
+
 int
 main (int argc, char* argv[])
 {
+#ifdef G_THREADS_ENABLED
   int i;
 
   if (argc == 2)
@@ -126,6 +131,7 @@
     {
       fprintf (stderr, "      %s\n", func_table[i].name);
     }
+#endif
 
   return 0;
 }
Index: configure
--- configure.orig	2008-10-17 08:34:41 +0200
+++ configure	2008-10-17 08:38:53 +0200
@@ -4266,13 +4266,7 @@
 if $ac_preproc_ok; then
   :
 else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 fi
 
 ac_ext=c
