lighttpd及pcre的交叉编译
2016-10-28 13:44
357 查看
lighttpd及pcre的交叉编译(不成熟)
lighttpd及pcre的交叉编译不成熟A环境说明
B交叉编译思路
C编译pcre
配置脚本设置编译工具等
编译安装
将库文件导入cache运行环境中的
将路径导入环境变量运行环境的
D编译lighttpd
配置脚本设置编译工具等
编译安装
文件结构设置与配置服务器
服务器的启动和关闭
A.环境说明
编译环境ubuntu12.04
i686-pc-linux
运行环境
openwrt
交叉编译工具
mips-openwrt-linux
B.交叉编译思路
在 lighttpd与相关依赖库的安装 基础下进行本次交叉编译通过config脚本配置编译环境中的编译工具为交叉编译工具
安装目录设置为最终运行目录,使得移植之后能够正确匹配
将需要的环境配置在运行设备上
C.编译pcre
1.配置脚本(设置编译工具等)
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
2.编译安装
make && make install
提示:
可以在make编译完后可以执行make check进行测试
3.将库文件导入cache(运行环境中的)
方法1:在/etc/ld.so.conf/中加入:/usr/local/lib/pcre,然后运行ldconfig
方法2:在/etc/ld.so.conf.d/下新生成一个文件(或在其中的文件中加入同样内容),文件内容为:
/usr/local/lib/pcre,然后运行ldconfig
4.将路径导入环境变量(运行环境的)
LD_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
D.编译lighttpd
1.配置脚本(设置编译工具等)
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
2.编译安装
make && make install
3.文件结构设置与配置服务器
根据需要进行服务器功能模块裁剪5.服务器的启动和关闭
设置执行文件权限chmod 777 [服务器路径]/sbin -R
启动服务器
[服务器路径]/sbin/lighttpd -f [服务器路径]/config/lighttpd.conf
访问服务器
在浏览器中输入ip:port,访问服务器主页
主页路径在/webpages
关闭服务器
killall lighttpd
相关文章推荐
- 嵌入式web服务器lighttpd的交叉编译及配置(for arm-linux)
- 移植apache2 ARM版 - 交叉编译pcre-8.33
- Lighttpd 交叉编译
- 嵌入式web服务器lighttpd的交叉编译及配置--xilinx zynq
- 交叉编译pcre、sqlite3
- Centos 7 下QT关于arm交叉编译环境的搭建
- 建立 arm-linux 交叉编译环境
- 交叉编译场景分析(arm-linux)--序
- KEIL C51环境下,汇编与C语言交叉编译的问题
- Zedboard交叉编译环境建立------(注意:无高清无码果照)
- 交叉编译glibc
- qt5 交叉编译
- android--ndk交叉编译工具安装
- 树莓派学习笔记——交叉编译练习之SQLite3安装
- cocos2dx交叉编译之项目导入eclipse
- Go语言的交叉编译
- 【cocos2d-x入门实战】环境配置、交叉编译及安卓项目的生成
- Jthread1.3.1 Jrtplib3.9.1跨平台交叉编译之Android(一)
- 搭建交叉编译工具链
- 基于DirectFB的GTK+的交叉编译[转]