Am 28.02.2011 um 20:01 schrieb Michael Olbrich: > On Wed, Feb 23, 2011 at 04:44:32PM +0100, [email protected] wrote: >> From: Daniel Kriesten <[email protected]> >> >> This patch extends the setup.py call to reflect CC and LDSHARED for >> crosscompiling the python bindings > > Please elaborate why this patch is needed. As far as I can tell the python > bindings are built with the cross compiler.
On my host machine it's not. AFAIR 'setup.py build_ext' gets the compiler from CC and the "shared linker" is taken from LDSHARED. The -shared get lost if LDSHARED is overwritten (linking is done by '<your-compiler-prefix>-gcc -shared') so the shared flag has to be placed in CFLAGS (Ok, may be one could also pass it in LDSHARED. I needed the python bindings on a ppc target and figured out it was build using hosts gcc. Diving deeper in the pythons distutils package I assumend using these flags is the intended way? > > Michael > >> Signed-off-by: Daniel Kriesten <[email protected]> >> --- >> ...d-2.39-fixup-setuppy-call-for-crosscompile.diff | 26 >> ++++++++++++++++++++ >> patches/gpsd-2.39/series | 1 + >> 2 files changed, 27 insertions(+), 0 deletions(-) >> >> diff --git >> a/patches/gpsd-2.39/gpsd-2.39-fixup-setuppy-call-for-crosscompile.diff >> b/patches/gpsd-2.39/gpsd-2.39-fixup-setuppy-call-for-crosscompile.diff >> new file mode 100644 >> index 0000000..55b0ecf >> --- /dev/null >> +++ b/patches/gpsd-2.39/gpsd-2.39-fixup-setuppy-call-for-crosscompile.diff >> @@ -0,0 +1,26 @@ >> +From 7c495258be3d8b16f75ee8a2b79693629bc3c671 Mon Sep 17 00:00:00 2001 >> +From: Daniel Kriesten <[email protected]> >> +Date: Mon, 21 Feb 2011 16:46:19 +0100 >> +Subject: [PATCH] fixup setup.py call for crosscompile >> + >> +Signed-off-by: Daniel Kriesten <[email protected]> >> +--- >> + Makefile.am | 2 +- >> + 1 files changed, 1 insertions(+), 1 deletions(-) >> + >> +diff --git a/Makefile.am b/Makefile.am >> +index 818c57a..2353f7b 100644 >> +--- a/Makefile.am >> ++++ b/Makefile.am >> +@@ -189,7 +189,7 @@ noinst_SCRIPTS = gpspacket.so gpslib.so setup.py >> + >> + .PHONY: build_python_ext >> + build_python_ext: gpspacket.c gpslib.c libgps.la >> +- (pwd="`pwd`"; cd $(srcdir) && $(PYTHON) setup.py build_ext --build-lib >> "$$pwd" --build-temp "$$pwd/build" --include-dirs "$$pwd") >> ++ (pwd="`pwd`"; cd $(srcdir) && CC=$(CC) LDSHARED=$(CC) CFLAGS=-shared >> $(PYTHON) setup.py build_ext --build-lib "$$pwd" --build-temp "$$pwd/build" >> --include-dirs "$(PTXDIST_SYSROOT_TARGET)/usr/include:$$pwd" --library-dirs >> "$(PTXDIST_SYSROOT_TARGET)/usr/lib") >> + >> + gpspacket.so: build_python_ext >> + gpslib.so: build_python_ext >> +-- >> +1.7.3.4 >> + >> diff --git a/patches/gpsd-2.39/series b/patches/gpsd-2.39/series >> index 0340e8d..5c60535 100644 >> --- a/patches/gpsd-2.39/series >> +++ b/patches/gpsd-2.39/series >> @@ -4,3 +4,4 @@ gpsd-2.39-fix_build_error.diff >> gpsd-2.39-fix-autotool-bug.diff >> gpsd-2.39-configure_ac-fix-python.diff >> gpsd-2.39-fixup-parallel-build-for-python.diff >> +gpsd-2.39-fixup-setuppy-call-for-crosscompile.diff >> -- >> 1.7.3.4 >> >> >> -- >> ptxdist mailing list >> [email protected] >> > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > > -- > ptxdist mailing list > [email protected] > Regards Daniel -- Daniel Kriesten Chair for Circuit and System Design Chemnitz University of Technology, Reichenhainer Str. 70, D-09126 Chemnitz Phone: +49 371 531-33158, Fax: +49 371 531-833158 http://www.tu-chemnitz.de/etit/sse -- ptxdist mailing list [email protected]
