This is an update from the previous PNG library I posted (1.0.5). In addition, the version also includes both a static lib and a dll+importlib. Since libpng depends on zlib, I've compiled libpng this way: the static pnglib is statically linked to the static libz; the png DLL is dynamically linked with the zlib DLL.
I've set up the binary package so that the dll is used for any packages built in the future that depend on libpng.
unpack png-1.0.6 cd png-1.0.6 # make sure that the zlib library and headers are setup # to link statically. patch -p1 < ../libpng-1.0.6-abc.patch # This patch contains the 'official' -a, -b, and -c patches patch -p1 < ../libpng-1.0.6-1-cygwin1.patch # This gives a tailored makefile # NOTE: There is some assembler code in 'pnggccrd.c' but # it doesn't work with cygwin yet. make make test make install /usr/local/include/png.h /usr/local/include/pngconf.h /usr/local/lib/libpng.a -----------------------------------------------
unpack png-1.0.6 cd zlib-1.0.6 # make sure the zlib library and headers are setup # so that libz.dll is linked. patch -p1 < ../libpng-1.0.6-abc.patch # This patch contains the 'official' -a, -b, and -c patches patch -p1 < ../libpng-1.0.6-1-cygwin1.dll-patch # This gives a tailored makefile and a .def file # NOTE: There is some assembler code in 'pnggccrd.c' but # it doesn't work with cygwin yet. make make test make install /usr/local/include/png.h /usr/local/include/pngconf.h /usr/local/bin/libpng.dll /usr/local/lib/libpng.a-dll /usr/local/lib/libpng.a -> libpng.a-dll My package: /usr/local/include/png.h (dll version) /usr/local/include/pngconf.h (dll version) /usr/local/include/static/png.h (static version) /usr/local/include/static/pngconf.h (static version) /usr/local/lib/libpng.a-static /usr/local/lib/libpng.a-dll /usr/local/bin/libpng.dll symlink libpng.a to libpng.a-dll # NOTE: the 'static' and 'dynamic' headers are # actually identical. I just wanted to establish the # pattern, if it becomes necessary for future packages # Yes, I know you can/should do all this with #defines, # and that will work in the current configuration. However, # it's all about flexibility. I want Joe User to be able # to say "I hate dll's" and completely eradicate them, and # not have to use special #defines to do so. # However, in this case, it's simple: # just change the symlink for libpng.a and POOF: static linking.