gnutls.mk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ################################################################################
  2. #
  3. # gnutls
  4. #
  5. ################################################################################
  6. GNUTLS_VERSION_MAJOR = 3.6
  7. GNUTLS_VERSION = $(GNUTLS_VERSION_MAJOR).15
  8. GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
  9. GNUTLS_SITE = https://www.gnupg.org/ftp/gcrypt/gnutls/v$(GNUTLS_VERSION_MAJOR)
  10. GNUTLS_LICENSE = LGPL-2.1+ (core library)
  11. GNUTLS_LICENSE_FILES = doc/COPYING.LESSER
  12. ifeq ($(BR2_PACKAGE_GNUTLS_OPENSSL),y)
  13. GNUTLS_LICENSE += , GPL-3.0+ (gnutls-openssl library)
  14. GNUTLS_LICENSE_FILES += doc/COPYING
  15. endif
  16. GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle pcre
  17. GNUTLS_CONF_OPTS = \
  18. --disable-doc \
  19. --disable-guile \
  20. --disable-libdane \
  21. --disable-rpath \
  22. --enable-local-libopts \
  23. --enable-openssl-compatibility \
  24. --with-librt-prefix=$(STAGING_DIR) \
  25. --without-tpm \
  26. $(if $(BR2_PACKAGE_GNUTLS_OPENSSL),--enable,--disable)-openssl-compatibility \
  27. $(if $(BR2_PACKAGE_GNUTLS_TOOLS),--enable-tools,--disable-tools)
  28. GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
  29. ac_cv_header_wchar_h=$(if $(BR2_USE_WCHAR),yes,no) \
  30. gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no) \
  31. gt_cv_c_wint_t=$(if $(BR2_USE_WCHAR),yes,no) \
  32. gl_cv_func_gettimeofday_clobber=no
  33. GNUTLS_INSTALL_STAGING = YES
  34. # libpthread autodetection poison the linkpath
  35. GNUTLS_CONF_OPTS += $(if $(BR2_TOOLCHAIN_HAS_THREADS),--with-libpthread-prefix=$(STAGING_DIR)/usr)
  36. # gnutls needs libregex, but pcre can be used too
  37. # The check isn't cross-compile friendly
  38. GNUTLS_CONF_ENV += libopts_cv_with_libregex=yes
  39. GNUTLS_CONF_OPTS += \
  40. --with-regex-header=pcreposix.h \
  41. --with-libregex-cflags="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --cflags`" \
  42. --with-libregex-libs="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --libs`"
  43. # Consider crywrap as part of tools because it needs WCHAR, and it's so too
  44. ifeq ($(BR2_PACKAGE_GNUTLS_TOOLS),)
  45. GNUTLS_CONF_OPTS += --disable-crywrap
  46. endif
  47. # Prerequisite for crywrap
  48. ifeq ($(BR2_PACKAGE_ARGP_STANDALONE),y)
  49. GNUTLS_LIBS += -largp
  50. GNUTLS_DEPENDENCIES += argp-standalone
  51. endif
  52. # libidn support for nommu must exclude the crywrap wrapper (uses fork)
  53. GNUTLS_CONF_OPTS += $(if $(BR2_USE_MMU),,--disable-crywrap)
  54. ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
  55. GNUTLS_CONF_OPTS += --enable-cryptodev
  56. GNUTLS_DEPENDENCIES += cryptodev-linux
  57. endif
  58. ifeq ($(BR2_PACKAGE_LIBIDN2),y)
  59. GNUTLS_CONF_OPTS += --with-idn
  60. GNUTLS_DEPENDENCIES += libidn2
  61. else
  62. GNUTLS_CONF_OPTS += --without-idn
  63. endif
  64. ifeq ($(BR2_PACKAGE_P11_KIT),y)
  65. GNUTLS_CONF_OPTS += --with-p11-kit
  66. GNUTLS_DEPENDENCIES += p11-kit
  67. else
  68. GNUTLS_CONF_OPTS += --without-p11-kit
  69. endif
  70. ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
  71. GNUTLS_CONF_OPTS += --with-libunistring-prefix=$(STAGING_DIR)/usr
  72. GNUTLS_DEPENDENCIES += libunistring
  73. else
  74. GNUTLS_CONF_OPTS += --with-included-unistring
  75. endif
  76. # Provide a default CA cert location
  77. ifeq ($(BR2_PACKAGE_P11_KIT),y)
  78. GNUTLS_CONF_OPTS += --with-default-trust-store-pkcs11=pkcs11:model=p11-kit-trust
  79. else ifeq ($(BR2_PACKAGE_CA_CERTIFICATES),y)
  80. GNUTLS_CONF_OPTS += --with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt
  81. endif
  82. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  83. GNUTLS_LIBS += -latomic
  84. endif
  85. GNUTLS_CONF_ENV += LIBS="$(GNUTLS_LIBS)"
  86. $(eval $(autotools-package))