cairo.mk 4.3 KB

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