diff -Naur lua-5.3.5.orig/Makefile lua-5.3.5/Makefile --- lua-5.3.5.orig/Makefile 2016-12-20 17:26:08.000000000 +0100 +++ lua-5.3.5/Makefile 2019-06-11 17:13:26.477362347 +0200 @@ -10,13 +10,13 @@ # so take care if INSTALL_TOP is not an absolute path. See the local target. # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. -INSTALL_TOP= /usr/local +INSTALL_TOP= /usr INSTALL_BIN= $(INSTALL_TOP)/bin INSTALL_INC= $(INSTALL_TOP)/include -INSTALL_LIB= $(INSTALL_TOP)/lib +INSTALL_LIB= $(INSTALL_TOP)/lib@LIBDIRSUFFIX@ INSTALL_MAN= $(INSTALL_TOP)/man/man1 INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V -INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V +INSTALL_CMOD= $(INSTALL_TOP)/lib@LIBDIRSUFFIX@/lua/$V # How to install. If your install program does not support "-p", then # you may have to run ranlib on the installed liblua.a. @@ -41,7 +41,7 @@ # 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 liblua.so.@MAJORVER@ liblua.so.@VERSION@ TO_MAN= lua.1 luac.1 # Lua version and release. @@ -52,7 +52,7 @@ all: $(PLAT) $(PLATS) clean: - cd src && $(MAKE) $@ + cd src && $(MAKE) $@ V=$(V) R=$(R) test: dummy src/lua -v diff -Naur lua-5.3.5.orig/src/Makefile lua-5.3.5/src/Makefile --- lua-5.3.5.orig/src/Makefile 2018-06-25 19:46:36.000000000 +0200 +++ lua-5.3.5/src/Makefile 2019-06-11 16:55:56.755362347 +0200 @@ -7,7 +7,7 @@ PLAT= none CC= gcc -std=gnu99 -CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) +CFLAGS= -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS) LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) LIBS= -lm $(SYSLIBS) $(MYLIBS) @@ -29,6 +29,7 @@ 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_O= luac.o ALL_O= $(BASE_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) # Targets start here. @@ -59,6 +60,12 @@ $(AR) $@ $(BASE_O) $(RANLIB) $@ +$(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) + + $(LUA_T): $(LUA_O) $(LUA_A) $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) diff -Naur lua-5.3.5.orig/src/luaconf.h lua-5.3.5/src/luaconf.h --- lua-5.3.5.orig/src/luaconf.h 2017-04-19 19:29:57.000000000 +0200 +++ lua-5.3.5/src/luaconf.h 2019-06-11 17:10:26.744362347 +0200 @@ -200,9 +200,9 @@ #else /* }{ */ -#define LUA_ROOT "/usr/local/" +#define LUA_ROOT "/usr/" #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" -#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#define LUA_CDIR LUA_ROOT "lib@LIBDIRSUFFIX@/lua/" LUA_VDIR "/" #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \