summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2013-03-27 01:58:15 +0100
committerDan Nicholson <dbn.lists@gmail.com>2013-04-09 05:43:24 -0700
commitbfe139da8cf56bcad20dc396db9e38e5838556e7 (patch)
treed268709b3c4e76d3e1fd8e5933e1159a24db79c5 /check
parent5f9116931d807a6942385244ca097b58bd53ab03 (diff)
downloadpkg-config-bfe139da8cf56bcad20dc396db9e38e5838556e7.tar.gz
Mangle expected sysroot output to match MSYS shell
MSYS mangles UNIX paths on execution such that it prepends its root in Windows format. This affects PKG_CONFIG_SYSROOT_DIR and thus the check-sysroot test. Detect MSYS from the OSTYPE environment variable and adjust the expected test results to match. This likely means that sysroot support doesn't actually work on MSYS, but there probably aren't any toolchains that support sysroot there, anyway.
Diffstat (limited to 'check')
-rwxr-xr-xcheck/check-sysroot9
1 files changed, 7 insertions, 2 deletions
diff --git a/check/check-sysroot b/check/check-sysroot
index 0820206..7b72ed9 100755
--- a/check/check-sysroot
+++ b/check/check-sysroot
@@ -6,6 +6,11 @@ set -e
export PKG_CONFIG_SYSROOT_DIR=/sysroot
+# MSYS mangles / paths to its own root in windows format. This probably
+# means sysroot doesn't work there, but match what pkg-config passes
+# back anyway.
+[ "$OSTYPE" = msys ] && root=$(cd / && pwd -W) || root=
+
RESULT=""
run_test --cflags simple
@@ -20,8 +25,8 @@ if [ "$list_indirect_deps" = yes ]; then
fi
run_test --libs --static simple
-RESULT="-I/sysroot/public-dep/include"
+RESULT="-I$root/sysroot/public-dep/include"
run_test --cflags public-dep
-RESULT="-L/sysroot/public-dep/lib -lpublic-dep"
+RESULT="-L$root/sysroot/public-dep/lib -lpublic-dep"
run_test --libs public-dep