[PATCH] scripts: pylibfdt: add a new include path

Tom Rini trini at konsulko.com
Wed Oct 13 15:12:10 CEST 2021


On Wed, Oct 13, 2021 at 05:39:52PM +0800, Peng Fan (OSS) wrote:

> From: Peng Fan <peng.fan at nxp.com>
> 
> Opensuse python headers are under:
> =>ls /usr/include/python
> python@      python2.7/   python3.6m/  python3.8/   python3.9/
> 
> So add '-I/usr/include/python' to fix build on Opensuse Host.
> It should not hurt with other Host
> 
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>  scripts/dtc/pylibfdt/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile
> index 493995e303..698790a1a0 100644
> --- a/scripts/dtc/pylibfdt/Makefile
> +++ b/scripts/dtc/pylibfdt/Makefile
> @@ -18,7 +18,7 @@ quiet_cmd_pymod = PYMOD   $@
>  		CC="$(HOSTCC)" LDSHARED="$(HOSTCC) -shared " \
>  		LDFLAGS="$(HOSTLDFLAGS)" \
>  		VERSION="u-boot-$(UBOOTVERSION)" \
> -		CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \
> +		CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir) -I/usr/include/python" OBJDIR=$(obj) \
>  		SOURCES="$(PYLIBFDT_srcs)" \
>  		SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \
>  		$(PYTHON3) $< --quiet build_ext --inplace

We should probably, somewhere, be using something like "pkg-config
--cflags python3" to find out where to include.  Hard-coded /usr paths
are bad for environments like OpenEmbedded and generally non-portable.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20211013/b7aa026d/attachment.sig>


More information about the U-Boot mailing list