build: only define WITH_POLKIT if enabled

This commit is contained in:
Aleksander Morgado
2017-06-22 10:26:12 +02:00
parent fd0bed1df9
commit acf36f2ae0
2 changed files with 4 additions and 6 deletions

View File

@@ -296,9 +296,7 @@ elif test "x$with_polkit" = "xyes"; then
with_polkit=strict with_polkit=strict
fi fi
if test "x$with_polkit" = "xno"; then if test "x$with_polkit" != "xno"; then
AC_DEFINE(WITH_POLKIT, 0, [Define if you have PolicyKit support])
else
if test "x$have_polkit" = "xno"; then if test "x$have_polkit" = "xno"; then
AC_MSG_ERROR(PolicyKit development headers are required) AC_MSG_ERROR(PolicyKit development headers are required)
fi fi

View File

@@ -21,7 +21,7 @@
#include "mm-auth.h" #include "mm-auth.h"
#include "mm-auth-provider.h" #include "mm-auth-provider.h"
#ifdef WITH_POLKIT #if defined WITH_POLKIT
# include "mm-auth-provider-polkit.h" # include "mm-auth-provider-polkit.h"
#endif #endif
@@ -31,7 +31,7 @@ MMAuthProvider *
mm_auth_get_provider (void) mm_auth_get_provider (void)
{ {
if (!authp) { if (!authp) {
#if WITH_POLKIT #if defined WITH_POLKIT
authp = mm_auth_provider_polkit_new (); authp = mm_auth_provider_polkit_new ();
#else #else
authp = mm_auth_provider_new (); authp = mm_auth_provider_new ();