[file-roller] don't build session management support if the required libraries are not present
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] don't build session management support if the required libraries are not present
- Date: Mon, 27 Aug 2012 19:05:02 +0000 (UTC)
commit d2afeebafa65854159b8a6071ae3e949a8548e12
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Aug 27 20:26:15 2012 +0200
don't build session management support if the required libraries are not present
configure.ac | 38 ++++++++++++++++++++++++++++++++++++++
copy-n-paste/Makefile.am | 18 ++++++++++++------
src/main.c | 2 --
3 files changed, 50 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3c9b1d7..93100f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,6 +240,44 @@ fi
AC_MSG_RESULT($enable_libarchive)
AC_SUBST(LIBARCHIVE_LIBS)
AC_SUBST(LIBARCHIVE_CFLAGS)
+dnl ===========================================================================
+dnl
+dnl SM Client
+dnl
+GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"
+
+AC_MSG_CHECKING([which smclient backend to use])
+AC_ARG_WITH([smclient],
+ [AS_HELP_STRING([--with-smclient=no|auto|xsmp],
+ [Setting smclient backend (default:no)])],,
+ [with_smclient=no])
+
+if test "$with_smclient" == "auto"; then
+ case "$GDK_TARGET" in
+ x11) with_smclient=xsmp ;;
+ *) with_smclient=no ;;
+ esac
+fi
+
+AC_MSG_RESULT([$with_smclient])
+
+if test "$with_smclient" != "no"; then
+ AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
+
+ case "$with_smclient" in
+ xsmp) SMCLIENT_PKGS="sm >= 1.0.0 ice" ;;
+ *) SMCLIENT_PKGS="" ;;
+ esac
+
+ PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
+ AC_SUBST([SMCLIENT_CFLAGS])
+ AC_SUBST([SMCLIENT_LIBS])
+ AC_DEFINE(USE_SMCLIENT, 1, [Use a session menager])
+fi
+
+AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
+AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
+AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
dnl ******************************
diff --git a/copy-n-paste/Makefile.am b/copy-n-paste/Makefile.am
index 8cceb2b..b3313ae 100644
--- a/copy-n-paste/Makefile.am
+++ b/copy-n-paste/Makefile.am
@@ -5,11 +5,17 @@ noinst_LTLIBRARIES = libeggsmclient.la
libeggsmclient_la_LIBADD = $(GTK_LIBS)
libeggsmclient_la_CFLAGS = $(GTK_CFLAGS)
-libeggsmclient_la_SOURCES = eggdesktopfile.h \
- eggdesktopfile.c \
- eggsmclient.h \
- eggsmclient.c \
- eggsmclient-private.h \
- eggsmclient-xsmp.c
+
+libeggsmclient_la_SOURCES = \
+ eggdesktopfile.h \
+ eggdesktopfile.c
+
+if WITH_SMCLIENT
+libeggsmclient_la_SOURCES += \
+ eggsmclient.h \
+ eggsmclient.c \
+ eggsmclient-private.h \
+ eggsmclient-xsmp.c
+endif
-include $(top_srcdir)/git.mk
diff --git a/src/main.c b/src/main.c
index 46a695f..38641d5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,8 +21,6 @@
#include <config.h>
-#define USE_SMCLIENT 1
-
#include <string.h>
#include <sys/types.h>
#include <signal.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]