blob: 3c407a8eb1a7bae657a7b0136f3f25e32c4b7c98 [file] [log] [blame]
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -06001
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -06002Installing libpng version 1.2.9beta2 - February 22, 2006
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -06003
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -06004On Unix/Linux and similar systems, you can simply type
5
6 ./configure [--prefix=$HOME]
7 make check
8 make install
9
10and ignore the rest of this document.
11
12Or you can use one of the custom-built makefiles in the
13"scripts" directory
14
15 cp scripts/makefile.system makefile
16 make test
17 make install
18
19Or you can use one of the "projects" in the "projects" directory.
20
21Before installing libpng, you must first install zlib, if it
22is not already on your system. zlib can usually be found
23wherever you got libpng. zlib can be placed in another directory,
24at the same level as libpng.
25
26If your system already has a preinstalled zlib you will still need
27to have access to the zlib.h and zconf.h include files that
28correspond to the version of zlib that's installed.
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -060029
30You can rename the directories that you downloaded (they
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -060031might be called "libpng-1.2.9beta2" or "lpng109" and "zlib-1.2.1"
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060032or "zlib121") so that you have directories called "zlib" and "libpng".
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -060033
34Your directory structure should look like this:
35
36 .. (the parent directory)
37 libpng (this directory)
38 INSTALL (this file)
39 README
40 *.h
41 *.c
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -050042 contrib
43 gregbook
Glenn Randers-Pehrson6d8f3b01999-10-23 08:39:18 -050044 pngminus
45 pngsuite
Glenn Randers-Pehrsondb66d442000-06-23 21:38:16 -050046 visupng
Glenn Randers-Pehrsonfbbb5ec2001-01-15 22:01:20 -060047 projects
Glenn Randers-Pehrson3097f612001-05-07 14:52:45 -050048 beos
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060049 c5builder (Borland)
50 visualc6 (msvc)
Glenn Randers-Pehrsonb1828932001-06-23 08:03:17 -050051 netware.txt
52 wince.txt
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -060053 scripts
54 makefile.*
55 pngtest.png
56 etc.
57 zlib
58 README
59 *.h
60 *.c
61 contrib
62 etc.
63
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -060064If the line endings in the files look funny, you may wish to get the other
65distribution of libpng. It is available in both tar.gz (UNIX style line
66endings) and zip (DOS style line endings) formats.
67
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060068If you are building libpng with MSVC, you can enter the
69libpng projects\visualc6 directory and follow the instructions in
70projects\visualc6\README.txt.
71
72You can build libpng for WindowsCE by downloading and installing
73the projects\wince directory as instructed in the projects\wince.txt file, and
Glenn Randers-Pehrsonb1828932001-06-23 08:03:17 -050074then following the instructions in the README* files. Similarly, you can
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060075build libpng for Netware or Beos as instructed in projects\netware.txt
76or projects\beos.
Glenn Randers-Pehrsond4366722000-06-04 14:29:29 -050077
Glenn Randers-Pehrsondb66d442000-06-23 21:38:16 -050078Else enter the zlib directory and follow the instructions in zlib/README,
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -060079then come back here and run "configure" or choose the appropriate
80makefile.sys in the scripts directory.
Glenn Randers-Pehrsondb66d442000-06-23 21:38:16 -050081
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -060082The files that are presently available in the scripts directory
83include
84
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -060085 makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060086 makefile.elf => Linux/ELF makefile symbol versioning,
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -060087 gcc, creates libpng12.so.0.1.2.9beta2)
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060088 makefile.linux => Linux/ELF makefile
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -060089 (gcc, creates libpng12.so.0.1.2.9beta2)
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060090 makefile.gcmmx => Linux/ELF makefile
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -060091 (gcc, creates libpng12.so.0.1.2.9beta2,
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -060092 uses assembler code tuned for Intel MMX platform)
93 makefile.gcc => Generic makefile (gcc, creates static libpng.a)
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -050094 makefile.knr => Archaic UNIX Makefile that converts files with
95 ansi2knr (Requires ansi2knr.c from
96 ftp://ftp.cs.wisc.edu/ghost)
Glenn Randers-Pehrson0cc2f952002-10-03 06:32:37 -050097 makefile.aix => AIX/gcc makefile
Glenn Randers-Pehrson5e5c1e12000-11-10 12:26:19 -060098 makefile.cygwin => Cygwin/gcc makefile
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -060099 makefile.darwin => Darwin makefile, can use on MacosX
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500100 makefile.dec => DEC Alpha UNIX makefile
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600101 makefile.freebsd => FreeBSD makefile
Glenn Randers-Pehrson3097f612001-05-07 14:52:45 -0500102 makefile.hpgcc => HPUX makefile using gcc
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500103 makefile.hpux => HPUX (10.20 and 11.00) makefile
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600104 makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -0600105 makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
Glenn Randers-Pehrsonec61c232000-05-16 06:17:36 -0500106 makefile.intel => Intel C/C++ version 4.0 and later
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -0600107 libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -0500108 makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600109 makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD,
110 makes libpng12.so
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -0600111 makefile.openbsd => OpenBSD makefile
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600112 makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600113 makefile.sggcc => Silicon Graphics (gcc,
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -0600114 creates libpng12.so.0.1.2.9beta2)
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500115 makefile.sunos => Sun makefile
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600116 makefile.solaris => Solaris 2.X makefile (gcc,
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -0600117 creates libpng12.so.0.1.2.9beta2)
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600118 makefile.so9 => Solaris 9 makefile (gcc,
Glenn Randers-Pehrsonddfebd32006-02-22 09:19:25 -0600119 creates libpng12.so.0.1.2.9beta2)
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -0600120 makefile.32sunu => Sun Ultra 32-bit makefile
121 makefile.64sunu => Sun Ultra 64-bit makefile
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500122 makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
123 makefile.mips => MIPS makefile
124 makefile.acorn => Acorn makefile
125 makefile.amiga => Amiga makefile
126 smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
127 (Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
128 makefile.atari => Atari makefile
129 makefile.beos => BEOS makefile for X86
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600130 makefile.bor => Borland makefile (uses bcc)
131 makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600132 makefile.tc3 => Turbo C 3.0 makefile
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500133 makefile.dj2 => DJGPP 2 makefile
134 makefile.msc => Microsoft C makefile
135 makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and later (uses
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600136 assembler code tuned for Intel MMX platform)
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500137 makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later (does
138 not use assembler code)
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500139 makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
140 pngos2.def => OS/2 module definition file used by makefile.os2
141 makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
142 makevms.com => VMS build script
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600143 descrip.mms => VMS makefile for MMS or MMK
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500144 SCOPTIONS.ppc => Used with smakefile.ppc
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600145
146Copy the file (or files) that you need from the
147scripts directory into this directory, for example
148
Glenn Randers-Pehrson860ab2b1999-10-14 07:43:10 -0500149 MSDOS example: copy scripts\makefile.msc makefile
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600150 UNIX example: cp scripts/makefile.std makefile
151
152Read the makefile to see if you need to change any source or
153target directories to match your preferences.
154
155Then read pngconf.h to see if you want to make any configuration
156changes.
157
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600158Then just run "make" which will create the libpng library in
159this directory and "make test" which will run a quick test that reads
160the "pngtest.png" file and writes a "pngout.png" file that should be
161identical to it. Look for "9782 zero samples" in the output of the
162test. For more confidence, you can run another test by typing
163"pngtest pngnow.png" and looking for "289 zero samples" in the output.
164Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
Glenn Randers-Pehrson6d8f3b01999-10-23 08:39:18 -0500165your output with the result shown in contrib/pngsuite/README.
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600166
167Most of the makefiles will allow you to run "make install" to
168put the library in its final resting place (if you want to
169do that, run "make install" in the zlib directory first if necessary).
Glenn Randers-Pehrsond1e8c862002-06-20 06:54:34 -0500170Some also allow you to run "make test-installed" after you have
Glenn Randers-Pehrson0cc2f952002-10-03 06:32:37 -0500171run "make install".
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600172
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600173If you encounter a compiler error message complaining about the
174lines
175 __png.h__ already includes setjmp.h;
176 __dont__ include it again.;
177This means you have compiled another module that includes setjmp.h,
178which is hazardous because the two modules might not include exactly
179the same setjmp.h. If you are sure that you know what you are doing
180and that they are exactly the same, then you can comment out or
181delete the two lines. Better yet, use the cexcept interface
182instead, as demonstrated in contrib/visupng of the libpng distribution.
183
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600184Further information can be found in the README and libpng.txt
Glenn Randers-Pehrson9c3ab682006-02-20 22:09:05 -0600185files, in the individual makefiles, in png.h, and the manual pages
186libpng.3 and png.5.
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600187
188
189Using the ./configure script -- 16 December 2002.
190=================================================
191
192
193The ./configure script should work compatibly with what scripts/makefile.*
194did, however there are some options you need to add to configure explicitly,
195which previously was done semi-automatically (if you didn't edit
196scripts/makefile.* yourself, that is)
197
198
199CFLAGS="-Wall -O3 -funroll-loops \
200-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
201--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
202
203You can alternatively specify --includedir=/usr/include, /usr/local/include,
204/usr/include/png12, or whatever.
205
206