c++cgcccompilationautoreconf

How to configure autoreconf to use a different compiler than GCC


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

" 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?

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

Thank You


Solution

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

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

    configure CC=clang CXX=clang++
    

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