From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> 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@xxxxxxx Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212149 Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- 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