summaryrefslogtreecommitdiffstats
path: root/zz_config/win-builds-switch.in
diff options
context:
space:
mode:
authorAdrien Nader <adrien@notk.org>2014-12-12 09:37:30 +0100
committerAdrien Nader <adrien@notk.org>2014-12-12 09:37:30 +0100
commit3ec32e6b3ed5ff9b400f59d74b1ff3bfb0ea3a1b (patch)
tree01962e0c2a48c96c6f761723cf681bf03787b33b /zz_config/win-builds-switch.in
parent4b4fd5e03db899defb9ea933d2b933afcf5de298 (diff)
zz_config/win-builds-switch: simplify control flow for updating $PATH.
Diffstat (limited to 'zz_config/win-builds-switch.in')
-rw-r--r--zz_config/win-builds-switch.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/zz_config/win-builds-switch.in b/zz_config/win-builds-switch.in
index bd70461..0fcea3f 100644
--- a/zz_config/win-builds-switch.in
+++ b/zz_config/win-builds-switch.in
@@ -32,6 +32,16 @@ replace_in_path() {
echo 'Set ${PATH}='"${PATH}"'.' 1>&2
}
+put_toolchain_in_path() {
+ local BASE="${1}"
+ local BITS="${2}"
+
+ replace_in_path \
+ "/opt/${BASE}_??/bin" \
+ "/opt/${BASE}_../bin" \
+ "/opt/${BASE}_${BITS}/bin"
+}
+
unset PKG_CONFIG_PATH
echo 'Unset ${PKG_CONFIG_LIBDIR}.' 1>&2
@@ -44,15 +54,13 @@ else
if ! grep '^\(CYGWIN\|Linux\)' /proc/version >/dev/null 2>/dev/null; then
# MSYS
PKG_CONFIG_LIBDIR="!{YYPREFIX}/lib@@LIBDIRSUFFIX@@/pkgconfig"
- SERIES="windows"
+ put_toolchain_in_path "windows" "@@BITS@@"
else
# Cygwin, Linux, possibly any other
PKG_CONFIG_LIBDIR="@@YYPREFIX_TARGET@@/lib@@LIBDIRSUFFIX@@/pkgconfig"
- SERIES="cross_toolchain"
+ put_toolchain_in_path "cross_toolchain" "@@BITS@@"
fi
export PKG_CONFIG_LIBDIR
echo 'Set ${PKG_CONFIG_LIBDIR}='"${PKG_CONFIG_LIBDIR}"'.' 1>&2
-
- replace_in_path "/opt/${SERIES}_??/bin" "/opt/${SERIES}_../bin" "/opt/${SERIES}_@@BITS@@/bin"
fi