lua-users home
lua-l archive

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

On Wed, Mar 5, 2008 at 5:05 AM, John Hein <> 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.
>  I'd like to submit the following patch to fix that issue.
>  If there is a better place to submit this, please let me know.

Another classic way is the use of a CROSS_COMPILE variable.
The Makefile then looks something like this:

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).

In any case, adding ARFLAGS is certainly useful.