From 2f65d585b2e7a6dd734c4be8bf71e16842e30450 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 19 Mar 2019 15:29:20 -0600 Subject: [PATCH] adjust Windows cross-compile to use zlib/win32/Makefile.gcc original commit: b4c583ad7259eabad7344d5dedc297c8414140a4 --- c/Mf-ta6nt | 4 +++- c/Mf-ti3nt | 4 +++- configure | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/c/Mf-ta6nt b/c/Mf-ta6nt index 2911db5363..615051f7db 100644 --- a/c/Mf-ta6nt +++ b/c/Mf-ta6nt @@ -51,4 +51,6 @@ ${Kernel}: ${kernelobj} ../zlib/libz.a $(LD) -r -X -o ${Kernel} ${kernelobj} ../zlib/libz.a ../zlib/configure.log: - (cd ../zlib; env CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" ./configure --uname=CYGWIN) + echo "all:" >> ../zlib/Makefile + echo '\t$$(MAKE) -f win32/Makefile.gcc CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" RC="$(WINDRES)"' >> ../zlib/Makefile + touch ../zlib/configure.log diff --git a/c/Mf-ti3nt b/c/Mf-ti3nt index 62650bce85..356b89153c 100644 --- a/c/Mf-ti3nt +++ b/c/Mf-ti3nt @@ -51,4 +51,6 @@ ${Kernel}: ${kernelobj} ../zlib/libz.a $(LD) -r -X -o ${Kernel} ${kernelobj} ../zlib/libz.a ../zlib/configure.log: - (cd ../zlib; env CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" ./configure --uname=CYGWIN) + echo "all:" >> ../zlib/Makefile + echo '\t$$(MAKE) -f win32/Makefile.gcc CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" RC="$(WINDRES)"' >> ../zlib/Makefile + touch ../zlib/configure.log diff --git a/configure b/configure index 5efab7e8d6..ed4b8c2e16 100755 --- a/configure +++ b/configure @@ -42,7 +42,12 @@ disablecurses=no : ${CC:="gcc"} : ${CPPFLAGS:=""} : ${CFLAGS:=""} +: ${LD:="ld"} : ${LDFLAGS:=""} +: ${AR:="ar"} +: ${ARFLAGS:="ruv"} +: ${RANLIB:="ranlib"} +: ${WINDRES:="windres"} # On WSL, set OS to "Windows_NT" to create a Windows # build instead of a Linux (on Windows) build: @@ -232,6 +237,9 @@ while [ $# != 0 ] ; do RANLIB=*) RANLIB=`echo $1 | sed -e 's/^RANLIB=//'` ;; + WINDRES=*) + WINDRES=`echo $1 | sed -e 's/^WINDRES=//'` + ;; *) echo "option '$1' unrecognized or missing an argument; try $0 --help" exit 1 @@ -315,6 +323,7 @@ if [ "$help" = "yes" ]; then echo " AR= archiver" echo " ARFLAGS= archiver flags" echo " RANLIB= archive indexer" + echo " WINDRES= resource compiler" echo "" echo "Available machine types: $machs" echo "" @@ -426,4 +435,5 @@ LIBNCURSES=$LIBNCURSES AR=$AR ARFLAGS=$ARFLAGS RANLIB=$RANLIB +WINDRES=$WINDRES END