package/civetweb: bump version to 1.11
authorJohn Faith <jfaith@impinj.com>
Tue, 25 Sep 2018 23:29:42 +0000 (23:29 +0000)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 26 Nov 2018 21:21:13 +0000 (22:21 +0100)
v1.11 now has library and header install targets for use by apps that
serve pages.  The config changes allow enabling the civetweb webserver
app binary and/or libs and headers.

The C++ interface option is automatically enabled if C++ support is
available.

The civetweb Makefile sets -fPIC in CFLAGS when linking shared
objects, but not when compiling the objects used in the library
resulting in a link failure, so add -fPIC to COPT which is added
to CFLAGS in its Makefile.

The typo patch has already been incorporated upstream, so it was
removed.

Signed-off-by: John Faith <jfaith@impinj.com>
[Thomas:
 - keep using "config", a "menuconfig" for just three sub-options is
   not relevant
 - move the BR2_PACKAGE_CIVETWEB_LIB option near the existing
   BR2_PACKAGE_CIVETWEB_SERVER option, since both allow to select what
   should be built/installed
 - remove BR2_PACKAGE_CIVETWEB_SHARED_LIB, the .mk file will use
   BR2_STATIC_LIBS/BR2_SHARED_LIBS/BR2_STATIC_SHARED_LIBS to know what
   to do
 - select BR2_PACKAGE_CIVETWEB_SERVER if BR2_PACKAGE_CIVETWEB_LIB is
   not enabled to ensure at least the server *or* the library is
   selected
 - introduce CIVETWEB_BUILD_TARGETS in the .mk file to properly use
   the appropriate make targets to build the server, static library
   and/or shared library
 - cleanup the use of CIVETWEB_INSTALL_TARGETS, and use it for both
   target and staging installation
 - factorize common installation options into a CIVETWEB_INSTALL_OPTS
   variable that is used for both the target and staging installation]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/civetweb/0001-Lua-fix-a-typo-changing-LFS_DIR-to-LFS_DIR.patch [deleted file]
package/civetweb/Config.in
package/civetweb/civetweb.hash
package/civetweb/civetweb.mk

diff --git a/package/civetweb/0001-Lua-fix-a-typo-changing-LFS_DIR-to-LFS_DIR.patch b/package/civetweb/0001-Lua-fix-a-typo-changing-LFS_DIR-to-LFS_DIR.patch
deleted file mode 100644 (file)
index aee3cfc..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 0821066f9adf8410891cd07684ecac50a9bc36a4 Mon Sep 17 00:00:00 2001
-From: Fabio Porcedda <fabio.porcedda@gmail>
-Date: Wed, 25 Feb 2015 18:40:24 +0100
-Subject: [PATCH] Lua: fix a typo changing %(LFS_DIR) to $(LFS_DIR)
-
-Also this fix a error on GNU Make v4.0:
-  Makefile:203: *** mixed implicit and normal rules.  Stop.
-
-Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail>
----
- resources/Makefile.in-lua | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/resources/Makefile.in-lua b/resources/Makefile.in-lua
-index 0902f11..f3d95fd 100644
---- a/resources/Makefile.in-lua
-+++ b/resources/Makefile.in-lua
-@@ -57,5 +57,5 @@ LFS_CFLAGS = -I$(LFS_DIR)
- OBJECTS += $(LUA_OBJECTS) $(SQLITE_OBJECTS) $(LFS_OBJECTS)
- CFLAGS += $(LUA_CFLAGS) $(SQLITE_CFLAGS) $(LFS_CFLAGS) -DUSE_LUA -DUSE_LUA_SQLITE3 -DUSE_LUA_FILE_SYSTEM
--SOURCE_DIRS = $(LUA_DIR) $(SQLITE_DIR) %(LFS_DIR)
-+SOURCE_DIRS = $(LUA_DIR) $(SQLITE_DIR) $(LFS_DIR)
--- 
-2.3.0
-
index d68a1ffd53509540016cbe20bdc0f7b348e5d1fe..9e439690853c1fef5661ef75dde479b1e19204b7 100644 (file)
@@ -2,6 +2,7 @@ config BR2_PACKAGE_CIVETWEB
        bool "civetweb"
        depends on BR2_TOOLCHAIN_HAS_THREADS
        depends on BR2_USE_MMU # fork()
+       select BR2_PACKAGE_CIVETWEB_SERVER if !BR2_PACKAGE_CIVETWEB_LIB
        help
          Full featured embedded web server with Lua support.
 
@@ -9,6 +10,17 @@ config BR2_PACKAGE_CIVETWEB
 
 if BR2_PACKAGE_CIVETWEB
 
+config BR2_PACKAGE_CIVETWEB_SERVER
+       bool "enable the web server application"
+       help
+         Include the web server and its config files.
+
+config BR2_PACKAGE_CIVETWEB_LIB
+       bool "enable library for embedding"
+       help
+         Enable the civetweb library for embedding in another
+         application.
+
 config BR2_PACKAGE_CIVETWEB_WITH_LUA
        bool "enable Lua support"
        # required by the bundled Sqlite3 and Lua code
index 745f4a8ce670834072a44f30dcba8223acd74042..b3cbaad71d9e702684eebdb026c37f77c55292b5 100644 (file)
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256 79a852a26068eb6d2f8de5ee72e021f0d2c8bd176eb81f41909a876b736815d9  civetweb-v1.5.tar.gz
+sha256 de7d5e7a2d9551d325898c71e41d437d5f7b51e754b242af897f7be96e713a42  civetweb-v1.11.tar.gz
index d29765b87d24acecb58a2959fcc83c3341d7a87c..4c3c443db74e0104f457da5d067bbddc0f028ce5 100644 (file)
@@ -4,16 +4,22 @@
 #
 ################################################################################
 
-CIVETWEB_VERSION = v1.5
-CIVETWEB_SITE = $(call github,sunsetbrew,civetweb,$(CIVETWEB_VERSION))
+CIVETWEB_VERSION = v1.11
+CIVETWEB_SITE = $(call github,civetweb,civetweb,$(CIVETWEB_VERSION))
 CIVETWEB_LICENSE = MIT
 CIVETWEB_LICENSE_FILES = LICENSE.md
 
-CIVETWEB_CONF_OPTS = TARGET_OS=LINUX WITH_IPV6=1
+CIVETWEB_CONF_OPTS = TARGET_OS=LINUX WITH_IPV6=1 \
+       $(if $(BR2_INSTALL_LIBSTDCPP),WITH_CPP=1)
 CIVETWEB_COPT = -DHAVE_POSIX_FALLOCATE=0
 CIVETWEB_LIBS = -lpthread -lm
 CIVETWEB_SYSCONFDIR = /etc
 CIVETWEB_HTMLDIR = /var/www
+CIVETWEB_INSTALL_OPTS = \
+       DOCUMENT_ROOT="$(CIVETWEB_HTMLDIR)" \
+       CONFIG_FILE2="$(CIVETWEB_SYSCONFDIR)/civetweb.conf" \
+       HTMLDIR="$(TARGET_DIR)$(CIVETWEB_HTMLDIR)" \
+       SYSCONFDIR="$(TARGET_DIR)$(CIVETWEB_SYSCONFDIR)"
 
 ifeq ($(BR2_PACKAGE_CIVETWEB_WITH_LUA),y)
 CIVETWEB_CONF_OPTS += WITH_LUA=1
@@ -28,19 +34,48 @@ else
 CIVETWEB_COPT += -DNO_SSL
 endif
 
+ifeq ($(BR2_PACKAGE_CIVETWEB_SERVER),y)
+CIVETWEB_BUILD_TARGETS += build
+CIVETWEB_INSTALL_TARGETS += install
+endif
+
+ifeq ($(BR2_PACKAGE_CIVETWEB_LIB),y)
+CIVETWEB_INSTALL_STAGING = YES
+CIVETWEB_INSTALL_TARGETS += install-headers
+
+ifeq ($(BR2_STATIC_LIBS)$(BR2_STATIC_SHARED_LIBS),y)
+CIVETWEB_BUILD_TARGETS += lib
+CIVETWEB_INSTALL_TARGETS += install-lib
+endif
+
+ifeq ($(BR2_SHARED_LIBS)$(BR2_STATIC_SHARED_LIBS),y)
+CIVETWEB_BUILD_TARGETS += slib
+CIVETWEB_INSTALL_TARGETS += install-slib
+CIVETWEB_COPT += -fPIC
+endif
+
+endif # BR2_PACKAGE_CIVETWEB_LIB
+
 define CIVETWEB_BUILD_CMDS
-       $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) build \
+       $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(CIVETWEB_BUILD_TARGETS) \
                $(CIVETWEB_CONF_OPTS) \
                COPT="$(CIVETWEB_COPT)" LIBS="$(CIVETWEB_LIBS)"
 endef
 
+define CIVETWEB_INSTALL_STAGING_CMDS
+       mkdir -p $(STAGING_DIR)/usr/include
+       $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(CIVETWEB_INSTALL_TARGETS) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               $(CIVETWEB_INSTALL_OPTS) \
+               $(CIVETWEB_CONF_OPTS) \
+               COPT='$(CIVETWEB_COPT)'
+endef
+
 define CIVETWEB_INSTALL_TARGET_CMDS
-       $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install \
-               DOCUMENT_ROOT="$(CIVETWEB_HTMLDIR)" \
-               CONFIG_FILE2="$(CIVETWEB_SYSCONFDIR)/civetweb.conf" \
-               HTMLDIR="$(TARGET_DIR)$(CIVETWEB_HTMLDIR)" \
-               SYSCONFDIR="$(TARGET_DIR)$(CIVETWEB_SYSCONFDIR)" \
+       mkdir -p $(TARGET_DIR)/usr/include
+       $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(CIVETWEB_INSTALL_TARGETS) \
                PREFIX="$(TARGET_DIR)/usr" \
+               $(CIVETWEB_INSTALL_OPTS) \
                $(CIVETWEB_CONF_OPTS) \
                COPT='$(CIVETWEB_COPT)'
 endef