ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] Using host's programs when building packages


From: Philippe Normand
Subject: [Ltib] Using host's programs when building packages
Date: Wed, 02 Apr 2008 18:39:23 +0200

Hi again!

I'm now building PyGobject. During the build a program is compiled and
executed to generate a Python file:

gcc -g -O2 -Wall -fno-strict-aliasing -std=c9x -o generate-constants
generate_constants-generate-constants.o   
arm-none-linux-gnueabi-gcc
-B /home/phil/mx31/ltib-imx31ads-20071008/rootfs/usr/lib//
-idirafter /home/phil/mx31/ltib-imx31ads-20071008/rootfs/usr/include
-iwithprefix include
-Wl,-rpath-link,/home/phil/mx31/ltib-imx31ads-20071008/rootfs/lib:/home/phil/mx31/ltib-imx31ads-20071008/rootfs/usr/lib
 -O2 -fsigned-char -msoft-float -g -O2 -Wall -fno-strict-aliasing -std=c9x -o 
generate-constants generate_constants-generate-constants.o
rm -f constants.py
cp ./constants.py.in constants.py
chmod 644 constants.py
../gobject/generate-constants >> constants.py
/bin/sh: ../gobject/generate-constants: cannot execute binary file
make[2]: *** [constants.py] Error 126
make[2]: Leaving directory
`/home/phil/mx31/ltib-imx31ads-20071008/rpm/BUILD/pygobject-2.14.1/gobject'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/phil/mx31/ltib-imx31ads-20071008/rpm/BUILD/pygobject-2.14.1'
make: *** [all] Error 2
error: Bad exit status
from /home/phil/mx31/ltib-imx31ads-20071008/tmp/rpm-tmp.55427 (%build)


Problem is that the program is compiled by the gcc for arm, so it can't
run on my build machine. Is there a way to avoid the spoofing stuff so
that /usr/bin/gcc is not spoofed for a specific step of the build?

One solution could be to manually compile the program to execute for the
build machine, generate the python file (constants.py), keep it in a
corner and during the real build, somehow copy it at the right place...
But I find that a bit too painful :/

Here is the spec file I wrote:

%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : GObject python bindings
Name            : pygobject
Version         : 2.14.1
Release         : 1
License         : LGPL
Vendor          : Freescale
Packager        : Philippe Normand
Group           : Development/Languages
Source          : %{name}-%{version}.tar.gz
BuildRoot       : %{_tmppath}/%{name}
Prefix          : %{pfx}

%Description
%{summary}

%Prep
%setup 

%Build
#python2.4 setup.py build --build-base=%{_build}
PYTHON=python2.4 ./configure --prefix=%{_prefix} --host=$CFGHOST
--build=%{_build}
make

%Install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}
#python2.4 setup.py install --root=$RPM_BUILD_ROOT/%{pfx}

%Clean
rm -rf $RPM_BUILD_ROOT
#python2.4 setup.py clean

%Files
%defattr(-,root,root)
%{pfx}/*


Philippe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]