build: fix GCC detection in pgo.sh

On my system, GCC doesn't output its name when passing the --version
flag:

    $ cc --version
    cc (Debian 12.2.0-3) 12.2.0
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As the Free Software Foundation is unlikely to write another compiler, I
think that searching for the foundation's name instead of GCC is a good
enough fix (and I'm almost sure we wouldn't be the first ones to do so).
This commit is contained in:
Andrea Pappacoda 2022-10-23 23:56:34 +02:00
parent 59c9dfe109
commit 1313e6352a
No known key found for this signature in database
GPG key ID: 4A9208A2455077A7

View file

@ -30,7 +30,7 @@ do_pgo=no
CFLAGS="${CFLAGS-} -O3"
case $(${CC-cc} --version) in
*GCC*)
*Free\ Software\ Foundation*)
compiler=gcc
do_pgo=yes
;;