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

时间:2022-03-30 02:26:09

I am trying to compile the code for one of the projects and the source file uses autoreconf for generating the makefiles.

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

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

“autoreconf --verbose --force --make”

The problem is that this somehow generates the makefiles that uses the compiler as GCC. I want it to generate the configuration files with a different compiler. How can I do it?

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

I can issue the command as make CC= but this throws an error in the libtool that is used later on.

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

Thank You

1 个解决方案

#1


3  

Typically autoreconf just regenerates the configure script and the autoconf makefile templates, it doesn't create any actual makefiles.

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

Makefiles get created when configure is run, and that's when you want to override the compile:

运行configure时会创建Makefile,并且当您想要覆盖编译时:

configure CC=clang CXX=clang++

that should create makefiles that use CC=clang and CXX=clang++

应该创建使用CC = clang和CXX = clang ++的makefile

#1


3  

Typically autoreconf just regenerates the configure script and the autoconf makefile templates, it doesn't create any actual makefiles.

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

Makefiles get created when configure is run, and that's when you want to override the compile:

运行configure时会创建Makefile,并且当您想要覆盖编译时:

configure CC=clang CXX=clang++

that should create makefiles that use CC=clang and CXX=clang++

应该创建使用CC = clang和CXX = clang ++的makefile