在Solaris 11.3中编译httpd-2.4.20失败

时间:2016-05-28 08:53:58

标签: apache gcc makefile solaris

我试图在Solaris 11.3框中编译httpd-2.4.20。 ./configure不会给出任何错误。但是make会出错,我不知道如何修复它。在stackoverflow或谷歌搜索中找不到类似的问题。我的命令如下。

root@LDOM01-test:/data/software/httpd-2.4.20# uname -ar
SunOS LDOM01-test 5.11 11.3 sun4v sparc sun4v

root@LDOM01-test:/data/software/httpd-2.4.20# gcc --version
gcc (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@LDOM01-test:/data/software/httpd-2.4.20# ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
....
....
....

root@LDOM01-test:/data/software/httpd-2.4.20# make
.....
.....
.....

/usr/local/apr/build-1/libtool --silent --mode=compile gcc -std=gnu99  -g -O2      -DSOLARIS2=11 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE64_SOURCE     -I. -I/data/software/httpd-2.4.20/os/unix -I/data/software/httpd-2.4.20/include -I/usr/local/apr/include/apr-1 -I/usr/include/pcre -I/data/software/httpd-2.4.20/modules/aaa -I/data/software/httpd-2.4.20/modules/cache -I/data/software/httpd-2.4.20/modules/core -I/data/software/httpd-2.4.20/modules/database -I/data/software/httpd-2.4.20/modules/filters -I/data/software/httpd-2.4.20/modules/ldap -I/data/software/httpd-2.4.20/modules/loggers -I/data/software/httpd-2.4.20/modules/lua -I/data/software/httpd-2.4.20/modules/proxy -I/data/software/httpd-2.4.20/modules/session -I/data/software/httpd-2.4.20/modules/ssl -I/data/software/httpd-2.4.20/modules/test -I/data/software/httpd-2.4.20/server -I/data/software/httpd-2.4.20/modules/arch/unix -I/data/software/httpd-2.4.20/modules/dav/main -I/data/software/httpd-2.4.20/modules/generators -I/data/software/httpd-2.4.20/modules/mappers -prefer-pic -c regexp.c && touch regexp.slo
/usr/local/apr/build-1/libtool --silent --mode=link gcc -std=gnu99  -g -O2           -o mod_sed.la -rpath /usr/local/apache2/modules -module -avoid-version  mod_sed.lo sed0.lo sed1.lo regexp.lo -export-symbols-regex sed_module
/usr/local/apr/build-1/libtool[1086]: eval: syntax error at line 1: `|' unexpected
*** Error code 3
make: Fatal error: Command failed for target `mod_sed.la'
Current working directory /data/software/httpd-2.4.20/modules/filters
*** Error code 1
The following command caused the error:
if test `pwd` = "/data/software/httpd-2.4.20"; then \
    echo "" ; \
fi; \
list=''; for i in $list; do \
    target="shared-build"; \
    if test "$i" = "."; then \
        made_local=yes; \
        target="local-shared-build"; \
    fi; \
    if test "$i" != "srclib"; then \
        (cd $i && make $target) || exit 1; \
    fi; \
done; \
if test -f 'modules.mk'; then \
    if test -n 'mod_buffer.la mod_ratelimit.la mod_reqtimeout.la mod_ext_filter.la mod_request.la mod_include.la mod_filter.la mod_substitute.la mod_sed.la mod_deflate.la'; then \
        echo "Building shared: mod_buffer.la mod_ratelimit.la mod_reqtimeout.la mod_ext_filter.la mod_request.la mod_include.la mod_filter.la mod_substitute.la mod_sed.la mod_deflate.la"; \
        if test "$made_local" != "yes"; then \
                make "local-shared-build" || exit 1; \
        fi; \
    fi; \
fi; \
if test `pwd` = "/data/software/httpd-2.4.20"; then \
        echo "" ; \
fi
make: Fatal error: Command failed for target `shared-build-recursive'
Current working directory /data/software/httpd-2.4.20/modules/filters
*** Error code 1
The following command caused the error:
if test `pwd` = "/data/software/httpd-2.4.20"; then \
    echo "" ; \
fi; \
list='aaa cache core database debugging filters http loggers metadata proxy session slotmem ssl proxy/balancers arch/unix dav/main generators dav/fs mappers'; for i in $list; do \
    target="shared-build"; \
    if test "$i" = "."; then \
        made_local=yes; \
        target="local-shared-build"; \
    fi; \
    if test "$i" != "srclib"; then \
        (cd $i && make $target) || exit 1; \
    fi; \
done; \
if test -f 'modules.mk'; then \
    if test -n ''; then \
        echo "Building shared: "; \
        if test "$made_local" != "yes"; then \
                make "local-shared-build" || exit 1; \
        fi; \
    fi; \
fi; \
if test `pwd` = "/data/software/httpd-2.4.20"; then \
        echo "" ; \
fi
make: Fatal error: Command failed for target `shared-build-recursive'
Current working directory /data/software/httpd-2.4.20/modules
*** Error code 1
The following command caused the error:
if test `pwd` = "/data/software/httpd-2.4.20"; then \
    echo "" ; \
fi; \
list='srclib os server modules support'; for i in $list; do \
    target="shared-build"; \
    if test "$i" = "."; then \
        made_local=yes; \
        target="local-shared-build"; \
    fi; \
    if test "$i" != "srclib"; then \
        (cd $i && make $target) || exit 1; \
    fi; \
done; \
if test -f 'modules.mk'; then \
    if test -n ''; then \
        echo "Building shared: "; \
        if test "$made_local" != "yes"; then \
                make "local-shared-build" || exit 1; \
        fi; \
    fi; \
fi; \
if test `pwd` = "/data/software/httpd-2.4.20"; then \
        echo "" ; \
fi
make: Fatal error: Command failed for target `shared-build-recursive'
Current working directory /data/software/httpd-2.4.20
*** Error code 1
The following command caused the error:
otarget=`echo all-recursive|sed s/-recursive//`; \
list='  srclib os server modules support'; \
for i in $list; do \
    if test -d "$i"; then \
        target="$otarget"; \
        echo "Making $target in $i"; \
        if test "$i" = "."; then \
                made_local=yes; \
                target="local-$target"; \
        fi; \
        (cd $i && make $target) || exit 1; \
    fi; \
done; \
if test "$otarget" = "all" && test -z 'httpd shared-build '; then \
    made_local=yes; \
fi; \
if test "$made_local" != "yes"; then \
    make "local-$otarget" || exit 1; \
fi
make: Fatal error: Command failed for target `all-recursive'

3 个答案:

答案 0 :(得分:3)

./configure后.... 编辑apr libtool srclib / apr / libtool并删除\ $ global_symbol_pipe |从以下一行

# The commands to list exported symbols.
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
>>>>>
export_symbols_cmds="\$NM \$libobjs \$convenience |  \$SED 's/.* //' | sort | uniq > \$export_symbols"

然后是gmake。 (谢谢Andrew Henle)

答案 1 :(得分:2)

Solaris 11.3 / usr / bin / nm是问题所在。我使用环境变量将其更改为gnm,它解决了所有问题。

export NM=/usr/bin/gnm;

答案 2 :(得分:0)

使用gmake代替make

许多项目隐含地要求使用GNU make。