[pulseaudio-commits] r2062 - /trunk/configure.ac

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Nov 16 15:48:11 PST 2007


Author: lennart
Date: Sat Nov 17 00:48:09 2007
New Revision: 2062

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2062&root=pulseaudio&view=rev
Log:
detect whether PolicyKit support is available

Modified:
    trunk/configure.ac

Modified: trunk/configure.ac
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/configure.ac?rev=2062&root=pulseaudio&r1=2061&r2=2062&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat Nov 17 00:48:09 2007
@@ -862,6 +862,47 @@
 AC_SUBST(HAVE_DBUS)
 AM_CONDITIONAL([HAVE_DBUS], [test "x$HAVE_DBUS" = x1])
 
+#### PolicyKit support (optional) ####
+
+AC_ARG_ENABLE([polkit],
+    AC_HELP_STRING([--disable-polkit], [Disable optional PolicyKit support]),
+        [
+            case "${enableval}" in
+                yes) polkit=yes ;;
+                no) polkit=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-polkit) ;;
+            esac
+        ],
+        [polkit=auto])
+
+if test "x${polkit}" != xno ; then
+
+    PKG_CHECK_MODULES(POLKIT, [ polkit-dbus ],
+        [
+            HAVE_POLKIT=1
+            saved_LIBS="$LIBS"
+            LIBS="$LIBS POLKIT_LIBS"
+            AC_CHECK_FUNCS(polkit_context_is_caller_authorized)
+            LIBS="$saved_LIBS"
+            AC_DEFINE([HAVE_POLKIT], 1, [Have PolicyKit])
+            policydir=`pkg-config --variable prefix`/usr/share/PolicyKit/policy/
+            AC_SUBST(policydir)
+        ],
+        [
+            HAVE_POLKIT=0
+            if test "x$polkit" = xyes ; then
+                AC_MSG_ERROR([*** PolicyKit support not found])
+            fi
+        ])
+else
+    HAVE_POLKIT=0
+fi
+
+AC_SUBST(POLKIT_CFLAGS)
+AC_SUBST(POLKIT_LIBS)
+AC_SUBST(HAVE_POLKIT)
+AM_CONDITIONAL([HAVE_POLKIT], [test "x$HAVE_POLKIT" = x1])
+
 ### Build and Install man pages ###
 AC_ARG_ENABLE(manpages,
         AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
@@ -1061,6 +1102,11 @@
 ENABLE_BLUEZ=no
 if test "x${HAVE_BLUEZ}" = "x1" ; then
    ENABLE_BLUEZ=yes
+fi
+
+ENABLE_POLKIT=no
+if test "x${HAVE_POLKIT}" = "x1" ; then
+   ENABLE_POLKIT=yes
 fi
 
 echo "
@@ -1086,6 +1132,7 @@
     Enable BlueZ:           ${ENABLE_BLUEZ}
     Enable TCP Wrappers:    ${ENABLE_TCPWRAP}
     Enable libsamplerate:   ${ENABLE_LIBSAMPLERATE}
+    Enable PolicyKit:       ${ENABLE_POLKIT}
     System User:            ${PA_SYSTEM_USER}
     System Group:           ${PA_SYSTEM_GROUP}
     Realtime Group:         ${PA_REALTIME_GROUP}




More information about the pulseaudio-commits mailing list