vim configure-opw.sh
#! /bin/sh
CXX=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++ CC=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-gcc AR=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-ar LD=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-ld RANLIB=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-ranlib STRIP=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-strip ./configure --prefix=/usr/pcre --host=mips-openwrt-linux --build=i686-pc-linux --enable-utf8 --enable-unicode-properties
将脚本复制到安装文件路径后,进行配置
./configure-opw.sh
注:
必须指定g++编译器,因为在本文件编译中需要通过CPP编译相关动态库,并且在之后会使用,若不指定,会出现如下错误:
CXX libpcrecpp_la-pcrecpp.lo
CXX libpcrecpp_la-pcre_scanner.lo
CXX libpcrecpp_la-pcre_stringpiece.lo
CXXLD libpcrecpp.la
./.libs/libpcre.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make && make install
提示:
可以在make编译完后可以执行make check进行测试
/usr/local/lib/pcre
,然后运行ldconfig/usr/local/lib/pcre
,然后运行ldconfigLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$/usr/local/lib/pcre
export LD_LIBRARY_PATH
C_INCLUDE_PATH=/usr/include/libxml2:/usr/local/include/pcre
export C_INCLUDE_PATH
vim configure-opw.sh
#! /bin/sh
CC=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-gcc AR=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-ar LD=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-ld RANLIB=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-ranlib STRIP=/home/jeff/extfs/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-strip ./configure --prefix=/tmp/webserver/lighttpd-1.4.42-opw --host=mips-openwrt-linux --build=i686-pc-linux --disable-FEATURE --enable-shared --disable-static --disable-lfs --disable-ipv6 --without-PACKAGE --without-valgrind --without-openssl --without-kerberos5 --without-pcre --without-zlib --without-bzip2
将脚本复制到安装文件路径后,进行配置
./configure-opw.sh
make && make install
根据需要进行服务器功能模块裁剪
chmod 777 [服务器路径]/sbin -R
[服务器路径]/sbin/lighttpd -f [服务器路径]/config/lighttpd.conf
killall lighttpd