summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2003-10-11 03:43:14 +0000
committergrant <grant@pkgsrc.org>2003-10-11 03:43:14 +0000
commit8031c4141d9b6b5d6f8f6129d31751d57d8036a8 (patch)
tree915c730d299c2b2025787271ecdf2b929c0bbb14 /mk/compiler.mk
parent162b76d62195b29ded7898d0bf30d85c10a1aa4d (diff)
downloadpkgsrc-8031c4141d9b6b5d6f8f6129d31751d57d8036a8.tar.gz
set CC_VERSION for non-gcc and use it in the BUILD_INFO file.
Diffstat (limited to 'mk/compiler.mk')
-rw-r--r--mk/compiler.mk10
1 files changed, 6 insertions, 4 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index 418afaab5de..3bba8156398 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.18 2003/10/11 02:44:18 grant Exp $
+# $NetBSD: compiler.mk,v 1.19 2003/10/11 03:43:14 grant Exp $
# This Makefile fragment implements handling for supported
# C/C++/fortran compilers.
@@ -232,15 +232,17 @@ libstdc++-buildlink-la:
# on the compiler being used. This is only functional for gcc right now.
#
CC_VERSION?= # empty
-.if defined(_CC_IS_GCC)
-. if !defined(_CC_VERSION)
+.if !defined(_CC_VERSION)
+. if defined(_CC_IS_GCC)
_CC_VERSION!= if ${CC} -dumpversion > /dev/null 2>&1; then \
${ECHO} `${CC} -dumpversion`; \
else \
${ECHO} ""; \
fi
-. endif
CC_VERSION= gcc-${_CC_VERSION}
+. else
+CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc'
+. endif
.endif
# The SunPro C++ compiler doesn't support passing linker flags with