From: Chris Packham <chris.packham@alliedtelesis.co.nz>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: [PATCH] configure: Don't use cross_prefix when invoking pkg-config
Date: Wed, 24 Jan 2024 09:26:36 +1300 [thread overview]
Message-ID: <20240123202636.179467-1-chris.packham@alliedtelesis.co.nz> (raw)
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>
---
Notes:
I ran into an issue cross-compiling fio where it couldn't find libxnvme
in my cross sysroot. pkg-config shouldn't need to have a target tuple
prefix and I see that the configure script was already inconsistent with
using it hence this patch which resolves the build issue for me.
configure | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 742cb7c5..cba0ce5f 100755
--- 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
@@ -1627,14 +1627,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
--
2.43.0
next reply other threads:[~2024-01-23 20:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 20:26 Chris Packham [this message]
2024-01-24 12:50 ` [PATCH] configure: Don't use cross_prefix when invoking pkg-config Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240123202636.179467-1-chris.packham@alliedtelesis.co.nz \
--to=chris.packham@alliedtelesis.co.nz \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).