diff --git a/packaging/win32/functions.sh b/packaging/win32/functions.sh index 42f79c57961..29c984734af 100644 --- a/packaging/win32/functions.sh +++ b/packaging/win32/functions.sh @@ -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" @@ -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: $@" } diff --git a/packaging/win32/install.sh b/packaging/win32/install.sh index 45a2e60aec5..ad6cfb33e76 100755 --- a/packaging/win32/install.sh +++ b/packaging/win32/install.sh @@ -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 }