Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to build liblua.a LuaJit library for iOS? — Gideros Forum

How to build liblua.a LuaJit library for iOS?

n1cken1cke Maintainer
edited September 2015 in General questions
Hello, I am trying to build iOS LuaJit library (liblua.a) from gideros/tree/master/luajit cause iOS version I found at giderosplugins/tree/master/LuaJIT/luajit is one year old. I have xCode and CommandLineTools. CommandLineTools loaded and installed to Libraries/Developer automatically when I tried to use "make" command. I changed extension of build-ios from "sh" to "command". I can build usual lua and luajit for MacOS but when I try to build iOS Iib I am getting errors.
First, I tried build-ios without any modifications. I got error:
Mac-Admin:~ admin$ /Users/admin/Desktop/luajit-source/build-ios.command ; exit;
make: *** No rule to make target `clean'. Stop.
make: *** No targets specified and no makefile found. Stop.
cp: src/libluajit.a: No such file or directory
make: *** No rule to make target `clean'. Stop.
make: *** No targets specified and no makefile found. Stop.
cp: src/libluajit.a: No such file or directory
make: *** No rule to make target `clean'. Stop.
make: *** No targets specified and no makefile found. Stop.
cp: src/libluajit.a: No such file or directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: libluajit-armv7.a (No such file or directory)
make: *** No rule to make target `clean'. Stop.
rm: libluajit-armv7.a: No such file or directory
rm: libluajit-armv7s.a: No such file or directory
rm: libluajit-i386.a: No such file or directory
logout
I changed line "#cd /Applications/Xcode/5.0.2/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" to "#cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" cause I thought this would help and I have xCode 6. Same error.
I changed line "ISDKVER=iPhoneOS7.0.sdk" to "ISDKVER=iPhoneOS8.0.sdk" cause I don't have iOS7 SDK. Same error.

What I need to build it? Please, help.

Comments

  • The OSX version is a mystery to me, I made the Windows and Android version, but have no idea on how to make the OSX version. Atilim originally made it, so he might be able to remember. Everything is done there apart from the last compile step.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • BTW: If you have LuaJIT working from thos files on OSX then please can you PM someone (John, Nico, Arturs, Me) a zip of it so we can add it to the prebuilt versions.

    Once we finally get something working on iOS then I'll look at making a version for Windows Mobile.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • n1cken1cke Maintainer
    I found source of my errors. I updated xCode to 7-beta, deleted commandlinetools and set path for make and other tools to xCode inner folder. Apple changed standard path to tools in new versions.
    However I didn't figure out how to build working luajit even for OSX :-(
    My steps for OSX luajit:
    1) make TARGET_CFLAGS="-I../../libgvfs" TARGET_LIBS="-L../../libgvfs -lgvfs"
    It seems this thing doesn't work as expected. No difference with simple make. Output files are same.
    2) clang -dynamiclib [list of .o files after previous make] -current_version 1.0 -compatibility_version 1.0 -o liblua.1.dylib
    3) replace liblua.1.dylib in Gideros Player
    Of course I am getting error:
    Dyld Error Message:
    Symbol not found: _lua_getprintfunc
    Referenced from: /Applications/Gideros Studio/Gideros Player.app/Contents/MacOS/Gideros Player
    Expected in: /Applications/Gideros Studio/Gideros Player.app/Contents/MacOS/../Frameworks/liblua.1.dylib
    [long list of threads and binary images]
  • Is (2) how to make a dylib from the normal lib?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • n1cken1cke Maintainer
    edited September 2015
    Sorry, I have very little experience with libraries building and linking especially for MacOS.
    Yes, I googled that (2) is one of ways. dylib can be compiled from sources too. It is .so library in many aspects.
    Between step 2 and 3 must be very important thing:
    install_name_tool -change libgvfs.1.dylib @executable_path/../Frameworks/libgvfs.1.dylib src/libluajit.so
    But it doesn't help with error.

    I found some info about MacOS paths and now I can compile iOS libraries.
    One line from build-ios.sh must be changed:
    ISDKP=$IXCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/
    ISDKP=/usr/bin/
    I compiled luajit iOS lib for arm7 and got errors for arm7s and arm64. I replaced lib in Gideros Player project and got 3 errors while building in xCode:
    Undefined symbols for architecture armv7:
    "_lua_setprintfunc", referenced from:
    LuaApplication::setPrintFunc(void ( *)(char const*, int, void*), void*) in libgideros.a(luaapplication.o)
    LuaApplication::initialize() in libgideros.a(luaapplication.o)
    "_lua_getprintfunc", referenced from:
    LuaApplication::LuaApplication() in libgideros.a(luaapplication.o)
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    After that I downloaded and pasted luajit iOS library compiled for Love. Same error.
    I think question is how to link libgvfs to luajit.
  • I remember that is the problem I had too.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.