INSTALL 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. Installing libpng
  2. On Unix/Linux and similar systems, you can simply type
  3. ./configure [--prefix=/path]
  4. make check
  5. make install
  6. and ignore the rest of this document.
  7. If configure does not work on your system and you have a reasonably
  8. up-to-date set of tools, running ./autogen.sh before running ./configure
  9. may fix the problem. You can also run the individual commands in
  10. autogen.sh with the --force option, if supported by your version of
  11. the tools. To be really sure that you aren't using any of the included
  12. pre-built scripts, you can do this:
  13. ./configure --enable-maintainer-mode
  14. make maintainer-clean
  15. ./autogen.sh
  16. ./configure [--prefix=/path] [other options]
  17. make
  18. make install
  19. make check
  20. Instead, you can use one of the custom-built makefiles in the
  21. "scripts" directory
  22. cp scripts/makefile.system makefile
  23. make test
  24. make install
  25. The files that are presently available in the scripts directory
  26. are listed and described in scripts/README.txt.
  27. Or you can use one of the "projects" in the "projects" directory.
  28. Before installing libpng, you must first install zlib, if it
  29. is not already on your system. zlib can usually be found
  30. wherever you got libpng. zlib can be placed in another directory,
  31. at the same level as libpng.
  32. If you want to use "cmake" (see www.cmake.org), type
  33. cmake . -DCMAKE_INSTALL_PREFIX=/path
  34. make
  35. make install
  36. If your system already has a preinstalled zlib you will still need
  37. to have access to the zlib.h and zconf.h include files that
  38. correspond to the version of zlib that's installed.
  39. You can rename the directories that you downloaded (they
  40. might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.5"
  41. or "zlib125") so that you have directories called "zlib" and "libpng".
  42. Your directory structure should look like this:
  43. .. (the parent directory)
  44. libpng (this directory)
  45. INSTALL (this file)
  46. README
  47. *.h
  48. *.c
  49. CMakeLists.txt => "cmake" script
  50. configuration files:
  51. configure.ac, configure, Makefile.am, Makefile.in,
  52. autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
  53. libpng-config.in, aclocal.m4, config.h.in, config.sub,
  54. depcomp, install-sh, mkinstalldirs, test-pngtest.sh
  55. contrib
  56. gregbook
  57. pngminim
  58. pngminus
  59. pngsuite
  60. visupng
  61. projects
  62. visualc71
  63. vstudio
  64. scripts
  65. makefile.*
  66. *.def (module definition files)
  67. etc.
  68. pngtest.png
  69. etc.
  70. zlib
  71. README
  72. *.h
  73. *.c
  74. contrib
  75. etc.
  76. If the line endings in the files look funny, you may wish to get the other
  77. distribution of libpng. It is available in both tar.gz (UNIX style line
  78. endings) and zip (DOS style line endings) formats.
  79. If you are building libpng with MSVC, you can enter the
  80. libpng projects\visualc6 or visualc71 directory and follow the instructions
  81. in README.txt.
  82. Otherwise enter the zlib directory and follow the instructions in zlib/README,
  83. then come back here and run "configure" or choose the appropriate
  84. makefile.sys in the scripts directory.
  85. Copy the file (or files) that you need from the
  86. scripts directory into this directory, for example
  87. MSDOS example: copy scripts\makefile.msc makefile
  88. UNIX example: cp scripts/makefile.std makefile
  89. Read the makefile to see if you need to change any source or
  90. target directories to match your preferences.
  91. Then read pnglibconf.dfa to see if you want to make any configuration
  92. changes.
  93. Then just run "make" which will create the libpng library in
  94. this directory and "make test" which will run a quick test that reads
  95. the "pngtest.png" file and writes a "pngout.png" file that should be
  96. identical to it. Look for "9782 zero samples" in the output of the
  97. test. For more confidence, you can run another test by typing
  98. "pngtest pngnow.png" and looking for "289 zero samples" in the output.
  99. Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
  100. your output with the result shown in contrib/pngsuite/README.
  101. Most of the makefiles will allow you to run "make install" to
  102. put the library in its final resting place (if you want to
  103. do that, run "make install" in the zlib directory first if necessary).
  104. Some also allow you to run "make test-installed" after you have
  105. run "make install".
  106. Further information can be found in the README and libpng-manual.txt
  107. files, in the individual makefiles, in png.h, and the manual pages
  108. libpng.3 and png.5.