Build 自动工具命名错误

Build 自动工具命名错误,build,crash,gnu,autoconf,Build,Crash,Gnu,Autoconf,我有以下配置.ac: AC_PREREQ([2.69]) AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) AC_PROG_CXX AC_OUTPUT 它生成configure,其中包含以下行:(grepcoreconfigure) 有趣的是,我有一个名为core的文件夹。所以/配置产量 checking for g++... g++ checking whether the C++ compiler works...

我有以下
配置.ac

AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_PROG_CXX
AC_OUTPUT
它生成configure,其中包含以下行:(
grepcoreconfigure

有趣的是,我有一个名为
core
的文件夹。所以
/配置
产量

checking 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
我在谷歌发现,这是在编译器崩溃的情况下完成的。但是,禁用这个检查有什么好方法吗(我真的不关心那些可以在autoconf测试中转储内核的编译器)。 我不想重命名文件夹

但这有什么好办法来禁用这项检查吗

不,没有

我不想重命名文件夹

在这种情况下,我建议在autoconf'bootstrap.sh'脚本中的某个地方或在运行的任何东西之后修补'configure'

#!/bin/sh
autoreconf -fvi # or whatever autoreconf needs
sed -i 's/rm -f core/rm -f/g' configure

请注意,
sed-i
不是一个通用的解决方案,因为它依赖于GNU-sed,但要想出一个可移植的解决方案并不难。

如问题中所示,大多数项目都有一个
configure.ac
文件,其中包含生成
configure
脚本的规则。最后一行几乎总是
AC_OUTPUT
(就像您的情况一样)。您可以在该行之后添加此命令(通常作为文件的最后一行),以操作生成的配置文件并清除有问题的命令:

m4_esyscmd_s([test -f configure && sed -i -e '/rm -f/s/ core / /' configure])

谢谢将
core
移动到
src/core
。我必须尊重传统。
m4_esyscmd_s([test -f configure && sed -i -e '/rm -f/s/ core / /' configure])