You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2014-2015 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:=libwebsockets
  9. PKG_VERSION:=3.1.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
  14. PKG_HASH:=db948be74c78fc13f1f1a55e76707d7baae3a1c8f62b625f639e8f2736298324
  15. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
  17. PKG_LICENSE:=LGPL-2.1+exception
  18. PKG_LICENSE_FILES:=LICENSE
  19. CMAKE_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. CMAKE_OPTIONS += -DLWS_IPV6=$(if $(CONFIG_IPV6),ON,OFF)
  23. CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
  24. # other options worth noting
  25. # CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON
  26. # CMAKE_OPTIONS += -DLWS_WITHOUT_DAEMONIZE=ON
  27. # CMAKE_OPTIONS += -DLWS_WITHOUT_SERVER=ON
  28. # CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON
  29. define Package/libwebsockets/Default
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. TITLE:=libwebsockets
  33. DEPENDS:=+zlib +libcap
  34. URL:=https://libwebsockets.org
  35. MAINTAINER:=Karl Palsson <karlp@etactica.com>
  36. PROVIDES:= libwebsockets
  37. endef
  38. define Package/libwebsockets-openssl
  39. $(call Package/libwebsockets/Default)
  40. TITLE += (OpenSSL)
  41. DEPENDS += +libopenssl
  42. VARIANT:=openssl
  43. endef
  44. define Package/libwebsockets-mbedtls
  45. $(call Package/$(PKG_NAME)/Default)
  46. TITLE += (mbedTLS)
  47. DEPENDS += +libmbedtls
  48. VARIANT:=mbedtls
  49. endef
  50. define Package/libwebsockets-full
  51. $(call Package/libwebsockets/Default)
  52. TITLE += (Full - OpenSSL, libuv, plugins, CGI)
  53. DEPENDS += +libopenssl +libuv
  54. VARIANT:=full
  55. endef
  56. ifeq ($(BUILD_VARIANT),openssl)
  57. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  58. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  59. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  60. endif
  61. ifeq ($(BUILD_VARIANT),mbedtls)
  62. CMAKE_OPTIONS += -DLWS_WITH_MBEDTLS=1
  63. endif
  64. ifeq ($(BUILD_VARIANT),full)
  65. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  66. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  67. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  68. CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
  69. CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
  70. CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
  71. CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
  72. CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
  73. endif
  74. define Package/libwebsockets/install
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
  77. endef
  78. Package/libwebsockets-mbedtls/install = $(Package/libwebsockets/install)
  79. Package/libwebsockets-openssl/install = $(Package/libwebsockets/install)
  80. Package/libwebsockets-full/install = $(Package/libwebsockets/install)
  81. $(eval $(call BuildPackage,libwebsockets-openssl))
  82. $(eval $(call BuildPackage,libwebsockets-mbedtls))
  83. $(eval $(call BuildPackage,libwebsockets-full))