libglib2.mk 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ################################################################################
  2. #
  3. # libglib2
  4. #
  5. ################################################################################
  6. LIBGLIB2_VERSION_MAJOR = 2.52
  7. LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).2
  8. LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.xz
  9. LIBGLIB2_SITE = http://ftp.gnome.org/pub/gnome/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
  10. LIBGLIB2_LICENSE = LGPL-2.0+
  11. LIBGLIB2_LICENSE_FILES = COPYING
  12. LIBGLIB2_INSTALL_STAGING = YES
  13. LIBGLIB2_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/lib install
  14. LIBGLIB2_CONF_ENV = \
  15. ac_cv_func_posix_getpwuid_r=yes \
  16. glib_cv_stack_grows=no \
  17. glib_cv_uscore=no \
  18. ac_cv_func_strtod=yes \
  19. ac_fsusage_space=yes \
  20. fu_cv_sys_stat_statfs2_bsize=yes \
  21. ac_cv_func_closedir_void=no \
  22. ac_cv_func_getloadavg=no \
  23. ac_cv_lib_util_getloadavg=no \
  24. ac_cv_lib_getloadavg_getloadavg=no \
  25. ac_cv_func_getgroups=yes \
  26. ac_cv_func_getgroups_works=yes \
  27. ac_cv_func_chown_works=yes \
  28. ac_cv_have_decl_euidaccess=no \
  29. ac_cv_func_euidaccess=no \
  30. ac_cv_have_decl_strnlen=yes \
  31. ac_cv_func_strnlen_working=yes \
  32. ac_cv_func_lstat_dereferences_slashed_symlink=yes \
  33. ac_cv_func_lstat_empty_string_bug=no \
  34. ac_cv_func_stat_empty_string_bug=no \
  35. vb_cv_func_rename_trailing_slash_bug=no \
  36. ac_cv_have_decl_nanosleep=yes \
  37. jm_cv_func_nanosleep_works=yes \
  38. gl_cv_func_working_utimes=yes \
  39. ac_cv_func_utime_null=yes \
  40. ac_cv_have_decl_strerror_r=yes \
  41. ac_cv_func_strerror_r_char_p=no \
  42. jm_cv_func_svid_putenv=yes \
  43. ac_cv_func_getcwd_null=yes \
  44. ac_cv_func_getdelim=yes \
  45. ac_cv_func_mkstemp=yes \
  46. utils_cv_func_mkstemp_limitations=no \
  47. utils_cv_func_mkdir_trailing_slash_bug=no \
  48. jm_cv_func_gettimeofday_clobber=no \
  49. gl_cv_func_working_readdir=yes \
  50. jm_ac_cv_func_link_follows_symlink=no \
  51. utils_cv_localtime_cache=no \
  52. ac_cv_struct_st_mtim_nsec=no \
  53. gl_cv_func_tzset_clobber=no \
  54. gl_cv_func_getcwd_null=yes \
  55. gl_cv_func_getcwd_path_max=yes \
  56. ac_cv_func_fnmatch_gnu=yes \
  57. am_getline_needs_run_time_check=no \
  58. am_cv_func_working_getline=yes \
  59. gl_cv_func_mkdir_trailing_slash_bug=no \
  60. gl_cv_func_mkstemp_limitations=no \
  61. ac_cv_func_working_mktime=yes \
  62. jm_cv_func_working_re_compile_pattern=yes \
  63. ac_use_included_regex=no \
  64. gl_cv_c_restrict=no \
  65. ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/bin/glib-genmarshal \
  66. ac_cv_prog_F77=no \
  67. ac_cv_func_posix_getgrgid_r=no \
  68. glib_cv_long_long_format=ll \
  69. ac_cv_func_printf_unix98=yes \
  70. ac_cv_func_vsnprintf_c99=yes \
  71. ac_cv_func_newlocale=no \
  72. ac_cv_func_uselocale=no \
  73. ac_cv_func_strtod_l=no \
  74. ac_cv_func_strtoll_l=no \
  75. ac_cv_func_strtoull_l=no \
  76. gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no)
  77. # old uClibc versions don't provide qsort_r
  78. ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
  79. LIBGLIB2_CONF_ENV += glib_cv_have_qsort_r=no
  80. else
  81. LIBGLIB2_CONF_ENV += glib_cv_have_qsort_r=yes
  82. endif
  83. # glib/valgrind.h contains inline asm not compatible with thumb1
  84. ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
  85. LIBGLIB2_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
  86. endif
  87. HOST_LIBGLIB2_CONF_OPTS = \
  88. --disable-coverage \
  89. --disable-dtrace \
  90. --disable-fam \
  91. --disable-libelf \
  92. --disable-selinux \
  93. --disable-systemtap \
  94. --disable-xattr \
  95. --with-pcre=system
  96. LIBGLIB2_DEPENDENCIES = \
  97. host-pkgconf host-libglib2 \
  98. libffi pcre util-linux zlib $(TARGET_NLS_DEPENDENCIES)
  99. HOST_LIBGLIB2_DEPENDENCIES = \
  100. host-gettext \
  101. host-libffi \
  102. host-pcre \
  103. host-pkgconf \
  104. host-util-linux \
  105. host-zlib
  106. LIBGLIB2_CONF_OPTS = \
  107. --with-pcre=system \
  108. --disable-compile-warnings
  109. ifneq ($(BR2_ENABLE_LOCALE),y)
  110. LIBGLIB2_DEPENDENCIES += libiconv
  111. endif
  112. ifeq ($(BR2_PACKAGE_ELFUTILS),y)
  113. LIBGLIB2_CONF_OPTS += --enable-libelf
  114. LIBGLIB2_DEPENDENCIES += elfutils
  115. else
  116. LIBGLIB2_CONF_OPTS += --disable-libelf
  117. endif
  118. ifeq ($(BR2_PACKAGE_LIBICONV),y)
  119. LIBGLIB2_CONF_OPTS += --with-libiconv=gnu
  120. LIBGLIB2_DEPENDENCIES += libiconv
  121. endif
  122. # Purge gdb-related files
  123. ifneq ($(BR2_PACKAGE_GDB),y)
  124. define LIBGLIB2_REMOVE_GDB_FILES
  125. rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
  126. endef
  127. endif
  128. # Purge useless binaries from target
  129. define LIBGLIB2_REMOVE_DEV_FILES
  130. rm -rf $(TARGET_DIR)/usr/lib/glib-2.0
  131. rm -rf $(addprefix $(TARGET_DIR)/usr/share/glib-2.0/,codegen gettext)
  132. rm -f $(addprefix $(TARGET_DIR)/usr/bin/,gdbus-codegen glib-compile-schemas glib-compile-resources glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
  133. $(LIBGLIB2_REMOVE_GDB_FILES)
  134. endef
  135. LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
  136. # Remove schema sources/DTDs, we use staging ones to compile them.
  137. # Do so at target finalization since other packages install additional
  138. # ones and we want to deal with it in a single place.
  139. define LIBGLIB2_REMOVE_TARGET_SCHEMAS
  140. rm -f $(TARGET_DIR)/usr/share/glib-2.0/schemas/*.xml \
  141. $(TARGET_DIR)/usr/share/glib-2.0/schemas/*.dtd
  142. endef
  143. # Compile schemas at target finalization since other packages install
  144. # them as well, and better do it in a central place.
  145. # It's used at run time so it doesn't matter defering it.
  146. define LIBGLIB2_COMPILE_SCHEMAS
  147. $(HOST_DIR)/bin/glib-compile-schemas \
  148. $(STAGING_DIR)/usr/share/glib-2.0/schemas \
  149. --targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
  150. endef
  151. LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
  152. LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
  153. $(eval $(autotools-package))
  154. $(eval $(host-autotools-package))
  155. LIBGLIB2_HOST_BINARY = $(HOST_DIR)/bin/glib-genmarshal