lua53/lua-5.3.3-shared.patch

74 lines
2.2 KiB
Diff

Index: lua-5.3.3/Makefile
===================================================================
--- lua-5.3.3.orig/Makefile
+++ lua-5.3.3/Makefile
@@ -41,7 +41,7 @@ PLATS= aix bsd c89 freebsd generic linux
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so.$V
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -61,6 +61,7 @@ install: dummy
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+ ln -s liblua.so.$V $(INSTALL_LIB)/liblua.so
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
Index: lua-5.3.3/src/Makefile
===================================================================
--- lua-5.3.3.orig/src/Makefile
+++ lua-5.3.3/src/Makefile
@@ -29,6 +29,7 @@ MYOBJS=
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.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
@@ -43,7 +44,7 @@ LUAC_T= luac
LUAC_O= luac.o
ALL_O= $(BASE_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)
# Targets start here.
@@ -55,21 +56,26 @@ o: $(ALL_O)
a: $(ALL_A)
+# shared libraries (for linux)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) $(MYCFLAGS) -o $(LUA_SO).$V -shared -Wl,-soname,$(LUA_SO).$V $(CORE_O) $(LIB_O) -lm -ldl
+ ln -sf $(LUA_SO).$V $(LUA_SO)
+
$(LUA_A): $(BASE_O)
$(AR) $@ $(BASE_O)
$(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(CC) $(MYCFLAGS) -o $@ $(MYLDFLAGS) $(LUA_O) -L. -llua $(LIBS)
-$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUAC_T): $(LUAC_O) $(LUA_SO)
+ $(CC) $(MYCFLAGS) -o $@ $(MYLDFLAGS) $(LUAC_O) -L. -llua $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
depend:
- @$(CC) $(CFLAGS) -MM l*.c
+ @$(CC) $(MYCFLAGS) -MM l*.c
echo:
@echo "PLAT= $(PLAT)"