diff options
| author | Jiri Olsa <jolsa@redhat.com> | 2013-03-21 06:41:05 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-05-30 09:31:42 -0400 |
| commit | 1e9f7aad3f5ed32e82bb6dea7afccbdb607c2ea3 (patch) | |
| tree | 5a3748e9536f0f7855767340558e54a6a22a3906 /tools/perf | |
| parent | 9c12cf95b32a099ac92ef0e9d138acb4bef984be (diff) | |
perf tools: Merge all *LDFLAGS* make variable into LDFLAGS
Merging all *LDFLAGS* make variable into LDFLAGS to eliminate all
special *LDFLAGS* variables and make the setup clear.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1369398928-9809-20-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/Makefile | 6 | ||||
| -rw-r--r-- | tools/perf/config/Makefile | 41 |
2 files changed, 25 insertions, 22 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 58275f2b566e..1a3557c09098 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -513,8 +513,6 @@ endif | |||
| 513 | 513 | ||
| 514 | LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group | 514 | LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group |
| 515 | 515 | ||
| 516 | ALL_LDFLAGS += $(BASIC_LDFLAGS) | ||
| 517 | |||
| 518 | export INSTALL SHELL_PATH | 516 | export INSTALL SHELL_PATH |
| 519 | 517 | ||
| 520 | ### Build rules | 518 | ### Build rules |
| @@ -537,7 +535,7 @@ $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS | |||
| 537 | $(CFLAGS) -c $(filter %.c,$^) -o $@ | 535 | $(CFLAGS) -c $(filter %.c,$^) -o $@ |
| 538 | 536 | ||
| 539 | $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) | 537 | $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) |
| 540 | $(QUIET_LINK)$(CC) $(CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \ | 538 | $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \ |
| 541 | $(BUILTIN_OBJS) $(LIBS) -o $@ | 539 | $(BUILTIN_OBJS) $(LIBS) -o $@ |
| 542 | 540 | ||
| 543 | $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS | 541 | $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS |
| @@ -642,7 +640,7 @@ $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Uti | |||
| 642 | $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< | 640 | $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< |
| 643 | 641 | ||
| 644 | $(OUTPUT)perf-%: %.o $(PERFLIBS) | 642 | $(OUTPUT)perf-%: %.o $(PERFLIBS) |
| 645 | $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) | 643 | $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS) |
| 646 | 644 | ||
| 647 | $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) | 645 | $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) |
| 648 | $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) | 646 | $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index a53d2b37831a..c6e49022d78b 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
| @@ -71,7 +71,6 @@ CFLAGS += \ | |||
| 71 | -std=gnu99 | 71 | -std=gnu99 |
| 72 | 72 | ||
| 73 | EXTLIBS = -lpthread -lrt -lelf -lm | 73 | EXTLIBS = -lpthread -lrt -lelf -lm |
| 74 | ALL_LDFLAGS = $(LDFLAGS) | ||
| 75 | 74 | ||
| 76 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) | 75 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) |
| 77 | CFLAGS += -fstack-protector-all | 76 | CFLAGS += -fstack-protector-all |
| @@ -107,8 +106,6 @@ CFLAGS += \ | |||
| 107 | -I../lib/ \ | 106 | -I../lib/ \ |
| 108 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | 107 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
| 109 | 108 | ||
| 110 | BASIC_LDFLAGS = | ||
| 111 | |||
| 112 | ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) | 109 | ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) |
| 113 | BIONIC := 1 | 110 | BIONIC := 1 |
| 114 | EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) | 111 | EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) |
| @@ -120,9 +117,9 @@ ifdef NO_LIBELF | |||
| 120 | NO_DEMANGLE := 1 | 117 | NO_DEMANGLE := 1 |
| 121 | NO_LIBUNWIND := 1 | 118 | NO_LIBUNWIND := 1 |
| 122 | else | 119 | else |
| 123 | FLAGS_LIBELF=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | 120 | FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) |
| 124 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) | 121 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) |
| 125 | FLAGS_GLIBC=$(CFLAGS) $(ALL_LDFLAGS) | 122 | FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS) |
| 126 | ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) | 123 | ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) |
| 127 | LIBC_SUPPORT := 1 | 124 | LIBC_SUPPORT := 1 |
| 128 | endif | 125 | endif |
| @@ -146,7 +143,7 @@ else | |||
| 146 | LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib | 143 | LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib |
| 147 | endif | 144 | endif |
| 148 | 145 | ||
| 149 | FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | 146 | FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS) |
| 150 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) | 147 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) |
| 151 | msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev); | 148 | msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev); |
| 152 | NO_DWARF := 1 | 149 | NO_DWARF := 1 |
| @@ -156,7 +153,7 @@ endif # NO_LIBELF | |||
| 156 | 153 | ||
| 157 | ifndef NO_LIBELF | 154 | ifndef NO_LIBELF |
| 158 | CFLAGS += -DLIBELF_SUPPORT | 155 | CFLAGS += -DLIBELF_SUPPORT |
| 159 | FLAGS_LIBELF=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | 156 | FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) |
| 160 | ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) | 157 | ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) |
| 161 | CFLAGS += -DLIBELF_MMAP | 158 | CFLAGS += -DLIBELF_MMAP |
| 162 | endif | 159 | endif |
| @@ -170,13 +167,21 @@ ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | |||
| 170 | NO_DWARF := 1 | 167 | NO_DWARF := 1 |
| 171 | else | 168 | else |
| 172 | CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS) | 169 | CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS) |
| 173 | BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS) | 170 | LDFLAGS += $(LIBDW_LDFLAGS) |
| 174 | EXTLIBS += -lelf -ldw | 171 | EXTLIBS += -lelf -ldw |
| 175 | endif # PERF_HAVE_DWARF_REGS | 172 | endif # PERF_HAVE_DWARF_REGS |
| 176 | endif # NO_DWARF | 173 | endif # NO_DWARF |
| 177 | 174 | ||
| 178 | endif # NO_LIBELF | 175 | endif # NO_LIBELF |
| 179 | 176 | ||
| 177 | ifndef NO_LIBELF | ||
| 178 | CFLAGS += -DLIBELF_SUPPORT | ||
| 179 | FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) | ||
| 180 | ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) | ||
| 181 | CFLAGS += -DLIBELF_MMAP | ||
| 182 | endif # try-cc | ||
| 183 | endif # NO_LIBELF | ||
| 184 | |||
| 180 | # There's only x86 (both 32 and 64) support for CFI unwind so far | 185 | # There's only x86 (both 32 and 64) support for CFI unwind so far |
| 181 | ifneq ($(ARCH),x86) | 186 | ifneq ($(ARCH),x86) |
| 182 | NO_LIBUNWIND := 1 | 187 | NO_LIBUNWIND := 1 |
| @@ -190,7 +195,7 @@ ifdef LIBUNWIND_DIR | |||
| 190 | LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib | 195 | LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib |
| 191 | endif | 196 | endif |
| 192 | 197 | ||
| 193 | FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) | 198 | FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) |
| 194 | ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) | 199 | ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) |
| 195 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); | 200 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); |
| 196 | NO_LIBUNWIND := 1 | 201 | NO_LIBUNWIND := 1 |
| @@ -201,11 +206,11 @@ ifndef NO_LIBUNWIND | |||
| 201 | CFLAGS += -DLIBUNWIND_SUPPORT | 206 | CFLAGS += -DLIBUNWIND_SUPPORT |
| 202 | EXTLIBS += $(LIBUNWIND_LIBS) | 207 | EXTLIBS += $(LIBUNWIND_LIBS) |
| 203 | CFLAGS += $(LIBUNWIND_CFLAGS) | 208 | CFLAGS += $(LIBUNWIND_CFLAGS) |
| 204 | BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS) | 209 | LDFLAGS += $(LIBUNWIND_LDFLAGS) |
| 205 | endif # NO_LIBUNWIND | 210 | endif # NO_LIBUNWIND |
| 206 | 211 | ||
| 207 | ifndef NO_LIBAUDIT | 212 | ifndef NO_LIBAUDIT |
| 208 | FLAGS_LIBAUDIT = $(CFLAGS) $(ALL_LDFLAGS) -laudit | 213 | FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit |
| 209 | ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) | 214 | ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) |
| 210 | msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); | 215 | msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); |
| 211 | NO_LIBAUDIT := 1 | 216 | NO_LIBAUDIT := 1 |
| @@ -220,7 +225,7 @@ ifdef NO_NEWT | |||
| 220 | endif | 225 | endif |
| 221 | 226 | ||
| 222 | ifndef NO_SLANG | 227 | ifndef NO_SLANG |
| 223 | FLAGS_SLANG=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang | 228 | FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang |
| 224 | ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y) | 229 | ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y) |
| 225 | msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev); | 230 | msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev); |
| 226 | NO_SLANG := 1 | 231 | NO_SLANG := 1 |
| @@ -233,7 +238,7 @@ ifndef NO_SLANG | |||
| 233 | endif | 238 | endif |
| 234 | 239 | ||
| 235 | ifndef NO_GTK2 | 240 | ifndef NO_GTK2 |
| 236 | FLAGS_GTK2=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) | 241 | FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
| 237 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) | 242 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) |
| 238 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); | 243 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); |
| 239 | NO_GTK2 := 1 | 244 | NO_GTK2 := 1 |
| @@ -263,7 +268,7 @@ else | |||
| 263 | CFLAGS += -DNO_LIBPERL | 268 | CFLAGS += -DNO_LIBPERL |
| 264 | NO_LIBPERL := 1 | 269 | NO_LIBPERL := 1 |
| 265 | else | 270 | else |
| 266 | ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS) | 271 | LDFLAGS += $(PERL_EMBED_LDFLAGS) |
| 267 | EXTLIBS += $(PERL_EMBED_LIBADD) | 272 | EXTLIBS += $(PERL_EMBED_LIBADD) |
| 268 | endif | 273 | endif |
| 269 | endif | 274 | endif |
| @@ -322,7 +327,7 @@ else | |||
| 322 | $(warning $(and ,)) | 327 | $(warning $(and ,)) |
| 323 | $(error $(and ,)) | 328 | $(error $(and ,)) |
| 324 | else | 329 | else |
| 325 | ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS) | 330 | LDFLAGS += $(PYTHON_EMBED_LDFLAGS) |
| 326 | EXTLIBS += $(PYTHON_EMBED_LIBADD) | 331 | EXTLIBS += $(PYTHON_EMBED_LIBADD) |
| 327 | LANG_BINDINGS += $(OUTPUT)python/perf.so | 332 | LANG_BINDINGS += $(OUTPUT)python/perf.so |
| 328 | endif | 333 | endif |
| @@ -338,7 +343,7 @@ else | |||
| 338 | EXTLIBS += -liberty | 343 | EXTLIBS += -liberty |
| 339 | CFLAGS += -DHAVE_CPLUS_DEMANGLE | 344 | CFLAGS += -DHAVE_CPLUS_DEMANGLE |
| 340 | else | 345 | else |
| 341 | FLAGS_BFD=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd | 346 | FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd |
| 342 | has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) | 347 | has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) |
| 343 | ifeq ($(has_bfd),y) | 348 | ifeq ($(has_bfd),y) |
| 344 | EXTLIBS += -lbfd | 349 | EXTLIBS += -lbfd |
| @@ -353,7 +358,7 @@ else | |||
| 353 | ifeq ($(has_bfd_iberty_z),y) | 358 | ifeq ($(has_bfd_iberty_z),y) |
| 354 | EXTLIBS += -lbfd -liberty -lz | 359 | EXTLIBS += -lbfd -liberty -lz |
| 355 | else | 360 | else |
| 356 | FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty | 361 | FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty |
| 357 | has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle) | 362 | has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle) |
| 358 | ifeq ($(has_cplus_demangle),y) | 363 | ifeq ($(has_cplus_demangle),y) |
| 359 | EXTLIBS += -liberty | 364 | EXTLIBS += -liberty |
| @@ -387,7 +392,7 @@ ifndef NO_BACKTRACE | |||
| 387 | endif | 392 | endif |
| 388 | 393 | ||
| 389 | ifndef NO_LIBNUMA | 394 | ifndef NO_LIBNUMA |
| 390 | FLAGS_LIBNUMA = $(CFLAGS) $(ALL_LDFLAGS) -lnuma | 395 | FLAGS_LIBNUMA = $(CFLAGS) $(LDFLAGS) -lnuma |
| 391 | ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y) | 396 | ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y) |
| 392 | msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev); | 397 | msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev); |
| 393 | NO_LIBNUMA := 1 | 398 | NO_LIBNUMA := 1 |
