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.

89 lines
2.5 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:=1.6.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_URL:=https://github.com/warmcat/libwebsockets.git
  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/$(PKG_NAME)/Default
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. TITLE:=libwebsockets
  33. DEPENDS:=+zlib
  34. URL:=https://libwebsockets.org
  35. MAINTAINER:=Karl Palsson <karlp@remake.is>
  36. endef
  37. define Package/libwebsockets-openssl
  38. $(call Package/$(PKG_NAME)/Default)
  39. TITLE += (OpenSSL)
  40. DEPENDS += +libopenssl
  41. VARIANT:=openssl
  42. endef
  43. define Package/libwebsockets-cyassl
  44. $(call Package/$(PKG_NAME)/Default)
  45. TITLE += (CyaSSL)
  46. DEPENDS += +libcyassl
  47. VARIANT:=cyassl
  48. endef
  49. ifeq ($(BUILD_VARIANT),openssl)
  50. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  51. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  52. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  53. endif
  54. ifeq ($(BUILD_VARIANT),cyassl)
  55. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  56. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  57. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  58. # for cyassl, edit package/libs/cyassl/Makefile to include --enable-opensslextra
  59. # NOTE: it will compile without it, untested whether it it's needed?!
  60. CMAKE_OPTIONS += -DLWS_USE_CYASSL=ON
  61. CMAKE_OPTIONS += -DLWS_CYASSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libcyassl.so
  62. CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
  63. endif
  64. define Package/libwebsockets/install
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
  67. endef
  68. Package/$(PKG_NAME)-cyassl/install = $(Package/$(PKG_NAME)/install)
  69. Package/$(PKG_NAME)-openssl/install = $(Package/$(PKG_NAME)/install)
  70. $(eval $(call BuildPackage,libwebsockets-openssl))
  71. $(eval $(call BuildPackage,libwebsockets-cyassl))