AC_PATH_PROG(DHCLIENT, [dhclient])
AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant])
+PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
+ AC_MSG_ERROR(gthread is required))
+AC_SUBST(GTHREAD_CFLAGS)
+AC_SUBST(GTHREAD_LIBS)
+
PKG_CHECK_MODULES(GMODULE, gmodule-2.0, dummy=yes,
AC_MSG_ERROR(gmodule is required))
AC_SUBST(GMODULE_CFLAGS)
iface.c iface-storage.c iface-helper.c iface-inet.c \
network.c rtnl.c dhcp.c resolver.c
-connmand_LDADD = @HAL_LIBS@ @GDBUS_LIBS@ @GMODULE_LIBS@
+connmand_LDADD = @HAL_LIBS@ @GDBUS_LIBS@ @GMODULE_LIBS@ @GTHREAD_LIBS@
statedir = $(localstatedir)/run/connman
plugindir = $(libdir)/connman/plugins
endif
-AM_CFLAGS = @GMODULE_CFLAGS@ @GDBUS_CFLAGS@ @HAL_CFLAGS@ \
+AM_CFLAGS = @GTHREAD_CFLAGS@ @GMODULE_CFLAGS@ @GDBUS_CFLAGS@ @HAL_CFLAGS@ \
-DSTATEDIR=\""$(statedir)"\" \
-DSTORAGEDIR=\""$(storagedir)\"" \
-DPLUGINDIR=\""$(plugindir)"\"
mkdir(STORAGEDIR, S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+ if (g_thread_supported() == FALSE)
+ g_thread_init(NULL);
+
main_loop = g_main_loop_new(NULL, FALSE);
+ if (dbus_threads_init_default() == FALSE) {
+ fprintf(stderr, "Can't init usage of threads\n");
+ exit(1);
+ }
+
dbus_error_init(&err);
conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, CONNMAN_SERVICE, &err);