1

On Ubuntu 19.04, I have to build a project that requires an older gcc version that one installed in my system. For certain reasons, I cannot modify makefiles; during the build, gcc command must invoke older gcc, not the default version. How do I achieve that without breaking the default gcc currently installed in the system?

olegst
  • 121
  • Does the software's build process invoke gcc directly, or does the makefile do something like setting CC := gcc in which case you may be able to override it on the command line like make CC=path/to/old/gcc? – steeldriver Oct 23 '19 at 12:12
  • @steeldriver Through an internal variable which cannot be controlled from outside. Currently I just fixed it in the makefile with gcc-6 instead of gcc, but as soon as I start working with the repository I'm going to have a headache. – olegst Oct 24 '19 at 11:36
  • 1

1 Answers1

0

As it turned out, they call gcc through their own internal variable where they also add some flags. After I overrode it from command line:

make CCCMD='gcc-6 ...'

it got fixed.

I just forgot about overriding feature of make.

olegst
  • 121