mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Wang Nan <wangnan0@huawei.com>
Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org,
	Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] perf build: Remove all condition feature check {C,LD}FLAGS
Date: Fri, 29 Jan 2016 12:01:43 -0300	[thread overview]
Message-ID: <20160129150143.GD17165@kernel.org> (raw)
In-Reply-To: <1454047050-204993-1-git-send-email-wangnan0@huawei.com>

Em Fri, Jan 29, 2016 at 05:57:30AM +0000, Wang Nan escreveu:
> 'make feature-dump' should give a stable result, so even 'NO_SOMETHING=1'
> is given (for babeltrace, if LIBBABELTRACE=1 is not given), we should
> try to detect those feature and {C,LD}FLAGS. Build or not should be
> controled independent.

Testing it now.

- Arnaldo
 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Li Zefan <lizefan@huawei.com>
> ---
>  tools/perf/config/Makefile | 101 +++++++++++++++++++++------------------------
>  1 file changed, 47 insertions(+), 54 deletions(-)
> 
> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> index 511141b..0045a5d 100644
> --- a/tools/perf/config/Makefile
> +++ b/tools/perf/config/Makefile
> @@ -61,50 +61,45 @@ endif
>  
>  ifeq ($(LIBUNWIND_LIBS),)
>    NO_LIBUNWIND := 1
> -else
> -  #
> -  # For linking with debug library, run like:
> -  #
> -  #   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
> -  #
> -  ifdef LIBUNWIND_DIR
> -    LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
> -    LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
> -  endif
> -  LIBUNWIND_LDFLAGS += $(LIBUNWIND_LIBS)
> -
> -  # Set per-feature check compilation flags
> -  FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
> -  FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS)
> -  FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
> -  FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS)
>  endif
> +#
> +# For linking with debug library, run like:
> +#
> +#   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
> +#
> +ifdef LIBUNWIND_DIR
> +  LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
> +  LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
> +endif
> +LIBUNWIND_LDFLAGS += $(LIBUNWIND_LIBS)
> +
> +# Set per-feature check compilation flags
> +FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
> +FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS)
> +FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
> +FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS)
>  
>  ifeq ($(NO_PERF_REGS),0)
>    CFLAGS += -DHAVE_PERF_REGS_SUPPORT
>  endif
>  
> -ifndef NO_LIBELF
> -  # for linking with debug library, run like:
> -  # make DEBUG=1 LIBDW_DIR=/opt/libdw/
> -  ifdef LIBDW_DIR
> -    LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
> -    LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
> -  endif
> -  FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
> -  FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
> +# for linking with debug library, run like:
> +# make DEBUG=1 LIBDW_DIR=/opt/libdw/
> +ifdef LIBDW_DIR
> +  LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
> +  LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
>  endif
> +FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
> +FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
>  
> -ifdef LIBBABELTRACE
> -  # for linking with debug library, run like:
> -  # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
> -  ifdef LIBBABELTRACE_DIR
> -    LIBBABELTRACE_CFLAGS  := -I$(LIBBABELTRACE_DIR)/include
> -    LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
> -  endif
> -  FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
> -  FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
> +# for linking with debug library, run like:
> +# make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
> +ifdef LIBBABELTRACE_DIR
> +  LIBBABELTRACE_CFLAGS  := -I$(LIBBABELTRACE_DIR)/include
> +  LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
>  endif
> +FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
> +FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
>  
>  FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
>  # include ARCH specific config
> @@ -145,28 +140,26 @@ ifdef PARSER_DEBUG
>    $(call detected_var,PARSER_DEBUG_FLEX)
>  endif
>  
> -ifndef NO_LIBPYTHON
> -  # Try different combinations to accommodate systems that only have
> -  # python[2][-config] in weird combinations but always preferring
> -  # python2 and python2-config as per pep-0394. If we catch a
> -  # python[-config] in version 3, the version check will kill it.
> -  PYTHON2 := $(if $(call get-executable,python2),python2,python)
> -  override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
> -  PYTHON2_CONFIG := \
> -    $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
> -  override PYTHON_CONFIG := \
> -    $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
> +# Try different combinations to accommodate systems that only have
> +# python[2][-config] in weird combinations but always preferring
> +# python2 and python2-config as per pep-0394. If we catch a
> +# python[-config] in version 3, the version check will kill it.
> +PYTHON2 := $(if $(call get-executable,python2),python2,python)
> +override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
> +PYTHON2_CONFIG := \
> +  $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
> +override PYTHON_CONFIG := \
> +  $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
>  
> -  PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
> +PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
>  
> -  PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
> -  PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
> +PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
> +PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
>  
> -  FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
> -  FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
> -  FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
> -  FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
> -endif
> +FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
> +FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
> +FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
> +FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
>  
>  CFLAGS += -fno-omit-frame-pointer
>  CFLAGS += -ggdb3
> -- 
> 1.8.3.4

  reply	other threads:[~2016-01-29 15:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  5:57 Wang Nan
2016-01-29 15:01 ` Arnaldo Carvalho de Melo [this message]
2016-02-03 10:16 ` [tip:perf/core] perf build: Remove all condition feature check {C ,LD}FLAGS tip-bot for Wang Nan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160129150143.GD17165@kernel.org \
    --to=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome