r16182 - gnucash/trunk/packaging/win32 - Install.sh: Fix PKG_CONFIG_PATH tracking when cross-compiling.

Andreas Köhler andi5 at cvs.gnucash.org
Mon Jun 18 16:42:33 EDT 2007


Author: andi5
Date: 2007-06-18 16:42:30 -0400 (Mon, 18 Jun 2007)
New Revision: 16182
Trac: http://svn.gnucash.org/trac/changeset/16182

Modified:
   gnucash/trunk/packaging/win32/functions.sh
   gnucash/trunk/packaging/win32/install.sh
Log:
Install.sh: Fix PKG_CONFIG_PATH tracking when cross-compiling.

One must not simply set or reset environment variables that are tracked
for changes, because add_to_env relies on accurate helper variables.


Modified: gnucash/trunk/packaging/win32/functions.sh
===================================================================
--- gnucash/trunk/packaging/win32/functions.sh	2007-06-18 20:42:24 UTC (rev 16181)
+++ gnucash/trunk/packaging/win32/functions.sh	2007-06-18 20:42:30 UTC (rev 16182)
@@ -122,6 +122,7 @@
 }
 
 # usage: set_env_or_die VALUE NAME
+# like add_to_env, but die if $NAME has been set to a different value
 function set_env_or_die() {
     _OLDADDS=`eval echo '"$'"$2_ADDS"'"'`
     add_to_env "$1" "$2"
@@ -137,6 +138,14 @@
     fi
 }
 
+# usage set_env VALUE NAME
+# like $NAME=$VALUE, but also reset env tracking variables
+function set_env() {
+    eval "$2=$1"
+    eval "$2_BASE="
+    eval "$2_ADDS=$1"
+}
+
 function assert_one_dir() {
     quiet [ -d "$@" ] || die "Detected multiple directories where only one was expected; please delete all but the latest one: $@"
 }

Modified: gnucash/trunk/packaging/win32/install.sh
===================================================================
--- gnucash/trunk/packaging/win32/install.sh	2007-06-18 20:42:24 UTC (rev 16181)
+++ gnucash/trunk/packaging/win32/install.sh	2007-06-18 20:42:30 UTC (rev 16182)
@@ -72,10 +72,10 @@
         export CFLAGS="$CFLAGS -g -O0"
     fi
 
-    if [ "$CROSS_COMPILE" ]; then
+    if [ "$CROSS_COMPILE" = "yes" ]; then
         # to avoid using the build machine's installed packages
-        export PKG_CONFIG_PATH=""
-        export PKG_CONFIG_LIBDIR=""
+        set_env "" PKG_CONFIG_PATH    # registered
+        export PKG_CONFIG_LIBDIR=""   # not registered
     fi
 }
 



More information about the gnucash-changes mailing list