Tech Tip: Overriding the C compiler with ExtUtils::MakeMaker
In order to override the C compiler with ExtUtils::MakeMaker, one can do something like:
perl Makefile.PL CC=/usr/bin/clang
Which will make the "CC" variable in the generated makefile be set to /usr/bin/clang instead of the default. Apparently, setting the CC environment variable does not work like it does with CMake.
Thanks to Sisyphus for the tip.
If you want to permanently use this setting put it in the
$ENV{PERL_MM_OPT}.Module::Buildhas also its own$ENV{PERL_MB_OPT}.This feature is used in particular by
local::libto change the install directory for CPAN modules.