summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
diff options
context:
space:
mode:
authorgrant <grant>2003-10-12 03:05:37 +0000
committergrant <grant>2003-10-12 03:05:37 +0000
commit7c4865645f28c11831957a235148a2f3e0c72235 (patch)
tree7abc5d4a1eada781334293bd1d66bf0da7ff49b2 /mk/compiler.mk
parent8b1ca7a0c3ab3084a2956d96d3b65a68d19ca8cd (diff)
downloadpkgsrc-7c4865645f28c11831957a235148a2f3e0c72235.tar.gz
fix logic error introduced in last, sync comments about CC_VERSION
with reality.
Diffstat (limited to 'mk/compiler.mk')
-rw-r--r--mk/compiler.mk15
1 files changed, 8 insertions, 7 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index 3bba8156398..77477da9c7a 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.19 2003/10/11 03:43:14 grant Exp $
+# $NetBSD: compiler.mk,v 1.20 2003/10/12 03:05:37 grant Exp $
# This Makefile fragment implements handling for supported
# C/C++/fortran compilers.
@@ -46,7 +46,8 @@
#
# CC_VERSION
# The compiler and version being used. For gcc, this is
-# 'gcc-<version>' and (currently) empty for other compilers.
+# 'gcc-<version>' and the string reported by ${CC} -V | grep
+# '^cc' for others.
#
# e.g.
# .include "../../mk/bsd.prefs.mk"
@@ -229,20 +230,20 @@ libstdc++-buildlink-la:
.endif
# CC_VERSION can be tested by package Makefiles to tweak things based
-# on the compiler being used. This is only functional for gcc right now.
+# on the compiler being used.
#
CC_VERSION?= # empty
-.if !defined(_CC_VERSION)
-. if defined(_CC_IS_GCC)
+.if defined(_CC_IS_GCC)
+. if !defined(_CC_VERSION)
_CC_VERSION!= if ${CC} -dumpversion > /dev/null 2>&1; then \
${ECHO} `${CC} -dumpversion`; \
else \
${ECHO} ""; \
fi
+. endif
CC_VERSION= gcc-${_CC_VERSION}
-. else
+.else
CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc'
-. endif
.endif
# The SunPro C++ compiler doesn't support passing linker flags with