1*593dc095SDavid du Colombier 2*593dc095SDavid du ColombierInstalling libpng version 1.2.8 - December 3, 2004 3*593dc095SDavid du Colombier 4*593dc095SDavid du ColombierBefore installing libpng, you must first install zlib. zlib 5*593dc095SDavid du Colombiercan usually be found wherever you got libpng. zlib can be 6*593dc095SDavid du Colombierplaced in another directory, at the same level as libpng. 7*593dc095SDavid du ColombierNote that your system might already have a preinstalled 8*593dc095SDavid du Colombierzlib, but you will still need to have access to the 9*593dc095SDavid du Colombierzlib.h and zconf.h include files that correspond to the 10*593dc095SDavid du Colombierversion of zlib that's installed. 11*593dc095SDavid du Colombier 12*593dc095SDavid du ColombierYou can rename the directories that you downloaded (they 13*593dc095SDavid du Colombiermight be called "libpng-1.2.8" or "lpng109" and "zlib-1.2.1" 14*593dc095SDavid du Colombieror "zlib121") so that you have directories called "zlib" and "libpng". 15*593dc095SDavid du Colombier 16*593dc095SDavid du ColombierYour directory structure should look like this: 17*593dc095SDavid du Colombier 18*593dc095SDavid du Colombier .. (the parent directory) 19*593dc095SDavid du Colombier libpng (this directory) 20*593dc095SDavid du Colombier INSTALL (this file) 21*593dc095SDavid du Colombier README 22*593dc095SDavid du Colombier *.h 23*593dc095SDavid du Colombier *.c 24*593dc095SDavid du Colombier contrib 25*593dc095SDavid du Colombier gregbook 26*593dc095SDavid du Colombier pngminus 27*593dc095SDavid du Colombier pngsuite 28*593dc095SDavid du Colombier visupng 29*593dc095SDavid du Colombier projects 30*593dc095SDavid du Colombier beos 31*593dc095SDavid du Colombier c5builder (Borland) 32*593dc095SDavid du Colombier visualc6 (msvc) 33*593dc095SDavid du Colombier netware.txt 34*593dc095SDavid du Colombier wince.txt 35*593dc095SDavid du Colombier scripts 36*593dc095SDavid du Colombier makefile.* 37*593dc095SDavid du Colombier pngtest.png 38*593dc095SDavid du Colombier etc. 39*593dc095SDavid du Colombier zlib 40*593dc095SDavid du Colombier README 41*593dc095SDavid du Colombier *.h 42*593dc095SDavid du Colombier *.c 43*593dc095SDavid du Colombier contrib 44*593dc095SDavid du Colombier etc. 45*593dc095SDavid du Colombier 46*593dc095SDavid du ColombierIf the line endings in the files look funny, you may wish to get the other 47*593dc095SDavid du Colombierdistribution of libpng. It is available in both tar.gz (UNIX style line 48*593dc095SDavid du Colombierendings) and zip (DOS style line endings) formats. 49*593dc095SDavid du Colombier 50*593dc095SDavid du Colombier 51*593dc095SDavid du ColombierIf you are building libpng with MSVC, you can enter the 52*593dc095SDavid du Colombierlibpng projects\visualc6 directory and follow the instructions in 53*593dc095SDavid du Colombierprojects\visualc6\README.txt. 54*593dc095SDavid du Colombier 55*593dc095SDavid du ColombierYou can build libpng for WindowsCE by downloading and installing 56*593dc095SDavid du Colombierthe projects\wince directory as instructed in the projects\wince.txt file, and 57*593dc095SDavid du Colombierthen following the instructions in the README* files. Similarly, you can 58*593dc095SDavid du Colombierbuild libpng for Netware or Beos as instructed in projects\netware.txt 59*593dc095SDavid du Colombieror projects\beos. 60*593dc095SDavid du Colombier 61*593dc095SDavid du ColombierElse enter the zlib directory and follow the instructions in zlib/README, 62*593dc095SDavid du Colombierthen come back here and choose the appropriate makefile.sys in the scripts 63*593dc095SDavid du Colombierdirectory. 64*593dc095SDavid du Colombier 65*593dc095SDavid du ColombierThe files that are presently available in the scripts directory 66*593dc095SDavid du Colombierinclude 67*593dc095SDavid du Colombier 68*593dc095SDavid du Colombier makefile.std => Generic UNIX makefile (cc, creates static libpng.a) 69*593dc095SDavid du Colombier makefile.elf => Linux/ELF makefile symbol versioning, 70*593dc095SDavid du Colombier gcc, creates libpng12.so.0.1.2.8) 71*593dc095SDavid du Colombier makefile.linux => Linux/ELF makefile 72*593dc095SDavid du Colombier (gcc, creates libpng12.so.0.1.2.8) 73*593dc095SDavid du Colombier makefile.gcmmx => Linux/ELF makefile 74*593dc095SDavid du Colombier (gcc, creates libpng12.so.0.1.2.8, 75*593dc095SDavid du Colombier uses assembler code tuned for Intel MMX platform) 76*593dc095SDavid du Colombier makefile.gcc => Generic makefile (gcc, creates static libpng.a) 77*593dc095SDavid du Colombier makefile.knr => Archaic UNIX Makefile that converts files with 78*593dc095SDavid du Colombier ansi2knr (Requires ansi2knr.c from 79*593dc095SDavid du Colombier ftp://ftp.cs.wisc.edu/ghost) 80*593dc095SDavid du Colombier makefile.aix => AIX/gcc makefile 81*593dc095SDavid du Colombier makefile.cygwin => Cygwin/gcc makefile 82*593dc095SDavid du Colombier makefile.darwin => Darwin makefile, can use on MacosX 83*593dc095SDavid du Colombier makefile.dec => DEC Alpha UNIX makefile 84*593dc095SDavid du Colombier makefile.freebsd => FreeBSD makefile 85*593dc095SDavid du Colombier makefile.hpgcc => HPUX makefile using gcc 86*593dc095SDavid du Colombier makefile.hpux => HPUX (10.20 and 11.00) makefile 87*593dc095SDavid du Colombier makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit 88*593dc095SDavid du Colombier makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) 89*593dc095SDavid du Colombier makefile.intel => Intel C/C++ version 4.0 and later 90*593dc095SDavid du Colombier libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later 91*593dc095SDavid du Colombier makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so. 92*593dc095SDavid du Colombier makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD, 93*593dc095SDavid du Colombier makes libpng12.so 94*593dc095SDavid du Colombier makefile.openbsd => OpenBSD makefile 95*593dc095SDavid du Colombier makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) 96*593dc095SDavid du Colombier makefile.sggcc => Silicon Graphics (gcc, 97*593dc095SDavid du Colombier creates libpng12.so.0.1.2.8) 98*593dc095SDavid du Colombier makefile.sunos => Sun makefile 99*593dc095SDavid du Colombier makefile.solaris => Solaris 2.X makefile (gcc, 100*593dc095SDavid du Colombier creates libpng12.so.0.1.2.8) 101*593dc095SDavid du Colombier makefile.so9 => Solaris 9 makefile (gcc, 102*593dc095SDavid du Colombier creates libpng12.so.0.1.2.8) 103*593dc095SDavid du Colombier makefile.32sunu => Sun Ultra 32-bit makefile 104*593dc095SDavid du Colombier makefile.64sunu => Sun Ultra 64-bit makefile 105*593dc095SDavid du Colombier makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc 106*593dc095SDavid du Colombier makefile.mips => MIPS makefile 107*593dc095SDavid du Colombier makefile.acorn => Acorn makefile 108*593dc095SDavid du Colombier makefile.amiga => Amiga makefile 109*593dc095SDavid du Colombier smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler 110*593dc095SDavid du Colombier (Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc) 111*593dc095SDavid du Colombier makefile.atari => Atari makefile 112*593dc095SDavid du Colombier makefile.beos => BEOS makefile for X86 113*593dc095SDavid du Colombier makefile.bor => Borland makefile (uses bcc) 114*593dc095SDavid du Colombier makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode) 115*593dc095SDavid du Colombier makefile.tc3 => Turbo C 3.0 makefile 116*593dc095SDavid du Colombier makefile.dj2 => DJGPP 2 makefile 117*593dc095SDavid du Colombier makefile.msc => Microsoft C makefile 118*593dc095SDavid du Colombier makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and later (uses 119*593dc095SDavid du Colombier assembler code tuned for Intel MMX platform) 120*593dc095SDavid du Colombier makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later (does 121*593dc095SDavid du Colombier not use assembler code) 122*593dc095SDavid du Colombier makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) 123*593dc095SDavid du Colombier pngos2.def => OS/2 module definition file used by makefile.os2 124*593dc095SDavid du Colombier makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model 125*593dc095SDavid du Colombier makevms.com => VMS build script 126*593dc095SDavid du Colombier descrip.mms => VMS makefile for MMS or MMK 127*593dc095SDavid du Colombier SCOPTIONS.ppc => Used with smakefile.ppc 128*593dc095SDavid du Colombier 129*593dc095SDavid du ColombierCopy the file (or files) that you need from the 130*593dc095SDavid du Colombierscripts directory into this directory, for example 131*593dc095SDavid du Colombier 132*593dc095SDavid du Colombier MSDOS example: copy scripts\makefile.msc makefile 133*593dc095SDavid du Colombier UNIX example: cp scripts/makefile.std makefile 134*593dc095SDavid du Colombier 135*593dc095SDavid du ColombierRead the makefile to see if you need to change any source or 136*593dc095SDavid du Colombiertarget directories to match your preferences. 137*593dc095SDavid du Colombier 138*593dc095SDavid du ColombierThen read pngconf.h to see if you want to make any configuration 139*593dc095SDavid du Colombierchanges. 140*593dc095SDavid du Colombier 141*593dc095SDavid du ColombierThen just run "make" which will create the libpng library in 142*593dc095SDavid du Colombierthis directory and "make test" which will run a quick test that reads 143*593dc095SDavid du Colombierthe "pngtest.png" file and writes a "pngout.png" file that should be 144*593dc095SDavid du Colombieridentical to it. Look for "9782 zero samples" in the output of the 145*593dc095SDavid du Colombiertest. For more confidence, you can run another test by typing 146*593dc095SDavid du Colombier"pngtest pngnow.png" and looking for "289 zero samples" in the output. 147*593dc095SDavid du ColombierAlso, you can run "pngtest -m contrib/pngsuite/*.png" and compare 148*593dc095SDavid du Colombieryour output with the result shown in contrib/pngsuite/README. 149*593dc095SDavid du Colombier 150*593dc095SDavid du ColombierMost of the makefiles will allow you to run "make install" to 151*593dc095SDavid du Colombierput the library in its final resting place (if you want to 152*593dc095SDavid du Colombierdo that, run "make install" in the zlib directory first if necessary). 153*593dc095SDavid du ColombierSome also allow you to run "make test-installed" after you have 154*593dc095SDavid du Colombierrun "make install". 155*593dc095SDavid du Colombier 156*593dc095SDavid du ColombierIf you encounter a compiler error message complaining about the 157*593dc095SDavid du Colombierlines 158*593dc095SDavid du Colombier __png.h__ already includes setjmp.h; 159*593dc095SDavid du Colombier __dont__ include it again.; 160*593dc095SDavid du ColombierThis means you have compiled another module that includes setjmp.h, 161*593dc095SDavid du Colombierwhich is hazardous because the two modules might not include exactly 162*593dc095SDavid du Colombierthe same setjmp.h. If you are sure that you know what you are doing 163*593dc095SDavid du Colombierand that they are exactly the same, then you can comment out or 164*593dc095SDavid du Colombierdelete the two lines. Better yet, use the cexcept interface 165*593dc095SDavid du Colombierinstead, as demonstrated in contrib/visupng of the libpng distribution. 166*593dc095SDavid du Colombier 167*593dc095SDavid du ColombierFurther information can be found in the README and libpng.txt 168*593dc095SDavid du Colombierfiles, in the individual makefiles, in png.h, and the manual pages 169*593dc095SDavid du Colombierlibpng.3 and png.5. 170