diff -ru glib-2.0.1-orig/acglib.m4 glib-2.0.1/acglib.m4
--- glib-2.0.1-orig/acglib.m4	Thu Mar 28 15:05:39 2002
+++ glib-2.0.1/acglib.m4	Wed Apr  3 17:24:49 2002
@@ -105,6 +105,7 @@
 dnl GLIB_SYSDEFS (INCLUDES, DEFS_LIST, OFILE [, PREFIX])
 AC_DEFUN(GLIB_SYSDEFS,
 [glib_sysdefso="translit($3, [-_a-zA-Z0-9 *], [-_a-zA-Z0-9])"
+if test "$cross_compiling" != "yes"; then
 glib_sysdef_msg=`echo $2 | sed 's/:[[^ 	]]*//g'`
 if test "x`(echo '\n') 2>/dev/null`" != 'x\n'; then
   glib_nl='\\n'
@@ -146,4 +147,20 @@
 	done
 	AC_MSG_RESULT(failed)])
 rm -f confrun.c
+else
+ 	AC_MSG_WARN(cross compiling; generating default $glib_sysdefso)
+ 	cat > $glib_sysdefso << ______EOF
+#include <sys/types.h>
+#include <sys/poll.h>
+
+#define GLIB_SYSDEF_POLLIN =POLLIN
+#define GLIB_SYSDEF_POLLOUT =POLLOUT
+#define GLIB_SYSDEF_POLLPRI =POLLPRI
+#define GLIB_SYSDEF_POLLERR =POLLERR
+#define GLIB_SYSDEF_POLLHUP =POLLHUP
+#define GLIB_SYSDEF_POLLNVAL =POLLNVAL
+
+______EOF
+ 	
+fi
 ])
diff -ru glib-2.0.1-orig/configure.in glib-2.0.1/configure.in
--- glib-2.0.1-orig/configure.in	Thu Mar 28 15:25:14 2002
+++ glib-2.0.1/configure.in	Wed Apr  3 17:26:40 2002
@@ -318,7 +318,8 @@
 fi
 
 dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
-AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
+dnl NOTE: Why is this being done? Doesn't AM_PROG_CC_STDC take care of this?
+AC_CACHE_CHECK([for extra flags to get ANSI library prototypes], glib_cv_ansi_flags, [
 glib_save_LIBS=$LIBS
 LIBS="$LIBS -lm"
 AC_TRY_RUN([#include <math.h>
@@ -336,6 +337,10 @@
      )
 )
 LIBS=$glib_save_LIBS
+])
+if test "x$glib_cv_ansi_flags" != "xno"; then
+	CFLAGS="$CFLAGS $glib_cv_ansi_flags";
+fi
 
 dnl NeXTStep cc seems to need this
 AC_MSG_CHECKING([for extra flags for POSIX compliance])
@@ -1204,7 +1209,9 @@
 		G_THREAD_LIBS="-pthread"
 		;;
              *)
-		for thread_lib in "" pthread pthread32 pthreads thread dce; do
+	 	AC_CACHE_CHECK([for thread_lib],
+			glib_cv_thread_lib,
+		[for thread_lib in "" pthread pthread32 pthreads thread dce; do
 			if test x"$thread_lib" = x; then
 				add_thread_lib=""
 				IN=""
@@ -1232,16 +1239,20 @@
 				  exit (check_me != 42);
 				}],
 				[AC_MSG_RESULT(yes)
-				G_THREAD_LIBS="$add_thread_lib"
+				glib_cv_thread_lib="$add_thread_lib"
 				break],
-				[AC_MSG_RESULT(no)])
-		done
+				[AC_MSG_RESULT(no)],
+				)
+		done])
+		G_THREAD_LIBS="$glib_cv_thread_lib"
                 ;;
 	   esac 	
 	   if test "x$G_THREAD_LIBS" = xerror; then
              AC_MSG_ERROR($LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2)
 	   fi
-	   for thread_lib in "" rt rte; do
+	   AC_CACHE_CHECK([for sched_get_priority_min_lib],
+		glib_cv_posix_priority_min_lib,
+	   [for thread_lib in "" rt rte; do
 	     if test x"$thread_lib" = x; then
 	       add_thread_lib=""
 	       IN=""
@@ -1250,8 +1261,6 @@
 	       IN=" in -l$thread_lib"
 	     fi
 	     LIBS="$glib_save_LIBS $add_thread_lib"
-			
-	     AC_MSG_CHECKING(for sched_get_priority_min$IN)
 	     AC_TRY_RUN([#include <sched.h>
 		         #include <errno.h>
 			 int main() {
@@ -1264,7 +1273,13 @@
 		     	 posix_priority_max="sched_get_priority_max(SCHED_OTHER)"
 			 break],
 			[AC_MSG_RESULT(no)])
-	   done
+	   done])
+		if test "x$glib_cv_posix_priority_min_lib" != "x"; then
+			 G_THREAD_LIBS="$G_THREAD_LIBS $glib_cv_posix_priority_min_lib"
+			 posix_priority_min="sched_get_priority_min(SCHED_OTHER)"
+			 posix_priority_max="sched_get_priority_max(SCHED_OTHER)"
+		fi
+
 	   LIBS="$glib_save_LIBS"
            mutex_has_default=yes
            mutex_default_type='pthread_mutex_t'
@@ -1418,7 +1433,8 @@
 		AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
 		CPPFLAGS="$glib_save_CPPFLAGS"
 
-		AC_MSG_CHECKING(whether to use the PID niceness surrogate for thread priorities)
+ 		AC_CACHE_CHECK([for whether to use the PID niceness surrogate for thread priorities],
+			glib_cv_g_thread_use_pid_surrogate,
 		AC_TRY_RUN([#include <pthread.h> 
 			#include <sys/types.h>
 			#include <unistd.h>
@@ -1433,10 +1449,15 @@
 			  exit (getpid()==other_pid || 
 				$posix_priority_min != $posix_priority_max);
 			}],
-			[AC_MSG_RESULT(yes)
-			  AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
-                        ],
-			[AC_MSG_RESULT(no)])
+			glib_cv_g_thread_use_pid_surrogate=yes,
+			glib_cv_g_thread_use_pid_surrogate=no))
+			if test "x$glib_cv_g_thread_use_pid_surrogate" = "xyes"; then
+				AC_MSG_RESULT(yes)
+				AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, 
+					[whether to use the PID niceness surrogate for thread priorities])
+			else
+				AC_MSG_RESULT(no)
+			fi
 	elif test x"$have_threads" = xwin32; then
 		# It's a pointer to a private struct
 		GLIB_SIZEOF(,struct _GThreadData *, system_thread)
