configure: Don't use cross_prefix when invoking pkg-config
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Tue, 23 Jan 2024 20:26:36 +0000 (09:26 +1300)
committerJens Axboe <axboe@kernel.dk>
Tue, 23 Jan 2024 23:28:31 +0000 (16:28 -0700)
pkg-config doesn't need to have a cross prefixed version. It can be
pointed at alternate sysroots with environment variables like
PKG_CONFIG_SYSROOT_DIR. The configure script was already inconsistent
with using `pkg-config` in some places and `${cross_prefix}pkg-config`
in others. Make check_min_lib_version() and the gtk checks consistent
with the rest by dropping the `${cross_prefix}` usage with pkg-config.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20240123202636.179467-1-chris.packham@alliedtelesis.co.nz
Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure

index f86fcf77df6c25284a872abb8b658a6ef800cd73..dea8d07d113bbee100794dc1111bf4820a7b81b8 100755 (executable)
--- a/configure
+++ b/configure
@@ -155,11 +155,11 @@ output_sym() {
 check_min_lib_version() {
   _feature=$3
 
-  if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
+  if pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
     return 0
   fi
   : "${_feature:=${1}}"
-  if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
+  if pkg-config --version > /dev/null 2>&1; then
     if test "$(eval echo \"\$$_feature\")" = "yes" ; then
       feature_not_found "$_feature" "$1 >= $2"
     fi
@@ -1631,14 +1631,14 @@ int main(void)
   return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
 }
 EOF
-GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
+GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
 ORG_LDFLAGS=$LDFLAGS
 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
 if test "$?" != "0" ; then
   echo "configure: gtk and gthread not found"
   exit 1
 fi
-GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
+GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
 if test "$?" != "0" ; then
   echo "configure: gtk and gthread not found"
   exit 1