请教:gcc-4.6.1环境编译apache-httpd-2.2.19服务的问题

B超 发布于 2011/07/08 12:31
阅读 2K+
收藏 0

初学linux环境中从源码包编译安装软件的方法,在编译安装好gcc-4.6.1环境之后,编译apache-httpd-server的过程出了点儿问题,还请社区内的高手不吝赐教.

编译安装gcc4.6.1的过程可参考我的博文:

http://my.oschina.net/cbcgorilla/blog/17371

在/etc/profile文件中配置好环境变量:

export GCC46_HOME=/usr/local/gcc-4.6.1
export CPLUS_INCLUDE_PATH=$GCC46_HOME/include:$GCC46_HOME/include/c++/4.6.1
export LIBRARY_PATH=/usr/local/gmp-5.0.2/lib:/usr/local/mpfr-3.0.1/lib:/usr/local/mpc-0.9/lib:$GCC46_HOME/lib64:$GCC46_HOME/lib:$GCC46_HOME/lib/gcc/x86_64-unknown-linux-gnu/4.6.1
export LD_LIBRARY_PATH=/usr/local/gmp-5.0.2/lib:/usr/local/mpfr-3.0.1/lib:/usr/local/mpc-0.9/lib:$GCC46_HOME/lib64:$GCC46_HOME/lib:$GCC46_HOME/lib/gcc/x86_64-unknown-linux-gnu/4.6.1

export PATH=$GCC46_HOME/bin:$PATH
检查gcc版本号:

[root@vmtestdb httpd-2.2.19]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc-4.6.1 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-5.0.2 --with-mpfr=/usr/local/mpfr-3.0.1 --with-mpc=/usr/local/mpc-0.9
Thread model: posix
gcc version 4.6.1 (GCC) 

之后依次编译安装apr及apr-util包的过程全部正常,具体版本分别为:

apr-1.4.5

apr-util-1.3.12

到下一步在做apache-httpd-2.2.19的配置过程出了问题:

[root@vmtestdb httpd-2.2.19]# ./configure --prefix=/app/apache/httpd \
>  --with-apr=/usr/local/apr/bin/apr-1-config \
>  --with-apr-util=/usr/local/apr-util/bin/apu-1-config \
>  --with-ssl=/usr/local/ssl \
>  --enable-mods-shared="all ssl  cache proxy authn_alias mem_cache file_cache charset_lite dav_lock disk_cache" \
>  --enable-dav=shared \
>  --enable-rewrite=shared \
>  --enable-speling=shared \
>  --enable-deflate=shared \
>  --enable-proxy=shared \
>  --enable-so
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "

Configuring Apache Portable Runtime Utility library...

checking for APR-util... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
configure: Configuring PCRE regular expression library
configuring package in srclib/pcre now
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for bcopy... yes
checking for memmove... yes
checking for strerror... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pcre.h
config.status: creating pcre-config
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default commands
srclib/pcre configured properly
  setting AP_LIBS to "/app/apache/http/httpd-2.2.19/srclib/pcre/libpcre.la"
  setting INCLUDES to "-I$(top_builddir)/srclib/pcre"

Configuring Apache httpd ...

  adding "-I." to INCLUDES
  adding "-I$(top_srcdir)/os/$(OS_DIR)" to INCLUDES
  adding "-I$(top_srcdir)/server/mpm/$(MPM_SUBDIR_NAME)" to INCLUDES
  adding "-I$(top_srcdir)/modules/http" to INCLUDES
  adding "-I$(top_srcdir)/modules/filters" to INCLUDES
  adding "-I$(top_srcdir)/modules/proxy" to INCLUDES
  adding "-I$(top_srcdir)/include" to INCLUDES
  adding "-I$(top_srcdir)/modules/generators" to INCLUDES
  adding "-I$(top_srcdir)/modules/mappers" to INCLUDES
  adding "-I$(top_srcdir)/modules/database" to INCLUDES
  adding "-I/usr/local/apr/include/apr-1" to INCLUDES
  adding "-I/usr/local/apr-util/include/apr-1" to INCLUDES

Applying OS-specific hints for httpd ...

  forcing SINGLE_LISTEN_UNSERIALIZED_ACCEPT to "1"
  forcing AP_NONBLOCK_WHEN_MULTI_LISTEN to "1"
checking for rm... /bin/rm
checking for pkg-config... /usr/bin/pkg-config
checking for rsync... /usr/bin/rsync
checking for gawk... gawk
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for lynx... no
checking for links... no
checking for elinks... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking for APR version 1.2.0 or later... yes
checking for APR-util version 1.2.0 or later... no
configure: error: APR-util version 1.2.0 or later is required
按照提示,感觉应该是apr-util的库或头文件没有找到,尝试着调整了一下LD_LIBRARY_PATH这个环境变量,加入apr-util库的一些路径,依然还是apr-util version 1.2.0找不到。

于是删除以上配置的所有环境变量,恢复成系统原有gcc的版本【gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)】,则能正常完成configure和编译安装。

但现在对于在我配置的gcc4.6.1的环境为何不能完成apache-httpd的编译依然没有找到答案,希望这里能有高手指点一二,谢谢各位支持了!

 

 

 

 

加载中
0
B超
B超

参考网页http://zhidao.baidu.com/question/276732487.html里面的说明,gcc版本用4.6.1,在configure步骤加了--with-included-apr这样一个参数就通过了,居然不同版本的gcc对这个玩意儿还区别对待,汗ing....

Note

The --with-included-apr option was added in version 2.2.3

# Force the use of the bundled apr/apr-util
./configure --with-included-apr

0
红薯
红薯
装一个新版的 aprapr-util
B超
B超
感谢红薯大哥的关注,不过我这里提到的apr和apr-util已经是在http://apr.apache.org/可以找到的最新版本了,而且我试过在几个旧版本的gcc环境下,这些包都是能正常编译通过的,唯独在这个gcc4.6的环境中无法通过,并且我安装的apr-util包是比检查过程要求的1.2.0要高一些的,我怀疑这个是不是和新版本gcc编译环境中检查依赖包版本的机制有关,或者还缺什么路径没有配置好,对于这些内容我都还不了解,或者还有其他什么原因呢?
0
f
flawy
我也是遇到同样的问题...
返回顶部
顶部