-PKG_CHECK_MODULES(HAL, hal >= 0.5.8, dummy=yes,
- AC_MSG_ERROR(libhal is required))
-AC_SUBST(HAL_CFLAGS)
-AC_SUBST(HAL_LIBS)
-
-PKG_CHECK_MODULES(SQLITE, sqlite3, dummy=yes,
- AC_MSG_ERROR(sqlite3 is required))
-AC_SUBST(SQLITE_CFLAGS)
-AC_SUBST(SQLITE_LIBS)
-
-AC_OUTPUT(Makefile include/Makefile src/Makefile doc/Makefile
- test/Makefile plugins/Makefile scripts/Makefile
- scripts/fi.epitest.hostap.WPASupplicant.service
- scripts/connman src/connman.service connman.pc)
-
+AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
+AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
+
+PKG_CHECK_MODULES(UDEV, libudev >= 127, udev_found=yes, udev_found=no)
+AC_SUBST(UDEV_CFLAGS)
+AC_SUBST(UDEV_LIBS)
+AM_CONDITIONAL(UDEV, test "${udev_found}" = "yes")
+
+PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
+AC_SUBST(POLKIT_CFLAGS)
+AC_SUBST(POLKIT_LIBS)
+AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
+
+AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
+ [enable fake plugin]), [enable_fake=${enableval}])
+AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
+
+AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
+ test/Makefile plugins/Makefile scripts/Makefile scripts/connman
+ src/connman.service doc/version.xml connman.pc)