AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
-PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
+AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
+ [enable threading support]), [
+ AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
+
+ PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
AC_MSG_ERROR(gthread is required))
-AC_SUBST(GTHREAD_CFLAGS)
-AC_SUBST(GTHREAD_LIBS)
+ GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
+ GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
+])
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
AC_MSG_ERROR(libdbus is required))
element.c device.c network.c security.c resolver.c \
storage.c manager.c agent.c rtnl.c dbus.c
-connmand_LDADD = @GDBUS_LIBS@ @GLIB_LIBS@ @GTHREAD_LIBS@ -ldl
+connmand_LDADD = @GDBUS_LIBS@ @GLIB_LIBS@ -ldl
connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=connman.ver
plugindir = $(libdir)/connman/plugins
endif
-AM_CFLAGS = @GTHREAD_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ \
+AM_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ \
-DSTATEDIR=\""$(statedir)"\" \
-DSTORAGEDIR=\""$(storagedir)\"" \
-DPLUGINDIR=\""$(plugindir)"\"
DBusError err;
struct sigaction sa;
+#ifdef NEED_THREADS
if (g_thread_supported() == FALSE)
g_thread_init(NULL);
+#endif
context = g_option_context_new(NULL);
g_option_context_add_main_entries(context, options, NULL);
main_loop = g_main_loop_new(NULL, FALSE);
+#ifdef NEED_THREADS
if (dbus_threads_init_default() == FALSE) {
fprintf(stderr, "Can't init usage of threads\n");
exit(1);
}
+#endif
dbus_error_init(&err);