Improve default HOST_CC / CC settings

Instead of blindly defaulting to cc, try to find the actual compiler
installed on the system, and as a last resort

Change-Id: I114780b8e4bb54fab72dbd80466266126d6574a5
This commit is contained in:
Lionel Sambuc 2014-07-31 18:36:24 +02:00
parent a2502f41d7
commit f1deff716e
2 changed files with 18 additions and 0 deletions

View file

@ -7,8 +7,17 @@ _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
CPPFLAGS+= -Wp,-iremap,${DESTDIR}/:/

View 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