diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2019-07-24 19:07:58 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-24 20:36:01 -0400 |
commit | 1517dc3a15606850b1b52b789cbdeb554e2c68c6 (patch) | |
tree | 449aca4ae8e095fd2399421463385615c1785230 | |
parent | 2f641a1cfba76a291915d43ff9546de91b604ece (diff) | |
download | trace-cmd-1517dc3a15606850b1b52b789cbdeb554e2c68c6.tar.gz |
trace-cmd: Only add udis86 CFLAGS and LDFLAGS if it is found
As we need to update both LDFLAGS and CFLAGS, move the test to see if
udisc86 is installed to a variable, and then set NO_UDIS86 if it is not
found. This way we do not need to test if it exists twice, nor have
LDFLAGS set unconditionally.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204277
Link: http://lore.kernel.org/linux-trace-devel/20190724190758.4e18498f@gandalf.local.home
Reported-by: howaboutsynergy@pm.me
Tested-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | Makefile | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -136,9 +136,14 @@ export NO_PYTHON test-build = $(if $(shell sh -c 'echo "$(1)" | \ $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y'), $2) +UDIS86_AVAILABLE := $(call test-build,\#include <udis86.h>, y) +ifneq ($(strip $(UDIS86_AVAILABLE)), y) +NO_UDIS86 := 1 +endif + ifndef NO_UDIS86 # have udis86 disassembler library? -udis86-flags := $(call test-build,\#include <udis86.h>,-DHAVE_UDIS86 -ludis86) +udis86-flags := -DHAVE_UDIS86 -ludis86 udis86-ldflags := -ludis86 endif # NO_UDIS86 |