|
On Apr 6, 2015 15:03, "Dirk Laurie" <dirk.laurie@gmail.com> wrote:
>
> I started hacking the `linux` option in the Makefile, when the
> thought struck me: On a list lile this, surely someone has
> succeeded in building Lua on an Android with the aid of the
> Terminal IDE app. It has gcc 4.4.0 and GNU Make 3.82.
Yes it is possible, unfortunately I upgraded to Android 5 and Terminal IDE stopped working (Android 5 requires PIE for all applications, Terminal IDE would have to be rebuilt), so I can't verify the procedure.
I had to modify the Lua src/Makefile and do the following:
--- Makefile
+++ Makefile.terminalide
@@ -6,16 +6,16 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
-LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
+CC= terminal-gcc
+CFLAGS= -fPIE -O2 -Wall -Wextra -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
+LDFLAGS= -Bsymbolic $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
-AR= ar rcu
-RANLIB= ranlib
+AR= arm-eabi-ar rcu
+RANLIB= arm-eabi-ranlib
RM= rm -f
Notice replacing CC, AR and RANLIB, and -fPIE and -Bsymbolic. I can't explain why those are needed, but are a result of a lot of frustration, experimentation, and StackOverflow/Google searching to find something that work. Also, another change I did is modifying llex.c to hardcode ls->decpoint = '.'.