INSTALL 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. Quick-start build instructions
  2. ------------------------------
  3. 1) Configure the package:
  4. ./configure
  5. 2) Compile it:
  6. make
  7. 3) Install it:
  8. make install
  9. This final step may require temporary root access (eg. with sudo) if
  10. you don't have write permission to the directory in which cairo will
  11. be installed.
  12. NOTE: If you are working with source from git/cvs rather than from a tar
  13. file, then you should use ./autogen.sh in place of ./configure
  14. anywhere it is mentioned in these instructions.
  15. More detailed build instructions
  16. --------------------------------
  17. 1) Configure the package
  18. The first step in building cairo is to configure the package by
  19. running the configure script. [Note: if you don't have a configure
  20. script, skip down below to the Extremely detailed build
  21. instructions.]
  22. The configure script attempts to automatically detect as much as
  23. possible about your system. So, you should primarily just accept
  24. its defaults by running:
  25. ./configure
  26. The configure script does accept a large number of options for
  27. fine-tuning its behavior. See "./configure --help" for a complete
  28. list. The most commonly used options are discussed here.
  29. --prefix=PREFIX
  30. This option specifies the directory under which the software
  31. should be installed. By default configure will choose a
  32. directory such as /usr/local. If you would like to install
  33. cairo to some other location, pass the director to configure
  34. with the --prefix option. For example:
  35. ./configure --prefix=/opt/cairo
  36. would install cairo into the /opt/cairo directory. You could
  37. also choose a prefix directory within your home directory if
  38. you don't have write access to any system-wide directory.
  39. After installing into a custom prefix, you will need to set
  40. some environment variables to allow the software to be
  41. found. Assuming the /opt/cairo prefix and assuming you are
  42. using the bash shell, the following environment variables
  43. should be set:
  44. PKG_CONFIG_PATH=/opt/cairo/lib/pkgconfig
  45. LD_LIBRARY_PATH=/opt/cairo/lib
  46. export PKG_CONFIG_PATH LD_LIBRARY_PATH
  47. (NOTE: On Mac OS X, at least, use DYLD_LIBRARY_PATH in place
  48. of LD_LIBRARY_PATH above.)
  49. --enable-XYZ
  50. --enable-XYZ=yes
  51. --enable-XYZ=auto
  52. --enable-XYZ=no
  53. --disable-XYZ
  54. Cairo's various font and surface backends and other features can be
  55. enabled or disabled at configure time. Features can be divided into
  56. three categories based on their default state:
  57. * default=yes: These are the recommended features like PNG functions
  58. and PS/PDF/SVG backends. It is highly recommended to not disable
  59. these features but if that's really what one wants, they can be
  60. disabled using --disable-XYZ.
  61. * default=auto: These are the "native" features, that is, they are
  62. platform specific, like the Xlib surface backend. You probably
  63. want one or two of these. They will be automatically enabled if
  64. all their required facilities are available. Or you can use
  65. --enable-XYZ or --disable-XYZ to make your desire clear, and then
  66. cairo errs during configure if your intention cannot be followed.
  67. * default=no: These are the "experimental" features, and hence by
  68. default off. Use --enabled-XYZ to enable them.
  69. The list of all features and their default state can be seen in the
  70. output of ./configure --help.
  71. 2) Compile the package:
  72. This step is very simple. Just:
  73. make
  74. The Makefiles included with cairo are designed to work on as many
  75. different systems as possible.
  76. When cairo is compiled, you can also run some automated tests of
  77. cairo with:
  78. make check
  79. NOTE: Some versions of X servers will cause the -xlib tests to
  80. report failures in make check even when cairo is working just
  81. fine. If you see failures in nothing but -xlib tests, please
  82. examine the corresponding -xlib-out.png images and compare them to
  83. the -ref.png reference images (the -xlib-diff.png images might also
  84. be useful). If the results seem "close enough" please do not report
  85. a bug against cairo as the "failures" you are seeing are just due
  86. to subtle variations in X server implementations.
  87. 3) Install the package:
  88. The final step is to install the package with:
  89. make install
  90. If you are installing to a system-wide location you may need to
  91. temporarily acquire root access in order to perform this
  92. operation. A good way to do this is to use the sudo program:
  93. sudo make install
  94. Extremely detailed build instructions
  95. -------------------------------------
  96. So you want to build cairo but it didn't come with a configure
  97. script. This is probably because you have checked out the latest
  98. in-development code via git. If you need to be on the bleeding edge,
  99. (for example, because you're wanting to develop some aspect of cairo
  100. itself), then you're in the right place and should read on.
  101. However, if you don't need such a bleeding-edge version of cairo, then
  102. you might prefer to start by building the latest stable cairo release:
  103. http://cairographics.org/releases
  104. or perhaps the latest (unstable) development snapshot:
  105. http://cairographics.org/snapshots
  106. There you'll find nicely packaged tar files that include a configure
  107. script so you can go back the the simpler instructions above.
  108. But you're still reading, so you're someone that loves to
  109. learn. Excellent! We hope you'll learn enough to make some excellent
  110. contributions to cairo. Since you're not using a packaged tar file,
  111. you're going to need some additional tools beyond just a C compiler in
  112. order to compile cairo. Specifically, you need the following utilities:
  113. automake
  114. autoconf
  115. autoheader
  116. aclocal
  117. libtoolize
  118. pkg-config [at least version 0.16]
  119. gtk-doc (recommended)
  120. Hopefully your platform of choice has packages readily available so
  121. that you can easily install things with your system's package
  122. management tool, (such as "apt-get install automake" on Debian or "yum
  123. install automake" on Fedora, etc.). Note that Mac OS X ships with
  124. glibtoolize instead of libtoolize.
  125. Once you have all of those packages installed, the next step is to run
  126. the autogen.sh script. That can be as simple as:
  127. ./autogen.sh
  128. But before you run that command, note that the autogen.sh script
  129. accepts all the same arguments as the configure script, (and in fact,
  130. will generate the configure script and run it with the arguments you
  131. provide). So go back up to step (1) above and see what additional
  132. arguments you might want to pass, (such as prefix). Then continue with
  133. the instructions, simply using ./autogen.sh in place of ./configure.
  134. Happy hacking!