| 1 | This applies to Lua 5.2 and 5.3.
|
| 2 |
|
| 3 | From 7a1b4e0829124976878ca2765a8e546667a92ceb Mon Sep 17 00:00:00 2001
|
| 4 | From: Leo Famulari <[email protected]>
|
| 5 | Date: Fri, 30 Oct 2015 19:11:31 -0400
|
| 6 | Subject: [PATCH] apply existing non-executable library patch and install
|
| 7 | libraries as executable
|
| 8 |
|
| 9 | ---
|
| 10 | Makefile | 6 +++---
|
| 11 | src/Makefile | 8 +++++++-
|
| 12 | 2 files changed, 10 insertions(+), 4 deletions(-)
|
| 13 |
|
| 14 | diff --git a/Makefile b/Makefile
|
| 15 | index 1aea8e6..bfcfed9 100644
|
| 16 | |
| 17 | |
| 18 | @@ -44,7 +44,7 @@ INTERPRETER= lua
|
| 19 | COMPILER= luac
|
| 20 | TO_BIN= $(INTERPRETER) $(COMPILER)
|
| 21 | TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
|
| 22 | -TO_LIB= liblua.a
|
| 23 | +TO_LIB= liblua.a liblua.so liblua.so.${V}
|
| 24 | TO_PC= lua-$(V).pc
|
| 25 | TO_MAN= lua.1 luac.1
|
| 26 |
|
| 27 | @@ -56,7 +56,7 @@ R= $V.3
|
| 28 | all: $(PLAT)
|
| 29 |
|
| 30 | $(PLATS):
|
| 31 | - cd src && $(MAKE) $@
|
| 32 | + cd src && $(MAKE) $@ V=$(V) R=$(R)
|
| 33 |
|
| 34 | clean:
|
| 35 | cd src && $(MAKE) $@
|
| 36 | @@ -69,7 +69,7 @@ install: dummy $(TO_PC)
|
| 37 | cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_PC) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
|
| 38 | cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
|
| 39 | cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
|
| 40 | - cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
|
| 41 | + cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
|
| 42 | cd src && $(INSTALL_DATA) ../$(TO_PC) $(INSTALL_PC)
|
| 43 | cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
|
| 44 |
|
| 45 | diff --git a/src/Makefile b/src/Makefile
|
| 46 | index 7b4b2b7..c86476e 100644
|
| 47 | |
| 48 | |
| 49 | @@ -29,6 +29,7 @@ MYOBJS=
|
| 50 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
|
| 51 |
|
| 52 | LUA_A= liblua.a
|
| 53 | +LUA_SO= liblua.so
|
| 54 | CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
|
| 55 | lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
|
| 56 | ltm.o lundump.o lvm.o lzio.o
|
| 57 | @@ -43,7 +44,7 @@ LUAC_T= luac
|
| 58 | LUAC_O= luac.o
|
| 59 |
|
| 60 | ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
|
| 61 | -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
|
| 62 | +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
|
| 63 | ALL_A= $(LUA_A)
|
| 64 |
|
| 65 | # Targets start here.
|
| 66 | @@ -55,6 +56,11 @@ o: $(ALL_O)
|
| 67 |
|
| 68 | a: $(ALL_A)
|
| 69 |
|
| 70 | +$(LUA_SO): $(CORE_O) $(LIB_O)
|
| 71 | + $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
|
| 72 | + ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
|
| 73 | + ln -sf $(LUA_SO).$(R) $(LUA_SO)
|
| 74 | +
|
| 75 | $(LUA_A): $(BASE_O)
|
| 76 | $(AR) $@ $(BASE_O)
|
| 77 | $(RANLIB) $@
|
| 78 | --
|
| 79 | 2.6.1
|
| 80 |
|