build - 自动工具命名错误

标签 build crash gnu autoconf

我有以下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 yield
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

我在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/

相关文章:

ios - 在 flutter 时从 NotificationServiceExtension 更改 CFBundleVersion #66448

android-studio - Android Studio崩溃-没有项目

android - 使用OpenCV进行Android编程-应用崩溃

c++ - 解决 GNU 中重新声明的链接器错误

macos - 在 Mac(单声道)上构建 F# .fsproj

android - 如何修复构建gradle

build - 了解 CMake 背后的目的

java - 尝试按标签获取 View 时 Android 崩溃

solaris - 在 Solaris 上构建 binutils 2.21.1a 时出错

macos - 在 OS X 上安装 GCC 4.7.1