pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk set CC_VERSION for non-gcc and use it in the BUILD_...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6d4308846fca
branches:  trunk
changeset: 462729:6d4308846fca
user:      grant <grant%pkgsrc.org@localhost>
date:      Sat Oct 11 03:43:14 2003 +0000

description:
set CC_VERSION for non-gcc and use it in the BUILD_INFO file.

diffstat:

 mk/bsd.pkg.mk  |   8 ++------
 mk/compiler.mk |  10 ++++++----
 2 files changed, 8 insertions(+), 10 deletions(-)

diffs (52 lines):

diff -r d7c69e05a606 -r 6d4308846fca mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sat Oct 11 03:20:30 2003 +0000
+++ b/mk/bsd.pkg.mk     Sat Oct 11 03:43:14 2003 +0000
@@ -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 @@
        @${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 -r d7c69e05a606 -r 6d4308846fca mk/compiler.mk
--- a/mk/compiler.mk    Sat Oct 11 03:20:30 2003 +0000
+++ b/mk/compiler.mk    Sat Oct 11 03:43:14 2003 +0000
@@ -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 @@
 # 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
+CC_VERSION=            gcc-${_CC_VERSION}
+.  else
+CC_VERSION!=           ${CC} -V 2>&1 | ${GREP} '^cc'
 .  endif
-CC_VERSION=            gcc-${_CC_VERSION}
 .endif
 
 # The SunPro C++ compiler doesn't support passing linker flags with



Home | Main Index | Thread Index | Old Index