Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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:=3.15.3-stable
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
  12. # PKG_SOURCE_URL:=https://www.wolfssl.com/
  13. PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
  14. PKG_HASH:=dc97c07a7667b39a890e14f4b4a209f51524a4cabee7adb6c80822ee78c1f62a
  15. PKG_FIXUP:=libtool
  16. PKG_INSTALL:=1
  17. PKG_USE_MIPS16:=0
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_LICENSE:=GPL-2.0+
  20. PKG_CPE_ID:=cpe:/a:yassl:cyassl
  21. PKG_CONFIG_DEPENDS:=\
  22. CONFIG_WOLFSSL_HAS_AES_CCM CONFIG_WOLFSSL_HAS_AES_GCM \
  23. CONFIG_WOLFSSL_HAS_ARC4 CONFIG_WOLFSSL_HAS_CHACHA \
  24. CONFIG_WOLFSSL_HAS_DES3 CONFIG_WOLFSSL_HAS_DH CONFIG_WOLFSSL_HAS_DTLS \
  25. CONFIG_WOLFSSL_HAS_ECC CONFIG_WOLFSSL_HAS_ECC25519 \
  26. CONFIG_WOLFSSL_HAS_OCSP CONFIG_WOLFSSL_HAS_POLY_1305 \
  27. CONFIG_WOLFSSL_HAS_PSK CONFIG_WOLFSSL_HAS_SESSION_TICKET \
  28. CONFIG_WOLFSSL_HAS_WPAS
  29. include $(INCLUDE_DIR)/package.mk
  30. define Package/libwolfssl
  31. SECTION:=libs
  32. SUBMENU:=SSL
  33. CATEGORY:=Libraries
  34. TITLE:=wolfSSL library
  35. URL:=http://www.wolfssl.com/
  36. MENU:=1
  37. PROVIDES:=libcyassl
  38. endef
  39. define Package/libwolfssl/description
  40. wolfSSL (formerly CyaSSL) is an SSL library optimized for small
  41. footprint, both on disk and for memory use.
  42. endef
  43. define Package/libwolfssl/config
  44. source "$(SOURCE)/Config.in"
  45. endef
  46. TARGET_CFLAGS += $(FPIC)
  47. # --enable-stunnel needed for OpenSSL API compatibility bits
  48. CONFIGURE_ARGS += \
  49. --enable-opensslextra \
  50. --enable-sni \
  51. --enable-stunnel \
  52. --disable-examples \
  53. --disable-leanpsk \
  54. --disable-leantls \
  55. ifeq ($(CONFIG_IPV6),y)
  56. CONFIGURE_ARGS += \
  57. --enable-ipv6
  58. endif
  59. ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y)
  60. CONFIGURE_ARGS += \
  61. --enable-aesccm
  62. endif
  63. ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y)
  64. CONFIGURE_ARGS += \
  65. --disable-aesgcm
  66. endif
  67. ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y)
  68. CONFIGURE_ARGS += \
  69. --disable-chacha
  70. endif
  71. ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y)
  72. CONFIGURE_ARGS += \
  73. --enable-ecc \
  74. --enable-supportedcurves
  75. endif
  76. ifeq ($(CONFIG_WOLFSSL_HAS_DH),y)
  77. CONFIGURE_ARGS += \
  78. --enable-dh
  79. endif
  80. ifneq ($(CONFIG_WOLFSSL_HAS_ARC4),y)
  81. CONFIGURE_ARGS += \
  82. --disable-arc4
  83. else
  84. CONFIGURE_ARGS += \
  85. --enable-arc4
  86. endif
  87. ifneq ($(CONFIG_WOLFSSL_HAS_DES3),y)
  88. CONFIGURE_ARGS += \
  89. --disable-des3
  90. else
  91. CONFIGURE_ARGS += \
  92. --enable-des3
  93. endif
  94. ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y)
  95. CONFIGURE_ARGS += \
  96. --enable-psk
  97. endif
  98. ifeq ($(CONFIG_WOLFSSL_HAS_SESSION_TICKET),y)
  99. CONFIGURE_ARGS += \
  100. --enable-session-ticket
  101. endif
  102. ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y)
  103. CONFIGURE_ARGS += \
  104. --enable-dtls
  105. endif
  106. ifeq ($(CONFIG_WOLFSSL_HAS_OCSP),y)
  107. CONFIGURE_ARGS += \
  108. --enable-ocsp --enable-ocspstapling --enable-ocspstapling2
  109. endif
  110. ifeq ($(CONFIG_WOLFSSL_HAS_WPAS),y)
  111. CONFIGURE_ARGS += \
  112. --enable-wpas --enable-sha512 --enable-fortress --enable-fastmath
  113. endif
  114. ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y)
  115. CONFIGURE_ARGS += \
  116. --enable-curve25519
  117. endif
  118. ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y)
  119. CONFIGURE_ARGS += \
  120. --enable-poly1305
  121. endif
  122. #ifneq ($(CONFIG_TARGET_x86),)
  123. # CONFIGURE_ARGS += --enable-intelasm
  124. #endif
  125. #ifneq ($(CONFIG_TARGET_x86_64),)
  126. # CONFIGURE_ARGS += --enable-intelasm
  127. #endif
  128. define Build/InstallDev
  129. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  130. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  131. $(INSTALL_DIR) $(1)/usr/lib
  132. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.{so*,la} $(1)/usr/lib/
  133. ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
  134. ln -s libwolfssl.la $(1)/usr/lib/libcyassl.la
  135. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  136. endef
  137. define Package/libwolfssl/install
  138. $(INSTALL_DIR) $(1)/usr/lib
  139. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/
  140. ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
  141. endef
  142. $(eval $(call BuildPackage,libwolfssl))