forhappy / zklua

Lua binding of apache zookeeper.
Apache License 2.0
98 stars 47 forks source link

How to install zklua on macosx? #16

Open wbdu opened 9 years ago

wbdu commented 9 years ago

localhost:zklua steven$ make gcc -c pkg-config --cflags lua -fPIC -O2 zklua.c zklua.c:28:1: error: unknown type name '' ^ In file included from zklua.c:29: In file included from ./zklua.h:24: In file included from /usr/local/include/lua.h:12: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include/stdarg.h:30:1: error: expected identifier or '(' typedef __builtin_va_list va_list; ^ In file included from zklua.c:29: ./zklua.h:28:10: fatal error: 'zookeeper/zookeeper.h' file not found

include <zookeeper/zookeeper.h>

     ^

3 errors generated. make: *\ [zklua.o] Error 1

yandd commented 9 years ago

你需要删除zklua.c中的第28行'_'。

wbdu commented 9 years ago

Thks,删除掉后编译通过了。 再请教一个问题,我想用luajit编译,应该如何修改MakeFile呢?

yandd commented 9 years ago

只需要修改Makefile中的LUA_INC_DIR = /usr/local/include/luajit-2.0为你自己的luajit头文件路径即可

wbdu commented 9 years ago

:( 没找到LUA_INC_DIR,只有: LUA_LIB_DIR = /usr/local/Cellar LUA_VERSION = lua LUA_VERSION_NUMBER = 5.2.4_1

wbdu commented 9 years ago

作者是用pkg-config搞的。我不知该如何修改:( CC = gcc CFLAGS = pkg-config --cflags $(LUA_VERSION) -fPIC -O2 #-Wall INSTALL_PATH = $(shell pkg-config $(LUA_VERSION) --variable=libdir)/$(LUA_VERSION)/$(LUA_VERSION_NUMBER)

yandd commented 9 years ago

LUA_INC_DIR = /usr/local/include/luajit-2.0 CFLAGS = -I$(LUA_INC_DIR) -fPIC -O2 -Wall

我是这样修改的

wbdu commented 9 years ago

谢谢啦,那上面那个INSTALL_PATH应该如何修改呢? 后面用到了

install: zklua.so ifeq ($(OS_NAME), Darwin) install zklua.so $(INSTALL_PATH)/zklua.so else install -D -s zklua.so $(INSTALL_PATH)/zklua.so endif

wbdu commented 9 years ago

我改好了,再次感谢。

wbdu commented 9 years ago

在openresty环境下运行实例,直接导致nginx进程崩溃了。

yandd commented 9 years ago

我也有这个问题,但是作者一直没回应,你先看下pull request把其他的BUG改掉