diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk index eb15b1ee9fa5..f6a29377d9a0 100644 --- a/share/mk/local.init.mk +++ b/share/mk/local.init.mk @@ -1,4 +1,6 @@ +.include "src.opts.mk" + .if defined(.PARSEDIR) .if ${.MAKE.MODE:Mmeta*} != "" .if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && ${.MAKE.MAKEFILES:M*bsd.prog.mk} == "" @@ -10,7 +12,22 @@ .endif .endif +.if ${MK_SYSROOT} == "yes" && !empty(SYSROOT) +CFLAGS_LAST+= --sysroot=${SYSROOT} +CXXFLAGS_LAST+= --sysroot=${SYSROOT} +LDADD+= --sysroot=${SYSROOT} .if ${MACHINE} == "host" +# we cheat? +LDADD+= -B/usr/lib +CFLAGS_LAST+= -I/usr/include +CXXFLAGS_LAST+= -I/usr/include +.endif +.endif + +.if ${MACHINE} == "host" +.if ${.MAKE.DEPENDFILE:E} != "host" +UPDATE_DEPENDFILE?= no +.endif HOST_CC?= /usr/bin/cc HOST_CFLAGS+= -DHOSTPROG CC= ${HOST_CC}