Add support for reading rules directory from libudev.pc
[connman] / configure.ac
index 393bee6..a6cc07c 100644 (file)
@@ -1,7 +1,7 @@
 AC_PREREQ(2.60)
 AC_INIT()
 
-AM_INIT_AUTOMAKE(connman, 0.5)
+AM_INIT_AUTOMAKE(connman, 0.7)
 AM_CONFIG_HEADER(config.h)
 
 AM_MAINTAINER_MODE
@@ -186,6 +186,11 @@ if (test "${enable_udev}" = "yes"); then
                        [Define to 1 if you need the
                                udev_device_get_parent_with_subsystem_devtype()
                                                                        function.]))
+       UDEV_DATADIR="`pkg-config --variable=rulesdir libudev`"
+       if (test -z "${UDEV_DATADIR}"); then
+               UDEV_DATADIR="${sysconfdir}/udev/rules.d"
+       fi
+       AC_SUBST(UDEV_DATADIR)
 fi
 AC_SUBST(UDEV_CFLAGS)
 AC_SUBST(UDEV_LIBS)
@@ -198,6 +203,11 @@ if (test "${enable_polkit}" = "yes"); then
                                AC_MSG_ERROR(PolicyKit >= 0.7 is required))
        AC_SUBST(POLKIT_CFLAGS)
        AC_SUBST(POLKIT_LIBS)
+       POLKIT_DATADIR="`pkg-config --variable=policydir polkit`"
+       if (test -z "${POLKIT_DATADIR}"); then
+               POLKIT_DATADIR="${datadir}/PolicyKit/policy"
+       fi
+       AC_SUBST(POLKIT_DATADIR)
 fi
 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
 
@@ -209,6 +219,7 @@ AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
                [enable fake device support]), [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 client/Makefile scripts/Makefile
-               scripts/connman src/connman.service doc/version.xml connman.pc)
+AC_OUTPUT(Makefile gdbus/Makefile include/Makefile include/version.h
+               src/Makefile src/connman.service scripts/connman
+               scripts/Makefile plugins/Makefile client/Makefile
+               test/Makefile doc/Makefile doc/version.xml connman.pc)