This is an old revision of the document!
LibPNG Windows, How to compile
Building LibPng 1.2.29
Requirements
- LibPNG Sources, http://www.libpng.org
- Zlib binaries and development files http://pecl2.php.net/downloads/php-windows-builds/php-libs/
- Common tools used to compile PHP
- LibPNG Makefile libpng.mak.txt
- LibPNG Dep Filelibpng.dep.txt
Configuration
LibPNG can be compiled using various modes listed below:
- “libpng - Win32 DLL Release” based on “Win32 (x86) Dynamic-Link Library”
- “libpng - Win32 DLL Debug” based on “Win32 (x86) Dynamic-Link Library”)
- “libpng - Win32 DLL ASM Release” based on “Win32 (x86) Dynamic-Link Library”
- “libpng - Win32 DLL ASM Debug” based on “Win32 (x86) Dynamic-Link Library”
- “libpng - Win32 DLL VB” based on “Win32 (x86) Dynamic-Link Library”
- “libpng - Win32 LIB Release” based on “Win32 (x86) Static Library”
- “libpng - Win32 LIB Debug” based on “Win32 (x86) Static Library”
- “libpng - Win32 LIB ASM Release” based on “Win32 (x86) Static Library”
- “libpng - Win32 LIB ASM Debug” based on “Win32 (x86) Static Library”
PHP uses “libpng - Win32 LIB ASM Release” and “libpng - Win32 LIB ASM Debug” respectively for the normal and debug PHP builds
One of these option has to be used while calling the makefile.
The ASM versions do not work yet with Visual C++ 8 (VS2005) or later. We did not have the time to fix the .asm files. Contributions welcome (both for php and for the libpng project).
Download the libpng Makefile and dep file and remove the .txt extension.
Compile
This step describe the process for Visual C++ 6. It should work for 2k3/5/8 as well but it is not yet tested. However you can use the VC7.1 project files in the libpng archive if the libpng.mak fails.
Copy the make file to the project\vc6 directory To compile libpng, simply go to th proj==ects directory of the libpng source and run:
cd c:\build_php_deps\libpng1229\projects\ nmake /f libpng.mak CFG="libpng - Win32 LIB Release" PHP_SDK_PATH="c:\php_sdk\"