Samba4.4.5 cross compilation for PowerPC

Uri Simchoni uri at samba.org
Thu Jan 26 06:14:56 UTC 2017


On 01/25/2017 03:24 AM, shivappa Sangapur wrote:
> Uri, could you please help me over this to resolve python issue....
> 
> 
> 
> --
> View this message in context: http://samba.2283325.n4.nabble.com/Samba4-4-5-cross-compilation-for-PowerPC-tp4710972p4713927.html
> Sent from the Samba - samba-technical mailing list archive at Nabble.com.
> 
PYTHON_CONFIG should point to a *program*. That program, when run with
"--includes" switch must emit the Python-extra include directories.

python-config supports other switches, but currently --include is all we
need that program to support.

The problem is that Python 2.x's python-config doesn't support cross
compilation. It's a python program that would run perfectly on the
target machine but we want it to run on the build machine.

What I did (based on https://buildroot.org/) was to ditch Python2's
pkg-config altogether and point PYTHON_CONFIG to a different program,
incidentally, one that it a patched version of Python3's python-config
(which, maybe, also doesn't fully support cross-compilation, but is
easier to fix).

Having taken a fresh look at the problem, I think we can leverage
pkg-config. The following example assumes you built Python with a /usr
prefix and installed it in /build-rootdir:

===========
#!/bin/bash

for ARG in "$@"
do
    case "$ARG" in
        --includes)
            PKG_CONFIG_PATH=/build-rootdir/usr/lib/pkgconfig \
            PKG_CONFIG_SYSROOT_DIR=/build-rootdir \
            pkg-config --cflags python
	;;
    esac
done
===========

This correctly emits "-I/build-rootdir/usr/include/python2.7"

...or, you can simply hack a program that just prints
"-I/build-rootdir/usr/include/python2.7" when you give it the --includes
command line...

Once you have a program that emits the right -I directive, point
PYTHON_CONFIG to it.

...or, you can look at the no-Python patches that circle around the
mailing list - if you don't need an AD-DC you can get by without Python.

I hope that helps,
Uri.




More information about the samba-technical mailing list