Alien-FreeImage

 view release on metacpan or  search on metacpan

src/Source/LibPNG/INSTALL  view on Meta::CPAN

    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
    make test
    make install

The files that are presently available in the scripts directory
are listed and described in scripts/README.txt.

Or you can use one of the "projects" in the "projects" directory.

Before installing libpng, you must first install zlib, if it
is not already on your system.  zlib can usually be found
wherever you got libpng; otherwise go to http://zlib.net.  You can place
zlib in in the same directory as libpng or in another directory.

If your system already has a preinstalled zlib you will still need
to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed.

If you wish to test with a particular zlib that is not first in the
standard library search path, put ZLIBLIB, ZLIBINC, CPPFLAGS, LDFLAGS,
and LD_LIBRARY_PATH in your environment before running "make test"
or "make distcheck":

ZLIBLIB=/path/to/lib export ZLIBLIB
ZLIBINC=/path/to/include export ZLIBINC
CPPFLAGS="-I$ZLIBINC" export CPPFLAGS
LDFLAGS="-L$ZLIBLIB" export LDFLAGS
LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH

If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
in your environment and type "make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test".

IV. Using cmake

If you want to use "cmake" (see www.cmake.org), type

   cmake . -DCMAKE_INSTALL_PREFIX=/path
   make
   make install

As when using the simple configure method described above, "/path" points to
the installation directory where you want to put the libpng "lib", "include",
and "bin" subdirectories.

V. Directory structure

You can rename the directories that you downloaded (they
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.8"
or "zlib128") so that you have directories called "zlib" and "libpng".

Your directory structure should look like this:

   ..       (the parent directory)
      libpng  (this directory)
          INSTALL (this file)
          README
          *.h, *.c  => libpng source files
          CMakeLists.txt    =>  "cmake" script
          configuration files:
             configure.ac, configure, Makefile.am, Makefile.in,
             autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
             libpng-config.in, aclocal.m4, config.h.in, config.sub,
             depcomp, install-sh, mkinstalldirs, test-pngtest.sh
          contrib
             arm-neon, conftest, examples, gregbook, libtests, pngminim,
             pngminus, pngsuite, tools, visupng
          projects
             cbuilder5, owatcom, visualc71, vstudio, xcode
          scripts
             makefile.*
             *.def (module definition files)
             etc.
          pngtest.png
          etc.
      zlib
          README, *.h, *.c contrib, etc.

If the line endings in the files look funny, you may wish to get the other
distribution of libpng.  It is available in both tar.gz (UNIX style line
endings) and zip (DOS style line endings) formats.

VI. Building with project files

If you are building libpng with MSVC, you can enter the
libpng projects\visualc71 or vstudio directory and follow the instructions
in README.txt.

Otherwise enter the zlib directory and follow the instructions in zlib/README,
then come back here and run "configure" or choose the appropriate
makefile.sys in the scripts directory.

VII. Building with makefiles

Copy the file (or files) that you need from the
scripts directory into this directory, for example

   MSDOS example: copy scripts\makefile.msc makefile
                  copy scripts\pnglibconf.h.prebuilt pnglibconf.h
   UNIX example:  cp scripts/makefile.std makefile
                  cp scripts/pnglibconf.h.prebuilt pnglibconf.h

Read the makefile to see if you need to change any source or
target directories to match your preferences.

Then read pnglibconf.dfa to see if you want to make any configuration
changes.

Then just run "make" which will create the libpng library in
this directory and "make test" which will run a quick test that reads
the "pngtest.png" file and writes a "pngout.png" file that should be
identical to it.  Look for "9782 zero samples" in the output of the
test.  For more confidence, you can run another test by typing
"pngtest pngnow.png" and looking for "289 zero samples" in the output.
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
your output with the result shown in contrib/pngsuite/README.

Most of the makefiles will allow you to run "make install" to
put the library in its final resting place (if you want to
do that, run "make install" in the zlib directory first if necessary).
Some also allow you to run "make test-installed" after you have
run "make install".

VIII. Configuring libpng for 16-bit platforms

You will want to look into zconf.h to tell zlib (and thus libpng) that
it cannot allocate more then 64K at a time.  Even if you can, the memory
won't be accessible.  So limit zlib and libpng to 64K by defining MAXSEG_64K.

IX. Configuring for DOS

For DOS users who only have access to the lower 640K, you will
have to limit zlib's memory usage via a png_set_compression_mem_level()
call.  See zlib.h or zconf.h in the zlib library for more information.

X. Configuring for Medium Model

Libpng's support for medium model has been tested on most of the popular
compilers.  Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets
defined, and FAR gets defined to far in pngconf.h, and you should be
all set.  Everything in the library (except for zlib's structure) is
expecting far data.  You must use the typedefs with the p or pp on
the end for pointers (or at least look at them and be careful).  Make
note that the rows of data are defined as png_bytepp, which is
an "unsigned char far * far *".

XI. Prepending a prefix to exported symbols

Starting with libpng-1.6.0, you can configure libpng (when using the
"configure" script) to prefix all exported symbols by means of the
configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
string beginning with a letter and containing only uppercase
and lowercase letters, digits, and the underscore (i.e., a C language
identifier).  This creates a set of macros in pnglibconf.h, so this is
transparent to applications; their function calls get transformed by
the macros to use the modified names.

XII. Configuring for compiler xxx:

All includes for libpng are in pngconf.h.  If you need to add, change
or delete an include, this is the place to do it.
The includes that are not needed outside libpng are placed in pngpriv.h,
which is only used by the routines inside libpng itself.
The files in libpng proper only include pngpriv.h and png.h, which
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
As of libpng-1.5.0, pngpriv.h also includes three other private header
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
that previously appeared in the public headers.

XIII. Removing unwanted object code

There are a bunch of #define's in pngconf.h that control what parts of
libpng are compiled.  All the defines end in _SUPPORTED.  If you are
never going to use a capability, you can change the #define to #undef
before recompiling libpng and save yourself code and data space, or
you can turn off individual capabilities with defines that begin with
PNG_NO_.

In libpng-1.5.0 and later, the #define's are in pnglibconf.h instead.

You can also turn all of the transforms and ancillary chunk capabilities
off en masse with compiler directives that define
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
or all four, along with directives to turn on any of the capabilities that
you do want.  The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the
extra transformations but still leave the library fully capable of reading
and writing PNG files with all known public chunks. Use of the
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
that is incapable of reading or writing ancillary chunks.  If you are
not using the progressive reading capability, you can turn that off
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
capability, which you'll still have).

All the reading and writing specific code are in separate files, so the
linker should only grab the files it needs.  However, if you want to
make sure, or if you are building a stand alone library, all the
reading files start with "pngr" and all the writing files start with "pngw".
The files that don't match either (like png.c, pngtrans.c, etc.)
are used for both reading and writing, and always need to be included.
The progressive reader is in pngpread.c

If you are creating or distributing a dynamically linked library (a .so
or DLL file), you should not remove or disable any parts of the library,
as this will cause applications linked with different versions of the
library to fail if they call functions not available in your library.
The size of the library itself should not be an issue, because only
those sections that are actually used will be loaded into memory.

XIV. Changes to the build and configuration of libpng in libpng-1.5.x

Details of internal changes to the library code can be found in the CHANGES
file and in the GIT repository logs.  These will be of no concern to the vast
majority of library users or builders; however, the few who configure libpng
to a non-default feature set may need to change how this is done.



( run in 1.641 second using v1.01-cache-2.11-cpan-119454b85a5 )