Browse Source

- lua: split patch; update host-lua build

master
vanhofen 5 years ago
parent
commit
d4e2ac1fa3
  1. 13
      archive-patches/lua-01-fix-LUA_ROOT.patch
  2. 62
      archive-patches/lua-01-fix-build.patch
  3. 13
      archive-patches/lua-01-remove-man.patch
  4. 25
      archive-patches/lua-01-remove-readline.patch
  5. 12
      make/host-tools.mk
  6. 8
      make/system-lua.mk

13
archive-patches/lua-01-fix-LUA_ROOT.patch

@ -0,0 +1,13 @@
diff --git a/src/luaconf.h b/src/luaconf.h
index 18be9a9..131747b 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -100,7 +99,7 @@
#else /* }{ */
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
-#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT "/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \

62
archive-patches/lua-01-fix-build.patch

@ -1,62 +0,0 @@
From 57e1907d6813565e29990864807bdceb393653d3 Mon Sep 17 00:00:00 2001
Message-Id: <57e1907d6813565e29990864807bdceb393653d3.1390660080.git.striper@gmx.de>
From: striper <striper@gmx.de>
Date: Sat, 25 Jan 2014 15:27:54 +0100
Subject: [PATCH] - fix build
---
Makefile | 2 +-
src/Makefile | 2 +-
src/luaconf.h | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index d2c7db4..2dea130 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= $(INSTALL_TOP)/.remove
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
diff --git a/src/Makefile b/src/Makefile
index 7b4b2b7..395d5ba 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -103,7 +103,7 @@ freebsd:
generic: $(ALL)
linux:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -fPIC" SYSLIBS="-Wl,-E -ldl"
macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc
diff --git a/src/luaconf.h b/src/luaconf.h
index 18be9a9..131747b 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -43,7 +43,6 @@
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
-#define LUA_USE_READLINE /* needs some extra libraries */
#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */
@@ -100,7 +99,7 @@
#else /* }{ */
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
-#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT "/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \
--
1.8.5.2

13
archive-patches/lua-01-remove-man.patch

@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index d2c7db4..2dea130 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= $(INSTALL_TOP)/.remove
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V

25
archive-patches/lua-01-remove-readline.patch

@ -0,0 +1,25 @@
diff --git a/src/Makefile b/src/Makefile
index 7b4b2b7..395d5ba 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -103,7 +103,7 @@ freebsd:
generic: $(ALL)
linux:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -fPIC" SYSLIBS="-Wl,-E -ldl"
macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc
diff --git a/src/luaconf.h b/src/luaconf.h
index 18be9a9..131747b 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -43,7 +43,6 @@
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
-#define LUA_USE_READLINE /* needs some extra libraries */
#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */

12
make/host-tools.mk

@ -239,21 +239,23 @@ $(HOST_DIR)/bin/resize2fs: $(ARCHIVE)/e2fsprogs-$(HOST_E2FSPROGS_VER).tar.gz | $
# -----------------------------------------------------------------------------
HOST_LUA = $(HOST_DIR)/bin/lua
HOST_LUA_VER = $(LUA_VER)
#$(ARCHIVE)/lua-$(HOST_LUA_VER).tar.gz:
# $(WGET) http://www.lua.org/ftp/lua-$(HOST_LUA_VER).tar.gz
HOST_LUA_PATCH = lua-01-fix-build.patch
HOST_LUA_PATCH = lua-01-fix-LUA_ROOT.patch
HOST_LUA_PATCH += lua-01-remove-readline.patch
host_lua: $(HOST_DIR)/bin/lua
$(HOST_DIR)/bin/lua: $(ARCHIVE)/lua-$(HOST_LUA_VER).tar.gz | $(TARGET_DIR)
host_lua: $(HOST_LUA)
$(HOST_LUA): $(ARCHIVE)/lua-$(HOST_LUA_VER).tar.gz | $(TARGET_DIR)
$(REMOVE)/lua-$(HOST_LUA_VER)
$(UNTAR)/lua-$(HOST_LUA_VER).tar.gz
$(CHDIR)/lua-$(HOST_LUA_VER); \
$(call apply_patches, $(HOST_LUA_PATCH)); \
$(MAKE) linux
install -m 0755 -D $(BUILD_TMP)/lua-$(HOST_LUA_VER)/src/lua $@
$(MAKE) linux; \
$(MAKE) install INSTALL_TOP=$(HOST_DIR)
$(REMOVE)/lua-$(HOST_LUA_VER)
# -----------------------------------------------------------------------------

8
make/system-lua.mk

@ -3,17 +3,15 @@
#
# -----------------------------------------------------------------------------
HOST_LUA = $(HOST_DIR)/bin/lua
# -----------------------------------------------------------------------------
LUA_ABIVER = 5.2
LUA_VER = $(LUA_ABIVER).4
$(ARCHIVE)/lua-$(LUA_VER).tar.gz:
$(WGET) http://www.lua.org/ftp/lua-$(LUA_VER).tar.gz
LUA_PATCH = lua-01-fix-build.patch
LUA_PATCH = lua-01-fix-LUA_ROOT.patch
LUA_PATCH += lua-01-remove-readline.patch
LUA_PATCH += lua-01-remove-man.patch
LUA_PATCH += lua-02-shared-libs-for-lua.patch
LUA_PATCH += lua-03-lua-pc.patch
LUA_PATCH += lua-04-crashfix.diff

Loading…
Cancel
Save