Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #
  2. # Copyright (C) 2006-2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=wolfssl
  9. PKG_VERSION:=5.6.6-stable
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
  13. PKG_HASH:=3d2ca672d41c2c2fa667885a80d6fa03c3e91f0f4f72f87aef2bc947e8c87237
  14. PKG_FIXUP:=libtool
  15. PKG_INSTALL:=1
  16. PKG_USE_MIPS16:=0
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_LICENSE:=GPL-2.0-or-later
  19. PKG_LICENSE_FILES:=LICENSING COPYING
  20. PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
  21. PKG_CPE_ID:=cpe:/a:wolfssl:wolfssl
  22. PKG_CONFIG_DEPENDS:=\
  23. CONFIG_WOLFSSL_HAS_AES_CCM \
  24. CONFIG_WOLFSSL_HAS_ARC4 \
  25. CONFIG_WOLFSSL_HAS_CERTGEN \
  26. CONFIG_WOLFSSL_HAS_CHACHA_POLY \
  27. CONFIG_WOLFSSL_HAS_DH \
  28. CONFIG_WOLFSSL_HAS_DTLS \
  29. CONFIG_WOLFSSL_HAS_ECC25519 \
  30. CONFIG_WOLFSSL_HAS_OCSP \
  31. CONFIG_WOLFSSL_HAS_OPENVPN CONFIG_WOLFSSL_ALT_NAMES \
  32. CONFIG_WOLFSSL_HAS_SESSION_TICKET \
  33. CONFIG_WOLFSSL_HAS_TLSV10 \
  34. CONFIG_WOLFSSL_HAS_TLSV13 \
  35. CONFIG_WOLFSSL_HAS_WPAS \
  36. CONFIG_WOLFSSL_HAS_AFALG \
  37. CONFIG_WOLFSSL_HAS_CPU_CRYPTO \
  38. CONFIG_WOLFSSL_HAS_DEVCRYPTO_AES \
  39. CONFIG_WOLFSSL_HAS_DEVCRYPTO_CBC \
  40. CONFIG_WOLFSSL_HAS_DEVCRYPTO_FULL
  41. include $(INCLUDE_DIR)/package.mk
  42. define Package/libwolfssl
  43. SECTION:=libs
  44. SUBMENU:=SSL
  45. CATEGORY:=Libraries
  46. TITLE:=wolfSSL library
  47. URL:=http://www.wolfssl.com/
  48. MENU:=1
  49. PROVIDES:=libcyassl
  50. DEPENDS:=+WOLFSSL_HAS_DEVCRYPTO:kmod-cryptodev +WOLFSSL_HAS_AFALG:kmod-crypto-user
  51. ABI_VERSION:=32
  52. endef
  53. define Package/libwolfssl/description
  54. wolfSSL (formerly CyaSSL) is an SSL library optimized for small
  55. footprint, both on disk and for memory use.
  56. endef
  57. define Package/libwolfssl/config
  58. source "$(SOURCE)/Config.in"
  59. endef
  60. TARGET_CFLAGS += \
  61. $(FPIC) \
  62. -fomit-frame-pointer \
  63. -flto \
  64. -DFP_MAX_BITS=8192 \
  65. $(if $(CONFIG_WOLFSSL_ALT_NAMES),-DWOLFSSL_ALT_NAMES)
  66. TARGET_LDFLAGS += -flto
  67. # --enable-stunnel needed for OpenSSL API compatibility bits
  68. CONFIGURE_ARGS += \
  69. --enable-reproducible-build \
  70. --enable-lighty \
  71. --enable-opensslall \
  72. --enable-opensslextra \
  73. --enable-sni \
  74. --enable-stunnel \
  75. --enable-altcertchains \
  76. --disable-crypttests \
  77. --disable-examples \
  78. --disable-jobserver \
  79. --$(if $(CONFIG_IPV6),enable,disable)-ipv6 \
  80. --$(if $(CONFIG_WOLFSSL_HAS_AES_CCM),enable,disable)-aesccm \
  81. --$(if $(CONFIG_WOLFSSL_HAS_CHACHA_POLY),enable,disable)-chacha \
  82. --$(if $(CONFIG_WOLFSSL_HAS_CHACHA_POLY),enable,disable)-poly1305 \
  83. --$(if $(CONFIG_WOLFSSL_HAS_DH),enable,disable)-dh \
  84. --$(if $(CONFIG_WOLFSSL_HAS_ARC4),enable,disable)-arc4 \
  85. --$(if $(CONFIG_WOLFSSL_HAS_TLSV10),enable,disable)-tlsv10 \
  86. --$(if $(CONFIG_WOLFSSL_HAS_TLSV13),enable,disable)-tls13 \
  87. --$(if $(CONFIG_WOLFSSL_HAS_SESSION_TICKET),enable,disable)-session-ticket \
  88. --$(if $(CONFIG_WOLFSSL_HAS_DTLS),enable,disable)-dtls \
  89. --$(if $(CONFIG_WOLFSSL_HAS_ECC25519),enable,disable)-curve25519 \
  90. --$(if $(CONFIG_WOLFSSL_HAS_AFALG),enable,disable)-afalg \
  91. --$(if $(CONFIG_WOLFSSL_HAS_OPENVPN),enable,disable)-openvpn \
  92. --enable-devcrypto=$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_CBC),cbc\
  93. ,$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_AES),aes\
  94. ,$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_FULL),yes,no)))
  95. ifeq ($(CONFIG_WOLFSSL_HAS_OCSP),y)
  96. CONFIGURE_ARGS += \
  97. --enable-ocsp --enable-ocspstapling --enable-ocspstapling2
  98. endif
  99. ifeq ($(CONFIG_WOLFSSL_HAS_WPAS),y)
  100. CONFIGURE_ARGS += \
  101. --enable-wpas --enable-fortress --enable-fastmath
  102. endif
  103. define Build/InstallDev
  104. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  105. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  106. $(INSTALL_DIR) $(1)/usr/lib
  107. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.{so*,la} $(1)/usr/lib/
  108. ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
  109. ln -s libwolfssl.la $(1)/usr/lib/libcyassl.la
  110. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  111. endef
  112. define Package/libwolfssl/install
  113. $(INSTALL_DIR) $(1)/usr/lib
  114. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so.* $(1)/usr/lib/
  115. endef
  116. $(eval $(call BuildPackage,libwolfssl))