Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157613133
D28315.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
773 B
Referenced Files
None
Subscribers
None
D28315.diff
View Options
diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk
--- a/share/mk/bsd.compiler.mk
+++ b/share/mk/bsd.compiler.mk
@@ -187,7 +187,16 @@
. elif ${_v:Mclang} || ${_v:M(clang-*.*.*)}
${X_}COMPILER_TYPE:= clang
. else
+# With GCC, cc --version prints "cc $VERSION ($PKGVERSION)", so if a
+# distribution overrides the default GCC PKGVERSION it is not identified.
+# However, its -v output always says "gcc version" in it, so fall back on that.
+_gcc_version!= ${${cc}:N${CCACHE_BIN}} -v 2>&1 | grep "gcc version"
+. if !empty(_gcc_version)
+${X_}COMPILER_TYPE:= gcc
+. else
.error Unable to determine compiler type for ${cc}=${${cc}}. Consider setting ${X_}COMPILER_TYPE.
+. endif
+.undef _gcc_version
. endif
.endif
.if !defined(${X_}COMPILER_VERSION)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 24, 10:19 AM (2 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33469957
Default Alt Text
D28315.diff (773 B)
Attached To
Mode
D28315: bsd.compiler.mk: Detect distribution-provided GCC when executed as cc
Attached
Detach File
Event Timeline
Log In to Comment