mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-04-21 20:30:45 +02:00
Adjust expected path for native Windows test
When check-path is run on native Windows (MINGW), that path reported by `pkg-config --variable=pc_path pkg-config` is adjusted to the directory pkg-config is run from. Adjust the expected result based on getting the current directory from cmd in Windows format.
This commit is contained in:
parent
df1ac943d4
commit
f6212f6b97
3 changed files with 24 additions and 8 deletions
|
|
@ -9,14 +9,27 @@ PKG_CONFIG_PATH="$srcdir/sub" run_test --exists sub1
|
|||
|
||||
# default pkg-config path, making sure to resolve the variables fully
|
||||
eval pc_path="$pc_path"
|
||||
case ${MACHTYPE} in
|
||||
*-msys)
|
||||
# Make sure path doesn't get mangled on MSYS
|
||||
RESULT=$(echo $pc_path | sed 's,/,\\/,g')
|
||||
;;
|
||||
*)
|
||||
if [ "$native_win32" = yes ]; then
|
||||
# This is pretty hacky. On native win32 (MSYS/MINGW), pkg-config
|
||||
# builds the default path from the installation directory. It
|
||||
# then adds lib/pkgconfig and share/pkgconfig to it. Normally,
|
||||
# the autoconf build directory would be used, but that path is in
|
||||
# Unix format.
|
||||
if [ "$OSTYPE" = msys ]; then
|
||||
# MSYS has "pwd -W" to get the current directory in Windows format
|
||||
pcdir=$(cd $top_builddir/.libs && pwd -W)
|
||||
else
|
||||
# Assume we have cmd somewhere to get variable %cd%. Make sure
|
||||
# to strip carriage returns.
|
||||
pcdir=$(cd $top_builddir/.libs &&
|
||||
cmd /C echo %cd% | sed -r 's/\r//g')
|
||||
fi
|
||||
win_path="$pcdir/lib/pkgconfig;$pcdir/share/pkgconfig"
|
||||
|
||||
# Convert from forward slashes to Windows backslashes
|
||||
RESULT=$(echo $win_path | sed 's,/,\\,g')
|
||||
else
|
||||
RESULT=$pc_path
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
unset PKG_CONFIG_LIBDIR
|
||||
run_test --variable=pc_path pkg-config
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# Settings from the configure script
|
||||
#
|
||||
|
||||
top_builddir=@top_builddir@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
includedir=@includedir@
|
||||
|
|
@ -13,3 +14,4 @@ system_include_path="@system_include_path@"
|
|||
system_library_path="@system_library_path@"
|
||||
list_indirect_deps=@use_indirect_deps@
|
||||
PACKAGE_VERSION=@PACKAGE_VERSION@
|
||||
native_win32=@native_win32@
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ case "$host" in
|
|||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$native_win32])
|
||||
AC_SUBST([native_win32])
|
||||
AM_CONDITIONAL(NATIVE_WIN32, [test "x$native_win32" = xyes])
|
||||
|
||||
dnl
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue