1 # $NetBSD: bsd.host.mk,v 1.2 2014/04/10 19:02:18 plunky Exp $
3 .if
!defined
(_BSD_HOST_MK_
)
6 .if
${HOST_OSTYPE
:C
/\
-.
*//:U
} == "Minix"
9 #LSC: Be a bit smarter about the default compiler
10 .if exists
(/usr
/pkg
/bin
/clang
) || exists
(/usr
/bin
/clang
)
14 .if exists
(/usr
/pkg
/bin
/gcc
) || exists
(/usr
/bin
/gcc
)
17 .
endif # ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
19 # Helpers for cross-compiling
22 HOST_COMPILE.c?
=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
23 HOST_COMPILE.
cc?
= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
24 HOST_LINK.
cc?
= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
25 .if defined
(HOSTPROG_CXX
)
26 HOST_LINK.c?
= ${HOST_LINK.
cc}
28 HOST_LINK.c?
= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
45 # HOST_SH must be an absolute path
48 .if
!defined
(HOST_OSTYPE
)
49 _HOST_OSNAME
!= uname
-s
50 _HOST_OSREL
!= uname
-r
51 # For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
52 # something that does not look like an identifier, then use uname -m.
53 _HOST_ARCH
!= uname
-p
2>/dev
/null
54 _HOST_ARCH
:= ${HOST_ARCH
:tW
:C
/.
*[^
-_A-Za-z0-9
].
*//:S
/unknown
//}
58 HOST_OSTYPE
:= ${_HOST_OSNAME}-${_HOST_OSREL
:C
/\
([^\
)]*\
)//g
:[*]:C
/ /_
/g
}-${_HOST_ARCH
:C
/\
([^\
)]*\
)//g
:[*]:C
/ /_
/g
}
59 .MAKEOVERRIDES
+= HOST_OSTYPE
60 .
endif # !defined(HOST_OSTYPE)
62 .if
${USETOOLS} == "yes"
63 HOST_MKDEP?
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}host-mkdep
64 HOST_MKDEPCXX?
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}host-mkdep
66 HOST_MKDEP?
= CC
=${HOST_CC
:Q
} mkdep
67 HOST_MKDEPCXX?
= CC
=${HOST_CXX
:Q
} mkdep
70 .if
${NEED_OWN_INSTALL_TARGET} != "no"
71 HOST_INSTALL_FILE?
= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
72 HOST_INSTALL_DIR?
= ${INSTALL} -d
73 HOST_INSTALL_SYMLINK?
= ${INSTALL} ${SYMLINK} ${RENAME}