zlib icon indicating copy to clipboard operation
zlib copied to clipboard

win32/Makefile.gcc doesn't use CROSS_PREFIX nor PREFIX

Open MrSparc opened this issue 8 years ago • 8 comments

My host is Linux and I'm building a script for cross compiling for many target platforms (windows, linux-arm, android, ios, etc.). So for cross compiling for Windows I'm using mingw, then I would like to set the compiler prefix like this: CROSS_PREFIX="i586-pc-mingw32-"

But win32/Makefile.gcc doesn't use this at all (like ./configure does). This makefile looks is prepared to use instead the PREFIX var, but includes a line that make impossible to set the var before makefile being invoked: PREFIX =

I can patch the win32/Makefile.gcc to remove this line but this should be fixed.

MrSparc avatar Dec 21 '16 14:12 MrSparc

MinGW support in stock zlib is at pretty early stage... using win32/Makefile.gcc was a temporary workaround until configure gets full support for MinGW... There is at least three main variations of MinGW using either MSYS or MSYS2 and that makes adding the support to configure pretty complicated.

mtl1979 avatar Jan 04 '17 17:01 mtl1979

I had a similar issue and came up with this https://github.com/madler/zlib/pull/220 You might be able to do... HOST=i586-pc-mingw32 make -fwin32/Makefile.mingw-w64

jcadduono avatar Feb 08 '17 06:02 jcadduono

@Timofonic zlib-ng also has quite long inactive periods. Makes no sense to advertise it on every possible issue on this project.

mtl1979 avatar Sep 07 '17 03:09 mtl1979

If CMake with the -DCMAKE_INSTALL_PREFIX=

worked sufficiently would that be a reasonable solution instead?

jeking3 avatar Nov 23 '17 02:11 jeking3

@jeking3 Apples and Oranges, FYI... Has nothing to do with cmake.

mtl1979 avatar Nov 23 '17 09:11 mtl1979

@mtl1979 I am suggesting that static check-in makefiles or project files are not easily maintainable across multiple platforms when a project changes, and that using cmake across the board would solve this problem. If one always generates a project or makefile or whatnot, it will always be provably correct through CI.

jeking3 avatar Nov 23 '17 14:11 jeking3

@jeking3 cmake has its own problems which are way worse than configure and GNU make together

mtl1979 avatar Nov 23 '17 14:11 mtl1979

@ all : Can you try the current devel branch? What are your results?

Thanks in advance.

Neustradamus avatar Jan 19 '24 10:01 Neustradamus