Add support for reading policy directory from polkit.pc
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 8 Jan 2009 20:02:04 +0000 (21:02 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 8 Jan 2009 20:02:04 +0000 (21:02 +0100)
configure.ac
plugins/Makefile.am

index 1d8fc5e..223e1e0 100644 (file)
@@ -198,6 +198,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")
 
index b4c187b..befc2d9 100644 (file)
@@ -96,7 +96,7 @@ polkit_la_SOURCES = polkit.c
 polkit_la_LIBADD = @POLKIT_LIBS@ @GLIB_LIBS@
 polkit_la_CFLAGS = @GLIB_CFLAGS@ @POLKIT_CFLAGS@
 
-policydir = $(datadir)/PolicyKit/policy
+policydir = @POLKIT_DATADIR@
 
 policy_DATA = connman.policy
 endif