From e5e345a4b0aa9ac50ed23f90851fc5c68e94e0fd Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Thu, 4 May 2023 11:58:39 -0700 Subject: [PATCH] local.dirdeps.mk skip N_host_libs for non-FreeBSD host The N_host_libs dance only makes sense if host is FreeBSD. Even then, if MK_host_egacy is yes we need libmd libnetbsd does not need libutil when using libegacy Sponsored by: Juniper Networks, Inc. --- lib/libnetbsd/Makefile.depend | 1 - lib/libnetbsd/Makefile.depend.options | 1 + share/mk/local.dirdeps.mk | 38 +++++++++++-------- .../pseudo/host-tools/Makefile.depend.host | 2 +- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/libnetbsd/Makefile.depend b/lib/libnetbsd/Makefile.depend index cf2961c09880..18be76b0cb6f 100644 --- a/lib/libnetbsd/Makefile.depend +++ b/lib/libnetbsd/Makefile.depend @@ -4,7 +4,6 @@ DIRDEPS = \ include \ include/xlocale \ - lib/libutil \ .include diff --git a/lib/libnetbsd/Makefile.depend.options b/lib/libnetbsd/Makefile.depend.options index 4dcc6c412671..95c6de3baf00 100644 --- a/lib/libnetbsd/Makefile.depend.options +++ b/lib/libnetbsd/Makefile.depend.options @@ -1,5 +1,6 @@ DIRDEPS_OPTIONS = host_egacy +DIRDEPS.host_egacy.no = lib/libutil DIRDEPS.host_egacy.yes = tools/build .include diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index d0ae1c0171cb..f2328d6cd99c 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -18,22 +18,8 @@ M_dep_qual_fixes += C;($m),[^/.,]*$$;\1; .endfor #.info M_dep_qual_fixes=${M_dep_qual_fixes} -# Cheat for including src.libnames.mk -____: -# Pull in _INTERNALLIBS -.include - -# Host libraries should mostly be excluded from the build so the -# host version in /usr/lib is used. Internal libraries need to be -# allowed to be built though since they are never installed. -_need_host_libs= -.for lib in ${_INTERNALLIBS} -_need_host_libs+= ${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} -.endfor - -N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} +# Some things we never want to build for host DIRDEPS_FILTER.host = \ - ${N_host_libs} \ Ninclude* \ Nlib/csu* \ Nlib/libc \ @@ -42,6 +28,28 @@ DIRDEPS_FILTER.host = \ Nsecure/lib* \ Nusr.bin/xinstall* \ +.if ${.MAKE.OS} == "FreeBSD" +# Host libraries should mostly be excluded from the build so the +# host version in /usr/lib is used. +# Internal libraries need to be allowed to be built though +# since they are never installed. + +# Cheat for including src.libnames.mk +____: +# Pull in _INTERNALLIBS +.include + +_need_host_libs= +.for lib in ${_INTERNALLIBS} +_need_host_libs+= ${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} +.endfor +.if ${MK_host_egacy} == "yes" +_need_host_libs+= lib/libmd +.endif + +N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} +DIRDEPS_FILTER.host+= ${N_host_libs} +.endif DIRDEPS_FILTER+= \ Nbin/cat.host \ diff --git a/targets/pseudo/host-tools/Makefile.depend.host b/targets/pseudo/host-tools/Makefile.depend.host index 39324fc6d49d..7ec04928d055 100644 --- a/targets/pseudo/host-tools/Makefile.depend.host +++ b/targets/pseudo/host-tools/Makefile.depend.host @@ -1,4 +1,5 @@ DIRDEPS= \ + sbin/md5 \ usr.bin/awk \ usr.bin/cap_mkdb \ usr.bin/file2c \ @@ -12,6 +13,5 @@ DIRDEPS= \ usr.sbin/makefs \ usr.sbin/nmtree \ - .include