+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
+Sat Dec 19 04:27:17 1998 Tim Janik <timj@gtk.org>
+
+ * fixed up sys/poll.h and sys/types.h inclusions.
+
Sat Dec 19 03:10:50 1998 Tim Janik <timj@gtk.org>
* fixed up gthread includes, cleaned up glibconfig.h a little bit.
EXTRA_DIST = \
glib.m4 \
glib.spec \
+ acglib.m4 \
sanity_check \
README.win32 \
glib.def \
configinclude_DATA = \
glibconfig.h
+configure: configure.in acglib.m4
+
BUILT_SOURCES = stamp-gc-h #note: not glibconfig.h
glibconfig.h: stamp-gc-h
@:
char *p = (char*) &tv;
int i;
FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
for (i = 0; i < $4; i++)
fprintf(f, "%s%d", i?",":"", *(p++));
fprintf(f, "\n");
undefine([AC_TYPE_NAME])dnl
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)
+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
+])
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
+# we rewrite this file
+rm -f glibconfig-sysdefs.h
+
# The following version number definitions apply to GLib and GModule
# as a whole, so if changes occoured in either of them, they are both
# treated with the same interface and binary age.
)
+dnl ****************************************
+dnl *** GLib POLL* compatibility defines ***
+dnl ****************************************
+GLIB_SYSDEFS([#include <sys/types.h>
+ #include <sys/poll.h>],
+ POLLIN POLLOUT POLLPRI POLLERR POLLHUP POLLNVAL,
+ glibconfig-sysdefs.h,
+ =)
+
+
dnl ******************************
dnl *** output the whole stuff ***
dnl ******************************
echo '#include <'"$g_mutex_header_file"'>' >> $outfile
fi
if test x$glib_sys_poll_h = xyes; then
- echo '#include <sys/types.h>' >> $outfile
- echo '#include <sys/poll.h>' >> $outfile
+ echo '#define GLIB_HAVE_SYS_POLL_H' >> $outfile
fi
cat >> $outfile <<_______EOF
#endif /* !__cplusplus */
_______EOF
-
+ echo >>$outfile
if test x$g_mutex_has_default = xyes; then
cat >>$outfile <<_______EOF
$g_enable_threads_def G_THREADS_ENABLED
#define g_static_mutex_get_mutex(mutex) (g_static_mutex_get_mutex_impl (&(mutex)))
_______EOF
fi
-
-
+
+ echo >>$outfile
g_bit_sizes="16 32"
if test -n "$gint64"; then
g_bit_sizes="$g_bit_sizes 64"
#define GULONG_TO_LE(val) ((gulong) GUINT${glongbits}_TO_LE (val))
#define GLONG_TO_BE(val) ((glong) GINT${glongbits}_TO_BE (val))
#define GULONG_TO_BE(val) ((gulong) GUINT${glongbits}_TO_BE (val))
-
#define GINT_TO_LE(val) ((gint) GINT${gintbits}_TO_LE (val))
#define GUINT_TO_LE(val) ((guint) GUINT${gintbits}_TO_LE (val))
#define GINT_TO_BE(val) ((gint) GINT${gintbits}_TO_BE (val))
#define GUINT_TO_BE(val) ((guint) GUINT${gintbits}_TO_BE (val))
#define G_BYTE_ORDER $g_byte_order
+_______EOF
+
+ if test -r glibconfig-sysdefs.h; then
+ cat glibconfig-sysdefs.h >>$outfile
+ fi
+
+
+ cat >>$outfile <<_______EOF
+
$glib_wc
} GSeekType;
typedef enum
{
- G_IO_IN
-#ifdef POLLIN
- = POLLIN
-#endif
- , G_IO_OUT
-#ifdef POLLOUT
- = POLLOUT
-#endif
- , G_IO_PRI
-#ifdef POLLPRI
- = POLLPRI
-#endif
-
- , G_IO_ERR
-#ifdef POLLERR
- = POLLERR
-#endif
- , G_IO_HUP
-#ifdef POLLHUP
- = POLLHUP
-#endif
- , G_IO_NVAL
-#ifdef POLLNVAL
- = POLLNVAL
-#endif
+ G_IO_IN GLIB_SYSDEF_POLLIN,
+ G_IO_OUT GLIB_SYSDEF_POLLOUT,
+ G_IO_PRI GLIB_SYSDEF_POLLPRI,
+ G_IO_ERR GLIB_SYSDEF_POLLERR,
+ G_IO_HUP GLIB_SYSDEF_POLLHUP,
+ G_IO_NVAL GLIB_SYSDEF_POLLNVAL
} GIOCondition;
struct _GIOChannel
EXTRA_DIST = \
glib.m4 \
glib.spec \
+ acglib.m4 \
sanity_check \
README.win32 \
glib.def \
configinclude_DATA = \
glibconfig.h
+configure: configure.in acglib.m4
+
BUILT_SOURCES = stamp-gc-h #note: not glibconfig.h
glibconfig.h: stamp-gc-h
@:
} GSeekType;
typedef enum
{
- G_IO_IN
-#ifdef POLLIN
- = POLLIN
-#endif
- , G_IO_OUT
-#ifdef POLLOUT
- = POLLOUT
-#endif
- , G_IO_PRI
-#ifdef POLLPRI
- = POLLPRI
-#endif
-
- , G_IO_ERR
-#ifdef POLLERR
- = POLLERR
-#endif
- , G_IO_HUP
-#ifdef POLLHUP
- = POLLHUP
-#endif
- , G_IO_NVAL
-#ifdef POLLNVAL
- = POLLNVAL
-#endif
+ G_IO_IN GLIB_SYSDEF_POLLIN,
+ G_IO_OUT GLIB_SYSDEF_POLLOUT,
+ G_IO_PRI GLIB_SYSDEF_POLLPRI,
+ G_IO_ERR GLIB_SYSDEF_POLLERR,
+ G_IO_HUP GLIB_SYSDEF_POLLHUP,
+ G_IO_NVAL GLIB_SYSDEF_POLLNVAL
} GIOCondition;
struct _GIOChannel
*/
#include "glib.h"
+#include <sys/types.h>
#include <sys/time.h>
+#ifdef GLIB_HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#endif /* GLIB_HAVE_SYS_POLL_H */
#include <unistd.h>
#include <errno.h>
#include "config.h"
*/
#include "glib.h"
+#include <sys/types.h>
#include <sys/time.h>
+#ifdef GLIB_HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#endif /* GLIB_HAVE_SYS_POLL_H */
#include <unistd.h>
#include <errno.h>
#include "config.h"