linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: Update make-trace-cmd.sh to handle pkg-config without --with-path
@ 2021-03-09 17:22 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-03-09 17:22 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: pierre.gondois

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Debian and Ubuntu's pkg-config does not support the "--with-path" option.
Check first if it is supported, and only use it when it is.

Set PKG_CONFIG_PATH to inform pkg-config where to search.

Note, this script may not be the best way to create packaging and there may
be better ways to do so.

Reported-by: pierre.gondois@arm.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212149
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 make-trace-cmd.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/make-trace-cmd.sh b/make-trace-cmd.sh
index ddff1814..31f32594 100755
--- a/make-trace-cmd.sh
+++ b/make-trace-cmd.sh
@@ -28,4 +28,12 @@ if [ -z "$PREFIX" ]; then
 	PREFIX="/usr"
 fi
 
-PKG_CONFIG="pkg-config --with-path $INSTALL_PATH/usr/lib64/pkgconfig --define-variable=prefix=$INSTALL_PATH/$PREFIX" CFLAGS="-g -Wall -I$INSTALL_PATH/$PREFIX/include" make DESTDIR=$INSTALL_PATH  $O_PATH prefix=$PREFIX $@
+PKG_PATH=`pkg-config --variable pc_path pkg-config | tr ":" " " | cut -d' ' -f1`
+
+WITH_PATH=""
+# If pkg-config supports --with-path, use that as well
+if pkg-config --with-path=/tmp --variable pc_path pkg-config &> /dev/null ; then
+	WITH_PATH="--with-path=$INSTALL_PATH$PKG_PATH"
+fi
+
+PKG_CONFIG_PATH="$INSTALL_PATH/$PKG_PATH" PKG_CONFIG="pkg-config $WITH_PATH --define-variable=prefix=$INSTALL_PATH/$PREFIX" CFLAGS="-g -Wall -I$INSTALL_PATH/$PREFIX/include" make DESTDIR=$INSTALL_PATH  $O_PATH prefix=$PREFIX $@
-- 
2.25.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-09 17:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 17:22 [PATCH] trace-cmd: Update make-trace-cmd.sh to handle pkg-config without --with-path Steven Rostedt

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 NNTP newsgroup(s).