[build2] Installation Error on Manjaro

Boris Kolpackov boris at codesynthesis.com
Tue Apr 7 08:49:54 UTC 2020


Matthew Krupcale <mkrupcale at matthewkrupcale.com> writes:

> I wonder if it would be easier to use __GNUC__ preprocessor macros[1]
> instead of trying to parse `gcc --version`.

Yes, that would be an alternative and we already do something like this
to detect the C/C++ stdlib (see libbuild2/cc/guess.cxx). However, I see
a number of issues:

1. This is not the only case where we need to parse potentially-localized
   information. Another notable ones are the output of:

   -v -E </dev/null in order to extract header search paths

   -print-search-dirs in order to extract library search paths

   I don't think these have equivalents at the preprocessor level.

2. We also hash the output of -v and use it as a checksum to detect
   compiler changes. On many distributions this includes additional
   relevant information (such as the package version) which is not
   part of __GNUC__. For example:

   gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~16.04) 

3. This would require a preprocessor run which is probably quite a bit
   slower than --version.



More information about the users mailing list