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.

63 lines
1.9 KiB

  1. #
  2. # Copyright (C) 2018 Jianhui Zhao
  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:=libuhttpd
  9. PKG_VERSION:=3.12.1
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL=https://github.com/zhaojh329/libuhttpd/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=c234dd3d491c4daa047e28870c6e740529b2eff2dd027dafb6bf02d8dba286b0
  14. PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
  15. PKG_LICENSE:=MIT
  16. PKG_LICENSE_FILES:=LICENSE
  17. CMAKE_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/libuhttpd/Default
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. SUBMENU:=Networking
  24. TITLE:=A lightweight HTTP server library based on libev
  25. URL:=https://github.com/zhaojh329/libuhttpd
  26. DEPENDS:=+libev $(2)
  27. VARIANT:=$(1)
  28. PROVIDES:=libuhttpd
  29. endef
  30. Package/libuhttpd-openssl=$(call Package/libuhttpd/Default,openssl,+PACKAGE_libuhttpd-openssl:libopenssl)
  31. Package/libuhttpd-wolfssl=$(call Package/libuhttpd/Default,wolfssl,+PACKAGE_libuhttpd-wolfssl:libwolfssl)
  32. Package/libuhttpd-mbedtls=$(call Package/libuhttpd/Default,mbedtls,+PACKAGE_libuhttpd-mbedtls:libmbedtls +PACKAGE_libuhttpd-mbedtls:zlib)
  33. Package/libuhttpd-nossl=$(call Package/libuhttpd/Default,nossl)
  34. CMAKE_OPTIONS += -DBUILD_EXAMPLE=OFF
  35. ifeq ($(BUILD_VARIANT),openssl)
  36. CMAKE_OPTIONS += -DUSE_OPENSSL=ON
  37. else ifeq ($(BUILD_VARIANT),wolfssl)
  38. CMAKE_OPTIONS += -DUSE_WOLFSSL=ON
  39. else ifeq ($(BUILD_VARIANT),mbedtls)
  40. CMAKE_OPTIONS += -DUSE_MBEDTLS=ON
  41. else
  42. CMAKE_OPTIONS += -DSSL_SUPPORT=OFF
  43. endif
  44. define Package/libuhttpd-$(BUILD_VARIANT)/install
  45. $(INSTALL_DIR) $(1)/usr/lib
  46. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuhttpd.so* $(1)/usr/lib/
  47. endef
  48. $(eval $(call BuildPackage,libuhttpd-openssl))
  49. $(eval $(call BuildPackage,libuhttpd-mbedtls))
  50. $(eval $(call BuildPackage,libuhttpd-wolfssl))
  51. $(eval $(call BuildPackage,libuhttpd-nossl))