Skip to content

Commit

Permalink
Install.sh: Fix PKG_CONFIG_PATH tracking when cross-compiling.
Browse files Browse the repository at this point in the history
One must not simply set or reset environment variables that are tracked
for changes, because add_to_env relies on accurate helper variables.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16182 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
andi5 committed Jun 18, 2007
1 parent 4fff6de commit 742564b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions packaging/win32/functions.sh
Expand Up @@ -122,6 +122,7 @@ function add_to_env() {
}

# 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"
Expand All @@ -137,6 +138,14 @@ function set_env_or_die() {
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: $@"
}
Expand Down
6 changes: 3 additions & 3 deletions packaging/win32/install.sh
Expand Up @@ -72,10 +72,10 @@ function prepare() {
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
}

Expand Down

0 comments on commit 742564b

Please sign in to comment.