diff options
-rw-r--r-- | configure.ac | 52 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/lightdm-gtk-greeter.c | 27 |
3 files changed, 71 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 4a7cbaa..f35268a 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,7 @@ AC_ARG_ENABLE([libindicator], [], [enable_libindicator=yes]) AC_ARG_WITH([libindicator], AS_HELP_STRING([--with-libindicator=ayatana|unity], [Preferred indicator backend [default=ayatana]])) +have_indicator_ng=no AS_IF([test "x$enable_libindicator" = "xyes"], [ AS_IF([test "x$with_libindicator" != "xunity" && $PKG_CONFIG --exists "$AYATANA_INDICATOR_PKG >= $AYATANA_INDICATOR_REQUIRED_VERSION" >/dev/null 2>&1], [ @@ -86,6 +87,7 @@ AS_IF([test "x$enable_libindicator" = "xyes"], [ CPPFLAGS_OLD="$CPPFLAGS" CPPFLAGS=`$PKG_CONFIG --cflags ${AYATANA_INDICATOR_PKG}` AC_CHECK_HEADER([libayatana-indicator/indicator-ng.h], [ + have_indicator_ng=yes AC_DEFINE([HAVE_LIBINDICATOR_NG], [1], [Define if "libayatana-indicator/indicator-ng.h" is present]) AC_DEFINE([HAVE_AYATANA_LIBINDICATOR_NG], [1], [Define if "libayatana-indicator/indicator-ng.h" is present]) ], [], [-]) @@ -110,6 +112,7 @@ AS_IF([test "x$enable_libindicator" = "xyes"], [ CPPFLAGS_OLD="$CPPFLAGS" CPPFLAGS=`$PKG_CONFIG --cflags ${UNITY_INDICATOR_PKG}` AC_CHECK_HEADER([libindicator/indicator-ng.h], [ + have_indicator_ng=yes AC_DEFINE([HAVE_LIBINDICATOR_NG], [1], [Define if "libindicator/indicator-ng.h" is present]) AC_DEFINE([HAVE_UNITY_LIBINDICATOR_NG], [1], [Define if "libindicator/indicator-ng.h" is present]) ], [], [-]) @@ -127,6 +130,13 @@ AS_IF([test "x$enable_libindicator" = "xyes"], [ AM_CONDITIONAL([HAVE_UNITY_LIBINDICATOR], [test "x$have_unity_libindicator" = "xyes"]) +AC_ARG_WITH([systemd-service-dir], AS_HELP_STRING([--with-systemd-service-dir=path], [Path where systemd indicator service units are stored])) +AS_IF([test "x$with_systemd_service_dir" = "x" || test "x$with_systemd_service_dir" = "x"], [ + with_systemd_service_dir="/usr/lib/systemd/user" +], []) +SYSTEMD_SERVICE_DIR="$with_systemd_service_dir" +AC_SUBST(SYSTEMD_SERVICE_DIR) + dnl ########################################################################### AC_ARG_ENABLE([libido], @@ -134,9 +144,12 @@ AC_ARG_ENABLE([libido], AC_HELP_STRING([--disable-libido], [Disable libido support]), [], [enable_libido=yes]) +have_ido=no + AS_IF([test "x$enable_libido" = "xyes" && test "x$have_libindicator" = "xyes"], [ AS_IF([test "x$have_ayatana_libindicator" = "xyes" && $PKG_CONFIG --exists "$AYATANA_IDO_PKG" >/dev/null 2>&1], [ PKG_CHECK_MODULES([AYATANA_LIBIDO], [$AYATANA_IDO_PKG >= $AYATANA_IDO_REQUIRED_VERSION], [ + have_ido=yes AC_DEFINE([HAVE_LIBIDO], [1], [Define if "$AYATANA_IDO_PKG" is present]) AC_DEFINE([HAVE_AYATANA_LIBIDO], [1], [Define if "$AYATANA_IDO_PKG" is present]) ]) @@ -147,6 +160,7 @@ AS_IF([test "x$enable_libido" = "xyes" && test "x$have_libindicator" = "xyes"], ], []) AS_IF([$PKG_CONFIG --exists "$UNITY_IDO_PKG" >/dev/null 2>&1], [ PKG_CHECK_MODULES([UNITY_LIBIDO], [$UNITY_IDO_PKG >= $UNITY_IDO_REQUIRED_VERSION], [ + have_ido=yes AC_DEFINE([HAVE_LIBIDO], [1], [Define if "$UNITY_IDO_PKG" is present]) AC_DEFINE([HAVE_UNITY_LIBIDO], [1], [Define if "$UNITY_IDO_PKG" is present]) ]) @@ -169,7 +183,9 @@ AS_IF([test "x$with_libxklavier" = "xyes"], PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier], [have_xklavier=yes]) AC_DEFINE([HAVE_LIBXKLAVIER], [1], [Define if "libxklavier" is present]) ], -[]) +[ + with_libxklavier=no +]) dnl ########################################################################### @@ -237,3 +253,37 @@ po/Makefile.in src/Makefile ]) AC_OUTPUT + +AS_IF([test "x$have_libindicator" = "xyes"], [ + AS_IF([test "x$have_ayatana_libindicator" = "xyes"], [ + indicator_backend="ayatana" + ], [ + indicator_backend="unity" + ]) +], [ + indicator_backend="disabled" +]) + +echo " +------------------------------------------------------ + LightDM GTK+ Greeter $VERSION + ==================================== + + Installation: + ============= + Prefix: $prefix + AT-SPI Service: $enable_at_spi_command + Use libxklavier: $with_libxklavier + Enable SIGTERM Handler: $enable_kill_on_sigterm + + Indicators: + =========== + Indicator Support: $indicator_backend + Indicator Services Command: $enable_indicator_services_command + systemd Services: $with_systemd_service_dir + Indicator NG: $have_indicator_ng + IDO: $have_ido + +------------------------------------------------------ + +Configuration finished, type make to compile" diff --git a/src/Makefile.am b/src/Makefile.am index fb717f9..5325a36 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,6 +41,7 @@ AM_CPPFLAGS = \ -DINDICATOR_DIR=\""$(INDICATORDIR)"\" \ -DUNITY_INDICATOR_DIR=\""$(UNITY_INDICATORDIR)"\" \ -DAYATANA_INDICATOR_DIR=\""$(AYATANA_INDICATORDIR)"\" \ + -DSYSTEMD_SERVICE_DIR=\""$(SYSTEMD_SERVICE_DIR)"\" \ $(WARN_CFLAGS) lightdm_gtk_greeter_CFLAGS = \ diff --git a/src/lightdm-gtk-greeter.c b/src/lightdm-gtk-greeter.c index 73b7120..cefa348 100644 --- a/src/lightdm-gtk-greeter.c +++ b/src/lightdm-gtk-greeter.c @@ -1569,7 +1569,7 @@ find_indicator_exec (const gchar *name) } else { g_free (desktop); - desktop = g_strdup_printf ("/usr/lib/systemd/user/%s.service", indicator); + desktop = g_strdup_printf ("%s/%s.service", SYSTEMD_SERVICE_DIR, indicator); if (g_key_file_load_from_file (keyfile, desktop, G_KEY_FILE_NONE, NULL)) { exec = g_key_file_get_string (keyfile, "Service", "ExecStart", NULL); @@ -1590,6 +1590,7 @@ init_indicators (void) gpointer iter_value; gsize length = 0; guint i; + GError *error = NULL; #ifdef HAVE_LIBINDICATOR IndicatorObject *io = NULL; @@ -1676,11 +1677,6 @@ init_indicators (void) #ifdef HAVE_LIBINDICATOR_NG else { /* service file */ - gchar *exec = find_indicator_exec (names[i]); - if (exec) { - spawn_line_pid (exec, G_SPAWN_SEARCH_PATH, NULL); - g_free (exec); - } #ifdef HAVE_UNITY_LIBINDICATOR_NG if (strchr (names[i], '.')) path = g_strdup_printf ("%s/%s", UNITY_INDICATOR_DIR, names[i]); @@ -1692,7 +1688,14 @@ init_indicators (void) else path = g_strdup_printf ("%s/org.ayatana.indicator.%s", AYATANA_INDICATOR_DIR, names[i]); #endif - io = INDICATOR_OBJECT (indicator_ng_new_for_profile (path, "desktop_greeter", NULL)); + io = INDICATOR_OBJECT (indicator_ng_new_for_profile (path, "desktop_greeter", &error)); + if (io) { + gchar *exec = find_indicator_exec (names[i]); + if (exec) { + spawn_line_pid (exec, G_SPAWN_SEARCH_PATH, NULL); + g_free (exec); + } + } } #endif @@ -1720,9 +1723,17 @@ init_indicators (void) } else { - g_warning ("Indicator \"%s\": failed to load", names[i]); + if (error != NULL) { + g_warning ("Indicator \"%s\": Failed to load from %s: %s", names[i], path, error->message); + g_clear_error (&error); + } else { + g_warning ("Indicator \"%s\": failed to load", names[i]); + } } + if (error != NULL) + g_clear_error (&error); + g_free (path); #endif } |