Skip to content
Snippets Groups Projects
Forked from third-party / png
1401 commits behind the upstream repository.
INSTALL 17.30 KiB

Installing libpng

Contents

   I. Simple installation
  II. Rebuilding the configure scripts
 III. Using scripts/makefile*
  IV. Using cmake
   V. Directory structure
  VI. Building with project files
 VII. Building with makefiles
VIII. Configuring libpng for 16-bit platforms
  IX. Configuring for DOS
   X. Configuring for Medium Model
  XI. Prepending a prefix to exported symbols
 XII. Configuring for compiler xxx:
XIII. Removing unwanted object code
 XIV. Changes to the build and configuration of libpng in libpng-1.5.x
  XV. Setjmp/longjmp issues
 XVI. Common linking failures
XVII. Other sources of information about libpng

I. Simple installation

On Unix/Linux and similar systems, you can simply type

    ./configure [--prefix=/path]
    make check
    make install

and ignore the rest of this document.  "/path" is the path to the directory
where you want to install the libpng "lib", "include", and "bin"
subdirectories.

If you downloaded a GIT clone, you will need to run ./autogen.sh before
running ./configure, to create "configure" and "Makefile.in" which are
not included in the GIT repository.

Note that "configure" is only included in the "*.tar" distributions and not
in the "*.zip" or "*.7z" distributions. If you downloaded one of those
distributions, see "Building with project files" or "Building with makefiles",
below.

II. Rebuilding the configure scripts

If configure does not work on your system, or if you have a need to
change configure.ac or Makefile.am, and you have a reasonably
up-to-date set of tools, running ./autogen.sh in a git clone before
running ./configure may fix the problem.  To be really sure that you
aren't using any of the included pre-built scripts, especially if you
are building from a tar distribution instead of a git distribution,
do this:

    ./configure --enable-maintainer-mode
    make maintainer-clean
    ./autogen.sh --maintainer --clean
    ./autogen.sh --maintainer
    ./configure [--prefix=/path] [other options]
    make
    make install
    make check

III. Using scripts/makefile*

Instead, you can use one of the custom-built makefiles in the
"scripts" directory

    cp scripts/pnglibconf.h.prebuilt pnglibconf.h
    cp scripts/makefile.system makefile