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)
+glib_sysdef_msg=`echo $2 | sed 's/:[[^ ]]*//g'`
+AC_MSG_CHECKING(system definitions for $glib_sysdef_msg)
cat >confrun.c <<_______EOF
#include <stdio.h>
$1
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
+for glib_sysdef_input in $2 ; do
+ glib_sysdef=`echo $glib_sysdef_input | sed 's/^\([[^:]]*\):.*$/\1/'`
+ glib_default=`echo $glib_sysdef_input | sed 's/^[[^:]]*:\(.*\)$/\1/'`
+ 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
+ if test $glib_sysdef != $glib_default; then
+ echo " fprintf (f, \"#define GLIB_SYSDEF_%s %s%d\\n\", \"$glib_sysdef\", \"$4\", $glib_default);" >>confrun.c
+ else
+ echo " fprintf (f, \"#define GLIB_SYSDEF_%s\\n\", \"$glib_sysdef\");" >>confrun.c
+ fi
+ 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
+[ for glib_sysdef_input in $2 ; do
+ glib_sysdef=`echo $glib_sysdef_input | sed 's/^\([[^:]]*\):.*$/\1/'`
+ glib_default=`echo $glib_sysdef_input | sed 's/^[[^:]]*:\(.*\)$/\1/'`
+ if test $glib_sysdef != $glib_default; then
+ glib_default=" $4$glib_default"
+ else
+ glib_default=
+ fi
+ echo "#define GLIB_SYSDEF_$glib_sysdef$glib_default" >>$glib_sysdefso
done
- AC_MSG_RESULT(failed),)
+ AC_MSG_RESULT(failed)])
rm -f confrun.c
])