[PATCH 4/8] Mangle expected sysroot output to match MSYS shell

Dan Nicholson dbn.lists at gmail.com
Sat Apr 6 09:17:40 PDT 2013


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.
---
 check/check-sysroot | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/check/check-sysroot b/check/check-sysroot
index 0820206..d03d1c7 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
-- 
1.8.1.4



More information about the pkg-config mailing list