[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [patch] help for cross compiling lua
- From: "Dirk Feytons" <dirk.feytons@...>
- Date: Wed, 5 Mar 2008 22:27:32 +0100
On Wed, Mar 5, 2008 at 8:26 PM, John E Hein <firstname.lastname@example.org> wrote:
> Dirk Feytons wrote at 14:42 +0100 on Mar 5, 2008:
> > Another classic way is the use of a CROSS_COMPILE variable.
> > The Makefile then looks something like this:
> > CC=$(CROSS_COMPILE)gcc
> > AR=$(CROSS_COMPILE)ar
> > ...
> > By just setting CROSS_COMPILE to e.g. "mips-linux-uclibc-" you can do
> > cross compilation while not setting the variable uses your host
> > compiler (provided your toolchains are appropriately named).
> I like the idea from a simplicity standpoint (just set one variable
> and be done with it).
> Unfortunately, it's not very standard _as far as I know_. For
> instance, autoconf doesn't generate support cross compiling that way.
> It just defines CC, etc., which you can override. However... it does
> support --host=<prefix> which is basically the same as your
> CROSS_COMPILE suggestion... except lua doesn't have a 'configure'
> stage before calling make - i.e., there's no "lua way" to configure
> the makefile before running make (again, as far as I know).
Lua has the advantage that it is ANSI C and so small that it is very
easy to just write a custom Makefile for whatever build setup you are
They better don't add autoconf stuff; the ./configure step would
probably take longer than the actual compilation :)
> autoconf is not a standard, you say? Well it's a bit of a de facto
> standard, unfortunately. But I agree. Basing Makefile support for
> cross compiles on what autoconf does is only one factor one might
Autoconf is not really standard in the embedded world from what I've
seen (which is not that much to be honest; we don't have many 3rd
> If lua adds something like the prefix above, it won't bother me. I'll
> just add CROSS_COMPILE to my cross build environment in addition to
> AR, CC, RANLIB, STRIP, etc. What's one more variable?
One advantage of CROSS_COMPILE is that it doesn't have any effect if
you don't use it.
> If lua does go that route, as far as naming the prefix, I don't know
> of anything that uses that exact name, CROSS_COMPILE. Indeed I
> don't know of any software off the top of my head which uses
> the prefix method. But there's lots of software out there.
> Does anyone have any good examples of software packages that use
> such a prefix method?
The Linux kernel :)
> > In any case, adding ARFLAGS is certainly useful.
> Indeed. Applying the ARFLAGS patch is a good fix regardless, I think.