build: add runuhttpd sdk target
This commit is contained in:
parent
cf018eae4c
commit
daca626e86
4
Makefile
4
Makefile
@ -61,6 +61,10 @@ ucidefaults:
|
||||
runhttpd: hostenv
|
||||
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua build/lucid.lua"
|
||||
|
||||
runuhttpd: hostenv
|
||||
cp $(realpath build)/luci.cgi $(realpath host)/www/cgi-bin/luci
|
||||
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host)/usr/sbin/uhttpd -p 8080 -h $(realpath host)/www -f"
|
||||
|
||||
runlua: hostenv
|
||||
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua -i build/setup.lua"
|
||||
|
||||
|
||||
8
build/luci.cgi
Executable file
8
build/luci.cgi
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
dofile "../../build/setup.lua"
|
||||
|
||||
require "luci.cacheloader"
|
||||
require "luci.sgi.cgi"
|
||||
luci.dispatcher.indexcache = "/tmp/luci-indexcache"
|
||||
luci.sgi.cgi.run()
|
||||
30
contrib/uhttpd/Makefile
Normal file
30
contrib/uhttpd/Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
include ../../build/config.mk
|
||||
include ../../build/gccconfig.mk
|
||||
|
||||
UHTTPD_SRC = svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src
|
||||
UHTTPD_DIR = uhttpd-src
|
||||
UHTTPD_PATCHDIR = patches
|
||||
|
||||
all: compile
|
||||
|
||||
include ../../build/module.mk
|
||||
|
||||
$(UHTTPD_DIR)/Makefile:
|
||||
svn co $(UHTTPD_SRC) $(UHTTPD_DIR)
|
||||
|
||||
$(UHTTPD_DIR)/.prepared: $(UHTTPD_DIR)/Makefile
|
||||
(cd $(UHTTPD_PATCHDIR); ls *.patch | sort > series) || true
|
||||
[ -f "$(UHTTPD_PATCHDIR)/series" ] && while read patch; do \
|
||||
patch -d $(UHTTPD_DIR) -p1 < $(UHTTPD_PATCHDIR)/$$patch; \
|
||||
done < $(UHTTPD_PATCHDIR)/series || true
|
||||
touch $@
|
||||
|
||||
compile: $(UHTTPD_DIR)/.prepared
|
||||
(cd $(UHTTPD_DIR); $(MAKE) LUA_SUPPORT=0 TLS_SUPPORT=0 CGI_SUPPORT=1)
|
||||
mkdir -p dist/usr/sbin
|
||||
cp $(UHTTPD_DIR)/uhttpd dist/usr/sbin
|
||||
|
||||
compile-all: compile
|
||||
|
||||
clean:
|
||||
rm -rf $(UHTTPD_DIR)
|
||||
11
contrib/uhttpd/patches/001-pass-env.patch
Normal file
11
contrib/uhttpd/patches/001-pass-env.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/uhttpd-cgi.c
|
||||
+++ b/uhttpd-cgi.c
|
||||
@@ -204,7 +204,7 @@ void uh_cgi_request(struct client *cl, s
|
||||
(pi->stat.st_mode & S_IXOTH)
|
||||
) {
|
||||
/* build environment */
|
||||
- clearenv();
|
||||
+ //clearenv();
|
||||
|
||||
/* common information */
|
||||
setenv("GATEWAY_INTERFACE", "CGI/1.1", 1);
|
||||
1
contrib/uhttpd/patches/series
Normal file
1
contrib/uhttpd/patches/series
Normal file
@ -0,0 +1 @@
|
||||
001-pass-env.patch
|
||||
Loading…
x
Reference in New Issue
Block a user