2
Installing libpng version 1.2.5 - October 3, 2002
4
Before installing libpng, you must first install zlib. zlib
5
can usually be found wherever you got libpng. zlib can be
6
placed in another directory, at the same level as libpng.
7
Note that your system might already have a preinstalled
8
zlib, but you will still need to have access to the
9
zlib.h and zconf.h include files that correspond to the
10
version of zlib that's installed.
2
Installing libpng version 1.2.12 - June 27, 2006
4
On Unix/Linux and similar systems, you can simply type
6
./configure [--prefix=$HOME]
10
and ignore the rest of this document.
12
If configure does not work on your system and you have a reasonably
13
up-to-date set of tools, running ./autogen.sh before running ./configure
14
may fix the problem. You can also run the individual commands in
15
autogen.sh with the --force option, if supported by your version of
16
the tools. If you run 'libtoolize --force', though, this will replace
17
the distributed, patched, version of ltmain.sh with an unpatched version
18
and your shared library builds may fail to produce libraries with the
19
correct version numbers.
21
Instead, you can use one of the custom-built makefiles in the
24
cp scripts/makefile.system makefile
28
Or you can use one of the "projects" in the "projects" directory.
30
Before installing libpng, you must first install zlib, if it
31
is not already on your system. zlib can usually be found
32
wherever you got libpng. zlib can be placed in another directory,
33
at the same level as libpng.
35
If your system already has a preinstalled zlib you will still need
36
to have access to the zlib.h and zconf.h include files that
37
correspond to the version of zlib that's installed.
12
39
You can rename the directories that you downloaded (they
13
might be called "libpng-1.2.5" or "lpng109" and "zlib-1.1.4"
14
or "zlib114") so that you have directories called "zlib" and "libpng".
40
might be called "libpng-1.2.12" or "lpng109" and "zlib-1.2.1"
41
or "zlib121") so that you have directories called "zlib" and "libpng".
16
43
Your directory structure should look like this:
49
74
distribution of libpng. It is available in both tar.gz (UNIX style line
50
75
endings) and zip (DOS style line endings) formats.
52
If you are building libpng with MSVC, you can enter the libpng\msvc directory
53
and follow the instructions in msvc\README.txt.
77
If you are building libpng with MSVC, you can enter the
78
libpng projects\visualc6 directory and follow the instructions in
79
projects\visualc6\README.txt.
55
You can build libpng for WindowsCE by entering the downloading and installing
56
the libpng\wince directory as instructed in the projects\wince.txt file, and
81
You can build libpng for WindowsCE by downloading and installing
82
the projects\wince directory as instructed in the projects\wince.txt file, and
57
83
then following the instructions in the README* files. Similarly, you can
58
build libpng for Netware as instructed in projects\netware.txt.
84
build libpng for Netware or Beos as instructed in projects\netware.txt
60
87
Else enter the zlib directory and follow the instructions in zlib/README,
61
then come back here and choose the appropriate makefile.sys in the scripts
88
then come back here and run "configure" or choose the appropriate
89
makefile.sys in the scripts directory.
64
91
The files that are presently available in the scripts directory
67
94
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
68
makefile.linux => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.5)
69
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.5,
95
makefile.elf => Linux/ELF makefile symbol versioning,
96
gcc, creates libpng12.so.0.1.2.12)
97
makefile.linux => Linux/ELF makefile
98
(gcc, creates libpng12.so.0.1.2.12)
99
makefile.gcmmx => Linux/ELF makefile
100
(gcc, creates libpng12.so.0.1.2.12,
70
101
uses assembler code tuned for Intel MMX platform)
71
102
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
72
103
makefile.knr => Archaic UNIX Makefile that converts files with
74
105
ftp://ftp.cs.wisc.edu/ghost)
75
106
makefile.aix => AIX/gcc makefile
76
107
makefile.cygwin => Cygwin/gcc makefile
77
makefile.darwin => Darwin makefile
108
makefile.darwin => Darwin makefile, can use on MacosX
78
109
makefile.dec => DEC Alpha UNIX makefile
79
makefile.hpgcc => FreeBSD makefile
110
makefile.freebsd => FreeBSD makefile
80
111
makefile.hpgcc => HPUX makefile using gcc
81
112
makefile.hpux => HPUX (10.20 and 11.00) makefile
113
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit
82
114
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
83
115
makefile.intel => Intel C/C++ version 4.0 and later
84
116
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
85
makefile.macosx => MACOS X Makefile
86
117
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
87
makefile.ne0bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng0.so
118
makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD,
88
120
makefile.openbsd => OpenBSD makefile
89
121
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
90
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.5)
122
makefile.sggcc => Silicon Graphics (gcc,
123
creates libpng12.so.0.1.2.12)
91
124
makefile.sunos => Sun makefile
92
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.5)
93
makefile.so9 => Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.5)
125
makefile.solaris => Solaris 2.X makefile (gcc,
126
creates libpng12.so.0.1.2.12)
127
makefile.so9 => Solaris 9 makefile (gcc,
128
creates libpng12.so.0.1.2.12)
94
129
makefile.32sunu => Sun Ultra 32-bit makefile
95
130
makefile.64sunu => Sun Ultra 64-bit makefile
96
131
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
103
138
makefile.beos => BEOS makefile for X86
104
139
makefile.bor => Borland makefile (uses bcc)
105
140
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
106
makefile.bd32 => To make a png32bd.dll with Borland C++ 4.5
107
141
makefile.tc3 => Turbo C 3.0 makefile
108
142
makefile.dj2 => DJGPP 2 makefile
109
143
makefile.msc => Microsoft C makefile
116
150
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
117
151
makevms.com => VMS build script
118
152
descrip.mms => VMS makefile for MMS or MMK
119
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5
120
153
SCOPTIONS.ppc => Used with smakefile.ppc
122
155
Copy the file (or files) that you need from the
131
164
Then read pngconf.h to see if you want to make any configuration
134
Then just run "make test" which will create the libpng library in
135
this directory and run a quick test that reads the "pngtest.png"
136
file and writes a "pngout.png" file that should be identical to it.
137
Look for "9782 zero samples" in the output of the test. For more
138
confidence, you can run another test by typing "pngtest pngnow.png"
139
and looking for "289 zero samples" in the output. Also, you can
140
run "pngtest -m *.png" in the "contrib/pngsuite" directory and compare
167
Then just run "make" which will create the libpng library in
168
this directory and "make test" which will run a quick test that reads
169
the "pngtest.png" file and writes a "pngout.png" file that should be
170
identical to it. Look for "9782 zero samples" in the output of the
171
test. For more confidence, you can run another test by typing
172
"pngtest pngnow.png" and looking for "289 zero samples" in the output.
173
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
141
174
your output with the result shown in contrib/pngsuite/README.
143
176
Most of the makefiles will allow you to run "make install" to
146
179
Some also allow you to run "make test-installed" after you have
147
180
run "make install".
182
If you encounter a compiler error message complaining about the
184
__png.h__ already includes setjmp.h;
185
__dont__ include it again.;
186
This means you have compiled another module that includes setjmp.h,
187
which is hazardous because the two modules might not include exactly
188
the same setjmp.h. If you are sure that you know what you are doing
189
and that they are exactly the same, then you can comment out or
190
delete the two lines. Better yet, use the cexcept interface
191
instead, as demonstrated in contrib/visupng of the libpng distribution.
149
193
Further information can be found in the README and libpng.txt
150
files, in the individual makefiles, in png.h, in the README files in
151
subdirectories of the LIB directory, and the manual pages libpng.3 and png.5.
194
files, in the individual makefiles, in png.h, and the manual pages
198
Using the ./configure script -- 16 December 2002.
199
=================================================
202
The ./configure script should work compatibly with what scripts/makefile.*
203
did, however there are some options you need to add to configure explicitly,
204
which previously was done semi-automatically (if you didn't edit
205
scripts/makefile.* yourself, that is)
208
CFLAGS="-Wall -O3 -funroll-loops \
209
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
210
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
212
You can alternatively specify --includedir=/usr/include, /usr/local/include,
213
/usr/include/png12, or whatever.