{"id":96,"date":"2018-02-12T11:49:43","date_gmt":"2018-02-12T03:49:43","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/blog\/?p=96"},"modified":"2020-10-06T22:37:29","modified_gmt":"2020-10-06T14:37:29","slug":"ios%e7%89%88%e6%9c%aculua%e7%9a%84%e7%bc%96%e8%af%91%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=96","title":{"rendered":"iOS\u7248\u672cuLua\u7684\u7f16\u8bd1\u6b65\u9aa4"},"content":{"rendered":"<p>iOS\u7248\u672cuLua\u7684\u7f16\u8bd1\u6b65\u9aa4<\/p>\n<p>\u4e8c.\u53d6\u5f97luajit2.0.2\u6e90\u4ee3\u7801\u5305, \u628a\u76ee\u5f55\u91cd\u65b0\u5168\u540d\u4e3aluajit<\/p>\n<p>\u4e09.\u5728luajit\u4e2d\u65b0\u5efa\u4e00compile_ios.sh\u6587\u4ef6:<br \/>\n\u6b64\u6587\u4ef6\u5185\u5bb9\u5728http:\/\/luajit.org\/install.html\u4e2d\u6709<\/p>\n<p>IXCODE=`xcode-select -print-path`<br \/>\nISDK=$IXCODE\/Platforms\/iPhoneOS.platform\/Developer<br \/>\nISDKVER=iPhoneOS6.0.sdk<br \/>\nISDKP=$ISDK\/usr\/bin\/<br \/>\nISDKF=&#8221;-arch armv7 -isysroot $ISDK\/SDKs\/$ISDKVER&#8221;<br \/>\nmake HOST_CC=&#8221;gcc -m32 -arch i386&#8243; CROSS=$ISDKP TARGET_FLAGS=&#8221;$ISDKF&#8221; \\<br \/>\nTARGET_SYS=iOS<\/p>\n<p>\u6ce8\u610f\u628aCROSS=$ISDKP\u5220\u9664<br \/>\n\u6ce8\u610f\u628aiPhoneOS6.0.sdk\u4fee\u6539\u4e3aiPhoneOS8.1.sdk<br \/>\n\u4ee5\u4e0b\u4e3a\u6b63\u5f0f\u5185\u5bb9:<\/p>\n<p>IXCODE=`xcode-select -print-path`<br \/>\nISDK=$IXCODE\/Platforms\/iPhoneOS.platform\/Developer<br \/>\nISDKVER=iPhoneOS8.1.sdk<br \/>\nISDKP=$ISDK\/usr\/bin\/<br \/>\nISDKF=&#8221;-arch armv7 -isysroot $ISDK\/SDKs\/$ISDKVER&#8221;<br \/>\nmake HOST_CC=&#8221;gcc -m32 -arch i386&#8243; TARGET_FLAGS=&#8221;$ISDKF&#8221; TARGET_SYS=iOS<\/p>\n<p>\u56db.chmod +x compile_ios.sh<\/p>\n<p>\u4e94.\u5982\u679c\u62a5sh\u4e0d\u6b63\u5e38,\u5219:<br \/>\nvi compile_ios.sh<br \/>\n:set ff=unix<br \/>\n:wq<\/p>\n<p>\u516d.<br \/>\n1.\u4fee\u6539luajit\u4e2d\u7684src\/makefile<br \/>\nLJCORE_0= \u2026<br \/>\n\u5728lj_lib.o lj_alloc.o lib_aux.o \u540e\u9762\u6dfb\u52a0 lua_wrap.o<\/p>\n<p>2.\u4fee\u6539luajit\u4e2d\u7684src\/makefile.dep<br \/>\n\u5728\u6700\u540e\u4e00\u884chost\/minilua.o: host\/minilua.c\u7684\u4e0a\u4e00\u884c\u6dfb\u52a0<br \/>\nlua_wrap.o: lua_wrap.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_ir.h lj_vm.h<\/p>\n<p>\u4e03. .\/compile_ios.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iOS\u7248\u672cuLua\u7684\u7f16\u8bd1\u6b65\u9aa4 \u4e8c.\u53d6\u5f97luajit2.0.2\u6e90\u4ee3\u7801\u5305, \u628a\u76ee\u5f55\u91cd\u65b0\u5168\u540d\u4e3aluajit \u4e09.\u5728l [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/96"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96"}],"version-history":[{"count":1,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}