@@ -155,15 +155,15 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
155155
156156-include config/feature-tests.mak
157157
158- ifeq ($(call try-cc,$(SOURCE_HELLO ) ,$(CFLAGS ) -Werror -fstack-protector-all) ,y)
158+ ifeq ($(call try-cc,$(SOURCE_HELLO ) ,$(CFLAGS ) -Werror -fstack-protector-all,-fstack-protector-all ) ,y)
159159 CFLAGS := $(CFLAGS) -fstack-protector-all
160160endif
161161
162- ifeq ($(call try-cc,$(SOURCE_HELLO ) ,$(CFLAGS ) -Werror -Wstack-protector) ,y)
162+ ifeq ($(call try-cc,$(SOURCE_HELLO ) ,$(CFLAGS ) -Werror -Wstack-protector,-Wstack-protector ) ,y)
163163 CFLAGS := $(CFLAGS ) -Wstack-protector
164164endif
165165
166- ifeq ($(call try-cc,$(SOURCE_HELLO ) ,$(CFLAGS ) -Werror -Wvolatile-register-var) ,y)
166+ ifeq ($(call try-cc,$(SOURCE_HELLO ) ,$(CFLAGS ) -Werror -Wvolatile-register-var,-Wvolatile-register-var ) ,y)
167167 CFLAGS := $(CFLAGS ) -Wvolatile-register-var
168168endif
169169
@@ -172,7 +172,7 @@ endif
172172BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH ) /include -I$(OUTPUT ) util -I$(TRACE_EVENT_DIR ) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
173173BASIC_LDFLAGS =
174174
175- ifeq ($(call try-cc,$(SOURCE_BIONIC ) ,$(CFLAGS ) ) ,y)
175+ ifeq ($(call try-cc,$(SOURCE_BIONIC ) ,$(CFLAGS ) ,bionic ) ,y)
176176 BIONIC := 1
177177 EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
178178 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
@@ -426,6 +426,8 @@ LIB_OBJS += $(OUTPUT)ui/helpline.o
426426LIB_OBJS += $(OUTPUT ) ui/hist.o
427427LIB_OBJS += $(OUTPUT ) ui/stdio/hist.o
428428
429+ LIB_OBJS += $(OUTPUT ) arch/common.o
430+
429431BUILTIN_OBJS += $(OUTPUT ) builtin-annotate.o
430432BUILTIN_OBJS += $(OUTPUT ) builtin-bench.o
431433# Benchmark modules
@@ -477,9 +479,9 @@ ifdef NO_LIBELF
477479 NO_LIBUNWIND := 1
478480else
479481FLAGS_LIBELF =$(ALL_CFLAGS ) $(ALL_LDFLAGS ) $(EXTLIBS )
480- ifneq ($(call try-cc,$(SOURCE_LIBELF ) ,$(FLAGS_LIBELF ) ) ,y)
482+ ifneq ($(call try-cc,$(SOURCE_LIBELF ) ,$(FLAGS_LIBELF ) ,libelf ) ,y)
481483 FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
482- ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y)
484+ ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc ),y)
483485 LIBC_SUPPORT := 1
484486 endif
485487 ifeq ($(BIONIC),1)
@@ -494,7 +496,7 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y)
494496 endif
495497else
496498 FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
497- ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
499+ ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw ),y)
498500 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);
499501 NO_DWARF := 1
500502 endif # Dwarf support
@@ -510,7 +512,7 @@ ifdef LIBUNWIND_DIR
510512endif
511513
512514FLAGS_UNWIND =$(LIBUNWIND_CFLAGS ) $(ALL_CFLAGS ) $(LIBUNWIND_LDFLAGS ) $(ALL_LDFLAGS ) $(EXTLIBS ) $(LIBUNWIND_LIBS )
513- ifneq ($(call try-cc,$(SOURCE_LIBUNWIND ) ,$(FLAGS_UNWIND ) ) ,y)
515+ ifneq ($(call try-cc,$(SOURCE_LIBUNWIND ) ,$(FLAGS_UNWIND ) ,libunwind ) ,y)
514516 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
515517 NO_LIBUNWIND := 1
516518endif # Libunwind support
@@ -539,7 +541,7 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
539541else # NO_LIBELF
540542BASIC_CFLAGS += -DLIBELF_SUPPORT
541543
542- ifeq ($(call try-cc,$(SOURCE_ELF_MMAP ) ,$(FLAGS_COMMON ) ) ,y)
544+ ifeq ($(call try-cc,$(SOURCE_ELF_MMAP ) ,$(FLAGS_COMMON ) ,-DLIBELF_MMAP ) ,y)
543545 BASIC_CFLAGS += -DLIBELF_MMAP
544546endif
545547
@@ -565,7 +567,7 @@ endif
565567
566568ifndef NO_LIBAUDIT
567569 FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit
568- ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT)),y)
570+ ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit ),y)
569571 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
570572 else
571573 BASIC_CFLAGS += -DLIBAUDIT_SUPPORT
@@ -576,7 +578,7 @@ endif
576578
577579ifndef NO_NEWT
578580 FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt
579- ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y)
581+ ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt ),y)
580582 msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev);
581583 else
582584 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
@@ -605,10 +607,10 @@ endif
605607
606608ifndef NO_GTK2
607609 FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
608- ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y)
610+ ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2 ),y)
609611 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
610612 else
611- ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2)),y)
613+ ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR ),y)
612614 BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR
613615 endif
614616 BASIC_CFLAGS += -DGTK2_SUPPORT
635637 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
636638 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
637639
638- ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)
640+ ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl ),y)
639641 BASIC_CFLAGS += -DNO_LIBPERL
640642 else
641643 ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS )
@@ -689,11 +691,11 @@ else
689691 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ ) --cflags 2>/dev/null)
690692 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS ) $(PYTHON_EMBED_LDOPTS )
691693
692- ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
694+ ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python ),y)
693695 $(call disable-python,Python.h (for Python 2.x))
694696 else
695697
696- ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED)),y)
698+ ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version ),y)
697699 $(warning Python 3 is not yet supported; please set)
698700 $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
699701 $(warning If you also have Python 2 installed, then)
@@ -727,22 +729,22 @@ else
727729 BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
728730 else
729731 FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
730- has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD))
732+ has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd )
731733 ifeq ($(has_bfd),y)
732734 EXTLIBS += -lbfd
733735 else
734736 FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
735- has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY))
737+ has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty )
736738 ifeq ($(has_bfd_iberty),y)
737739 EXTLIBS += -lbfd -liberty
738740 else
739741 FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
740- has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z))
742+ has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz )
741743 ifeq ($(has_bfd_iberty_z),y)
742744 EXTLIBS += -lbfd -liberty -lz
743745 else
744746 FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty
745- has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE))
747+ has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle )
746748 ifeq ($(has_cplus_demangle),y)
747749 EXTLIBS += -liberty
748750 BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
@@ -764,19 +766,19 @@ ifeq ($(NO_PERF_REGS),0)
764766endif
765767
766768ifndef NO_STRLCPY
767- ifeq ($(call try-cc,$(SOURCE_STRLCPY),),y)
769+ ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY ),y)
768770 BASIC_CFLAGS += -DHAVE_STRLCPY
769771 endif
770772endif
771773
772774ifndef NO_ON_EXIT
773- ifeq ($(call try-cc,$(SOURCE_ON_EXIT),),y)
775+ ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT ),y)
774776 BASIC_CFLAGS += -DHAVE_ON_EXIT
775777 endif
776778endif
777779
778780ifndef NO_BACKTRACE
779- ifeq ($(call try-cc,$(SOURCE_BACKTRACE),),y)
781+ ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT ),y)
780782 BASIC_CFLAGS += -DBACKTRACE_SUPPORT
781783 endif
782784endif
@@ -1039,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir)
10391041endif
10401042perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir ) )
10411043
1042- install : all
1044+ install : all try-install-man
10431045 $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(bindir_SQ)'
10441046 $(INSTALL ) $(OUTPUT ) perf ' $(DESTDIR_SQ)$(bindir_SQ)'
10451047 $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
@@ -1065,6 +1067,9 @@ install-doc:
10651067install-man :
10661068 $(MAKE ) -C Documentation install-man
10671069
1070+ try-install-man :
1071+ $(MAKE ) -C Documentation try-install-man
1072+
10681073install-html :
10691074 $(MAKE ) -C Documentation install-html
10701075
0 commit comments