Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julius Enriquez
SRB2
Commits
1af05afb
Commit
1af05afb
authored
3 years ago
by
James R.
Browse files
Options
Downloads
Plain Diff
Merge branch 'better-gcc-check' into 'master'
Makefile: Improve gcc detection See merge request
STJr/SRB2!1608
parents
8e0831a1
1a8ec797
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Makefile.d/detect.mk
+8
-4
8 additions, 4 deletions
src/Makefile.d/detect.mk
with
8 additions
and
4 deletions
src/Makefile.d/detect.mk
+
8
−
4
View file @
1af05afb
...
@@ -71,13 +71,17 @@ latest_gcc_version:=10.2
...
@@ -71,13 +71,17 @@ latest_gcc_version:=10.2
# manually set. And don't bother if this is a clean only
# manually set. And don't bother if this is a clean only
# run.
# run.
ifeq
(,$(call Wildvar,GCC% destructive))
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
# check if this is in fact GCC
ifneq
(,$(or $(findstring gcc,$(version)),\
ifneq
(,$(findstring gcc version,$(version)))
$(
findstring
GCC,
$(
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
# Turn version into words of major, minor
v
:=
$(
subst ., ,
$(
version
))
v
:=
$(
subst ., ,
$(
version
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment