]> Zhao Yanbai Git Server - minix.git/commitdiff
Improve default HOST_CC / CC settings
authorLionel Sambuc <lionel@minix3.org>
Thu, 31 Jul 2014 16:36:24 +0000 (18:36 +0200)
committerLionel Sambuc <lionel@minix3.org>
Thu, 31 Jul 2014 17:19:36 +0000 (19:19 +0200)
Instead of blindly defaulting to cc, try to find the actual compiler
installed on the system, and as a last resort

Change-Id: I114780b8e4bb54fab72dbd80466266126d6574a5

share/mk/bsd.sys.mk
share/mk/sys.mk

index 7c18cb12cedf09de5890887495c6a6f1f61e07ea..8afe3e565ee2c000e278bf73181ce1f5d3d4cf6a 100644 (file)
@@ -7,7 +7,16 @@ _BSD_SYS_MK_=1
 
 .if ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
 HOST_LDFLAGS?= -static
+
+#LSC: Be a bit smarter about the default compiler
+.if exists(/usr/pkg/bin/clang) || exists(/usr/bin/clang)
+HOST_CC?=   clang
+.endif
+
+.if exists(/usr/pkg/bin/gcc) || exists(/usr/bin/gcc)
+HOST_CC?=   gcc
 .endif
+.endif # ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
 
 .if ${MKREPRO:Uno} == "yes"
 CPPFLAGS+=     -Wp,-iremap,${NETBSDSRCDIR}:/usr/src
index 1f1398e5231a866d370cb5f8754c94eb2146fed6..ae407b1bbbb0bbd038807891f826c4df6cc7c192 100644 (file)
@@ -21,6 +21,15 @@ unix?=               We run MINIX.
 CPPFLAGS+= -DNDEBUG
 DBG=   -Os
 .endif
+
+#LSC: Be a bit smarter about the default compiler
+.if exists(/usr/pkg/bin/clang) || exists(/usr/bin/clang)
+CC?=   clang
+.endif
+
+.if exists(/usr/pkg/bin/gcc) || exists(/usr/bin/gcc)
+CC?=   gcc
+.endif
 .endif # defined(__MINIX)
 
 .LIBS:         .a