拿PHP的库php-5.2.9来说,先给出./configure的部分帮助信息:
php-5.2.9#./configure --hlep
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print `checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local] 最后编译完成后,安装的时候的目录,当这个指定完后,以下的一些安装目录默认就会是PREFIX/,注意有的lib库需要把bin安装到/usr/local/bin下的时候,就需要单独设置bindir=/usr/local/bin.
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data in DIR
[PREFIX/share]
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data in DIR
[PREFIX/com]
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
--includedir=DIR C header files in DIR [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM
run sed PROGRAM on installed program names
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
给出交叉编译脚本:
CC=armv7-marvell-linux-uclibcgnueabi-gcc ./configure \CC=armv7-marvell-linux-uclibcgnueabi-gcc ./configure \
--host=armv7-marvell-linux-uclibcgnueabi \
--prefix=/usr/local/armv7-marvell-linux-uclibcgnueabi-softfp_i686_64K_Dev_20131002/ \
--without-pear \
--enable-fastcgi \
--enable-sockets \
--with-gd \
--with-config-file-path=/etc \
--without-iconv \
--enable-mbstring \
--without-pcre-regex \
--disable-filter \
--disable-hash \
--disable-json \
--disable-mbregex \
--disable-mbregex-backtrack \
--disable-pdo \
--disable-simplexml \
--disable-spl \
--without-sqlite \
--disable-tokenizer \
--disable-xml \
--disable-xmlreader \
--disable-xmlwriter \
--with-png-dir=/usr/local/armv7-marvell-linux-uclibcgnueabi-softfp_i686_64K_Dev_20131002 \
--with-libxml-dir=/usr/local/armv7-marvell-linux-uclibcgnueabi-softfp_i686_64K_Dev_20131002
对于依赖的库,比如libxml2,在./configure 的时候,需要检查依赖库比如libxml2,如果找不到的时候,需要指定其安装目录,
注意一定是安装目录,而不是lib库的目录。以上的例子/usr/local/armv7-marvell-linux-uclibcgnueabi-softfp_i686_64K_Dev_20131002就是libxml2的安装目录,而不是libxml2.so的目录(也即/usr/local/armv7-marvell-linux-uclibcgnueabi-softfp_i686_64K_Dev_20131002/lib),否则是找不到的。
当然,编译libxml2的时候,需要制定其安装目录是/usr/local/armv7-marvell-linux-uclibcgnueabi-softfp_i686_64K_Dev_20131002。
阅读(2024) | 评论(1) | 转发(0) |