summaryrefslogtreecommitdiff
path: root/acglib.m4
diff options
context:
space:
mode:
authorManish Singh <yosh@src.gnome.org>1998-12-26 03:58:06 +0000
committerManish Singh <yosh@src.gnome.org>1998-12-26 03:58:06 +0000
commit6e7e2575d72bc2cfa10ec3cbaa4035b1667294b1 (patch)
tree75ac895770f11b1bcd6970053ee005c85630d5b6 /acglib.m4
parentb13a3368b38ca7187f3f445fd2d3be28bf170772 (diff)
acglib.m4 provide defaults for POLL sysdefs, simple enums don't work with
* acglib.m4 * configure.in: provide defaults for POLL sysdefs, simple enums don't work with bitwise logic. Reported by Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz> -Yosh
Diffstat (limited to 'acglib.m4')
-rw-r--r--acglib.m434
1 files changed, 24 insertions, 10 deletions
diff --git a/acglib.m4 b/acglib.m4
index 128fd0771..ff1dbc382 100644
--- a/acglib.m4
+++ b/acglib.m4
@@ -83,7 +83,8 @@ undefine([AC_CV_NAME])dnl
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
@@ -91,18 +92,31 @@ 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
+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
])