summaryrefslogtreecommitdiff
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
parent162b76d62195b29ded7898d0bf30d85c10a1aa4d (diff)
downloadpkgsrc-8031c4141d9b6b5d6f8f6129d31751d57d8036a8.tar.gz
set CC_VERSION for non-gcc and use it in the BUILD_INFO file.
-rw-r--r--mk/bsd.pkg.mk8
-rw-r--r--mk/compiler.mk10
2 files changed, 8 insertions, 10 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 7a991914539..a89873387a1 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1293 2003/10/02 15:45:31 gavan Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1294 2003/10/11 03:43:14 grant Exp $
#
# This file is in the public domain.
#
@@ -4535,11 +4535,7 @@ fake-pkg: ${PLIST} ${DESCR} ${MESSAGE}
@${ECHO} ${def}=${${def}:Q} | ${SED} -e 's|^PATH=[^ ]*|PATH=...|' >> ${BUILD_INFO_FILE}
. endfor
@${ECHO} "CC=${CC}" >> ${BUILD_INFO_FILE}
- @if ${CC} -v 2>&1 | ${GREP} -q '^gcc'; then \
- ${ECHO} "CC_VERSION=`${CC} -v 2>&1 | ${GREP} '^gcc'`" >> ${BUILD_INFO_FILE}; \
- elif ${CC} -V 2>&1 | ${GREP} -q '^cc'; then \
- ${ECHO} "CC_VERSION=`${CC} -V 2>&1 | ${GREP} '^cc'`" >> ${BUILD_INFO_FILE}; \
- fi
+ @${ECHO} "CC_VERSION=${CC_VERSION}" >> ${BUILD_INFO_FILE}
. if defined(USE_PERL5) && (${USE_PERL5} == "run")
@${ECHO} "PERL=`${PERL5} --version 2>/dev/null | ${GREP} 'This is perl'`" >> ${BUILD_INFO_FILE}
. endif
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