浏览代码

CLeaned up support for buildroot

Thomas Davis 12 年之前
父节点
当前提交
f062af4bce
共有 6 个文件被更改,包括 55 次插入42 次删除
  1. 5 3
      Makefile
  2. 12 0
      RELEASE_NOTES.md
  3. 8 21
      contrib/buildroot/Config.in
  4. 25 16
      contrib/buildroot/civetweb.mk
  5. 4 1
      docs/Building.md
  6. 1 1
      src/civetweb.c

+ 5 - 3
Makefile

@@ -22,13 +22,14 @@ BINDIR = $(EXEC_PREFIX)/bin
 DATAROOTDIR = $(PREFIX)/share
 DOCDIR = $(DATAROOTDIR)/doc/$(CPROG)
 SYSCONFDIR = $(PREFIX)/etc
+HTMLDIR = $(DOCDIR)
 
 # desired configuration of the document root
 # never assume that the document_root actually
 # exists on the build machine.  When building
 # a chroot, PREFIX if just a directory which
 # later becomes /.
-DOCUMENT_ROOT = $(DOCDIR)
+DOCUMENT_ROOT = $(HTMLDIR)
 PORTS = 8080
 
 BUILD_DIRS += $(BUILD_DIR) $(BUILD_DIR)/src
@@ -140,12 +141,13 @@ ifeq ($(TARGET_OS),LINUX)
 	install -d -m 755 "$(BINDIR)"
 	install -d -m 755  "$(DOCDIR)"
 	install -d -m 755  "$(SYSCONFDIR)"
+	install -d -m 755  "$(HTMLDIR)"
 	install -m 755 $(CPROG) "$(BINDIR)/"
 	install -m 644 resources/civetweb.conf  "$(SYSCONFDIR)/"
 	@sed -i 's#^document_root.*$$#document_root $(DOCUMENT_ROOT)#' "$(SYSCONFDIR)/civetweb.conf"
 	@sed -i 's#^listening_ports.*$$#listening_ports $(PORTS)#' "$(SYSCONFDIR)/civetweb.conf"
-	install -m 644 resources/itworks.html $(DOCDIR)/index.html
-	install -m 644 resources/civetweb_64x64.png $(DOCDIR)/
+	install -m 644 resources/itworks.html $(HTMLDIR)/index.html
+	install -m 644 resources/civetweb_64x64.png $(HTMLDIR)/
 	install -m 644 *.md "$(DOCDIR)"
 endif
 

+ 12 - 0
RELEASE_NOTES.md

@@ -1,3 +1,15 @@
+Release Notes v1.3 
+===
+### Objectives: *Buildroot Integration
+
+Changes
+-------
+
+- Made option to put initial HTMLDIR in a different place
+- Validated build without SQLITE3 large file support
+- Updated documentation
+- Updated Buildroot config example
+
 Release Notes v1.2 
 ===
 ### Objectives: *Installation Improvements, buildroot, cross compile support*

+ 8 - 21
contrib/buildroot/Config.in

@@ -1,6 +1,6 @@
 config BR2_PACKAGE_CIVETWEB
 	bool "civetweb"
-	depends on BR2_TOOLCHAIN_BUILDROOT_UCLIBC && !BR2_PTHREADS_NONE
+	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  Full featured embedded web server with LUA support.
 	  
@@ -8,27 +8,14 @@ config BR2_PACKAGE_CIVETWEB
 
 if BR2_PACKAGE_CIVETWEB
 
-	config BR2_CIVETWEB_WITH_IPV6
-		bool "enable IPV6 support"
-		depends on BR2_INET_IPV6
-
-	config BR2_CIVETWEB_WITH_LUA
-		bool "enable LUA support"
-		depends on BR2_LARGEFILE # util-linux
-
-	config BR2_CIVETWEB_WITH_SSL
-		bool "enable SSL support"
-		depends on BR2_PACKAGE_OPENSSL
-
-	comment "civetweb IPV6 support requires IPV6"
-		depends on !BR2_INET_IPV6
-
-	comment "civetweb LUA support requires large file support"
-		depends on !BR2_LARGEFILE
+config BR2_CIVETWEB_WITH_LUA
+	bool "enable LUA support"
+	help
+	  Enable Lua support in Civetweb. Note that this will use a
+	  version of Lua and Sqlite bundled within the Civetweb
+	  sources, and not the packages from Buildroot.
 
-	comment "civetweb SSL support requires OpenSSL"
-		depends on !BR2_PACKAGE_OPENSSL
 endif
 
 comment "civetweb requires a toolchain with PTHREAD support"
-	depends on !BR2_TOOLCHAIN_BUILDROOT_UCLIBC || BR2_PTHREADS_NONE
+	depends on !BR2_TOOLCHAIN_HAS_THREADS

+ 25 - 16
contrib/buildroot/civetweb.mk

@@ -1,36 +1,37 @@
-# 
-# Copyright (c) 2013 No Face Press, LLC
-# License http://opensource.org/licenses/mit-license.php MIT License
-#
 ################################################################################
 #
 # civetweb
 #
 ################################################################################
 
-CIVETWEB_VERSION = 1.2
+CIVETWEB_VERSION = 1.3
 CIVETWEB_SOURCE = civetweb-$(CIVETWEB_VERSION).tar.gz
 CIVETWEB_SITE = http://github.com/sunsetbrew/civetweb/tarball/v$(CIVETWEB_VERSION)
 CIVETWEB_LICENSE = MIT
 CIVETWEB_LICENSE_FILES = LICENSE.md
 
 CIVETWEB_COPT = $(TARGET_CFLAGS)
-CIVETWEB_MOPT = TARGET_OS=LINUX
+CIVETWEB_CONF_OPT = TARGET_OS=LINUX
 CIVETWEB_LDFLAGS = $(TARGET_LDFLAGS)
+CIVETWEB_HTMLDIR = /var/www
 
-ifndef BR2_PACKAGE_UTIL_LINUX_FALLOCATE
-	CIVETWEB_COPT += -DHAVE_POSIX_FALLOCATE=0
+ifneq ($(BR2_LARGEFILE),y)
+	CIVETWEB_COPT += -DSQLITE_DISABLE_LFS
 endif
 
-ifdef BR2_CIVETWEB_WITH_IPV6
-	CIVETWEB_MOPT += WITH_IPV6=1
+#ifeq ($(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),y)
+#	CIVETWEB_COPT += -DHAVE_POSIX_FALLOCATE=0
+#endif
+
+ifeq ($(BR2_INET_IPV6),y)
+	CIVETWEB_CONF_OPT += WITH_IPV6=1
 endif
 
-ifdef BR2_CIVETWEB_WITH_LUA
-	CIVETWEB_MOPT += WITH_LUA=1
+ifeq ($(BR2_CIVETWEB_WITH_LUA),y)
+	CIVETWEB_CONF_OPT += WITH_LUA=1
 endif
 
-ifdef BR2_CIVETWEB_WITH_SSL
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
 	CIVETWEB_COPT += -DNO_SSL_DL -lcrypt -lssl
 	CIVETWEB_DEPENDENCIES += openssl
 else
@@ -38,11 +39,19 @@ else
 endif
 
 define CIVETWEB_BUILD_CMDS
-	$(MAKE) CC="$(TARGET_CC)" -C $(@D) all $(CIVETWEB_MOPT) COPT="$(CIVETWEB_COPT)"
+	$(MAKE) CC="$(TARGET_CC)" -C $(@D) build \
+		$(CIVETWEB_CONF_OPT) \
+		COPT="$(CIVETWEB_COPT)"
 endef
 
 define CIVETWEB_INSTALL_TARGET_CMDS
-	$(MAKE) CC="$(TARGET_CC)" -C $(@D) install DOCUMENT_ROOT=/usr/local/share/doc/civetweb PREFIX="$(TARGET_DIR)/usr/local" $(CIVETWEB_MOPT) COPT='$(CIVETWEB_COPT)'
+	$(MAKE) CC="$(TARGET_CC)" -C $(@D) install \
+		DOCUMENT_ROOT="$(CIVETWEB_HTMLDIR)" \
+		HTMLDIR="$(TARGET_DIR)$(CIVETWEB_HTMLDIR)" \
+		PREFIX="$(TARGET_DIR)/usr/local" \
+		$(CIVETWEB_CONF_OPT) \
+		COPT='$(CIVETWEB_COPT)'
 endef
 
-$(eval $(generic-package))
+$(eval $(generic-package))
+

+ 4 - 1
docs/Building.md

@@ -70,7 +70,9 @@ make build WITH_LUA=1
 | WITH_CPP=1                | build libraries with c++ classes         |
 | CONFIG_FILE=file          | use 'file' as the config file            |
 | CONFIG_FILE2=file         | use 'file' as the backup config file     |
-| DOCUMENT_ROOT=/path       | document root override when installing   |
+| HTMLDIR=/path             | place to install initial web pages       |
+| DOCUMENT_ROOT=/path       | HTMLDIR override, config option, install |
+|                           | nothing is installed here.               |
 | PORTS=8080                | listening ports override when installing |
 | SSL_LIB=libssl.so.0       | use versioned SSL library                |
 | CRYPTO_LIB=libcrypto.so.0 | system versioned CRYPTO library          |
@@ -91,6 +93,7 @@ make build COPT="-DNDEBUG -DNO_CGI"
 | NO_CGI                    | disable CGI support                  |
 | NO_SSL                    | disable SSL functionality            |
 | NO_SSL_DL                 | link against system libssl library   |
+| SQLITE_DISABLE_LFS        | disables large files (LUA only)      |
 
 ## Cross Compiling
 

+ 1 - 1
src/civetweb.c

@@ -249,7 +249,7 @@ typedef int SOCKET;
 
 #include "civetweb.h"
 
-#define CIVETWEB_VERSION "1.2"
+#define CIVETWEB_VERSION "1.3"
 #define PASSWORDS_FILE_NAME ".htpasswd"
 #define CGI_ENVIRONMENT_SIZE 4096
 #define MAX_CGI_ENVIR_VARS 64