1# 2# libwebsockets makefile for openwrt 3# 4 5include $(TOPDIR)/rules.mk 6 7PKG_NAME:=libwebsockets 8PKG_VERSION:=2014-03-01 9PKG_RELEASE=$(PKG_SOURCE_VERSION) 10 11PKG_SOURCE_PROTO:=git 12PKG_SOURCE_URL:=https://github.com/warmcat/libwebsockets.git 13PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 14PKG_SOURCE_VERSION:=388dc7d201d8d123841869fb49ec4d94d6dd7f54 15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz 16CMAKE_INSTALL:=1 17 18include $(INCLUDE_DIR)/package.mk 19include $(INCLUDE_DIR)/cmake.mk 20 21CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs 22CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON 23CMAKE_OPTIONS += -DLWS_WITH_SSL=ON 24CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=$(if $(CONFIG_PACKAGE_libwebsockets-examples),"OFF","ON") 25 26# for wolfssl, define these in addition to LWS_OPENSSL_SUPPORT and 27# edit package/libs/wolfssl/Makefile to include --enable-opensslextra 28# CMAKE_OPTIONS += -DLWS_WITH_WOLFSSL=ON 29# CMAKE_OPTIONS += -DLWS_WOLFSSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libwolfssl.so 30# CMAKE_OPTIONS += -DLWS_WOLFSSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include 31 32# for cyassl, define these in addition to LWS_OPENSSL_SUPPORT and 33# edit package/libs/wolfssl/Makefile to include --enable-opensslextra 34# CMAKE_OPTIONS += -DLWS_WITH_CYASSL=ON 35# CMAKE_OPTIONS += -DLWS_CYASSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libcyassl.so 36# CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include 37 38# other options worth noting 39# CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON 40# CMAKE_OPTIONS += -DLWS_WITHOUT_DAEMONIZE=ON 41# CMAKE_OPTIONS += -DLWS_WITHOUT_SERVER=ON 42# CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON 43 44 45define Package/libwebsockets/Default 46 SECTION:=libs 47 CATEGORY:=Libraries 48 TITLE:=libwebsockets 49 DEPENDS:=+zlib +libopenssl 50endef 51 52define Package/libwebsockets 53 $(call Package/libwebsockets/Default) 54 TITLE+= (libraries) 55endef 56 57define Package/libwebsockets/description 58 libwebsockets 59 This package contains libwebsocket libraries 60endef 61 62define Package/libwebsockets-examples 63 $(call Package/libwebsockets/Default) 64 DEPENDS:=libwebsockets 65 TITLE+= (examples) 66endef 67 68define Package/libwebsockets-examples/description 69 libwebsockets examples 70 This package contains libwebsockets examples 71endef 72 73define Package/libwebsockets/install 74 $(INSTALL_DIR) $(1)/usr/lib 75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/ 76endef 77 78define Package/libwebsockets-examples/install 79 $(INSTALL_DIR) $(1)/usr/bin 80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-client $(1)/usr/bin/ 81 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-echo $(1)/usr/bin/ 82 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-fraggle $(1)/usr/bin/ 83 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-ping $(1)/usr/bin/ 84 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-server $(1)/usr/bin/ 85 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-server-extpoll $(1)/usr/bin/ 86 87 $(INSTALL_DIR) $(1)/usr/share/libwebsockets-test-server 88 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/favicon.ico $(1)/usr/share/libwebsockets-test-server/ 89 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/leaf.jpg $(1)/usr/share/libwebsockets-test-server/ 90 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/libwebsockets.org-logo.png $(1)/usr/share/libwebsockets-test-server/ 91 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/libwebsockets-test-server.key.pem $(1)/usr/share/libwebsockets-test-server/ 92 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/libwebsockets-test-server.pem $(1)/usr/share/libwebsockets-test-server/ 93 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/test.html $(1)/usr/share/libwebsockets-test-server/ 94endef 95 96$(eval $(call BuildPackage,libwebsockets)) 97$(eval $(call BuildPackage,libwebsockets-examples)) 98