+2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
+
+ * configure.ac (HAVE_GLIB): Add GLib check. Set XGSELOBJ if GLib is
+ used. Remove xgselect.o from XOBJ.
+
2013-06-03 Michael Albinus <michael.albinus@gmx.de>
* configure.ac (file-notification): New option, replaces inotify option.
AC_CHECK_FUNCS(snprintf)
+dnl Check this late. It depends on what other libraries (lrsvg, Gtk+ etc)
+dnl Emacs uses.
+XGSELOBJ=
+AC_MSG_CHECKING([whether GLib is linked in])
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[#include <glib.h>
+ ]],
+ [[g_print ("Hello world");]])],
+ [links_glib=yes],
+ [links_glib=no])
+AC_MSG_RESULT([$links_glib])
+if test "${links_glib}" = "yes"; then
+ AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.])
+ XGSELOBJ=xgselect.o
+fi
+AC_SUBST(XGSELOBJ)
+
dnl Adapted from Haible's version.
AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
AC_DEFINE(HAVE_X_WINDOWS, 1,
[Define to 1 if you want to use the X window system.])
XMENU_OBJ=xmenu.o
- XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o"
+ XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
FONT_OBJ=xfont.o
if test "$HAVE_XFT" = "yes"; then
FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
+2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
+
+ * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
+
+ * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
+
2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
Fix minor problems found by static checking.
## xmenu.o if HAVE_X_WINDOWS, else empty.
XMENU_OBJ=@XMENU_OBJ@
-## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o if
+## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o if
## HAVE_X_WINDOWS, else empty.
XOBJ=@XOBJ@
+# xgselect.o if linking with GLib, else empty
+XGSELOBJ=@XGSELOBJ@
+
TOOLKIT_LIBW=@TOOLKIT_LIBW@
## Only used if HAVE_X11, in LIBX_OTHER.
doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
profiler.o \
$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
- $(W32_OBJ) $(WINDOW_SYSTEM_OBJ)
+ $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
obj = $(base_obj) $(NS_OBJC_OBJ)
## Object files used on some machine or other.
}
#endif
-#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
+#if defined (HAVE_GLIB)
nfds = xg_select
#elif defined (HAVE_NS)
nfds = ns_select
#include "xgselect.h"
-#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
+#ifdef HAVE_GLIB
#include <glib.h>
#include <errno.h>
return retval;
}
-#endif /* USE_GTK || HAVE_GCONF || HAVE_GSETTINGS */
+#endif /* HAVE_GLIB */