Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Raeman <draeman@bbn.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] host-python: Find headers provided by -isystem flag in CPPFLAGS
Date: Fri, 29 Jul 2016 00:18:33 -0400	[thread overview]
Message-ID: <20160729041833.27902-1-draeman@bbn.com> (raw)
In-Reply-To: <20160728220029.GI5862@free.fr>

The Python setup.py logic will enable and disable modules for compilation
based on which libraries it believes are available.  The logic in this
script parses certain arguments out of CPPFLAGS to determine search
directories, and then it checks for existence of various system libaries
and headers within those search directories.

This patch will allow the logic to consider include directories that
are specified using the -isystem flag.  The default logic only considers
include directories specified using the -I flag.

Signed-off-by: David Raeman <draeman@bbn.com>
---
 package/python/116-search-isystem-inc.patch | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/python/116-search-isystem-inc.patch

diff --git a/package/python/116-search-isystem-inc.patch b/package/python/116-search-isystem-inc.patch
new file mode 100644
index 0000000..af0c788
--- /dev/null
+++ b/package/python/116-search-isystem-inc.patch
@@ -0,0 +1,24 @@
+Allow Python to find system header files in locations specified with
+flag -isystem in addition to the default behavior of searching -I.
+
+These directories are not used for complication, but are used to
+perform existence-checks for library header files so that Python
+can determine which modules should be built for the system.
+
+Signed-off-by: David Raeman <draeman@bbn.com>
+
+Index: b/setup.py
+===================================================================
+--- a/setup.py	2016-07-28 23:46:37.574969153 -0400
++++ b/setup.py	2016-07-29 00:01:02.928906258 -0400
+@@ -478,6 +478,10 @@
+                 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+             env_val = sysconfig.get_config_var(env_var)
+             if env_val:
++                # For the purpose of finding search directories, treat the
++                # -isystem flag as if it were a -I flag.
++                env_val = re.sub(r'(?i)(^|\s+)-isystem\s*', ' -I', env_val)
++
+                 # To prevent optparse from raising an exception about any
+                 # options in env_val that it doesn't know about we strip out
+                 # all double dashes and any dashes followed by a character
-- 
2.9.2

  parent reply	other threads:[~2016-07-29  4:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 19:52 [Buildroot] [PATCH 1/2] package/Makefile.in should grab HOST_DIR headers using -isystem instead of -I David Raeman
2016-07-25 19:52 ` [Buildroot] [PATCH 2/2] host-dtc: Install libftd and associated header files David Raeman
2016-07-25 20:01   ` Thomas Petazzoni
2016-07-25 20:26     ` David Raeman
2016-07-25 21:39       ` Yann E. MORIN
2016-07-25 21:52 ` [Buildroot] [PATCH 1/2] package/Makefile.in should grab HOST_DIR headers using -isystem instead of -I Yann E. MORIN
2016-07-25 21:57 ` Thomas Petazzoni
2016-07-28 22:00 ` Yann E. MORIN
2016-07-28 22:04   ` Khem Raj
2016-07-29  7:32     ` Thomas Petazzoni
2016-07-29  8:16       ` Khem Raj
2016-07-29  9:23         ` Thomas Petazzoni
2016-07-29 15:08           ` Khem Raj
2016-07-29 19:35             ` David Raeman
2016-07-29 21:15               ` Yann E. MORIN
2016-07-30 14:57                 ` David Raeman
2016-08-05  4:32                   ` Khem Raj
2016-08-05  4:30               ` Khem Raj
2016-08-02 21:39     ` Thomas Petazzoni
2016-07-29  0:09   ` David Raeman
2016-07-29  4:18   ` David Raeman [this message]
2016-08-01 21:59 ` Yann E. MORIN
2016-08-01 22:19   ` Yann E. MORIN
2016-08-02 12:21   ` David Raeman

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=20160729041833.27902-1-draeman@bbn.com \
    --to=draeman@bbn.com \
    --cc=buildroot@busybox.net \
    /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