From 3cfe887c40bab843bd7a4ee268262f82dbe7c38b Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 15 Feb 2011 09:07:27 -0800 Subject: Fixes for building Lua extension. --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 00905d7..749ba4c 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,7 @@ clean: rm -rf $(TESTS) tests/t.* rm -rf src/descriptor.pb rm -rf src/upbc deps + rm -rf lang_ext/lua/upb.so cd lang_ext/python && python setup.py clean --all # Core library (libupb.a). @@ -317,15 +318,15 @@ benchmarks/b.parsetostruct_googlemessage2.proto2_compiled: \ # Lua extension ################################################################## ifeq ($(shell uname), Darwin) - CPPFLAGS += -I/usr/include/lua5.1 - LDFLAGS += -L/usr/local/lib -llua + LUA_CPPFLAGS = -I/usr/include/lua5.1 + LUA_LDFLAGS = -L/usr/local/lib -llua else - CFLAGS += $(strip $(shell pkg-config --silence-errors --cflags lua || pkg-config --cflags lua5.1)) - LDFLAGS += $(strip $(shell pkg-config --silence-errors --libs lua || pkg-config --libs lua5.1)) + LUA_CPPFLAGS = $(strip $(shell pkg-config --silence-errors --cflags lua || pkg-config --cflags lua5.1)) + LUA_LDFLAGS = $(strip $(shell pkg-config --silence-errors --libs lua || pkg-config --libs lua5.1)) endif LUAEXT=lang_ext/lua/upb.so lua: $(LUAEXT) lang_ext/lua/upb.so: lang_ext/lua/upb.lo $(LIBUPB_PIC) @echo CC lang_ext/lua/upb.c - @$(CC) $(CFLAGS) $(CPPFLAGS) -shared -o $@ $< src/libupb_pic.a + @$(CC) $(CFLAGS) $(CPPFLAGS) $(LUA_CPPFLAGS) -fpic -shared -o $@ $< src/libupb_pic.a $(LUA_LDFLAGS) -- cgit v1.2.3