|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Installing libpng version 1.2.57 - December 29, 2016
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
On Unix/Linux and similar systems, you can simply type
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
./configure [--prefix=/path]
|
|
Packit |
0ba690 |
make check
|
|
Packit |
0ba690 |
make install
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
and ignore the rest of this document.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
If configure does not work on your system and you have a reasonably
|
|
Packit |
0ba690 |
up-to-date set of tools, running ./autogen.sh before running ./configure
|
|
Packit |
0ba690 |
may fix the problem. You can also run the individual commands in
|
|
Packit |
0ba690 |
autogen.sh with the --force option, if supported by your version of
|
|
Packit |
0ba690 |
the tools. If you run 'libtoolize --force', though, this will replace
|
|
Packit |
0ba690 |
the distributed, patched, version of ltmain.sh with an unpatched version
|
|
Packit |
0ba690 |
and your shared library builds may fail to produce libraries with the
|
|
Packit |
0ba690 |
correct version numbers.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Instead, you can use one of the custom-built makefiles in the
|
|
Packit |
0ba690 |
"scripts" directory
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
cp scripts/makefile.system makefile
|
|
Packit |
0ba690 |
make test
|
|
Packit |
0ba690 |
make install
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
The files that are presently available in the scripts directory
|
|
Packit |
0ba690 |
are listed and described in scripts/README.txt.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Or you can use one of the "projects" in the "projects" directory.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Before installing libpng, you must first install zlib, if it
|
|
Packit |
0ba690 |
is not already on your system. zlib can usually be found
|
|
Packit |
0ba690 |
wherever you got libpng. zlib can be placed in another directory,
|
|
Packit |
0ba690 |
at the same level as libpng.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
If you want to use "cmake" (see www.cmake.org), type
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
cmake . -DCMAKE_INSTALL_PREFIX=/path
|
|
Packit |
0ba690 |
make
|
|
Packit |
0ba690 |
make install
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
If your system already has a preinstalled zlib you will still need
|
|
Packit |
0ba690 |
to have access to the zlib.h and zconf.h include files that
|
|
Packit |
0ba690 |
correspond to the version of zlib that's installed.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
You can rename the directories that you downloaded (they
|
|
Packit |
0ba690 |
might be called "libpng-1.2.57" or "libpng12" and "zlib-1.2.3"
|
|
Packit |
0ba690 |
or "zlib123") so that you have directories called "zlib" and "libpng".
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Your directory structure should look like this:
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
.. (the parent directory)
|
|
Packit |
0ba690 |
libpng (this directory)
|
|
Packit |
0ba690 |
INSTALL (this file)
|
|
Packit |
0ba690 |
README
|
|
Packit |
0ba690 |
*.h
|
|
Packit |
0ba690 |
*.c
|
|
Packit |
0ba690 |
CMakeLists.txt => "cmake" script
|
|
Packit |
0ba690 |
configuration files:
|
|
Packit |
0ba690 |
configure.ac, configure, Makefile.am, Makefile.in,
|
|
Packit |
0ba690 |
autogen.sh, config.guess, ltmain.sh, missing,
|
|
Packit |
0ba690 |
aclocal.m4, config.h.in, config.sub,
|
|
Packit |
0ba690 |
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
|
|
Packit |
0ba690 |
contrib
|
|
Packit |
0ba690 |
gregbook
|
|
Packit |
0ba690 |
pngminim
|
|
Packit |
0ba690 |
pngminus
|
|
Packit |
0ba690 |
pngsuite
|
|
Packit |
0ba690 |
visupng
|
|
Packit |
0ba690 |
projects
|
|
Packit |
0ba690 |
cbuilder5 (Borland)
|
|
Packit |
0ba690 |
visualc6 (msvc)
|
|
Packit |
0ba690 |
visualc71
|
|
Packit |
0ba690 |
xcode
|
|
Packit |
0ba690 |
scripts
|
|
Packit |
0ba690 |
makefile.*
|
|
Packit |
0ba690 |
*.def (module definition files)
|
|
Packit |
0ba690 |
pngtest.png
|
|
Packit |
0ba690 |
etc.
|
|
Packit |
0ba690 |
zlib
|
|
Packit |
0ba690 |
README
|
|
Packit |
0ba690 |
*.h
|
|
Packit |
0ba690 |
*.c
|
|
Packit |
0ba690 |
contrib
|
|
Packit |
0ba690 |
etc.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
If the line endings in the files look funny, you may wish to get the other
|
|
Packit |
0ba690 |
distribution of libpng. It is available in both tar.gz (UNIX style line
|
|
Packit |
0ba690 |
endings) and zip (DOS style line endings) formats.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
If you are building libpng with MSVC, you can enter the
|
|
Packit |
0ba690 |
libpng projects\visualc6 or visualc71 directory and follow the instructions
|
|
Packit |
0ba690 |
in README.txt.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Otherwise enter the zlib directory and follow the instructions in zlib/README,
|
|
Packit |
0ba690 |
then come back here and run "configure" or choose the appropriate
|
|
Packit |
0ba690 |
makefile.sys in the scripts directory.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Copy the file (or files) that you need from the
|
|
Packit |
0ba690 |
scripts directory into this directory, for example
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
MSDOS example: copy scripts\makefile.msc makefile
|
|
Packit |
0ba690 |
UNIX example: cp scripts/makefile.std makefile
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Read the makefile to see if you need to change any source or
|
|
Packit |
0ba690 |
target directories to match your preferences.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Then read pngconf.h to see if you want to make any configuration
|
|
Packit |
0ba690 |
changes.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Then just run "make" which will create the libpng library in
|
|
Packit |
0ba690 |
this directory and "make test" which will run a quick test that reads
|
|
Packit |
0ba690 |
the "pngtest.png" file and writes a "pngout.png" file that should be
|
|
Packit |
0ba690 |
identical to it. Look for "9782 zero samples" in the output of the
|
|
Packit |
0ba690 |
test. For more confidence, you can run another test by typing
|
|
Packit |
0ba690 |
"pngtest pngnow.png" and looking for "289 zero samples" in the output.
|
|
Packit |
0ba690 |
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
|
|
Packit |
0ba690 |
your output with the result shown in contrib/pngsuite/README.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Most of the makefiles will allow you to run "make install" to
|
|
Packit |
0ba690 |
put the library in its final resting place (if you want to
|
|
Packit |
0ba690 |
do that, run "make install" in the zlib directory first if necessary).
|
|
Packit |
0ba690 |
Some also allow you to run "make test-installed" after you have
|
|
Packit |
0ba690 |
run "make install".
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
If you encounter a compiler error message complaining about the
|
|
Packit |
0ba690 |
lines
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
__png.h__ already includes setjmp.h;
|
|
Packit |
0ba690 |
__dont__ include it again.;
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
this means you have compiled another module that includes setjmp.h,
|
|
Packit |
0ba690 |
which is hazardous because the two modules might not include exactly
|
|
Packit |
0ba690 |
the same setjmp.h. If you are sure that you know what you are doing
|
|
Packit |
0ba690 |
and that they are exactly the same, then you can comment out or
|
|
Packit |
0ba690 |
delete the two lines. Better yet, use the cexcept interface
|
|
Packit |
0ba690 |
instead, as demonstrated in contrib/visupng of the libpng distribution.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Further information can be found in the README and libpng.txt
|
|
Packit |
0ba690 |
files, in the individual makefiles, in png.h, and the manual pages
|
|
Packit |
0ba690 |
libpng.3 and png.5.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
Using the ./configure script -- 16 December 2002.
|
|
Packit |
0ba690 |
=================================================
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
The ./configure script should work compatibly with what scripts/makefile.*
|
|
Packit |
0ba690 |
did, however there are some options you need to add to configure explicitly,
|
|
Packit |
0ba690 |
which previously was done semi-automatically (if you didn't edit
|
|
Packit |
0ba690 |
scripts/makefile.* yourself, that is)
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
CFLAGS="-Wall -O -funroll-loops \
|
|
Packit |
0ba690 |
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
|
|
Packit |
0ba690 |
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
You can alternatively specify --includedir=/usr/include, /usr/local/include,
|
|
Packit |
0ba690 |
/usr/include/png12, or whatever.
|
|
Packit |
0ba690 |
|
|
Packit |
0ba690 |
|