summaryrefslogtreecommitdiff
path: root/development/lua/lua-5.1.4-shared.diff
blob: e4083916c36e1a751494e5a7f9160fd9ca35be20 (plain)
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
diff -Nur lua-5.1.4.orig/Makefile lua-5.1.4/Makefile
--- lua-5.1.4.orig/Makefile	2008-08-11 19:40:48.000000000 -0500
+++ lua-5.1.4/Makefile	2008-10-28 11:05:20.258085554 -0500
@@ -43,7 +43,7 @@
 # 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.$R
 TO_MAN= lua.1 luac.1
 
 # Lua version and release.
diff -Nur lua-5.1.4.orig/src/Makefile lua-5.1.4/src/Makefile
--- lua-5.1.4.orig/src/Makefile	2008-01-19 13:37:58.000000000 -0600
+++ lua-5.1.4/src/Makefile	2008-10-28 11:08:46.895111523 -0500
@@ -18,11 +18,17 @@
 MYLDFLAGS=
 MYLIBS=
 
+# Shared object info
+MAJOR= 5
+MINOR= 1
+REL= 4
+
 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
 
 PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
 
 LUA_A=	liblua.a
+LUA_S= 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,8 +42,9 @@
 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_S) $(LUA_T) $(LUAC_T)
 ALL_A= $(LUA_A)
+ALL_S= $(LUA_S)
 
 default: $(PLAT)
 
@@ -47,10 +54,17 @@
 
 a:	$(ALL_A)
 
+s:	$(ALL_S)
+
 $(LUA_A): $(CORE_O) $(LIB_O)
 	$(AR) $@ $?
 	$(RANLIB) $@
 
+$(LUA_S): $(CORE_O) $(LIB_O)
+	gcc -shared -fPIC -Wl,-soname -Wl,$(LUA_S).$(MAJOR) \
+		-o $(LUA_S).$(MAJOR).$(MINOR).$(REL) $^ $(LIBS)
+	ln -s $(LUA_S).$(MAJOR).$(MINOR).$(REL) $(LUA_S)
+
 $(LUA_T): $(LUA_O) $(LUA_A)
 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
 
@@ -58,7 +72,7 @@
 	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
 
 clean:
-	$(RM) $(ALL_T) $(ALL_O)
+	$(RM) $(ALL_T) $(ALL_O) $(LUA_S) $(LUA_S).$(MAJOR).$(MINOR).$(REL)
 
 depend:
 	@$(CC) $(CFLAGS) -MM l*.c print.c