| 1 |
|
| 2 | Patch the two Makefile to also create liblua.so
|
| 3 | Original patch by Allan McRae <[email protected]>
|
| 4 | for Archlinux
|
| 5 |
|
| 6 |
|
| 7 | diff -ruN lua-5.1.5/Makefile lua-5.1.5-new/Makefile
|
| 8 | |
| 9 | |
| 10 | @@ -43,7 +43,7 @@
|
| 11 | # What to install.
|
| 12 | TO_BIN= lua luac
|
| 13 | TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
|
| 14 | -TO_LIB= liblua.a
|
| 15 | +TO_LIB= liblua.a liblua.so liblua.so.${V}
|
| 16 | TO_MAN= lua.1 luac.1
|
| 17 |
|
| 18 | # Lua version and release.
|
| 19 | @@ -53,7 +53,7 @@
|
| 20 | all: $(PLAT)
|
| 21 |
|
| 22 | $(PLATS) clean:
|
| 23 | - cd src && $(MAKE) $@
|
| 24 | + cd src && $(MAKE) $@ V=$(V) R=$(R)
|
| 25 |
|
| 26 | test: dummy
|
| 27 | src/lua test/hello.lua
|
| 28 | diff -ruN lua-5.1.5/src/Makefile lua-5.1.5-new/src/Makefile
|
| 29 | |
| 30 | |
| 31 | @@ -8,7 +8,7 @@
|
| 32 | PLAT= none
|
| 33 |
|
| 34 | CC= gcc
|
| 35 | -CFLAGS= -O2 -Wall $(MYCFLAGS)
|
| 36 | +CFLAGS= -O2 -Wall $(MYCFLAGS) -fPIC
|
| 37 | AR= ar rcu
|
| 38 | RANLIB= ranlib
|
| 39 | RM= rm -f
|
| 40 | @@ -34,9 +34,10 @@
|
| 41 |
|
| 42 | LUAC_T= luac
|
| 43 | LUAC_O= luac.o print.o
|
| 44 | +LUA_SO= liblua.so
|
| 45 |
|
| 46 | ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
|
| 47 | -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
|
| 48 | +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
|
| 49 | ALL_A= $(LUA_A)
|
| 50 |
|
| 51 | default: $(PLAT)
|
| 52 | @@ -57,6 +58,13 @@
|
| 53 | $(LUAC_T): $(LUAC_O) $(LUA_A)
|
| 54 | $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
|
| 55 |
|
| 56 | +$(LUA_SO): $(CORE_O) $(LIB_O)
|
| 57 | + $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
|
| 58 | + ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
|
| 59 | + ln -sf $(LUA_SO).$(R) $(LUA_SO)
|
| 60 | +
|
| 61 | +
|
| 62 | +
|
| 63 | clean:
|
| 64 | $(RM) $(ALL_T) $(ALL_O)
|
| 65 |
|