Suraj  Kumar commented on a discussion on 
source-builder/config/gcc-common-1.cfg: 
https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/35#note_110903

 > +  # be cut with ':' because _configdir contains 4 copies of 
 > +  # the same path
 > +  %define rtems_configdir %(echo %{_configdir} | cut -d':' -f1)
 > +
 > +  # Path to the location of the template script. 
 > +  %define stdcxx_template %{rtems_configdir}/stdcxx-template.py
 > +
 > +  # Get the current GCC version of the target being built. 
 > +  %define rsb_rtems_gcc_version %(%{_bindir}/%{_target}-gcc --version | 
 > head -1 | awk '{print $3}')
 > +
 > +  # Path to the target location of the script: gdb/python 
 > +  %define stdcxx_script %{_prefix}/share/gdb/python/rtems/stdcxx.py
 > +
 > +  # Modify the template script and update the current GCC version 
 > +  # and place it in the target location. 
 > +  cat %{stdcxx_template} | sed 
 > "s/@RSB_GCC_VERSION@/%{rsb_rtems_gcc_version}/g" > %{stdcxx_script}

@chris I am not sure if this what you had in mind, but here's something: 

in `rtems-base.bset` (`{prefix}/rsb/rtems/config` ), we can add the following 
line: 

```
%define rtems_build 1
```

The extra code I initially added to `gcc-common-1.cfg` can be moved over to 
`{prefix}/rtems/tools/gcc-pre-install.cfg` , and this line can be added to 
`gcc-common-1.cfg`: 

```
%define gcc_pre_installer %include %{_configdir}/rtems/tools/gcc-pre-install.cfg
```

Then, in `gcc-common-1.cfg`, we can add: 

```
%if %{rtems_build}
 %{gcc_pre_installer}
%endif 
```

How does this sound? Please let me know

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/35#note_110903
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
bugs@rtems.org
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to