Treat misconfigured pkg-config as no pkg-config

This commit is contained in:
Mike Sharov 2022-05-17 10:01:40 -04:00
parent 70e83a214c
commit 38b699e70e
1 changed files with 8 additions and 9 deletions

17
configure vendored
View File

@ -37,7 +37,7 @@ progs="CC=gcc CC=clang CC=cc INSTALL=install MSGFMT=msgfmt"
pkgs="libcurl libxml-2.0 libcrypto ncursesw"
# Default pkg flags to substitute when pkg-config is not found
pkg_libs="-lcurl -lxml2 -lcrypto -lncursesw"
pkg_cflags="-I\/usr\/include\/libxml2 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600"
pkg_cflags="-I/usr/include/libxml2 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600"
pkg_ldflags=""
# Automatic vars
@ -191,16 +191,15 @@ if [ -n "$pkgconfig" ] && [ -x "$pkgconfig" ]; then
for i in $pkgs; do
$pkgconfig --exists "$i" || faildeps="$i $faildeps"
done
if [ -n "$faildeps" ]; then
echo "Error: missing required packages: $faildeps"; die
if [ -z "$faildeps" ]; then
pkg_cflags=$($pkgconfig --cflags $pkgs)
pkg_libs=$($pkgconfig --libs-only-l $pkgs)
pkg_ldflags=$($pkgconfig --libs-only-L --libs-only-other $pkgs)
fi
pkg_cflags=$(escpath $($pkgconfig --cflags $pkgs))
pkg_libs=$(escpath $($pkgconfig --libs-only-l $pkgs))
pkg_ldflags=$(escpath $($pkgconfig --libs-only-L --libs-only-other $pkgs))
fi
sub "s/@pkg_cflags@/$pkg_cflags/"
sub "s/@pkg_libs@/$pkg_libs/"
sub "s/@pkg_ldflags@/$pkg_ldflags/"
sub "s/@pkg_cflags@/$(escpath $pkg_cflags)/"
sub "s/@pkg_libs@/$(escpath $pkg_libs)/"
sub "s/@pkg_ldflags@/$(escpath $pkg_ldflags)/"
sub "$custsubs"