lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all,

I am maintaining a toolchain [1] for cross-compiling GTK+
application for windows on archlinux. I'd like to upstream a
couple of patches, if possible.

The first one (implib.patch) creates an import library on the
mingw target. Credits go to the MSYS2 project: the patch is
theirs. I can't comment on this one as I don't even know what an
import library is... I just know I needed liblua.dll.a later on
the chain and this patch provided it.

The second one instead (strip.patch) is mine. In src/Makefile
there is this line:

    "AR=$(CC) -shared -Wl,--out-implib,liblua.dll.a -o" "RANLIB=strip --strip-unneeded" \

that fails when cross-compiling because the native `strip` command
does not work on host code.

Alternatively, if this is a dummy definition (as it seems), the
actual command can be substituted with `touch`, `true` or similar
inoffensive commands.

[1] https://github.com/ntd/aur-fedora-mingw
[2] https://github.com/Alexpux/MINGW-packages

Ciao.
-- 
Nicola
--- src/Makefile.orig	2015-04-07 11:24:43.263584500 +0200
+++ src/Makefile	2015-04-07 11:27:47.791263800 +0200
@@ -114,7 +114,7 @@
 
 mingw:
 	$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
-	"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
+	"AR=$(CC) -shared -Wl,--out-implib,liblua.dll.a -o" "RANLIB=strip --strip-unneeded" \
 	"SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
 	$(MAKE) "LUAC_T=luac.exe" luac.exe
 
--- lua-5.3.4.orig/src/Makefile	2017-07-29 11:13:33.143342024 +0200
+++ lua-5.3.4/src/Makefile	2017-07-29 11:14:37.675406819 +0200
@@ -13,6 +13,7 @@
 
 AR= ar rcu
 RANLIB= ranlib
+STRIP= strip
 RM= rm -f
 
 SYSCFLAGS=
@@ -114,7 +115,7 @@
 
 mingw:
 	$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
-	"AR=$(CC) -shared -Wl,--out-implib,liblua.dll.a -o" "RANLIB=strip --strip-unneeded" \
+	"AR=$(CC) -shared -Wl,--out-implib,liblua.dll.a -o" "RANLIB=$(STRIP) --strip-unneeded" \
 	"SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
 	$(MAKE) "LUAC_T=luac.exe" luac.exe