Using CFLAGS=-32 will not work for me, the configure script still screams that I constantly have to use win32/Makefile.gcc .
The latest version of zlib is 1.2.11, so the difference should be minimal to this day. Without any context in the system, the following may be useful for other users facing a similar problem these days.
I am cross-compiling on Linux (Ubuntu 18.04) and am aiming to create a 32-bit version of zlib. I did the following.
./configure (this is just so that we have the necessary file for the build process, although we will use a different Makefile)- Change
win32/Makefile.gcc for its PREFIX=i686-w64-mingw32- (for the 64-bit version, you change it to PREFIX=x86_64-w64-mingw32- . make -fwin32/Makefile.gcc- Set
make install -fwin32/Makefile.gcc SHARED_MODE=1 INCLUDE_PATH=/tmp/zlib-win32/include LIBRARY_PATH=/tmp/zlib-win32/lib BINARY_PATH=/tmp/zlib-win32/bin place using make install -fwin32/Makefile.gcc SHARED_MODE=1 INCLUDE_PATH=/tmp/zlib-win32/include LIBRARY_PATH=/tmp/zlib-win32/lib BINARY_PATH=/tmp/zlib-win32/bin . Note that you need to specify INCLUDE_PATH , LIBRARY_PATH and BINARY_PATH . BINARY_PATH will contain the result .dll file.
source share