[gnome-terminal] server: Only disable ubuntu modules on ubuntu



commit 04d58702ff269343a3b8b992ff545b9bb3a76ae9
Author: Christian Persch <chpe gnome org>
Date:   Thu May 23 19:21:34 2013 +0200

    server: Only disable ubuntu modules on ubuntu
    
    Add build time check for ubuntu, and an --enable-distro-packaging configure
    switch that will disable setting the env vars.

 configure.ac |   24 ++++++++++++++++++++++++
 src/server.c |   10 +++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 635c3b2..205b023 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,6 +196,30 @@ fi
 
 AM_CONDITIONAL([WITH_NAUTILUS_EXTENSION],[test "$with_nautilus_extension" = "yes"])
 
+# **********************
+# Distribution specifics
+# **********************
+
+if test -f /etc/os-release; then
+  DISTRO="$(source /etc/os-release && echo $ID)"
+else
+  DISTRO="unknown"
+fi
+
+case "$DISTRO" in
+  ubuntu) AC_DEFINE([HAVE_UBUNTU],[1],[Define if building under ubuntu]) ;;
+esac
+
+AC_MSG_CHECKING([whether building a distro package])
+AC_ARG_ENABLE([distro-packaging],
+  [AS_HELP_STRING([--enable-distro-packaging],[enable when building a distro package])],
+  [],[enable_distro_packaging=no])
+AC_MSG_RESULT([$enable_distro_packaging])
+
+if test "$enable_distro_packaging" = "yes"; then
+  AC_DEFINE([ENABLE_DISTRO_PACKAGING],[1],[Define if building a distro package])
+fi
+
 # ***********
 # Compilation
 # ***********
diff --git a/src/server.c b/src/server.c
index 211af6a..26d867a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -75,13 +75,17 @@ main (int argc, char **argv)
 
   terminal_i18n_init (TRUE);
 
-  /* Set some env vars to disable ubuntu crap. They'll certainly patch this
-   * out in their package, but anyone running from git will get the right
-   * behaviour.
+#ifndef ENABLE_DISTRO_PACKAGING
+#ifdef HAVE_UBUNTU
+  /* Set some env vars to disable the ubuntu modules. Their package will be 
+   * built using --enable-distro-packaging, but anyone running from git will
+   * get the right behaviour.
    */
   g_setenv ("LIBOVERLAY_SCROLLBAR", "0", TRUE);
   g_setenv ("UBUNTU_MENUPROXY", "0", TRUE);
   g_setenv ("NO_UNITY_GTK_MODULE", "1", TRUE);
+#endif
+#endif
 
 #if !GLIB_CHECK_VERSION (2, 35, 3)
   g_type_init ();


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