From: Zamir SUN <sztsian@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: johannes.berg@intel.com, johannes@sipsolutions.net,
linux-kernel@vger.kernel.org, zsun@redhat.com
Subject: Re: [PATCH 2/2] trace-cmd: Change the way of getting python ldflags.
Date: Fri, 23 Mar 2018 20:19:36 +0800 [thread overview]
Message-ID: <5a40a30f-c461-2734-edec-d9f3491559e7@gmail.com> (raw)
In-Reply-To: <20180322191331.48b3d9dd@gandalf.local.home>
On 03/23/2018 07:13 AM, Steven Rostedt wrote:
> On Sun, 4 Feb 2018 11:20:14 +0800
> sztsian@gmail.com wrote:
>
>> From: Zamir SUN <sztsian@gmail.com>
>>
>> Prior than this patch, Makefile detects python ldflags using a hardcoded
>> python command. It will cause problems if we are building against
>> python3 in the future when ldflags for python2 and python3 are
>> different. With this patch, python ldflags are detected by
>> corresponding python{,3}-config which will detect the right config for
>> python plugins.
>>
>> Signed-off-by: Zamir SUN (Red Hat) <sztsian@gmail.com>
>> ---
>> Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 7c0d1a6..f41e399 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -636,7 +636,7 @@ report_noswig: force
>>
>> PYTHON_INCLUDES = `pkg-config --cflags $(PYTHON_VERS)`
>> PYTHON_LDFLAGS = `pkg-config --libs $(PYTHON_VERS)` \
>> - $(shell python2 -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')")
>> + $(shell $(PYTHON_VERS)-config --ldflags)
>> PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0`
>>
>> ctracecmd.so: $(TCMD_LIB_OBJS) ctracecmd.i
>
> BTW, I did have this applied, but when testing it caused warnings. I
> had to apply this patch to fix it:
>
> -- Steve
Thanks for the info!
I am always using Fedora and Python is always preloaded so I did not
think of this scenario.
>
> From d5579b729114135da20bcee6896a0683ff54f33a Mon Sep 17 00:00:00 2001
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> Date: Thu, 22 Mar 2018 18:38:22 -0400
> Subject: [PATCH] trace-cmd build: Do not execute python scripts if there is no
> python
>
> I was triggering the following build messages when not having swig installed:
>
> make: -config: Command not found
>
> NO_PYTHON forced: swig not installed, not compiling python plugins
>
> make: -config: Command not found
> UPDATE trace_python_dir
> make: -config: Command not found
>
> This is due to the executing of $(PYTHON_VERS)-config, which would just turn
> into "-config". Do not assign the PYTHON_* variables if NO_PYTHON is
> defined.
>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> Makefile | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 2c82301..26fd42b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -373,10 +373,16 @@ report_nopythondev: force
> $(Q)echo " python-dev is not installed, not compiling python plugins"
> $(Q)echo
>
> +ifndef NO_PYTHON
> PYTHON_INCLUDES = `pkg-config --cflags $(PYTHON_VERS)`
> PYTHON_LDFLAGS = `pkg-config --libs $(PYTHON_VERS)` \
> $(shell $(PYTHON_VERS)-config --ldflags)
> PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0`
> +else
> +PYTHON_INCLUDES =
> +PYTHON_LDFLAGS =
> +PYGTK_CFLAGS =
> +endif
>
> export PYTHON_INCLUDES
> export PYTHON_LDFLAGS
>
--
Zamir SUN
Fedora user
GPG : 1D86 6D4A 49CE 4BBD 72CF FCF5 D856 6E11 F2A0 525E
next prev parent reply other threads:[~2018-03-23 12:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-04 3:20 [PATCH 0/2] trace-cmd: Improves python plugin support sztsian
2018-02-04 3:20 ` [PATCH 1/2] trace-cmd: Fix the detection for swig sztsian
2018-02-06 23:18 ` Steven Rostedt
2018-02-07 14:01 ` Zamir SUN
2018-02-07 14:40 ` Steven Rostedt
2018-02-07 15:09 ` Zamir SUN
2018-02-07 17:25 ` Vladislav Valtchev
2018-02-08 12:05 ` Zamir SUN
2018-02-08 14:04 ` Vladislav Valtchev
2018-02-04 3:20 ` [PATCH 2/2] trace-cmd: Change the way of getting python ldflags sztsian
2018-02-08 23:54 ` Steven Rostedt
2018-03-22 23:13 ` Steven Rostedt
2018-03-23 12:19 ` Zamir SUN [this message]
2018-02-06 12:31 ` [PATCH 0/2] trace-cmd: Improves python plugin support Zamir SUN
2018-02-06 14:14 ` Steven Rostedt
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=5a40a30f-c461-2734-edec-d9f3491559e7@gmail.com \
--to=sztsian@gmail.com \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=zsun@redhat.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