cairo.mk 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ################################################################################
  2. #
  3. # cairo
  4. #
  5. ################################################################################
  6. CAIRO_VERSION = 1.16.0
  7. CAIRO_SOURCE = cairo-$(CAIRO_VERSION).tar.xz
  8. CAIRO_LICENSE = LGPL-2.1 or MPL-1.1 (library)
  9. CAIRO_LICENSE_FILES = COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
  10. CAIRO_SITE = http://cairographics.org/releases
  11. CAIRO_INSTALL_STAGING = YES
  12. # 0002-ft-Use-FT_Done_MM_Var-instead-of-free-when-available-in-cairo_ft_apply_variation.patch
  13. CAIRO_IGNORE_CVES += CVE-2018-19876
  14. # relocation truncated to fit: R_68K_GOT16O
  15. ifeq ($(BR2_m68k_cf),y)
  16. CAIRO_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -mxgot"
  17. endif
  18. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
  19. CAIRO_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) -DCAIRO_NO_MUTEX=1"
  20. endif
  21. # cairo can use C++11 atomics when available, so we need to link with
  22. # libatomic for the architectures who need libatomic.
  23. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  24. CAIRO_CONF_ENV += LIBS="-latomic"
  25. endif
  26. CAIRO_CONF_OPTS = \
  27. --enable-trace=no \
  28. --enable-interpreter=no
  29. CAIRO_DEPENDENCIES = host-pkgconf fontconfig pixman
  30. # Just the bare minimum to make other host-* packages happy
  31. HOST_CAIRO_CONF_OPTS = \
  32. --enable-trace=no \
  33. --enable-interpreter=no \
  34. --disable-directfb \
  35. --enable-ft \
  36. --enable-gobject \
  37. --disable-glesv2 \
  38. --disable-vg \
  39. --disable-xlib \
  40. --disable-xcb \
  41. --without-x \
  42. --disable-xlib-xrender \
  43. --disable-ps \
  44. --disable-pdf \
  45. --enable-png \
  46. --enable-script \
  47. --disable-svg \
  48. --disable-tee \
  49. --disable-xml
  50. HOST_CAIRO_DEPENDENCIES = \
  51. host-freetype \
  52. host-fontconfig \
  53. host-libglib2 \
  54. host-libpng \
  55. host-pixman \
  56. host-pkgconf
  57. # DirectFB svg support rely on Cairo and Cairo DirectFB support depends on
  58. # DirectFB. Break circular dependency by disabling DirectFB support in Cairo
  59. # (which is experimental)
  60. ifeq ($(BR2_PACKAGE_DIRECTFB)x$(BR2_PACKAGE_DIRECTFB_SVG),yx)
  61. CAIRO_CONF_OPTS += --enable-directfb
  62. CAIRO_DEPENDENCIES += directfb
  63. else
  64. CAIRO_CONF_OPTS += --disable-directfb
  65. endif
  66. ifeq ($(BR2_PACKAGE_FREETYPE),y)
  67. CAIRO_CONF_OPTS += --enable-ft
  68. CAIRO_DEPENDENCIES += freetype
  69. else
  70. CAIRO_CONF_OPTS += --disable-ft
  71. endif
  72. ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
  73. CAIRO_CONF_OPTS += --enable-gobject
  74. CAIRO_DEPENDENCIES += libglib2
  75. else
  76. CAIRO_CONF_OPTS += --disable-gobject
  77. endif
  78. # Can use GL or GLESv2 but not both
  79. ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
  80. CAIRO_CONF_OPTS += --enable-gl --disable-glesv2
  81. CAIRO_DEPENDENCIES += libgl
  82. else
  83. ifeq ($(BR2_PACKAGE_HAS_LIBGLES),y)
  84. CAIRO_CONF_OPTS += --disable-gl --enable-glesv2
  85. CAIRO_DEPENDENCIES += libgles
  86. else
  87. CAIRO_CONF_OPTS += --disable-gl --disable-glesv2
  88. endif
  89. endif
  90. ifeq ($(BR2_PACKAGE_HAS_LIBOPENVG),y)
  91. CAIRO_CONF_OPTS += --enable-vg
  92. CAIRO_DEPENDENCIES += libopenvg
  93. else
  94. CAIRO_CONF_OPTS += --disable-vg
  95. endif
  96. ifeq ($(BR2_PACKAGE_LZO),y)
  97. CAIRO_DEPENDENCIES += lzo
  98. endif
  99. ifeq ($(BR2_PACKAGE_XORG7),y)
  100. CAIRO_CONF_OPTS += --enable-xlib --enable-xcb --with-x
  101. CAIRO_DEPENDENCIES += xlib_libX11 xlib_libXext
  102. else
  103. CAIRO_CONF_OPTS += --disable-xlib --disable-xcb --without-x
  104. endif
  105. ifeq ($(BR2_PACKAGE_XLIB_LIBXRENDER),y)
  106. CAIRO_CONF_OPTS += --enable-xlib-xrender
  107. CAIRO_DEPENDENCIES += xlib_libXrender
  108. else
  109. CAIRO_CONF_OPTS += --disable-xlib-xrender
  110. endif
  111. ifeq ($(BR2_PACKAGE_CAIRO_PS),y)
  112. CAIRO_CONF_OPTS += --enable-ps
  113. CAIRO_DEPENDENCIES += zlib
  114. else
  115. CAIRO_CONF_OPTS += --disable-ps
  116. endif
  117. ifeq ($(BR2_PACKAGE_CAIRO_PDF),y)
  118. CAIRO_CONF_OPTS += --enable-pdf
  119. CAIRO_DEPENDENCIES += zlib
  120. else
  121. CAIRO_CONF_OPTS += --disable-pdf
  122. endif
  123. ifeq ($(BR2_PACKAGE_CAIRO_PNG),y)
  124. CAIRO_CONF_OPTS += --enable-png
  125. CAIRO_DEPENDENCIES += libpng
  126. else
  127. CAIRO_CONF_OPTS += --disable-png
  128. endif
  129. ifeq ($(BR2_PACKAGE_CAIRO_SCRIPT),y)
  130. CAIRO_CONF_OPTS += --enable-script
  131. else
  132. CAIRO_CONF_OPTS += --disable-script
  133. endif
  134. ifeq ($(BR2_PACKAGE_CAIRO_SVG),y)
  135. CAIRO_CONF_OPTS += --enable-svg
  136. else
  137. CAIRO_CONF_OPTS += --disable-svg
  138. endif
  139. ifeq ($(BR2_PACKAGE_CAIRO_TEE),y)
  140. CAIRO_CONF_OPTS += --enable-tee
  141. else
  142. CAIRO_CONF_OPTS += --disable-tee
  143. endif
  144. ifeq ($(BR2_PACKAGE_CAIRO_XML),y)
  145. CAIRO_CONF_OPTS += --enable-xml
  146. else
  147. CAIRO_CONF_OPTS += --disable-xml
  148. endif
  149. $(eval $(autotools-package))
  150. $(eval $(host-autotools-package))