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

Re: How to handle cross compiling source packages?



On Thu, Mar 30, 2006 at 11:05:49AM +0400, Nikita V. Youshchenko wrote:
> Btw, maybe better to move discussion to debian-embedded@.

Okay, done.

> As for now, dpkg-cross goal is to cross-compile debian packages without any 
> modification. For example, to build foo_0.1_arm.deb on x86. Note that it 
> is a native arm package, *not* a package with arm libs to install on x86 
> for cross-compiling. To get the later, dpkg-cross -b could be used.

I'm currently able to cross compile packages for the "w32-i386"
platform. (see https://dev.njh6.de/wiki/index.php/Cross_Compiling_for_Win32)
However, there are some minor problems and a big one.

> >     The debian/rules gets 2 additional lines:
> >         export PATH := /usr/i586-mingw32msvc/bin:$(PATH)
> >         CONFIGURE_FLAGS=--prefix=/usr/i586-mingw32msvc --build= .....
> >
> >     However, it's then manual work to ensuring that these parameters
> >     are used for the call to "./configure".
> 
> With dpkg-cross, cross-compiler is assumed to be avalable in path (named 
> $(DEB_TARGET_GNU_TYPE)-gcc, for example arm-linux-gnu-gcc

I'm sure you mean $(DEB_HOST_GNU_TYPE).

Here my first problem. A "w32-i386" platform leads to:

    DEB_HOST_GNU_TYPE == i486-mingw32msvc

However, the mingw32 packages has the GNU type i586-mingw32msvc.
Is this a bug in the mingw32 package?
(that's why this mail is CCed to Ron, the maintainer of that package)


I could add another CPU type, which would lead to something
like "w32-i586". In this case, I had:

    DEB_HOST_GNU_TYPE == i586-mingw32msvc

But even now it doesn't work. Running

    dpkg-buildpackage -aw32-i586 -rfakeroot -us -uc

always leads to something like:

    ./configure [...] --host=i486-mingw32msvc
    [...]
    checking host system type... i586-pc-mingw32msvc
    checking target system type... i586-pc-mingw32msvc
    [...]

This part "pc-" is introduced by dpkg-cross and/or config.guess
and produces fatal errors.


I'm not sure how to handle this, but the only thing that helped
was setting the CROSSPREFIX manually:

  CROSSPREFIX=i586-mingw32msvc- dpkg-buildpackage -aw32-i386 -rfakeroot -us -uc

This way also doesn't need an extra "i586" CPU type.


> >     Last but not least, the "*.files" list.
> 
> With dpkg-cross approach to build 'native' packages for target 
> architecture, this issue does not exist.

Here is my big problem. After having successfully created a native
w32-i386 package, the conversion to a cross package fails.

The native package was:
    libsmpeg-dev_0.4.5+cvs20030824-1_w32-i386.deb

I transformed it via:
    dpkg-cross -aw32-i386 -b libsmpeg-dev_0.4.5+cvs20030824-1_w32-i386.deb

There were no errors or warnings. This command created a cross package:
    libsmpeg-dev-w32-i386-cross_0.4.5+cvs20030824-1_all.deb

Everything looks nice, except the paths. The file in the cross package are
still located in /usr/... instead of /usr/i586-mingw32msvc/...

Of course, I didn't except this would work. I expected the files to
be moved to "/usr/i486-mingw32msvc/". And I excepted the files to be
moved to the right location by setting CROSSDIR.

BTW, the command:
    CROSSDIR=/usr/i586-mingw32msvc \
    dpkg-cross -aw32-i386 -b libsmpeg-dev_0.4.5+cvs20030824-1_w32-i386.deb

produces the same wrong cross package.

Do you have similar problems with other platforms? This problem is really
annoying. Are their any ideas/solutions?

Anyway, that behaviour violates the documentation:
    /usr/share/doc/dpkg-cross/README.Debian.gz


Thanks in advance for your help.


Greets,

    Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR



Reply to: