No Description

Makefile 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #
  2. # Copyright (C) 2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=libwebsockets
  8. PKG_VERSION:=1.3-chrome37-firefox30
  9. PKG_RELEASE:=1
  10. PKG_SOURCE:=v$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=https://github.com/warmcat/$(PKG_NAME)/archive/
  12. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
  14. PKG_LICENSE:=LGPL-2.1+exception
  15. PKG_LICENSE_FILES:=LICENSE
  16. CMAKE_INSTALL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. include $(INCLUDE_DIR)/cmake.mk
  19. CMAKE_OPTIONS += $(if $(CONFIG_PACKAGE_kmod-ipv6),,-DLWS_IPV6=)
  20. CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
  21. # other options worth noting
  22. # CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON
  23. # CMAKE_OPTIONS += -DLWS_WITHOUT_DAEMONIZE=ON
  24. # CMAKE_OPTIONS += -DLWS_WITHOUT_SERVER=ON
  25. # CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON
  26. define Package/$(PKG_NAME)/Default
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. TITLE:=libwebsockets
  30. DEPENDS:=+zlib
  31. endef
  32. define Package/libwebsockets-openssl
  33. $(call Package/$(PKG_NAME)/Default)
  34. TITLE += (OpenSSL)
  35. DEPENDS += +libopenssl
  36. VARIANT:=openssl
  37. endef
  38. define Package/libwebsockets-cyassl
  39. $(call Package/$(PKG_NAME)/Default)
  40. TITLE += (CyaSSL)
  41. DEPENDS += +libcyassl
  42. VARIANT:=cyassl
  43. endef
  44. ifeq ($(BUILD_VARIANT),openssl)
  45. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  46. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  47. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  48. endif
  49. ifeq ($(BUILD_VARIANT),cyassl)
  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. # for cyassl, edit package/libs/cyassl/Makefile to include --enable-opensslextra
  54. # NOTE: it will compile without it, untested whether it it's needed?!
  55. CMAKE_OPTIONS += -DLWS_USE_CYASSL=ON
  56. CMAKE_OPTIONS += -DLWS_CYASSL_LIB=$(STAGING_DIR)/usr/lib/libcyassl.so
  57. CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
  58. endif
  59. define Package/libwebsockets/install
  60. $(INSTALL_DIR) $(1)/usr/lib
  61. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
  62. endef
  63. Package/$(PKG_NAME)-cyassl/install = $(Package/$(PKG_NAME)/install)
  64. Package/$(PKG_NAME)-openssl/install = $(Package/$(PKG_NAME)/install)
  65. $(eval $(call BuildPackage,libwebsockets-openssl))
  66. $(eval $(call BuildPackage,libwebsockets-cyassl))