Coder Social home page Coder Social logo

Comments (12)

oneoo avatar oneoo commented on July 24, 2024

我没有 llvm 6.0 的环境,麻烦你把hack过的makefile给我看看

from alilua.

tangyiyang avatar tangyiyang commented on July 24, 2024
  • make bitop: 直接到bitop 目录 make macosx
  • make cjson: 到cjson目录 修改 cjson的Makefile 42-43行 PREFIX = /usr/local CJSON_LDFLAGS = -bundle -undefined dynamic_lookup
  • make lzlib: 修改makefile 具体makefile如下
  • make cmsgpack: 没有用lua-lib下的,我直接clone github上的,然后用cmake编译的。
  • make lua-monip: 到monip目录 16行 修改-L$(LUAJIT)/lib -lluajit-5.1 然后在外面 make LUAJIT=/usr/local 然后把so手动拷贝到外面的目录
  • make crc32: 和monip类似

下面是修改的makefile的diff
不知道为什么 提不了pull request 很抱歉。

diff --git a/lua-libs/LuaBitOp-1.0.2/Makefile b/lua-libs/LuaBitOp-1.0.2/Makefile
index cd628f2..6978607 100644
--- a/lua-libs/LuaBitOp-1.0.2/Makefile
+++ b/lua-libs/LuaBitOp-1.0.2/Makefile
@@ -18,7 +18,7 @@ CCOPT= -O2 -fomit-frame-pointer
 CCWARN= -Wall
 SOCC= $(CC) -shared
 SOCFLAGS= -fPIC $(CCOPT) $(CCWARN) $(DEFINES) $(INCLUDES) $(CFLAGS)
-SOLDFLAGS= -O3 -fPIC $(LDFLAGS) -llua
+SOLDFLAGS= -O3 -fPIC $(LDFLAGS)
 ifneq (,$(findstring luajit,$(LIBLUA)))
 SOLDFLAGS = -O3 -fPIC $(LDFLAGS)
 endif
@@ -39,7 +39,7 @@ $(MODNAME).o: $(MODNAME).c
    $(CC) $(SOCFLAGS) -c -o $@ $(LIBLUA) $<

 $(MODSO): $(MODNAME).o
-   $(SOCC) $(SOLDFLAGS) -o $@ $(LIBLUA) $<
+   $(SOCC) $(SOLDFLAGS) -v -o $@ $(LIBLUA) $<

 install: $(MODSO)
    $(INSTALL) $< `$(INSTALLPATH) $(MODNAME)`
diff --git a/lua-libs/lua-cjson-2.1.0/Makefile b/lua-libs/lua-cjson-2.1.0/Makefile
index b91c4dc..fa517b6 100644
--- a/lua-libs/lua-cjson-2.1.0/Makefile
+++ b/lua-libs/lua-cjson-2.1.0/Makefile
@@ -39,8 +39,8 @@ LUA_BIN_DIR =       $(PREFIX)/bin
 #LUA_INCLUDE_DIR =   $(PREFIX)/include/lua51

 ## MacOSX (Macports)
-#PREFIX =            /opt/local
-#CJSON_LDFLAGS =     -bundle -undefined dynamic_lookup
+PREFIX =            /usr/local
+CJSON_LDFLAGS =     -bundle -undefined dynamic_lookup

 ## Solaris
 #CC           =      gcc
diff --git a/lua-libs/lua-crc32/Makefile b/lua-libs/lua-crc32/Makefile
index f57af0b..cfcc80a 100644
--- a/lua-libs/lua-crc32/Makefile
+++ b/lua-libs/lua-crc32/Makefile
@@ -13,12 +13,12 @@ LIBLUA = -L$(LUA) -llua
 INCLUDES = -I$(LUAJIT)/../include/
 endif
 else
-LIBLUA = -L$(LUAJIT) -lluajit-5.1
-INCLUDES = -I$(LUAJIT)/../include/luajit-2.0 -I$(LUAJIT)/../include/luajit-2.1
+LIBLUA = -L$(LUAJIT)/lib -lluajit-5.1
+INCLUDES = -I$(LUAJIT)/include/luajit-2.0 -I$(LUAJIT)/include/luajit-2.1
 endif

 all:$(MODNAME).o
-   $(CC) -o $(MODNAME).so $(OPTIMIZATION) -shared -fPIC $(CFLAGS) $(LIBLUA) *.o
+   $(CC) -v -o $(MODNAME).so $(OPTIMIZATION) -shared -fPIC $(CFLAGS) $(LIBLUA) *.o

 $(MODNAME).o:
    $(CC) -g -fPIC -c *.c $(INCLUDES) $(LIBLUA);
@@ -29,4 +29,4 @@ install:

 clean:
    rm *.o;
-   rm *.so;
\ No newline at end of file
+   rm *.so;
diff --git a/lua-libs/lua-monip/Makefile b/lua-libs/lua-monip/Makefile
index 6b48174..fc81cc0 100644
--- a/lua-libs/lua-monip/Makefile
+++ b/lua-libs/lua-monip/Makefile
@@ -10,11 +10,11 @@ ifeq ($(LUA),)
 LIBLUA = -llua -L/usr/lib
 else
 LIBLUA = -L$(LUA) -llua 
-INCLUDES = -I$(LUAJIT)/../include/
+INCLUDES = -I$(LUAJIT)/include/
 endif
 else
-LIBLUA = -L$(LUAJIT) -lluajit-5.1
-INCLUDES = -I$(LUAJIT)/../include/luajit-2.0 -I$(LUAJIT)/../include/luajit-2.1
+LIBLUA = -L$(LUAJIT)/lib -lluajit-5.1
+INCLUDES = -I$(LUAJIT)/include/luajit-2.0 -I$(LUAJIT)/include/luajit-2.1
 endif

 all:$(MODNAME).o
@@ -29,4 +29,4 @@ install:

 clean:
    rm *.o;
-   rm *.so;
\ No newline at end of file
+   rm *.so;
diff --git a/lua-libs/lzlib/Makefile b/lua-libs/lzlib/Makefile
index 80bb0f3..ef2cab8 100644
--- a/lua-libs/lzlib/Makefile
+++ b/lua-libs/lzlib/Makefile
@@ -6,9 +6,9 @@ DISTDIR=dist
 TMP=/tmp

 # change these to reflect your Lua installation
-LUA= $(HOME)/local/lua-5.1
-LUAINC= $(LUA)/include
-LUALIB= $(LUA)/lib
+LUA= /usr/local 
+LUAINC= /usr/local/include
+LUALIB= $(LIBLUA)
 LUABIN= $(LUA)/bin

 ZLIB=./
@@ -51,7 +51,7 @@ test: $(T_ZLIB) # $(T_GZIP)
    $(LUABIN)/lua -lluarc test_zlib3.lua

 $(T_ZLIB): lzlib.o
-   $(CC) -o $@ -shared $(LIBS) $<
+   $(CC) -L/usr/local/lib -o $@ -shared $(LIBS) $<

 clean:
    rm -f *.o *.so core core.* a.out

from alilua.

oneoo avatar oneoo commented on July 24, 2024

好的,谢谢啊。我找个 llvm 6.0 环境来测试一下

from alilua.

oneoo avatar oneoo commented on July 24, 2024

... 原来我自己就是啊

oneoo@one ~: llvm-gcc -v
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

from alilua.

tangyiyang avatar tangyiyang commented on July 24, 2024

额。那就说明可能不是llvm的问题了,可能是我哪里没设置对。。。

from alilua.

oneoo avatar oneoo commented on July 24, 2024

你直接make 别用系统的 luajit,看看

from alilua.

tangyiyang avatar tangyiyang commented on July 24, 2024

我一开始就是直接make的,是不是和我的sh的版本有关。sh -version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.

from alilua.

oneoo avatar oneoo commented on July 24, 2024

这跟 sh 版本无关的

我这边把系统的 luajit 清空了。试试看是否可以复现到问题

from alilua.

tangyiyang avatar tangyiyang commented on July 24, 2024

经过我家媳妇儿的指点,终于找到问题所在了。
因为我的机器上已经安装了Lua 5.2,导致了我直接make使用的是Lua 5.2的lua.h这个头文件,所以link bit.so的时候链接找不到 _luaL_setfuncs 这个function的implemention,因为Luajit是5.1!

简单粗暴的解决方案,注释掉。
#INCLUDES= -I/usr/local/include #-I/usr/local/include/luajit-2.0 -I/usr/local/include/luajit-2.1
就可以了。
打一个补丁吧。:)

from alilua.

oneoo avatar oneoo commented on July 24, 2024

哇塞,你家媳妇好牛~。嗯,这个 include 我fix下

from alilua.

oneoo avatar oneoo commented on July 24, 2024

麻烦帮忙把 # 注释改为

ifneq ($(LIBLUA),)
INCLUDES=“”
endif

看看是否正常

from alilua.

tangyiyang avatar tangyiyang commented on July 24, 2024

加上后可以哈。。这个issue可以close了

http://alilua.com/docs.html

这个网站挂了。。。

from alilua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.