pkg-config/check/check-path
Dave Shawley dadb7301f2 Fix tests under FreeBSD.
check-debug, check-path, and check-system-flags used the following
pattern which fails under FreeBSD's /bin/sh

  VAR_NAME=value run_test --args

When this is run VAR_NAME is not exported to `run_test` so I changed
this pattern to:

  VAR_NAME=value
  export VAR_NAME
  run_test --args

Also added `unset` in a few cases where it would/could make a
difference.
2020-05-01 10:58:50 +00:00

38 lines
1.2 KiB
Bash
Executable file

#! /bin/sh
set -e
. ${srcdir}/common
# PKG_CONFIG_PATH
RESULT=""
PKG_CONFIG_PATH="$srcdir/sub"
export PKG_CONFIG_PATH
run_test --exists sub1
unset PKG_CONFIG_PATH
# default pkg-config path, making sure to resolve the variables fully
eval pc_path="$pc_path"
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 &&
$WINE 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
fi
unset PKG_CONFIG_LIBDIR
run_test --variable=pc_path pkg-config