[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [patch] help for cross compiling lua
- From: Ico Doornekamp <lua@...>
- Date: Wed, 5 Mar 2008 15:49:53 +0100
* On 2008-03-05 Leo Razoumov <firstname.lastname@example.org> wrote :
> On 3/4/08, John Hein <email@example.com> wrote:
> > A classic way to cross compile tools is override
> > things like CC and RANLIB and AR. When trying to build
> > lua for an arm-based platform, I employed this technique.
> > Unfortunately the src/Makefile has 'AR= ar rcu'. So when one
> > overrides AR (with the cross platform version, arm-ar), building
> > liblua.a fails because the 'rcu' is missing.
> What's wrong with setting "AR=arm-ar rcu" in the Makefile?
Technically is not wrong, but it is convention to use variables like CC,
AR, LD, STRIP, etc. to point to the toolchain binaries so these can be
overridden when running the Makefile. For example:
$ make CC=mips-linux-gcc AR=mips-linux-ar
or even better, like was suggested in an earlier post, adding
the rules to Lua's makefiles to allow something like
$ make CROSS=mips-linux-
The flags to pass to these binaries are usually set in CFLAGS, LDFLAGS,
ARFLAGS, etc, since those usually need not be changed when using a