libtalloc.mk 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ################################################################################
  2. #
  3. # libtalloc
  4. #
  5. ################################################################################
  6. LIBTALLOC_VERSION = 2.4.2
  7. LIBTALLOC_SOURCE = talloc-$(LIBTALLOC_VERSION).tar.gz
  8. LIBTALLOC_SITE = https://www.samba.org/ftp/talloc
  9. LIBTALLOC_LICENSE = LGPL-3.0+
  10. LIBTALLOC_LICENSE_FILES = talloc.h
  11. LIBTALLOC_INSTALL_STAGING = YES
  12. # libtalloc is extracted from the samba source tree, and that has a workaround
  13. # that requires PYTHONHASHSEED to be set, and to be set to 1.
  14. # See https://gitlab.com/samba-team/samba/-/commit/420bbb1d92fd2a28725b53f425ba3d214831b660
  15. LIBTALLOC_CONF_ENV = PYTHONHASHSEED=1
  16. LIBTALLOC_MAKE_ENV = PYTHONHASHSEED=1
  17. # --with-libiconv= is unconditionally passed, even if libiconv is not
  18. # present. Indeed, waf will search for libiconv by default in
  19. # /usr/local. Because of a bug in some waf python script, /usr/local
  20. # is then used in many subsequent and unrelated checks, which
  21. # ultimately causes a failure when BR2_COMPILER_PARANOID_UNSAFE_PATH
  22. # is set. However no need to set libiconv as a dependency of
  23. # libtalloc since it's optional.
  24. LIBTALLOC_CONF_OPTS += --cross-compile \
  25. --cross-answers=$(@D)/cache.txt \
  26. --disable-stack-protector \
  27. --hostcc=gcc \
  28. --with-libiconv=$(STAGING_DIR)/usr
  29. ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
  30. LIBTALLOC_DEPENDENCIES += libtirpc host-pkgconf
  31. endif
  32. ifeq ($(BR2_PACKAGE_PYTHON3),y)
  33. LIBTALLOC_DEPENDENCIES += host-python3 python3
  34. LIBTALLOC_CONF_ENV += \
  35. PYTHON="$(HOST_DIR)/bin/python3" \
  36. PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"
  37. # There isn't any --enable-python configuration option
  38. else
  39. LIBTALLOC_CONF_OPTS += --disable-python
  40. endif
  41. LIBTALLOC_WAF = ./buildtools/bin/waf
  42. # like samba4, libtalloc uses the waf build system which requires a
  43. # proper answers file to configure package before build
  44. define LIBTALLOC_POPULATE_WAF_CACHE
  45. $(INSTALL) -m 0644 package/libtalloc/libtalloc-cache.txt $(@D)/cache.txt
  46. echo 'Checking uname machine type: $(BR2_ARCH)' >> $(@D)/cache.txt
  47. endef
  48. LIBTALLOC_PRE_CONFIGURE_HOOKS += LIBTALLOC_POPULATE_WAF_CACHE
  49. $(eval $(waf-package))