Quick-Cocos2dx升级LuaJit版本

下载LuaJit源码并编译成32位和64位

下载地址:http://luajit.org/download.html

进入LuaJIT-2.1.0-beta3 执行如下指令:

make

sudo make install

sudo ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit

katichar@192 LuaJIT-2.1.0-beta3 % sudo make install
Password:
==== Installing LuaJIT 2.1.0-beta3 to /usr/local ====
mkdir -p /usr/local/bin /usr/local/lib /usr/local/include/luajit-2.1 /usr/local/share/man/man1 /usr/local/lib/pkgconfig /usr/local/share/luajit-2.1.0-beta3/jit /usr/local/share/lua/5.1 /usr/local/lib/lua/5.1
cd src && install -m 0755 luajit /usr/local/bin/luajit-2.1.0-beta3
cd src && test -f libluajit.a && install -m 0644 libluajit.a /usr/local/lib/libluajit-5.1.a || :
rm -f /usr/local/lib/libluajit-5.1.2.1.0.dylib /usr/local/lib/libluajit-5.1.dylib /usr/local/lib/libluajit-5.1.2.dylib
cd src && test -f libluajit.so && \
	  install -m 0755 libluajit.so /usr/local/lib/libluajit-5.1.2.1.0.dylib && \
	  : /usr/local/lib && \
	  ln -sf libluajit-5.1.2.1.0.dylib /usr/local/lib/libluajit-5.1.dylib && \
	  ln -sf libluajit-5.1.2.1.0.dylib /usr/local/lib/libluajit-5.1.2.dylib || :
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=lib|" 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 /usr/local/include/luajit-2.1
cd src/jit && install -m 0644 bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua dis_mips64.lua dis_mips64el.lua vmdef.lua /usr/local/share/luajit-2.1.0-beta3/jit
==== Successfully installed LuaJIT 2.1.0-beta3 to /usr/local ====

Note: the development releases deliberately do NOT install a symlink for luajit
You can do this now by running this command (with sudo):

  ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit

1.library not found for -lgcc_s.10.4

cd /usr/local/lib

ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib

扩展php的zip功能

下载 zip-1.15.5.tgz http://pecl.php.net/get/zip-1.15.5.tgz

安装依赖:libzip 和 cmake

 

# Enable GC64 mode for x64.
XCFLAGS+= -DLUAJIT_ENABLE_GC64

make 错误:

1:ld: library not found for -lcrt1.o (osx version: 10.15)

原因:

解决方法:在~/.bahs_profile 增加

export C_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include
export LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib

2:ld: symbol(s) not found for architecture x86_64

Undefined symbols for architecture x86_64:
  "__Unwind_DeleteException", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_GetCFA", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_RaiseException", referenced from:
      _lj_err_throw in libluajit.a(lj_err.o)
  "__Unwind_SetGR", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_SetIP", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
ld: symbol(s) not found for architecture x86_64

解决:

修改src/Makefile文件

BUILDMODE=mixed // 注释掉
BUILDMODE=dynamic//打开此行

 

你可能感兴趣的:(Cocos2dx-lua)