lighttpd及pcre的交叉编译
来源:互联网 发布:自定义票据打印软件 编辑:程序博客网 时间:2024/06/05 06:50
lighttpd及pcre的交叉编译(不成熟)
- lighttpd及pcre的交叉编译不成熟
- A环境说明
- B交叉编译思路
- C编译pcre
- 配置脚本设置编译工具等
- 编译安装
- 将库文件导入cache运行环境中的
- 将路径导入环境变量运行环境的
- D编译lighttpd
- 配置脚本设置编译工具等
- 编译安装
- 文件结构设置与配置服务器
- 服务器的启动和关闭
- lighttpd及pcre的交叉编译不成熟
A.环境说明
- 编译环境
ubuntu12.04
i686-pc-linux - 运行环境
openwrt - 交叉编译工具
mips-openwrt-linux
B.交叉编译思路
- 在 lighttpd与相关依赖库的安装 基础下进行本次交叉编译
- 通过config脚本配置编译环境中的编译工具为交叉编译工具
- 安装目录设置为最终运行目录,使得移植之后能够正确匹配
- 将需要的环境配置在运行设备上
C.编译pcre
1.配置脚本(设置编译工具等)
vim configure-opw.sh
#! /bin/shCXX=/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 formatcollect2: 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/shCC=/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
0 0
- lighttpd及pcre的交叉编译
- Lighttpd交叉编译及使用
- 交叉编译pcre、sqlite3
- Lighttpd 交叉编译
- 嵌入式web服务器lighttpd的交叉编译及配置(for arm-linux)
- 嵌入式web服务器lighttpd的交叉编译及配置--xilinx zynq
- 交叉编译移植 lighttpd fastcgi 以及自己的fastcgi程序
- lighttpd及相关依赖库pcre/bzip2在ubuntu下的安装
- 正则库相关及windows-VS-C++环境下pcre && pcre++的编译和使用
- 移植apache2 ARM版 - 交叉编译pcre-8.33
- 编译Apache提示:APR 及PCRE 错误
- PCRE的安装及使用
- PCRE的安装及使用
- PCRE++编译
- 交叉编译和交叉调试环境的搭建及使用
- 交叉编译内核及程序的心得.
- glibc库的交叉编译及使用
- 交叉编译工具的安装及问题解决
- mybatis if标签test 判断数字遇到的问题
- mac os webStorm 完全卸载
- Android 爬坑之旅:软键盘挡住输入框问题的终极解决方案
- Android:视图绘制(六) ------Paint进阶之ColorMatrix(一)
- C++程序栈与尾递归优化
- lighttpd及pcre的交叉编译
- JVM性能调优监控工具jps、jstack、jmap、jhat、jstat、hprof使用详解
- cmd - 常用命令
- http错误码大全
- delete/newoperator operatornew/delete operatornew[]/delete[] placementnew/delete
- 位图索引bitmap(三):位图索引技术集合FastBit
- cpp的STL值vector和deque
- 配置文件jdk和hadoop和scala和spark
- Material Design设计之Palette调色板