diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 12 | ||||
-rw-r--r-- | src/luaconf.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile index e4a3cd6..d6bfbd3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -23,6 +23,7 @@ MYLIBS= PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris LUA_A= liblua.a +LUA_SO= liblua.so CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \ lundump.o lvm.o lzio.o @@ -36,7 +37,7 @@ LUAC_T= luac LUAC_O= luac.o print.o ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) +ALL_T= $(LUA_SO) $(LUA_A) $(LUA_T) $(LUAC_T) ALL_A= $(LUA_A) default: $(PLAT) @@ -47,15 +48,20 @@ o: $(ALL_O) a: $(ALL_A) +# shared libraries (for Linux) +$(LUA_SO): $(CORE_O) $(LIB_O) + $(CC) -o $(LUA_SO).$V -shared -Wl,-soname,$(LUA_SO).$V $(CORE_O) $(LIB_O) -lm -ldl + ln -fs $(LUA_SO).$(V) $(LUA_SO) + $(LUA_A): $(CORE_O) $(LIB_O) $(AR) $@ $? $(RANLIB) $@ $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) -L. -llua $(LIBS) $(LUAC_T): $(LUAC_O) $(LUA_A) - $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) + $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) -L. -llua $(LIBS) clean: $(RM) $(ALL_T) $(ALL_O) diff --git a/src/luaconf.h b/src/luaconf.h index e2cb261..d7078cb 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -184,7 +184,7 @@ #elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ defined(__ELF__) -#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#define LUAI_FUNC extern #define LUAI_DATA LUAI_FUNC #else |