我有以下configure.ac
:
AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_PROG_CXX
AC_OUTPUT
并生成包含以下几行的configure :(
grep core configure
)1572: rm -f core *.core core.conftest.* &&
2143:rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2210:rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2212:rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2214:rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
好玩始于我有一个名为
core
的文件夹。所以./configure
yieldchecking for g++... g++
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... rm: cannot remove 'core': Is a directory
yes
checking whether g++ accepts -g... rm: cannot remove 'core': Is a directory
yes
configure: creating ./config.status
rm: cannot remove 'core': Is a directory
我在Google中发现,这样做是在编译器崩溃的情况下完成的。但这是禁用此检查的一种好方法(我真的不在乎可以在autoconf测试中进行核心转储的编译器)。
重命名文件夹不是我想要的。
最佳答案
But is it any nice way to disable this check
不,没有。
Renaming folder is not what I want to do.
在这种情况下,我建议在autoconf'bootstrap.sh'脚本中的某处之后或运行
autoreconf
的任何内容之后修补'configure':#!/bin/sh
autoreconf -fvi # or whatever autoreconf needs
sed -i 's/rm -f core/rm -f/g' configure
注意
sed -i
并不是通用解决方案,因为它依赖于GNU sed,但是想出一个可移植的解决方案并不难。
关于build - 自动工具命名错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11811233/