mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 07:51:43 +00:00
Makefile: Improve gcc detection
Wasn't working for me until I fixed it. Turns out gcc really doesn't like giving its name out. Most of the time it reads argv[0].
This commit is contained in:
parent
824b1ab28c
commit
1a8ec7975c
1 changed files with 8 additions and 4 deletions
|
@ -71,13 +71,17 @@ latest_gcc_version:=10.2
|
|||
# manually set. And don't bother if this is a clean only
|
||||
# run.
|
||||
ifeq (,$(call Wildvar,GCC% destructive))
|
||||
version:=$(shell $(CC) --version)
|
||||
|
||||
# can't use $(CC) --version here since that uses argv[0] to display the name
|
||||
# also gcc outputs the information to stderr, so I had to do 2>&1
|
||||
# this program really doesn't like identifying itself
|
||||
version:=$(shell $(CC) -v 2>&1)
|
||||
|
||||
# check if this is in fact GCC
|
||||
ifneq (,$(or $(findstring gcc,$(version)),\
|
||||
$(findstring GCC,$(version))))
|
||||
ifneq (,$(findstring gcc version,$(version)))
|
||||
|
||||
version:=$(shell $(CC) -dumpversion)
|
||||
# in stark contrast to the name, gcc will give me a nicely formatted version number for free
|
||||
version:=$(shell $(CC) -dumpfullversion)
|
||||
|
||||
# Turn version into words of major, minor
|
||||
v:=$(subst ., ,$(version))
|
||||
|
|
Loading…
Reference in a new issue