【问题标题】:compile httpd-2.4.20 in Solaris 11.3 make fails在 Solaris 11.3 中编译 httpd-2.4.20 失败
【发布时间】:2016-09-26 14:17:40
【问题描述】:

我正在尝试在 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'

【问题讨论】:

    标签: apache gcc makefile solaris


    【解决方案1】:

    使用gmake 而不是make

    很多很多项目都隐含地需要使用 GNU make。

    【讨论】:

    • /usr/local/apr/build-1/libtool[1086]: eval: 第 1 行的语法错误:|' unexpected gmake[4]: *** [mod_sed.la] Error 3 gmake[4]: Leaving directory /data/software/httpd-2.4.20/modules/filters' gmake[3]: *** [shared-build-recursive] 错误 1 ​​gmake[3]: Leaving directory /data/software/httpd-2.4.20/modules/filters' gmake[2]: *** [shared-build-recursive] Error 1 gmake[2]: Leaving directory /data/software/httpd-2.4.20/modules' gmake[1]: *** [shared -build-recursive] 错误 1 ​​gmake[1]: 离开目录 `/data/software/httpd-2.4.20' gmake: *** [all-recursive] Error 1
    • 谢谢。您的链接很有帮助,并找到了解决方法。我刚刚删除了变量 \$global_symbol_pipe。然后它起作用了。 vim srclib/apr/libtool # 列出导出符号的命令。 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | 排序 | uniq > \$export_symbols" >>> >> export_symbols_cmds="\$NM \$ libobjs \$convenience | \$SED 's/.* //' | sort | uniq > \$export_symbols"
    • 当在 solaris 11.3 中编译任何其他软件包时会发生此错误。这是一个错误。找到这个链接lists.gnu.org/archive/html/bug-libtool/2016-01/msg00000.html
    【解决方案2】:

    在./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。 (感谢安德鲁·亨利)

    【讨论】:

    【解决方案3】:

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

    export NM=/usr/bin/gnm;
    

    【讨论】:

    • 在 Solaris 11 上拯救了我的一天!
    猜你喜欢
    • 1970-01-01
    • 2013-04-11
    • 1970-01-01
    • 2021-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多