lua/lua-5.1-dynlib.patch
2012-02-01 14:52:37 +04:00

31 lines
902 B
Diff

--- lua-5.1.4/src/Makefile.dynlib 2008-12-29 00:21:56.000000000 +0100
+++ lua-5.1.4/src/Makefile 2008-12-29 00:21:52.000000000 +0100
@@ -22,6 +22,7 @@
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+LUA_SO= liblua.so.$(V)
LUA_A= liblua.a
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 \
@@ -36,7 +37,7 @@
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_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
default: $(PLAT)
@@ -51,6 +52,11 @@
$(AR) $@ $?
$(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ gcc -Wl,-soname=liblua.so.$(V) -shared -o $@ $(MYLDFLAGS) $? $(LIBS) $(LUA_O)
+ rm -f liblua.so
+ ln -s $@ liblua.so
+
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)