]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Add configure checks for new functionality and use consistent name for defines
authorIain Lane <iain.lane@canonical.com>
Mon, 15 Apr 2013 17:39:30 +0000 (18:39 +0100)
committerIain Lane <iain.lane@canonical.com>
Mon, 15 Apr 2013 17:39:30 +0000 (18:39 +0100)
configure.ac
src/logind.c
src/session-child.c
src/session.c

index 3aafe0602ebf29e101676218b861b263881ebf77..bcb3d590ff55eb5a52b7a49ab238ae136019216b 100644 (file)
@@ -173,21 +173,21 @@ AC_DEFINE_UNQUOTED(GREETER_USER, "$GREETER_USER", User to run greeter as)
 
 AC_ARG_ENABLE(consolekit,
               AS_HELP_STRING([--enable-consolekit],
-                                [Build with Console Kit support @<:@default=yes@:>@]),,
+                                [Build with ConsoleKit support @<:@default=yes@:>@]),,
                  enable_consolekit=yes)
 AM_CONDITIONAL(ENABLE_CONSOLEKIT, test x$enable_consolekit = xyes)
 
 if test x$enable_consolekit = xyes; then
-  AC_DEFINE(WITH_CONSOLE_KIT, 1, [Define if Console Kit support is enabled])
+  AC_DEFINE(WITH_CONSOLEKIT, 1, [Define if ConsoleKit support is enabled])
 fi
 
 AC_ARG_ENABLE(logind,
               AS_HELP_STRING([--enable-logind],
-                                [Build with systemd logind support @<:@default=yes@:>@]),,
-                 enable_logind=yes)
+                                [Build with systemd logind support @<:@default=no@:>@]),,
+                 enable_logind=no)
 AM_CONDITIONAL(ENABLE_LOGIND, test x$enable_logind = xyes)
 
-if test x$enable_logind = xyes; then
+if test x$enable_logind != xyes; then
   AC_DEFINE(WITH_LOGIND, 1, [Define if systemd logind support is enabled])
 fi
 
@@ -246,4 +246,6 @@ echo "
         liblightdm-qt:            $compile_liblightdm_qt4
         liblightdm-qt5:           $compile_liblightdm_qt5
         Enable tests:             $enable_tests
+       ConsoleKit support:       $enable_consolekit
+       logind support:           $enable_logind        
 "
index abd3f7874ff5ae02bcaf1f23b7f4787a82e2a085..3e6154adb56a20bb0c26fdf832e10a6b63a674aa 100644 (file)
@@ -146,9 +146,3 @@ logind_unlock_session (const gchar *id)
 
     g_object_unref (bus);
 }
-
-void
-main ()
-{
-  g_printf ("%s\n", logind_get_session_id());
-}
index 60caa33c36eb940120f5ace8b040535323e0fb91..38aea02bf0222a9ff8829f33101b6f7d2d26e2a5 100644 (file)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -175,7 +177,7 @@ session_child_run (int argc, char **argv)
     gsize env_length;
     gsize command_argc;
     gchar **command_argv;
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
     GVariantBuilder ck_parameters;
 #endif
     int return_code;
@@ -191,7 +193,7 @@ session_child_run (int argc, char **argv)
     XAuthority *xauthority = NULL;
     gchar *xauth_filename;
     GDBusConnection *bus;
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
     gchar *console_kit_cookie;
 #endif
 #ifdef WITH_LOGIND
@@ -430,7 +432,7 @@ session_child_run (int argc, char **argv)
     write_string (logind_session);
 #endif
 
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
     /* Open a Console Kit session */
     g_variant_builder_init (&ck_parameters, G_VARIANT_TYPE ("(a(sv))"));
     g_variant_builder_open (&ck_parameters, G_VARIANT_TYPE ("a(sv)"));
@@ -631,7 +633,7 @@ session_child_run (int argc, char **argv)
             _exit (EXIT_FAILURE);
     }
 
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
     /* Close the Console Kit session */
     if (console_kit_cookie)
         ck_close_session (console_kit_cookie);
index c97589886de027f488fd5292978c751f2dce59a6..f097183e196abf92f72fef3a13c225de02ef2ab8 100644 (file)
@@ -9,6 +9,8 @@
  * license.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -21,7 +23,7 @@
 
 #include "session.h"
 #include "configuration.h"
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
 #include "console-kit.h"
 #endif
 #ifdef WITH_LOGIND
@@ -87,7 +89,7 @@ struct SessionPrivate
     /* Remote host this session is being controlled from */
     gchar *remote_host_name;
 
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
     /* Console kit cookie */
     gchar *console_kit_cookie;
 #endif
@@ -450,7 +452,7 @@ session_get_username (Session *session)
     return session->priv->username;
 }
 
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
 const gchar *
 session_get_console_kit_cookie (Session *session)
 {
@@ -577,7 +579,7 @@ session_run (Session *session, gchar **argv)
 #ifdef WITH_LOGIND
     session->priv->logind_session = read_string_from_child (session);
 #endif
-#ifdef WITH_CONSOLE_KIT
+#ifdef WITH_CONSOLEKIT
     session->priv->console_kit_cookie = read_string_from_child (session);
 #endif
 }
@@ -670,8 +672,12 @@ session_finalize (GObject *object)
     if (self->priv->xauthority)
         g_object_unref (self->priv->xauthority);
     g_free (self->priv->remote_host_name);
+#ifdef WITH_LOGIND
     g_free (self->priv->logind_session);
+#endif
+#ifdef WITH_CONSOLEKIT
     g_free (self->priv->console_kit_cookie);
+#endif
     g_list_free_full (self->priv->env, g_free);
 
     G_OBJECT_CLASS (session_parent_class)->finalize (object);