aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/subcmd
diff options
context:
space:
mode:
authorDavid Carrillo-Cisneros <davidcc@google.com>2017-08-27 00:54:40 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-08-28 16:44:46 -0300
commit3866058ef15b6ae6f4ff48e088428b46bcc43fa1 (patch)
tree821ab268db308660fd5aaf91b47103e8316df132 /tools/lib/subcmd
parenttools lib: Allow external definition of CC, AR and LD (diff)
downloadlinux-dev-3866058ef15b6ae6f4ff48e088428b46bcc43fa1.tar.xz
linux-dev-3866058ef15b6ae6f4ff48e088428b46bcc43fa1.zip
perf tools: Robustify detection of clang binary
Prior to this patch, make scripts tested for CLANG with ifeq ($(CC), clang), failing to detect CLANG binaries with different names. Fix it by testing for the existence of __clang__ macro in the list of compiler defined macros. Signed-off-by: David Carrillo-Cisneros <davidcc@google.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Paul Turner <pjt@google.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/20170827075442.108534-5-davidcc@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/subcmd')
-rw-r--r--tools/lib/subcmd/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
index 3d1c3b5b5150..7e9f03c97e4c 100644
--- a/tools/lib/subcmd/Makefile
+++ b/tools/lib/subcmd/Makefile
@@ -21,7 +21,7 @@ LIBFILE = $(OUTPUT)libsubcmd.a
CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
-ifeq ($(CC), clang)
+ifeq ($(CC_NO_CLANG), 0)
CFLAGS += -O3
else
CFLAGS += -O6