You are not logged in.

#1 2018-05-23 16:54:18

andrii_zymohliad
Member
From: Tallinn, Estonia
Registered: 2016-04-11
Posts: 19

[SOLVED] Simple and reliable way to build a project with custom gcc

I have to build a big C/C++ project with GCC-4.9. I've installed gcc49 from AUR alongside with the base GCC, which has the same executable names as the base GCC plus the suffix "-4.9".

What is the best way to tell the primary configure/make command to use GCC-4.9 executables instead of the main GCC? Is there something simpler than creating symlinks/aliases for each toolchain executable or digging up all places in makefiles where the compiler is specified?

Last edited by andrii_zymohliad (2018-05-23 17:34:49)

Offline

#2 2018-05-23 17:15:26

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [SOLVED] Simple and reliable way to build a project with custom gcc

If the makefile is using the standard variables, then you can set them
https://www.gnu.org/software/make/manua … ables.html

Otherwise symlinks should be the way to go, but that can be automated similar to a python venv.

for file in /usr/bin/*-4.9; do make_venv_symlink; done 

Last edited by progandy (2018-05-23 17:18:59)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2018-05-23 17:35:21

andrii_zymohliad
Member
From: Tallinn, Estonia
Registered: 2016-04-11
Posts: 19

Re: [SOLVED] Simple and reliable way to build a project with custom gcc

Thank you, progandy!

Offline

Board footer

Powered by FluxBB