[sawfish] tuneable session files installation



commit 49b8d05f3533b2b92c073272a803105299f59c2a
Author: Christopher Roy Bratusek <zanghar freenet de>
Date:   Fri Dec 10 13:27:38 2010 +0100

    tuneable session files installation

 Makedefs.in  |    4 ++++
 Makefile.in  |   25 ++++++++++++++++++-------
 configure.in |   39 ++++++++++++++++++++++++++++++++-------
 3 files changed, 54 insertions(+), 14 deletions(-)
---
diff --git a/Makedefs.in b/Makedefs.in
index da9a727..263eb80 100644
--- a/Makedefs.in
+++ b/Makedefs.in
@@ -44,6 +44,10 @@ sawfishexecdir= sawfishexecdir@
 GNOMEDIR= GNOMEDIR@
 KDEDIR= KDEDIR@
 
+KDE4_SESSION= KDE4_SESSION@
+GNOME2_SESSION= GNOME2_SESSION@
+XDM_SESSION= XDM_SESSION@
+
 CC= CC@
 MAKEDEP= MAKEDEP@
 CPPFLAGS=-DHAVE_CONFIG_H -DSAWFISH -D__STRICT_ANSI__ -I. -I.. @CPPFLAGS@
diff --git a/Makefile.in b/Makefile.in
index 2b6b341..bd82be5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -46,11 +46,16 @@ install : all installdirs
 	done
 	$(INSTALL_DATA) $(srcdir)/sawfish.desktop \
 		$(DESTDIR)$(datadir)/applications/
-	$(INSTALL_DATA) $(srcdir)/sawfish-wm.desktop \
-	  $(DESTDIR)$(GNOMEDIR)/share/gnome/wm-properties
+	if test $(GNOME2_SESSION) = "yes"; then \
+		$(INSTALL_DATA) $(srcdir)/sawfish-wm.desktop $(DESTDIR)$(GNOMEDIR)/share/gnome/wm-properties; \
+	fi
 	$(INSTALL_DATA) $(top_srcdir)/sawfish.pc $(DESTDIR)$(libdir)/pkgconfig/
-	$(INSTALL_DATA) $(top_srcdir)/sawfish-session.desktop $(DESTDIR)$(datadir)/xsessions/sawfish.desktop
-	$(INSTALL_DATA) $(top_srcdir)/sawfish-ksm.desktop $(DESTDIR)$(KDEDIR)/ksmserver/windowmanagers/sawfish.desktop
+	if test $(XDM_SESSION) = "yes"; then \
+		$(INSTALL_DATA) $(top_srcdir)/sawfish-session.desktop $(DESTDIR)$(datadir)/xsessions/sawfish.desktop; \
+	fi
+	if test $(KDE4_SESSION) = "yes"; then \
+		$(INSTALL_DATA) $(top_srcdir)/sawfish-ksm.desktop $(DESTDIR)$(KDEDIR)/ksmserver/windowmanagers/sawfish.desktop; \
+	fi
 
 installdirs : mkinstalldirs
 	$(SHELL) $< $(DESTDIR)$(sawfishdir)/$(version) \
@@ -67,10 +72,16 @@ uninstall :
 	done
 	rm -rf $(DESTDIR)$(sawfishdir)/$(version)
 	rm -f $(DESTDIR)$(libdir)/pkgconfig/sawfish.pc
-	rm -f $(DESTDIR)$(datadir)/xsessions/sawfish.desktop
+	if test $(XDM_SESSION) = "yes";â??then \
+		rm -f $(DESTDIR)$(datadir)/xsessions/sawfish.desktop; \
+	fi
 	rm -f $(DESTDIR)$(datadir)/applications/sawfish.desktop
-	rm -f $(DESTDIR)$(GNOMEDIR)/share/gnome/wm-properties/sawfish-wm.desktop
-	rm -f $(DESTDIR)$(KDEDIR)/ksmserver/windowmanagers/sawfish.desktop
+	if test $(GNOME2_SESSION) = "yes"; then \
+		rm -f $(DESTDIR)$(GNOMEDIR)/share/gnome/wm-properties/sawfish-wm.desktop; \
+	fi
+	if test $(KDE4_SESSION) = "yes"; then \
+		rm -f $(DESTDIR)$(KDEDIR)/ksmserver/windowmanagers/sawfish.desktop; \
+	fi
 
 # At this stage, DOC file omits some docstrings. (Only small portion,
 # though.) Byte compilation makes it complete.
diff --git a/configure.in b/configure.in
index 6cb4845..8c1444a 100644
--- a/configure.in
+++ b/configure.in
@@ -283,6 +283,35 @@ if test "$with_nls" = "yes"; then
 	SUBDIRS="${SUBDIRS} po"
 fi
 
+dnl session files stuff
+
+AC_ARG_WITH(kde4session,
+  [  --with-kde4session 	install kde4 session files
+  --without-kde4session], [], [with_kde4session=yes])
+
+KDE4_SESSION="$with_kde4session"
+
+if test "$with_kde4session" = "yes"; then
+	KDEDIR="`kde4-config --install data`"
+fi
+
+dnl fallback
+if test "x$KDEDIR" = x; then
+	KDEDIR="${datadir}/kde4/apps/"
+fi
+
+AC_ARG_WITH(gnome2session,
+  [  --with-gnome2session 	install gnome2 session files
+  --without-gnome2session], [], [with_gnome2session=yes])
+
+GNOME2_SESSION="$with_gnome2session"
+
+AC_ARG_WITH(xdmsession,
+  [  --with-xdmsession 	install xdm session files
+  --without-xdmsession], [], [with_xdmsession=yes])
+
+XDM_SESSION="$with_xdmsession"
+
 dnl Check for GNOME location
 AC_ARG_WITH(gnome_prefix,
  [  --with-gnome-prefix=DIR Root of GNOME installation], [],
@@ -329,13 +358,6 @@ if test $REP_MSGFMT = true; then
 fi
 AC_MSG_RESULT($LINGUAS)
 
-dnl install directory for sawfish-ksm.desktop
-KDEDIR="`kde4-config --install data`"
-
-if test "x$KDEDIR" = x; then
-	KDEDIR="${datadir}/kde4/apps/"
-fi
-
 gitdate=`date +%y%m%d`
 
 dnl Nonstandard exported symbols
@@ -387,6 +409,9 @@ AC_SUBST(VERSION)
 AC_SUBST(PACKAGE)
 AC_SUBST(GETTEXT_PACKAGE)
 AC_SUBST(LINGUAS)
+AC_SUBST(KDE4_SESSION)
+AC_SUBST(GNOME2_SESSION)
+AC_SUBST(XDM_SESSION)
 
 dnl Build all files
 AC_CONFIG_FILES([



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]