Commit 22742ad6 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all: lua-pc
tar xf lua-5.3.5.tar.gz
patch -Np1 -d lua-5.3.5 < lua-5.3.5-shared.patch
@echo "$$LUA_PC" > lua-5.3.5/lua.pc
cd lua-5.3.5 && sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h
cd lua-5.3.5 && make MYCFLAGS="-DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" linux
cd lua-5.3.5 && make test
cd lua-5.3.5 && make INSTALL_TOP=/usr INSTALL_DATA="cp -d" INSTALL_MAN=/usr/share/man/man1 TO_LIB="liblua.so liblua.so.5.3 liblua.so.5.3.5" install
mkdir -pv /usr/share/doc/lua-5.3.5
cd lua-5.3.5 && cp -v doc/*.{html,css,gif,png} /usr/share/doc/lua-5.3.5
cd lua-5.3.5 && install -v -m644 -D lua.pc /usr/lib/pkgconfig/lua.pc
rm -rf lua-5.3.5
lua-pc:
define LUA_PC
V=5.3
R=5.3.5
prefix=/usr
INSTALL_BIN=$${prefix}/bin
INSTALL_INC=$${prefix}/include
INSTALL_LIB=$${prefix}/lib
INSTALL_MAN=$${prefix}/share/man/man1
INSTALL_LMOD=$${prefix}/share/lua/$${V}
INSTALL_CMOD=$${prefix}/lib/lua/$${V}
exec_prefix=$${prefix}
libdir=$${exec_prefix}/lib
includedir=$${prefix}/include
Name: Lua
Description: An Extensible Extension Language
Version: $${R}
Requires:
Libs: -L$${libdir} -llua -lm -ldl
Cflags: -I$${includedir}
endef
export LUA_PC
diff -uNr lua-5.3.5/Makefile lua-5.3.5-shared/Makefile
--- lua-5.3.5/Makefile 2016-12-21 02:56:08.000000000 +1030
+++ lua-5.3.5-shared/Makefile 2018-07-24 04:41:56.471951439 +0930
@@ -46,13 +46,13 @@
# Lua version and release.
V= 5.3
-R= $V.4
+R= $V.5
# Targets start here.
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
test: dummy
src/lua -v
diff -uNr lua-5.3.5/src/Makefile lua-5.3.5-shared/src/Makefile
--- lua-5.3.5/src/Makefile 2018-06-26 03:16:36.000000000 +0930
+++ lua-5.3.5-shared/src/Makefile 2018-07-24 04:41:41.242902137 +0930
@@ -7,7 +7,7 @@
PLAT= none
CC= gcc -std=gnu99
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS= -fPIC -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(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)
pkg
/usr/lib/pkgconfig/.*
lib
/usr/lib/lib.*
doc
/usr/share/doc/.*
man
/usr/share/man/.*
bin
/usr/bin/.*
headers
/usr/include/.*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment