appweb-4.3.4-0移植到ARM

从http://appwebserver.org/downloads/appweb/download.ejs 获取到源代码

从projects目录复制一份appweb-linux-static.mk命名为appweb-linux-arm-static.mk

并复制appweb-linux-static-bit.h命名为appweb-linux-arm-static-bit.h

在appweb-linux-arm-static-bit.h中屏蔽掉#define BIT_HAS_SYNC 1,否则会出现

appweb-4.3.4-0/src/deps/mpr/mprLib.c:3819: undefined reference to `__sync_lock_test_and_set_4'

修改appweb-linux-arm-static.mk文件:

ARCH               := arm
CC                 := arm-linux-gcc
LD                 := arm-linux-ld


prep:
	@echo "      [Info] Use "make SHOW=1" to trace executed commands."
	@if [ "$(CONFIG)" = "" ] ; then echo WARNING: CONFIG not set ; exit 255 ; fi
	@if [ "$(BIT_APP_PREFIX)" = "" ] ; then echo WARNING: BIT_APP_PREFIX not set ; exit 255 ; fi
	@[ ! -x $(CONFIG)/bin ] && mkdir -p $(CONFIG)/bin; true
	@[ ! -x $(CONFIG)/inc ] && mkdir -p $(CONFIG)/inc; true
	@[ ! -x $(CONFIG)/obj ] && mkdir -p $(CONFIG)/obj; true
	@[ ! -f $(CONFIG)/inc/bitos.h ] && cp src/bitos.h $(CONFIG)/inc/bitos.h ; true
	@if ! diff $(CONFIG)/inc/bitos.h src/bitos.h >/dev/null ; then\
		cp src/bitos.h $(CONFIG)/inc/bitos.h  ; \
	fi; true
	@[ ! -f $(CONFIG)/inc/bit.h ] && cp projects/appweb-linux-arm-static-bit.h $(CONFIG)/inc/bit.h ; true
	@if ! diff $(CONFIG)/inc/bit.h projects/appweb-linux-arm-static-bit.h >/dev/null ; then\
		cp projects/appweb-linux-arm-static-bit.h $(CONFIG)/inc/bit.h  ; \
	fi; true
	@if [ -f "$(CONFIG)/.makeflags" ] ; then \
		if [ "$(MAKEFLAGS)" != " ` cat $(CONFIG)/.makeflags`" ] ; then \
			echo "   [Warning] Make flags have changed since the last build: "`cat $(CONFIG)/.makeflags`"" ; \
		fi ; \
	fi
	@echo $(MAKEFLAGS) >$(CONFIG)/.makeflags

修改完后,执行:

make -f projects/appweb-linux-arm-static.mk

编译生成的文件保存到linux-arm-static目录中

修改后的完整代码可以从http://download.csdn.net/detail/lqrensn/5597103下载

你可能感兴趣的:(我的开发板)