svn commit: r266587 - head/share/mk

2014-05-23 Thread Warner Losh
Author: imp
Date: Fri May 23 14:34:22 2014
New Revision: 266587
URL: http://svnweb.freebsd.org/changeset/base/266587

Log:
  Allow CC to not actually exist. During the ports INDEX run, all the
  Makefiles are evaluated without building things. In a normal build,
  the prerequisites would be built, and CC would be an actual thing. In
  an INDEX build, though, they don't exists. Redirect stderr to get rid
  of annoying messages, and assume that the compiler version is 0 if the
  actual compiler can't tell us. Do this in preference to guessing based
  on numbers because gcc410 might be 4.10, or 4.1.0 and without
  carefully crafted special knowledge we differentiate between them
  easily (also ming-gcc has no clues at all). Elsewhere, don't trust
  the compiler version if it is 0.

Modified:
  head/share/mk/bsd.compiler.mk

Modified: head/share/mk/bsd.compiler.mk
==
--- head/share/mk/bsd.compiler.mk   Fri May 23 14:32:57 2014
(r266586)
+++ head/share/mk/bsd.compiler.mk   Fri May 23 14:34:22 2014
(r266587)
@@ -21,11 +21,11 @@
 .if !target(__bsd.compiler.mk__)
 __bsd.compiler.mk__:
 
-_v!=   ${CC} --version
+_v!=   ${CC} --version 2/dev/null || echo 0.0.0
 .if !defined(COMPILER_TYPE)
-. if ${CC:T:Mgcc*}
+. if ${CC:T:M*gcc*}
 COMPILER_TYPE:=gcc  
-. elif ${CC:T:Mclang}
+. elif ${CC:T:M*clang*}
 COMPILER_TYPE:=clang
 . elif ${_v:Mgcc}
 COMPILER_TYPE:=gcc
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r266587 - head/share/mk

2014-05-23 Thread Don Lewis
On 23 May, Warner Losh wrote:
 Author: imp
 Date: Fri May 23 14:34:22 2014
 New Revision: 266587
 URL: http://svnweb.freebsd.org/changeset/base/266587
 
 Log:
   Allow CC to not actually exist. During the ports INDEX run, all the
   Makefiles are evaluated without building things. In a normal build,
   the prerequisites would be built, and CC would be an actual thing. In
   an INDEX build, though, they don't exists. Redirect stderr to get rid
   of annoying messages, and assume that the compiler version is 0 if the
   actual compiler can't tell us. Do this in preference to guessing based
   on numbers because gcc410 might be 4.10, or 4.1.0 and without
   carefully crafted special knowledge we differentiate between them
   easily (also ming-gcc has no clues at all). Elsewhere, don't trust
   the compiler version if it is 0.
 
 Modified:
   head/share/mk/bsd.compiler.mk
 
 Modified: head/share/mk/bsd.compiler.mk
 ==
 --- head/share/mk/bsd.compiler.mk Fri May 23 14:32:57 2014
 (r266586)
 +++ head/share/mk/bsd.compiler.mk Fri May 23 14:34:22 2014
 (r266587)
 @@ -21,11 +21,11 @@
  .if !target(__bsd.compiler.mk__)
  __bsd.compiler.mk__:
  
 -_v!= ${CC} --version
 +_v!= ${CC} --version 2/dev/null || echo 0.0.0
  .if !defined(COMPILER_TYPE)
 -. if ${CC:T:Mgcc*}
 +. if ${CC:T:M*gcc*}
  COMPILER_TYPE:=  gcc  
 -. elif ${CC:T:Mclang}
 +. elif ${CC:T:M*clang*}
  COMPILER_TYPE:=  clang
  . elif ${_v:Mgcc}
  COMPILER_TYPE:=  gcc
 

Thanks!

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org