【问题标题】:MacOS Mojave: ./configure script fails when checking the archiver (ar) interfaceMacOS Mojave:检查存档器 (ar) 界面时,./configure 脚本失败
【发布时间】:2019-07-03 12:04:27
【问题描述】:

在构建使用 autoconf 的 OpenFST 包之前,我正在运行 ./configure 命令。 检查ar接口时脚本失败:

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
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... no
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... unknown
configure: error: could not determine ar interface

这似乎与 this question 有关,但我不明白如何使脚本使用正确的 MacOS 文件以便配置工作。

【问题讨论】:

  • 显示(至少)生成的config.log 文件中显示失败的部分(即从checking the archiver 开始)。可能会显示执行该检查的configure 脚本部分,如果您能识别它,还可以显示生成它的configure.ac 部分。
  • 感谢@KenThomases!查看了 config.log 内部,这使我找到了此处描述的解决方案:github.com/commercialhaskell/stack/issues/4380

标签: macos configure autoconf openfst


【解决方案1】:

查看 config.log,发现问题与使用位于 /opt/local/bin/ 中的错误 ar 和错误 ranlib 而不是 /usr/bin 中的错误有关。

运行这个解决了这个问题:

sudo mv /opt/local/bin/ranlib /opt/local/bin/ranlib-backup-2019-02-09
sudo mv /opt/local/bin/ar /opt/local/bin/ar-backup-2019-02-09

根据本次讨论中的建议: https://github.com/commercialhaskell/stack/issues/4380

【讨论】:

  • 移动任何系统文件听起来很麻烦......请参阅我的回答以获得“更清洁”的建议。
【解决方案2】:

移动任何系统文件听起来很麻烦。 我建议执行以下操作,这在我的情况下有效(在 MacOS 下使用 gcc-6/gcc-8 进行 appveyor 测试):

# work around bugs in this environment
export TMPDIR=$PREFIX/tmp  # was set to something below the user

# have a folder with the files we're interested in linked ...
mkdir -p $PREFIX/tmp/sysbin
ln -s $PREFIX/tmp/sysbin/ar /usr/bin/ar
ln -s $$PREFIX/tmp/sysbin/ranlib /usr/bin/ranlib

# and let it be used
export PATH=$PREFIX/tmp/sysbin:$PATH

../configure

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-02
    • 2014-03-31
    • 2019-07-30
    • 2021-07-05
    • 2015-10-10
    • 1970-01-01
    • 2018-07-06
    相关资源
    最近更新 更多