如何配置 autoreconf 使用不同于 GCC 的编译器

How to configure autoreconf to use a different compiler than GCC

我正在尝试为其中一个项目编译代码,源文件使用 autoreconf 生成 makefile。

" autoreconf --verbose --force --make "

问题是这会以某种方式生成将编译器用作 GCC 的 makefile。我希望它使用不同的编译器生成配置文件。我该怎么做?

我可以发出 make CC= 命令,但这会在稍后使用的 libtool 中引发错误。

谢谢

通常 autoreconf 只是重新生成 configure 脚本和 autoconf makefile 模板,它不会创建任何实际的 makefile。

configure 为 运行 时创建 Makefile,这就是您想要覆盖编译器的时间:

configure CC=clang CXX=clang++

应该创建使用 CC=clangCXX=clang++

的 makefile