meson gcc path configuration

401 views Asked by At

Hi in my project I configure the gcc to be used by the option

meson build --cross-file mygcc.txt

in the file mygcc.txt I set the gcc commands needed:

[binaries]
c = '/usr/bin/gcc'
cc = '/usr/bin/gcc'
cpp = '/usr/bin/g++'
ar = '/usr/bin/gcc-ar'
strip = '/usr/bin/strip'
ld = '/usr/bin/ld'
....

I wonder if it is possible to set dynamically the root where the gcc is installed.

for example if I use gcc-toolset I can switch the default gcc installed under

/user/bin

to

/opt/rh/gcc-toolset-9/root/usr/bin

and in order to use the new gcc I need to change the path in mygcc.txt , remove the build dir and reconfigure meson.

but is it possible to configure meson in order to pick the gcc set in the bash used?

devel@lnx+ which gcc /opt/rh/gcc-toolset-9/root/usr/bin/gcc

1

There are 1 answers

0
Mariano On BEST ANSWER

In order to solve the problem I have modified the mygcc.txt file in

[binaries]
c = 'gcc'
cc = 'gcc'
cpp = 'g++'
ar = 'gcc-ar'
strip = 'strip'
ld = 'ld'
pkgconfig = 'pkg-config'
.......

then in the .bashrc I have added

#source gcc
source /opt/rh/gcc-toolset-9/enable