mac编译apache时出现 checking whether the C compiler works... no 的解决办法

在Mac系统下编译Apache时遇到configure检查C编译器失败的问题,错误提示为找不到指定路径的cc编译器。通过查看config.log文件发现详细错误信息。解决方案是执行特定命令,之后重新运行./configure即可成功完成配置。

在MAC下编译apache时执行 ./configure 出现如下错误。

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/hufeiyan/ws/httpd-2.2.26':
configure: error: C compiler cannot create executables

See `config.log' for more details

查看config.log有如下描述:

configure:4480: result: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc
configure:4709: checking for C compiler version
configure:4718: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc --version >&5
./configure: line 4720: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
configure:4729: $? = 127
configure:4718: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -v >&5
./configure: lin

gezi@ubuntu:~/curl-8.7.1$ ./configure \ > --build=x86_64-pc-linux-gnu \ # 使用步骤1获取的值 configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports nested variables... yes checking whether to enable debug build options... no checking whether to enable compiler optimizer... (assumed) yes checking whether to enable strict compiler warnings... no checking whether to enable compiler warnings as errors... no checking whether to enable curl debug memory tracking... no checking whether to enable hiding of library internal symbols... yes checking whether to enable c-ares for DNS lookups... no checking whether to disable dependency on -lrt... (assumed no) checking whether to enable ECH support... no checking for path separator... : checking for sed... /bin/sed checking for grep... /bin/grep checking that grep -E works... yes checking for -ar... no checking for ar... /usr/bin/ar configure: WARNING: using cross tools not prefixed with host triplet checking for a BSD-compatible install... /usr/bin/install -c checking for -gcc... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking how to run the C preprocessor... gcc -E checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for stdatomic.h... yes checking if _Atomic is available... yes checking for a sed that does not truncate output... (cached) /bin/sed checking for code coverage support... no checking whether build environment is sane... yes checking for -strip... no checking for strip... strip checking for a race-free mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of gcc... gcc3 checking curl version... 8.7.1 checking for httpd... no checking for apache2... no checking for apachectl... no checking for apxs... no configure: httpd/apache2 not in PATH, http tests disabled configure: apxs not in PATH, http tests disabled checking for nghttpx... no checking for caddy... no configure: error: select TLS backend(s) or disable TLS with --without-ssl. Select from these: --with-amissl --with-bearssl --with-gnutls --with-mbedtls --with-openssl (also works for BoringSSL and libressl) --with-rustls --with-schannel --with-secure-transport --with-wolfssl
10-11
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值