1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
| | From 115e612016fe615e6c895af8df7db646114a9860 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Mon, 2 Nov 2015 03:29:47 -0500
Subject: [PATCH] lua-5.1: Changes to Makefile patches
Install liblua.so with execute bit.
Don't set -fPIC from here. It will be set in the make flags.
Patch the two Makefile to also create liblua.so
Original patch by Allan McRae <allan@archlinux.org>
for Archlinux
---
Makefile | 6 +++---
src/Makefile | 10 +++++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 209a132..653dbed 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so liblua.so.${V}
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -53,7 +53,7 @@ R= 5.1.5
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
test: dummy
src/lua test/hello.lua
@@ -62,7 +62,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)
- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
ranlib:
diff --git a/src/Makefile b/src/Makefile
index e0d4c9f..ebc17e9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -34,9 +34,10 @@ LUA_O= lua.o
LUAC_T= luac
LUAC_O= luac.o print.o
+LUA_SO= liblua.so
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)
@@ -57,6 +58,13 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
+
+
+
clean:
$(RM) $(ALL_T) $(ALL_O)
--
2.6.1
|