【问题标题】:Apache httpd-2.4.9 compilation errorApache httpd-2.4.9 编译错误
【发布时间】:2014-07-23 01:37:58
【问题描述】:

我正在尝试在 mac osx 10.9 上安装 apache http server 2.4.9。我已经下载了 gcc 编译器。

sh-3.2# gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

我什至安装了命令行工具

sh-3.2# pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 5.1.0.0.1.1393561416
volume: /
location: /
install-time: 1401740485
groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group 

但是当我尝试从源代码编译 apache 2.4.9 时仍然出现以下错误

sh-3.2# ./configure --prefix=/usr/local/apache2
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-apple-darwin13.1.0
checking host system type... x86_64-apple-darwin13.1.0
checking target system type... x86_64-apple-darwin13.1.0
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc"
  setting CPP to "/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -E"
  setting CFLAGS to " "
  setting CPPFLAGS to " -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... yes
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/Users/silango/appsrc/httpd-2.4.9':
configure: error: C compiler cannot create executables
See `config.log' for more details

【问题讨论】:

  • 我想我只是为了完整起见分享一些相关的线程,并且你清楚地表明你正在尝试从源代码编译 Apache 并得到这些错误:stackoverflow.com/questions/13587001/… 和 @ 987654322@.

标签: c xcode macos apache


【解决方案1】:

您已降级 Xcode 命令行工具。我使用了 4 月 10 日的 Mavericks 版本,效果很好。

【讨论】:

    【解决方案2】:

    MAC OS X 10.9 已经内置了 httpd 模块,要启用它打开终端并输入以下命令:

    开始:

    sudo apachectl start
    

    停止:

    sudo apachectl stop
    

    重启:

    sudo apachectl restart
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-12
      • 2014-06-21
      • 2014-11-25
      • 2016-06-09
      • 2017-04-28
      • 2014-08-20
      • 1970-01-01
      相关资源
      最近更新 更多