r18994 - gnucash/trunk - Have the gnucash binary setup its required environment by itself

Geert Janssens gjanssens at code.gnucash.org
Mon Apr 5 10:48:22 EDT 2010


Author: gjanssens
Date: 2010-04-05 10:48:22 -0400 (Mon, 05 Apr 2010)
New Revision: 18994
Trac: http://svn.gnucash.org/trac/changeset/18994

Added:
   gnucash/trunk/src/bin/environment-osx.in
   gnucash/trunk/src/bin/environment-win32.in
   gnucash/trunk/src/bin/environment.in
Removed:
   gnucash/trunk/src/bin/gnucash-ddd.in
   gnucash/trunk/src/bin/gnucash-setup-env-osx.in
   gnucash/trunk/src/bin/gnucash-setup-env.in
Modified:
   gnucash/trunk/configure.in
   gnucash/trunk/src/bin/Makefile.am
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/bin/gnucash-gdb.in
   gnucash/trunk/src/bin/gnucash-valgrind.in
   gnucash/trunk/src/bin/gnucash.in
Log:
Have the gnucash binary setup its required environment by itself

- New "environment" config file that holds the environment modifications to make
- Added a parser for this file that does the actual modification
  of the environment (in gnucash-bin.c)
- Eliminate the old gnucash-setup-env script

Modified: gnucash/trunk/configure.in
===================================================================
--- gnucash/trunk/configure.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/configure.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -220,9 +220,10 @@
 ##################################################
 AC_SUBST(SED)
 
+
 # Set some defaults, they may be overridden below
 REGEX_LIBS=""
-GNUCASH_SETUP_ENV="gnucash-setup-env"
+GNUCASH_ENVIRONMENT="environment"
 
 AC_MSG_CHECKING(operating system)
 case $host_os in
@@ -232,8 +233,10 @@
 update to latest  darwin])
 		;;
 	darwin*)
-		AC_MSG_RESULT(yes)
+		platform=darwin
+		AC_MSG_RESULT($platform)
 		AC_MSG_CHECKING(For GDK-Quartz)
+		platform=osx
 		_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
 		if test "x$_gdk_tgt" = xquartz; then 
 		   AC_MSG_RESULT(yes)
@@ -244,14 +247,15 @@
 				     AC_MSG_RESULT(no))
 		   AC_SUBST(IGE_MAC_LIBS)
 		   AC_SUBST(IGE_MAC_CFLAGS)
-		   GNUCASH_SETUP_ENV="gnucash-setup-env-osx"
 		else
 		   AC_MSG_RESULT(no)
 		fi
+		GNUCASH_ENVIRONMENT="environment-osx"
 		;;
 	mingw*|cygwin*)
-		platform_win32=yes
-		AC_MSG_RESULT(win32)
+		platform=win32
+		AC_MSG_RESULT($platform)
+		GNUCASH_ENVIRONMENT="environment-win32"
 
 		AC_MSG_CHECKING(for native win32)
 		case $host_os in
@@ -287,14 +291,17 @@
 		LDFLAGS="${LDFLAGS} -no-undefined -mwindows"
 		;;
 	*)
-		AC_MSG_RESULT(linux/other)
-		GNUCASH_SETUP_ENV="gnucash-setup-env"
+		platform=linux/other
+		AC_MSG_RESULT($platform)
 
 		;;	
 esac
 AC_SUBST(REGEX_LIBS)
-AC_SUBST(GNUCASH_SETUP_ENV)
-AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
+AC_SUBST(GNUCASH_ENVIRONMENT)
+
+AM_CONDITIONAL(PLATFORM_LINUX, test "x$platform" = "xlinux/other")
+AM_CONDITIONAL(PLATFORM_OSX, test "x$platform" = "xdarwin")
+AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform" = "xwin32")
 AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
 
 # These are unavailable on windows/mingw32 and X11 isn't desired or

Modified: gnucash/trunk/src/bin/Makefile.am
===================================================================
--- gnucash/trunk/src/bin/Makefile.am	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/Makefile.am	2010-04-05 14:48:22 UTC (rev 18994)
@@ -33,31 +33,31 @@
   ${top_builddir}/src/gnc-module/libgnc-module.la
 
 GNUCASH_BIN_INSTALL_NAME=`echo gnucash-bin | sed -e '$(transform)'`
-GNUCASH_SETUP_ENV_INSTALL_NAME=`echo gnucash-setup-env | sed -e '$(transform)'`
 
-gnucash: gnucash.in gnucash-setup-env ${top_builddir}/config.status Makefile
-	rm -f $@.tmp
-	sed < $< > $@.tmp \
-	    -e 's#@-BIN_DIR-@#${bindir}#g' \
-	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
-	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
-	mv $@.tmp $@
-	chmod u+x $@
+configdir = ${GNC_CONFIGDIR}
+config_DATA = environment
 
-gnucash-gdb: gnucash-gdb.in gnucash-setup-env ${top_builddir}/config.status Makefile
+if PLATFORM_OSX
+PRE_RUN = if test -z \"\$$DBUS_SESSION_BUS_ADDRESS\"; then\n\
+    eval \`dbus-launch --sh-syntax --exit-with-session --config-file=${PREFIX}/etc/dbus-1/session.conf\`\nfi\n
+else
+PRE_RUN =
+endif
+
+gnucash: gnucash.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
-	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
+	    -e "s#@-PRE_RUN-@#${PRE_RUN}#g" \
 	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
 	mv $@.tmp $@
 	chmod u+x $@
 
-gnucash-ddd: gnucash-ddd.in gnucash-setup-env ${top_builddir}/config.status Makefile
+gnucash-gdb: gnucash-gdb.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
-	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
+	    -e "s#@-PRE_RUN-@#${PRE_RUN}#g" \
 	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
 	mv $@.tmp $@
 	chmod u+x $@
@@ -67,28 +67,33 @@
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
 	    -e "s#@-TOP_SRC_DIR-@#${abs_top_srcdir}#g" \
-	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
+	    -e "s#@-PRE_RUN-@#${PRE_RUN}#g" \
 	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
 	mv $@.tmp $@
 	chmod u+x $@
 
-gnucash-setup-env: ${GNUCASH_SETUP_ENV}.in ${top_builddir}/config.status Makefile
+environment: ${GNUCASH_ENVIRONMENT}.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
-		-e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
+	    -e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
 	    -e 's#@-GNC_STANDARD_REPORTS_DIR-@#${GNC_SHAREDIR}/guile-modules/gnucash/report/standard-reports#g' \
 	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
 	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
-        -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
-        -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+	    -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+	    -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
 	    -e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g" \
 	    -e 's#@-PATH_SEPARATOR-@#${PATH_SEPARATOR}#g' \
-	-e 's#@-PREFIX-@#${prefix}#g'
+	    -e 's#@-PREFIX-@#${prefix}#g'
+if PLATFORM_WIN32
+# Fix Windows paths.
+	sed < $@.tmp > $@.tmp2 -e 's,/,\\,g'
+	mv $@.tmp2 $@.tmp
+endif
 	mv $@.tmp $@
 	chmod u+x $@
 
-CLEANFILES = $(BUILT_SOURCES) gnucash gnucash-valgrind gnucash-gdb gnucash-ddd gnucash-setup-env
+CLEANFILES = $(BUILT_SOURCES) gnucash gnucash-valgrind gnucash-gdb environment
 
 # We handle gnucash scripts in a somewhat unexpected way, but we do
 # this so that a user who doesn't necessarily have the right
@@ -112,9 +117,7 @@
 	update-gnucash-gconf \
 	gnucash \
 	gnucash-valgrind \
-	gnucash-gdb \
-	gnucash-ddd \
-	gnucash-setup-env
+	gnucash-gdb
 
 # if you change gncoverridedir, make sure you change ./overrides/Makefile.am too.
 gncoverridesdir = ${GNC_LIBEXECDIR}/overrides
@@ -125,9 +128,9 @@
 	gnucash.in \
 	gnucash-valgrind.in \
 	gnucash-gdb.in \
-	gnucash-ddd.in \
-	gnucash-setup-env.in\
-	gnucash-setup-env-osx.in
+	environment.in \
+	environment-win32.in \
+	environment-osx.in
 
 ## Gnucash scripts -- real code is in overrides, these just get you there.
 ${gnc_common_scripts}: generate-gnc-script ${top_builddir}/config.status

Added: gnucash/trunk/src/bin/environment-osx.in
===================================================================
--- gnucash/trunk/src/bin/environment-osx.in	                        (rev 0)
+++ gnucash/trunk/src/bin/environment-osx.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -0,0 +1,31 @@
+# environment
+#
+# This configuration file can be used to change/add
+# environment variables during GnuCash startup.
+#
+# If you make any changes here, you should probably
+# also change the equivalent sections in:
+# - src/bin/environment.in
+# - src/bin/environment-win32.in
+# - packaging/win32/gnucash.iss.in
+# - packaging/win32/install.sh
+
+[Variables]
+GUILE_WARN_DEPRECATED=no
+XDG_CONFIG_DIRS=@-PREFIX-@/etc/xdg
+XDG_DATA_DIRS=@-PREFIX-@/share
+
+PATH=@-BIN_DIR-@;{PATH}
+GNC_MODULE_PATH=@-GNC_PKGLIB_INSTALLDIR-@;{GNC_MODULE_PATH}
+
+EXTRA_PATH={EXTRA_PATH};@-GNC_GUILE_MODULE_DIR-@;@-GNC_SCM_INSTALL_DIR-@
+GUILE_LOAD_PATH={EXTRA_PATH};{GUILE_LOAD_PATH}
+
+EXTRA_LIBS={GNC_MODULE_PATH};/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/
+EXTRA_LIBS={EXTRA_LIBS};@-GNC_LIB_INSTALLDIR-@;@-GNC_PKGLIB_INSTALLDIR-@
+LD_LIBRARY_PATH={EXTRA_LIBS};${LD_LIBRARY_PATH}
+DYLD_LIBRARY_PATH={EXTRA_LIBS};${DYLD_LIBRARY_PATH}
+
+GNC_DBD_DIR=@-GNC_DBD_DIR-@
+GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
+GNC_DOT_DIR={HOME}/Library/Application Support/Gnucash
\ No newline at end of file

Added: gnucash/trunk/src/bin/environment-win32.in
===================================================================
--- gnucash/trunk/src/bin/environment-win32.in	                        (rev 0)
+++ gnucash/trunk/src/bin/environment-win32.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -0,0 +1,16 @@
+# environment
+#
+# This configuration file can be used to change/add
+# environment variables during GnuCash startup.
+#
+# If you make any changes here, you should probably
+# also change the equivalent sections in:
+# - src/bin/environment.in
+# - src/bin/environment-osx.in
+# - packaging/win32/gnucash.iss.in
+# - packaging/win32/install.sh
+
+[Variables]
+# For now most of the environment is still set in
+# the install script or the installer. You can override
+# or add additional variables here.
\ No newline at end of file

Added: gnucash/trunk/src/bin/environment.in
===================================================================
--- gnucash/trunk/src/bin/environment.in	                        (rev 0)
+++ gnucash/trunk/src/bin/environment.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -0,0 +1,27 @@
+# environment
+#
+# This configuration file can be used to change/add
+# environment variables during GnuCash startup.
+#
+# If you make any changes here, you should probably
+# also change the equivalent sections in:
+# - src/bin/environment-osx.in
+# - src/bin/environment-win32.in
+# - packaging/win32/gnucash.iss.in
+# - packaging/win32/install.sh
+
+[Variables]
+GUILE_WARN_DEPRECATED=no
+
+PATH=@-BIN_DIR-@;{PATH}
+GNC_MODULE_PATH=@-GNC_PKGLIB_INSTALLDIR-@;{GNC_MODULE_PATH}
+
+EXTRA_PATH={EXTRA_PATH};@-GNC_GUILE_MODULE_DIR-@;@-GNC_SCM_INSTALL_DIR-@
+GUILE_LOAD_PATH={EXTRA_PATH};{GUILE_LOAD_PATH}
+
+EXTRA_LIBS={GNC_MODULE_PATH};@-GNC_LIB_INSTALLDIR-@;@-GNC_PKGLIB_INSTALLDIR-@
+LD_LIBRARY_PATH={EXTRA_LIBS};{LD_LIBRARY_PATH}
+DYLD_LIBRARY_PATH={EXTRA_LIBS};{DYLD_LIBRARY_PATH}
+
+GNC_DBD_DIR=@-GNC_DBD_DIR-@
+GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
\ No newline at end of file

Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2010-04-05 14:48:22 UTC (rev 18994)
@@ -95,10 +95,87 @@
 static char *help_path = GNC_HELPDIR;
 static char *gconf_path = APP_GNUCASH;
 
+static gchar  *environment_expand(gchar *param)
+{
+    gchar *search_start;
+    gchar *opening_brace;
+    gchar *closing_brace;
+    gchar *result;
+    gchar *tmp;
+    gchar *expanded=NULL;
+
+    if (!param)
+        return NULL;
+
+    /* Set an initial return value, so we can always use g_strconcat below) */
+    result=g_strdup ("x");
+
+    /* Look for matching pairs of { and }. Anything in between should be expanded */
+    search_start = param;
+    opening_brace = g_strstr_len (search_start, -1, "{");
+    closing_brace = g_strstr_len (search_start, -1, "}");
+
+    /* Note: the test on valid braces is fairly simple:
+     *       * if no pair of opening/closing braces is found, no expansion occurs
+     *       * braces can't be nested, this will give unexpected results
+     *       * the string should contain no other braces than those used to mark
+     *         expandable variables, or unexpected results will be returned.
+     */
+    while ( opening_brace && closing_brace && (closing_brace > opening_brace) )
+    {
+        /* Found a first matching pair */
+        gchar *to_expand;
+        const gchar *env_val;
+
+        /* If the string had characters before the opening {, copy them first */
+        if (opening_brace > search_start)
+        {
+            gchar *prefix = g_strndup (search_start, opening_brace - search_start);
+
+            tmp = g_strconcat (result, prefix, NULL);
+            g_free (result);
+            result = tmp;
+            g_free (prefix);
+        }
+
+        /* Expand the variable  we found and append it to the result */
+        to_expand = g_strndup (opening_brace + 1, closing_brace - opening_brace -1);
+        env_val = g_getenv (to_expand);
+        tmp = g_strconcat (result, env_val, NULL);
+        g_free (result);
+        result = tmp;
+        g_free (to_expand);
+
+        /* Look for matching pairs of { and }. Anything in between should be expanded */
+        search_start = closing_brace + 1;
+        opening_brace = g_strstr_len (search_start, -1, "{");
+        closing_brace = g_strstr_len (search_start, -1, "}");
+    }
+
+    /* No more braces found, append the remaining characters */
+    tmp = g_strconcat (result, search_start, NULL);
+    g_free (result);
+    result = tmp;
+
+    /* Remove the "x" from our result */
+    if (g_strcmp0 (result, "x"))
+        expanded = g_strdup (result + 1);
+    g_free (result);
+
+    return expanded;
+}
+
 static void
 environment_override()
 {
-    const char *path;
+    const gchar *path;
+    gchar *env_file;
+    GKeyFile    *keyfile=g_key_file_new();
+    GError      *error;
+    gchar **env_vars;
+    gsize param_count;
+    gint i;
+    gboolean got_keyfile;
 
     if ((path = g_getenv("GNC_CONFIG_PATH")))
         config_path = g_strdup(path);
@@ -117,6 +194,54 @@
         g_free(pathext);
     }
 #endif
+
+    env_file = g_strjoin(G_DIR_SEPARATOR_S, config_path, "environment", NULL);
+    got_keyfile = g_key_file_load_from_file (keyfile, env_file, G_KEY_FILE_NONE, &error);
+    g_free (env_file);
+    if ( !got_keyfile )
+        return;
+
+    /* Read the environment overrides and apply them */
+    env_vars = g_key_file_get_keys(keyfile, "Variables", &param_count, &error);
+    for ( i = 0; i < param_count; i++ )
+    {
+        gchar **val_list;
+        gsize val_count;
+        gint j;
+        gchar *new_val, *tmp_val;
+
+        /* For each variable, read its new value, optionally expand it and (un)set it */
+        val_list = g_key_file_get_string_list (keyfile, "Variables",
+                                               env_vars[i], &val_count,
+                                               &error );
+        if (!val_list)
+            g_unsetenv (env_vars[i]);
+        else
+        {
+            /* Set an initial return value, so we can always use g_build_path below) */
+            tmp_val = g_strdup ("x");
+            for ( j = 0; j < val_count; j++ )
+            {
+                gchar *expanded = environment_expand (val_list[j]);
+                new_val = g_build_path (G_SEARCHPATH_SEPARATOR_S, tmp_val, expanded, NULL);
+                g_free (tmp_val);
+                tmp_val = new_val;
+            }
+            g_strfreev (val_list);
+
+            /* Remove the "x" from our result */
+            if (g_strcmp0 (tmp_val, "x"))
+                new_val = g_strdup (tmp_val + sizeof (G_SEARCHPATH_SEPARATOR_S));
+            g_free (tmp_val);
+
+            if (!g_setenv (env_vars[i], new_val, TRUE))
+                g_warning ("Couldn't properly override environment variable \"%s\". "
+                           "This may lead to unexpected results", env_vars[i]);
+        }
+    }
+
+    g_strfreev(env_vars);
+
 }
 
 static gboolean
@@ -595,7 +720,13 @@
     g_message("main: binreloc relocation support was disabled at configure time.\n");
 #endif
 
-#ifdef HAVE_GETTEXT
+    /* This should be called before gettext is initialized
+     * The user may have configured a different language via
+     * the environment file.
+     */
+    environment_override();
+
+    #ifdef HAVE_GETTEXT
     {
         gchar *localedir = gnc_path_get_localedir();
         /* setlocale(LC_ALL, ""); is already called by gtk_set_locale()
@@ -610,7 +741,6 @@
     qof_log_init();
     qof_log_set_default(QOF_LOG_INFO);
 
-    environment_override();
     gnucash_command_line(&argc, argv);
     gnc_print_unstable_message();
     gnc_log_init();

Deleted: gnucash/trunk/src/bin/gnucash-ddd.in
===================================================================
--- gnucash/trunk/src/bin/gnucash-ddd.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash-ddd.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
-
-exec ddd @-GNUCASH_BIN_INSTALL_NAME-@ "$@"

Modified: gnucash/trunk/src/bin/gnucash-gdb.in
===================================================================
--- gnucash/trunk/src/bin/gnucash-gdb.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash-gdb.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -1,5 +1,4 @@
 #!/bin/sh
 
-. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
-
-exec gdb @-GNUCASH_BIN_INSTALL_NAME-@ "$@"
+ at -PRE_RUN-@
+exec $(dirname $0)/gdb @-GNUCASH_BIN_INSTALL_NAME-@ "$@"

Deleted: gnucash/trunk/src/bin/gnucash-setup-env-osx.in
===================================================================
--- gnucash/trunk/src/bin/gnucash-setup-env-osx.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash-setup-env-osx.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -1,40 +0,0 @@
-# If you make any changes here, you should probably also change the equivalent sections
-# in packaging/win32/gnucash.iss.in, packaging/win32/install.sh and src/bin/gnucash-setup-env.in
-
-PATH="@-BIN_DIR-@:${PATH}"
-export PATH
-XDG_CONFIG_DIRS=@-PREFIX-@/etc/xdg
-export XDG_CONFIG_DIRS
-XDG_DATA_DIRS=@-PREFIX-@/share
-export XDG_DATA_DIRS
-
-
-GUILE_WARN_DEPRECATED="no"
-export GUILE_WARN_DEPRECATED
-
-GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@@-PATH_SEPARATOR-@${GNC_MODULE_PATH}"
-
-EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_GUILE_MODULE_DIR-@"
-EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_SCM_INSTALL_DIR-@"
-GUILE_LOAD_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@${GUILE_LOAD_PATH}"
-
-EXTRA_LIBS="${GNC_MODULE_PATH}"
-EXTRA_LIBS="${EXTRA_LIBS}:/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/"
-EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_LIB_INSTALLDIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_PKGLIB_INSTALLDIR-@"
-
-LD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LD_LIBRARY_PATH}"
-DYLD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${DYLD_LIBRARY_PATH}"
-GNC_DBD_DIR="@-GNC_DBD_DIR-@"
-GNC_STANDARD_REPORTS_DIR="@-GNC_STANDARD_REPORTS_DIR-@"
-
-export GNC_MODULE_PATH
-export GUILE_LOAD_PATH
-export LD_LIBRARY_PATH
-export DYLD_LIBRARY_PATH
-export GNC_STANDARD_REPORTS_DIR
-export GNC_DOT_DIR="$HOME/Library/Application Support/Gnucash"
-
-if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
-    eval `dbus-launch --sh-syntax --exit-with-session --config-file=@-PREFIX-@/etc/dbus-1/session.conf`
-fi

Deleted: gnucash/trunk/src/bin/gnucash-setup-env.in
===================================================================
--- gnucash/trunk/src/bin/gnucash-setup-env.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash-setup-env.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -1,35 +0,0 @@
-# gnucash-setup-env
-#
-# Common environment setup used by different gnucash startup scripts
-#
-# If you make any changes here, you should probably also change the equivalent sections
-# in packaging/win32/gnucash.iss.in, packaging/win32/install.sh and
-# src/bin/gnucash-setup-env-osx.in
-
-PATH="@-BIN_DIR-@:${PATH}"
-export PATH
-
-GUILE_WARN_DEPRECATED="no"
-export GUILE_WARN_DEPRECATED
-
-GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@@-PATH_SEPARATOR-@${GNC_MODULE_PATH}"
-
-EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_GUILE_MODULE_DIR-@"
-EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_SCM_INSTALL_DIR-@"
-GUILE_LOAD_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@${GUILE_LOAD_PATH}"
-
-EXTRA_LIBS="${GNC_MODULE_PATH}"
-EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_LIB_INSTALLDIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_PKGLIB_INSTALLDIR-@"
-
-LD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LD_LIBRARY_PATH}"
-DYLD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${DYLD_LIBRARY_PATH}"
-GNC_DBD_DIR="@-GNC_DBD_DIR-@"
-GNC_STANDARD_REPORTS_DIR="@-GNC_STANDARD_REPORTS_DIR-@"
-
-export GNC_MODULE_PATH
-export GUILE_LOAD_PATH
-export LD_LIBRARY_PATH
-export DYLD_LIBRARY_PATH
-export GNC_DBD_DIR
-export GNC_STANDARD_REPORTS_DIR

Modified: gnucash/trunk/src/bin/gnucash-valgrind.in
===================================================================
--- gnucash/trunk/src/bin/gnucash-valgrind.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash-valgrind.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -1,7 +1,6 @@
 #!/bin/sh
 
-. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
-
+ at -PRE_RUN-@
 TOP_SRC_DIR="@-TOP_SRC_DIR-@"
 #
 # Other potentially useful options, particularly for valgrind-2.x:
@@ -19,4 +18,4 @@
     --error-limit=no \
     --tool=memcheck \
     --leak-check=full \
-    @-GNUCASH_BIN_INSTALL_NAME-@ "$@"
+    $(dirname $0)/@-GNUCASH_BIN_INSTALL_NAME-@ "$@"

Modified: gnucash/trunk/src/bin/gnucash.in
===================================================================
--- gnucash/trunk/src/bin/gnucash.in	2010-04-05 09:21:15 UTC (rev 18993)
+++ gnucash/trunk/src/bin/gnucash.in	2010-04-05 14:48:22 UTC (rev 18994)
@@ -1,5 +1,4 @@
 #!/bin/sh
 
-. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
-
-exec @-GNUCASH_BIN_INSTALL_NAME-@ "$@"
+ at -PRE_RUN-@
+exec $(dirname $0)/@-GNUCASH_BIN_INSTALL_NAME-@ "$@"



More information about the gnucash-changes mailing list