Jump to content
  • Advertisement
Sign in to follow this  
Angelic Ice

Installing NDK sources (especially for LuaJIT)

This topic is 654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I managed to build and install one library for my NDK version r12b (OS: Windows 7). It was pretty straight forward though, as I could build a solution for Visual Studio via CMake, ran the build and install project, done. Everything worked, got my module within the NDK sources folder. Could compile examples.

But when I build LuaJIT for Android, it tries to install it in usr/local/bin, which is neither the NDK nor even a Windows-path. It fails of course.

What can I do now? How do I manually install LuaJIT to the NDK?

Here is the installation error-message:

==== Successfully built LuaJIT 2.0.4 ====
==== Installing LuaJIT 2.0.4 to /usr/local ====
mkdir -p /usr/local/bin /usr/local/lib /usr/local/include/luajit-2.0 /usr/local/
share/man/man1 /usr/local/lib/pkgconfig /usr/local/share/luajit-2.0.4/jit /usr/l
ocal/share/lua/5.1 /usr/local/lib/lua/5.1
cd src && install -m 0755 luajit /usr/local/bin/luajit-2.0.4
cd src && test -f libluajit.a && install -m 0644 libluajit.a /usr/local/lib/libl
uajit-5.1.a || :
rm -f /usr/local/bin/luajit /usr/local/lib/libluajit-5.1.so.2.0.4 /usr/local/lib
/libluajit-5.1.so /usr/local/lib/libluajit-5.1.so.2
cd src && test -f libluajit.so && \
          install -m 0755 libluajit.so /usr/local/lib/libluajit-5.1.so.2.0.4 &&
          ldconfig -n /usr/local/lib && \
          ln -sf libluajit-5.1.so.2.0.4 /usr/local/lib/libluajit-5.1.so && \
          ln -sf libluajit-5.1.so.2.0.4 /usr/local/lib/libluajit-5.1.so.2 || :
/bin/sh: line 2: ldconfig: command not found
cd etc && install -m 0644 luajit.1 /usr/local/share/man/man1
cd etc && sed -e "s|^prefix=.*|prefix=/usr/local|" -e "s|^multilib=.*|multilib=l
ib|" luajit.pc > luajit.pc.tmp && \
          install -m 0644 luajit.pc.tmp /usr/local/lib/pkgconfig/luajit.pc && \
          rm -f luajit.pc.tmp
cd src && install -m 0644 lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h /u
cd src/jit && install -m 0644 bc.lua v.lua dump.lua dis_x86.lua dis_x64.lua dis_
arm.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua bcsave.lua vmdef.lua /usr/local/
ln -sf luajit-2.0.4 /usr/local/bin/luajit
ln: cannot remove `/usr/local/bin/luajit': No such file or directory
make: *** [install] Error 1

I tried building LuaJIT via this

make HOST_CC="gcc -m32" CROSS=%NDKP% TARGET_FLAGS="%NDKF%" TARGET_SYS="LINUX" clean default install

This is quite a journey : ) I hope someone can help me out!

Thanks a lot for taking your time to read my thread! (thanks for moving!)

Edited by Angelic Ice

Share this post

Link to post
Share on other sites

Those flags don't match the LuaJIT install page instructions.



Halfway down their page (scroll down to "Windows Systems") has instructions on what to unzip and the environment settings you need to build it.


A few sections below that are instructions to cross-compile for Android with all the necessary compiler variables and options.

Share this post

Link to post
Share on other sites

Flags do not match? What flags?


is what they suggest for armeabi but as some other people state TARGET_SYS="LINUX" needs to be added or it will be built for Windows. Nor can I use $variables and have to replace them by %variables%, which are all set environment-variables. Everything else should look the same or am I mistaken?

"Installing LuaJIT" also only covers the way for the build for Windows, or is it the same for the NDK? But then I would have no Android.mk.

Edited by Angelic Ice

Share this post

Link to post
Share on other sites

Usually you set the prefix to install, as shown at the install page: make PREFIX=/home/myself/lj2


You seem to be able to set it while installing too: make install PREFIX=/home/myself/lj2


Likely the Makefile itself also has this prefix, set to the default /usr/local

It looks somewhat standard-ish Unix, but not entirely, so ymmv.

Share this post

Link to post
Share on other sites
Yes, took me a while to figure that out, haha. Thanks though : )

Sadly, it does not generate an android.mk file, is this normal?
How do I make one the right way fitting to LuaJIT?
Already tried it myself via the Android.mk doc but they always are insufficient : / Edited by Angelic Ice

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!