Saturday, 12 May 2012

Building zlib

Although zlib is optional for libssh2, I decided to build it. Compared to OpenSSL, it was rather uneventful.

The only problem I had was that the makefile makefile.gcc in <zlib_home>/win32 said:
# To compile, or to compile and test, type:
#   make -fmakefile.gcc;  make test testdll -fmakefile.gcc

which led me to cd to the win32 dir and run make. Which dutifully ran and promptly failed. After some searching on the net, I came upon a post stating that I should run make on the zlib home, like this:
make -fwin32/makefile.gcc

And, after giving it some thought, I realized it made perfect sense, since the makefile doesn't qualify the files with a path, which means it expects to find them in the current dir.

I was going to attempt building a zlib example, and settled on gun.c, an unzip example. However, I stumbled upon some problems with the use of stdunix.h and functions like chown() and unlink(). I could work this out - replacing these functions with their Win32 counterparts, where appropriate; or installing MS's Subsystem for Unix Apps. But, in the end, I decided to move on to libssh2. If I ever need to actually use zlib, I'm sure I'll be able to sort it out.

No comments:

Post a Comment