linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cross compiling libnl, iw, crda and friends
@ 2009-06-09 19:54 Jon Loeliger
  2009-06-09 20:00 ` John W. Linville
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jon Loeliger @ 2009-06-09 19:54 UTC (permalink / raw)
  To: linux-wireless

Guys,

Am I missing an obvious solution to cross compiling libnl, iw,
the crda and related friends?

I have a cross-compiled kernel and headers and such, and I'd
like to add the various wireless tools into the mix, but I
think the existing Makefiles are basically unaware of cross
compiling.

I think there are a couple points of confusion.  While we need
to compile on the host machine, we need to point to the target
include files which may not be installed in standard locations.
The resulting libraries, though, need to be installed in standard
locations on the target.  This combination doesn't seem to be
recordable in the pkg-config files (libnl-2.0.pc, for example).

Then things like crda and iw need to use the headers from the
cross-build installation and the cross-kernel, not the host's.

Also, crda seems to have hard paths for the regulatory.bin.
I want to point to my source package for the build, but then
install it into a standard location on the target.  Feh.

I feel like I'm missing something here...?

Thanks,
jdl



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross compiling libnl, iw, crda and friends
  2009-06-09 19:54 Cross compiling libnl, iw, crda and friends Jon Loeliger
@ 2009-06-09 20:00 ` John W. Linville
  2009-06-09 21:04 ` Felix Fietkau
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: John W. Linville @ 2009-06-09 20:00 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linux-wireless

On Tue, Jun 09, 2009 at 02:54:46PM -0500, Jon Loeliger wrote:

> Am I missing an obvious solution to cross compiling libnl, iw,
> the crda and related friends?

Probably not -- I imagine that patches are welcome? :-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross compiling libnl, iw, crda and friends
  2009-06-09 19:54 Cross compiling libnl, iw, crda and friends Jon Loeliger
  2009-06-09 20:00 ` John W. Linville
@ 2009-06-09 21:04 ` Felix Fietkau
  2009-06-09 21:47 ` Alexandre Becholey - s h o c k f i s h /
  2009-06-09 22:50 ` Samuel Ortiz
  3 siblings, 0 replies; 6+ messages in thread
From: Felix Fietkau @ 2009-06-09 21:04 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linux-wireless

Jon Loeliger wrote:
> Guys,
> 
> Am I missing an obvious solution to cross compiling libnl, iw,
> the crda and related friends?
> 
> I have a cross-compiled kernel and headers and such, and I'd
> like to add the various wireless tools into the mix, but I
> think the existing Makefiles are basically unaware of cross
> compiling.
> 
> I think there are a couple points of confusion.  While we need
> to compile on the host machine, we need to point to the target
> include files which may not be installed in standard locations.
> The resulting libraries, though, need to be installed in standard
> locations on the target.  This combination doesn't seem to be
> recordable in the pkg-config files (libnl-2.0.pc, for example).
> 
> Then things like crda and iw need to use the headers from the
> cross-build installation and the cross-kernel, not the host's.
> 
> Also, crda seems to have hard paths for the regulatory.bin.
> I want to point to my source package for the build, but then
> install it into a standard location on the target.  Feh.
> 
> I feel like I'm missing something here...?
In OpenWrt, we have generic workarounds for stuff like libtool and
pkg-config. You may need to override PKG_CONFIG_PATH and
PKG_CONFIG_LIBDIR to point to your staging directory (if you use such a
thing). The configure script can be used with generic options like for
other packages.
Another thing that might interest you is that I created a tiny version
of libnl (based on a git snapshot), which only contains genl, not
rtnetlink or any of the netfilter stuff, and compiles down to less than
30k in binary size.
You can find it here:
https://dev.openwrt.org/browser/trunk/package/libnl-tiny
Our crda build system file is here:
https://dev.openwrt.org/browser/trunk/package/crda/Makefile
(it's an OpenWrt build system makefile, but you might get the point by
reading it).

Hope this helps,

- Felix

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross compiling libnl, iw, crda and friends
  2009-06-09 19:54 Cross compiling libnl, iw, crda and friends Jon Loeliger
  2009-06-09 20:00 ` John W. Linville
  2009-06-09 21:04 ` Felix Fietkau
@ 2009-06-09 21:47 ` Alexandre Becholey - s h o c k f i s h /
  2009-06-09 22:50 ` Samuel Ortiz
  3 siblings, 0 replies; 6+ messages in thread
From: Alexandre Becholey - s h o c k f i s h / @ 2009-06-09 21:47 UTC (permalink / raw)
  To: linux-wireless

Jon Loeliger wrote:
 > Guys,
 >
 > Am I missing an obvious solution to cross compiling libnl, iw,
 > the crda and related friends?
 >
 > I have a cross-compiled kernel and headers and such, and I'd
 > like to add the various wireless tools into the mix, but I
 > think the existing Makefiles are basically unaware of cross
 > compiling.
 >
 > I think there are a couple points of confusion.  While we need
 > to compile on the host machine, we need to point to the target
 > include files which may not be installed in standard locations.
 > The resulting libraries, though, need to be installed in standard
 > locations on the target.  This combination doesn't seem to be
 > recordable in the pkg-config files (libnl-2.0.pc, for example).
 >
 > Then things like crda and iw need to use the headers from the
 > cross-build installation and the cross-kernel, not the host's.
 >
 > Also, crda seems to have hard paths for the regulatory.bin.
 > I want to point to my source package for the build, but then
 > install it into a standard location on the target.  Feh.
 >
 > I feel like I'm missing something here...?
 >
 > Thanks,
 > jdl
 >
 >
 > --
 > To unsubscribe from this list: send the line "unsubscribe 
linux-wireless" in
 > the body of a message to majordomo@vger.kernel.org
 > More majordomo info at  http://vger.kernel.org/majordomo-info.html

[forgot to CC the mailing list...]

Hi,

I did cross-compile libnl for ARMv5 CPU a few months ago. What you need 
is a tool-chain (a gcc that runs or your computer but compile code for 
target machine and the glibc).
In your Makefile or configure (I don't remember, but if you are patient 
I can have a look soon), you'll have to add the tool-chain's include 
file (can also tell you the path soon) to the CFLAGS variable (CFLAGS += 
-I/path/to/the/tool-chain's/include).

http://www.kegel.com/crosstool/ may help you for your tool-chain

Best regards,

Alexandre

PS: If your target machine is an ARM, I have 3 tool-chains: gcc 3.4.3, 
gcc 4.1.x (fails with the weak attribute if I remember well) and gcc 
4.2.x, if that's interest you...



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross compiling libnl, iw, crda and friends
  2009-06-09 19:54 Cross compiling libnl, iw, crda and friends Jon Loeliger
                   ` (2 preceding siblings ...)
  2009-06-09 21:47 ` Alexandre Becholey - s h o c k f i s h /
@ 2009-06-09 22:50 ` Samuel Ortiz
  2009-06-10 14:59   ` Jon Loeliger
  3 siblings, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2009-06-09 22:50 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linux-wireless

Hi Jon,

On Tue, 2009-06-09 at 14:54 -0500, Jon Loeliger wrote:
> Guys,
> 
> Am I missing an obvious solution to cross compiling libnl, iw,
> the crda and related friends?
> 
> I have a cross-compiled kernel and headers and such, and I'd
> like to add the various wireless tools into the mix, but I
> think the existing Makefiles are basically unaware of cross
> compiling.
> 
> I think there are a couple points of confusion.  While we need
> to compile on the host machine, we need to point to the target
> include files which may not be installed in standard locations.
Unless you're looking for a quick and easy fix to build some
one-shot demo image for your target, you may want to start looking
at cross platform build systems, like openembedded, poky or maybe
openwrt.

Cheers,
Samuel.

> The resulting libraries, though, need to be installed in standard
> locations on the target.  This combination doesn't seem to be
> recordable in the pkg-config files (libnl-2.0.pc, for example).
> 
> Then things like crda and iw need to use the headers from the
> cross-build installation and the cross-kernel, not the host's.
> 
> Also, crda seems to have hard paths for the regulatory.bin.
> I want to point to my source package for the build, but then
> install it into a standard location on the target.  Feh.
> 
> I feel like I'm missing something here...?
> 
> Thanks,
> jdl
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cross compiling libnl, iw, crda and friends
  2009-06-09 22:50 ` Samuel Ortiz
@ 2009-06-10 14:59   ` Jon Loeliger
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Loeliger @ 2009-06-10 14:59 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-wireless

On Wed, 2009-06-10 at 00:50 +0200, Samuel Ortiz wrote:
> Hi Jon,
> 
> On Tue, 2009-06-09 at 14:54 -0500, Jon Loeliger wrote:
> > Guys,
> > 
> > Am I missing an obvious solution to cross compiling libnl, iw,
> > the crda and related friends?
> > 
> Unless you're looking for a quick and easy fix to build some
> one-shot demo image for your target, you may want to start looking
> at cross platform build systems, like openembedded, poky or maybe
> openwrt.
> 
> Cheers,
> Samuel.

Hi folks,

Thanks for the feedback.   I totally get the cross-compilation
environment thing, thanks.  I have all that set up.  (PowerPC,
LTIB, powerpc-e300-linux-gnu-, etc.)

My questions really pertain to the actual configure and makefile
mechanisms in these packages themselves.  For example, it seems
to me that the whole pkg-config mechanism as used in these
makefiles doesn't distinguish between the build and target include
directories.

I'll try and work up some patches.

Thanks,
jdl



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-10 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 19:54 Cross compiling libnl, iw, crda and friends Jon Loeliger
2009-06-09 20:00 ` John W. Linville
2009-06-09 21:04 ` Felix Fietkau
2009-06-09 21:47 ` Alexandre Becholey - s h o c k f i s h /
2009-06-09 22:50 ` Samuel Ortiz
2009-06-10 14:59   ` Jon Loeliger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).