From c97480f11bdfdc3cbb867b8127074bcb6b047024 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 12 Jan 2007 00:37:42 +0000 Subject: Allow compilation against GLib --- common/Makefile.am | 17 +++++++++++++---- common/dbus.c | 1 + common/glib-ectomy.h | 8 ++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/Makefile.am b/common/Makefile.am index 182d574e..3774edf9 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -5,19 +5,28 @@ else sdp_sources = sdp-dummy.c endif +if GLIB +glib_sources = +glib_cflags = @GLIB_CFLAGS@ +else +glib_sources = glib-ectomy.c +glib_cflags = +endif + noinst_LIBRARIES = libhelper.a libhelper_a_SOURCES = oui.h oui.c list.h list.c \ textfile.h textfile.c helper.h helper.c \ - glib-ectomy.h glib-ectomy.c logging.h logging.c \ - dbus.h dbus.c sdp-xml.h sdp-xml.c $(sdp_sources) + logging.h logging.c dbus.h dbus.c \ + sdp-xml.h sdp-xml.c $(sdp_sources) \ + glib-ectomy.h $(glib_sources) noinst_PROGRAMS = test_textfile test_textfile_LDADD = libhelper.a -AM_CFLAGS = @DBUS_CFLAGS@ +AM_CFLAGS = @DBUS_CFLAGS@ $(glib_cflags) -EXTRA_DIST = ppoll.h sdp-dummy.c sdp-expat.c +EXTRA_DIST = ppoll.h sdp-dummy.c sdp-expat.c glib-ectomy.c MAINTAINERCLEANFILES = Makefile.in diff --git a/common/dbus.c b/common/dbus.c index c8ed07e4..eb8c77f3 100644 --- a/common/dbus.c +++ b/common/dbus.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/common/glib-ectomy.h b/common/glib-ectomy.h index 411cc25f..8502deb5 100644 --- a/common/glib-ectomy.h +++ b/common/glib-ectomy.h @@ -1,6 +1,12 @@ #ifndef __GLIB_ECTOMY_H #define __GLIB_ECTOMY_H +#ifdef HAVE_GLIB +#include +#define g_timeout_remove g_source_remove +#define g_io_remove_watch g_source_remove +#else + #include #include @@ -106,4 +112,6 @@ gboolean g_utf8_validate(const gchar *str, gssize max_len, const gchar **end); #define g_main_quit(loop) g_main_loop_quit(loop) #define g_main_unref(loop) g_main_loop_unref(loop) +#endif + #endif /* __GLIB_ECTOMY_H */ -- cgit