diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-07-11 15:23:56 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-07-14 10:24:08 -0400 |
commit | 4c951fc9975c53bbc147515840b3c5e1d6da8ba1 (patch) | |
tree | 615a0d16de575927ae0d75a7cd82c9a0a443a68a | |
parent | be8c192dbbeaa685f5d3028f9c38205f362b6e14 (diff) | |
download | trace-cmd-4c951fc9975c53bbc147515840b3c5e1d6da8ba1.tar.gz |
trace-cmd make-trace-cmd.sh: Allow overriding of CFLAGS
Instead of hard coding CFLAGS to be "-g -Wall", have that be the default,
but if the user adds their own CFLAGS, it will override that.
Link: https://lore.kernel.org/linux-trace-devel/20220711152356.65790b1b@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rwxr-xr-x | make-trace-cmd.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/make-trace-cmd.sh b/make-trace-cmd.sh index 31f32594..c16edf23 100755 --- a/make-trace-cmd.sh +++ b/make-trace-cmd.sh @@ -4,7 +4,7 @@ if [ -z "$INSTALL_PATH" ]; then echo echo 'Error: No $INSTALL_PATH defined' echo - echo " usage: [PREFIX=prefix][BUILD_PATH=/path/to/build] INSTALL_PATH=/path/to/install make-trace-cmd.sh install|install_libs|clean|uninstall" + echo " usage: [PREFIX=prefix][BUILD_PATH=/path/to/build][CFLAGS=custom-cflags] INSTALL_PATH=/path/to/install make-trace-cmd.sh install|install_libs|clean|uninstall" echo echo " Used to create a self contained directory to copy to other machines." echo @@ -36,4 +36,8 @@ 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 $@ +if [ -z "$CFLAGS" ]; then + CFLAGS="-g -Wall" +fi + +PKG_CONFIG_PATH="$INSTALL_PATH/$PKG_PATH" PKG_CONFIG="pkg-config $WITH_PATH --define-variable=prefix=$INSTALL_PATH/$PREFIX" CFLAGS="-I$INSTALL_PATH/$PREFIX/include $CFLAGS" make DESTDIR=$INSTALL_PATH $O_PATH prefix=$PREFIX $@ |