Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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:=2.0.3
  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_MD5SUM:=a025156d606d90579e65d53ccd062a94
  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. PROVIDES:=libwebsockets
  34. DEPENDS:=+zlib
  35. URL:=https://libwebsockets.org
  36. MAINTAINER:=Karl Palsson <karlp@etactica.com>
  37. endef
  38. define Package/libwebsockets-openssl
  39. $(call Package/$(PKG_NAME)/Default)
  40. TITLE += (OpenSSL)
  41. DEPENDS += +libopenssl
  42. VARIANT:=openssl
  43. endef
  44. define Package/libwebsockets-cyassl
  45. $(call Package/$(PKG_NAME)/Default)
  46. TITLE += (CyaSSL)
  47. DEPENDS += +libcyassl
  48. VARIANT:=cyassl
  49. endef
  50. define Package/libwebsockets-full
  51. $(call Package/$(PKG_NAME)/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),cyassl)
  62. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  63. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  64. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  65. # for cyassl, edit package/libs/cyassl/Makefile to include --enable-opensslextra
  66. # NOTE: it will compile without it, untested whether it it's needed?!
  67. CMAKE_OPTIONS += -DLWS_USE_CYASSL=ON
  68. CMAKE_OPTIONS += -DLWS_CYASSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libcyassl.so
  69. CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
  70. endif
  71. ifeq ($(BUILD_VARIANT),full)
  72. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  73. CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
  74. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  75. CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
  76. CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
  77. CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
  78. CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
  79. CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
  80. endif
  81. define Package/libwebsockets/install
  82. $(INSTALL_DIR) $(1)/usr/lib
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
  84. endef
  85. Package/$(PKG_NAME)-cyassl/install = $(Package/$(PKG_NAME)/install)
  86. Package/$(PKG_NAME)-openssl/install = $(Package/$(PKG_NAME)/install)
  87. Package/$(PKG_NAME)-full/install = $(Package/$(PKG_NAME)/install)
  88. $(eval $(call BuildPackage,libwebsockets-openssl))
  89. $(eval $(call BuildPackage,libwebsockets-cyassl))
  90. $(eval $(call BuildPackage,libwebsockets-full))