-dnl GLIB_SYSDEFS (INCLUDES, DEFS_LIST, OFILE [, PREFIX])
-AC_DEFUN(GLIB_SYSDEFS,
-[glib_sysdefso="translit($3, [-_a-zA-Z0-9 *], [-_a-zA-Z0-9])"
-AC_MSG_CHECKING(system definitions for $2)
-cat >confrun.c <<_______EOF
-#include <stdio.h>
-$1
-int main (int c, char **v) {
- FILE *f = fopen ("$glib_sysdefso", "a");
- if (!f) return 1;
-_______EOF
-for glib_sysdef in $2 ; do
- echo "#ifdef $glib_sysdef" >>confrun.c
- echo " fprintf (f, \"#define GLIB_SYSDEF_%s %s%d\\n\", \"$glib_sysdef\", \"$4\", $glib_sysdef);" >>confrun.c
- echo "#else" >>confrun.c
- echo " fprintf (f, \"#define GLIB_SYSDEF_%s\\n\", \"$glib_sysdef\");" >>confrun.c
- echo "#endif" >>confrun.c
-done
-echo "return 0; }" >>confrun.c
-AC_TRY_RUN(`cat confrun.c`, AC_MSG_RESULT(done),
- for glib_sysdef in $2 ; do
- echo "#define GLIB_SYSDEF_$glib_sysdef" >>$glib_sysdefso
- done
- AC_MSG_RESULT(failed),)
-rm -f confrun.c
-])
+# GLIB_CHECK_VALUE(SYMBOL, INCLUDES, ACTION-IF-FAIL)
+# ---------------------------------------------------------------
+AC_DEFUN([GLIB_CHECK_VALUE],
+[AC_CACHE_CHECK([value of $1], AS_TR_SH([glib_cv_value_$1]),
+ [_AC_COMPUTE_INT([$1], AS_TR_SH([glib_cv_value_$1]), [$2], [$3])])
+])dnl
+
+# GLIB_CHECK_COMPILE_WARNINGS(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ---------------------------------------------------------------------
+# Try to compile PROGRAM, check for warnings
+m4_define([GLIB_CHECK_COMPILE_WARNINGS],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest.$ac_objext
+glib_ac_compile_save="$ac_compile"
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext'
+AS_IF([_AC_EVAL_STDERR($ac_compile) &&
+ AC_TRY_COMMAND([(if test -s conftest.err; then false ; else true; fi)])],
+ [$2],
+ [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+m4_ifvaln([$3],[$3])dnl])dnl
+ac_compile="$glib_ac_compile_save"
+rm -f conftest.$ac_objext conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# GLIB_CHECK_COMPILE_WARNINGS
+
+# GLIB_ASSERT_SET(VARIABLE)
+# -------------------------
+AC_DEFUN([GLIB_ASSERT_SET],
+[if test "x${$1+set}" != "xset" ; then
+ AC_MSG_ERROR($1 [must be set in cache file when cross-compiling.])
+fi
+])dnl