From 57028ca47f3f5cf584c4ae82dc656f1f00a3a47c Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Fri, 8 Nov 2013 14:20:22 +0000 Subject: [PATCH] Fix buildworld when WITH_TESTS is enabled. The addition of the TESTS knob and its enabling of the build of tests in lib/libcrypt/tests/ broke the build. The reason is that we cannot descend into tests/ subdirectories until all prerequisites have been built, which in the case of tests may be "a lot of things" (libatf-c in this case). Ensure that we do not walk tests/ directories during the bootstrapping of the libraries as part of buildworld. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) --- Makefile.inc1 | 28 ++++++++++++++++------------ share/mk/bsd.own.mk | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 1e70db79d0a0..f9a49b5ba786 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1602,10 +1602,12 @@ ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib} && \ - ${MAKE} DIRPRFX=${_lib}/ obj && \ - ${MAKE} DIRPRFX=${_lib}/ depend && \ - ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all && \ - ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \ + ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \ + DIRPRFX=${_lib}/ all && \ + ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \ + DIRPRFX=${_lib}/ install .endif .endfor @@ -1614,10 +1616,10 @@ ${_lib}__L: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib} && \ - ${MAKE} DIRPRFX=${_lib}/ obj && \ - ${MAKE} DIRPRFX=${_lib}/ depend && \ - ${MAKE} DIRPRFX=${_lib}/ all && \ - ${MAKE} DIRPRFX=${_lib}/ install + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ all && \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ install .endif .endfor @@ -1627,10 +1629,12 @@ ${_lib}__L: .PHONY .MAKE lib/libpam__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ cd ${.CURDIR}/lib/libpam && \ - ${MAKE} DIRPRFX=lib/libpam/ obj && \ - ${MAKE} DIRPRFX=lib/libpam/ depend && \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all && \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install + ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ obj && \ + ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ depend && \ + ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \ + -D_NO_LIBPAM_SO_YET all && \ + ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \ + -D_NO_LIBPAM_SO_YET install _prereq_libs: ${_prereq_libs:S/$/__PL/} _startup_libs: ${_startup_libs:S/$/__L/} diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 528ecdbe9f34..c292d6e52cce 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -556,6 +556,20 @@ MK_CLANG_FULL:= no MK_LLDB:= no .endif +.if defined(NO_TESTS) +# This should be handled above along the handling of all other NO_* options. +# However, the above is broken when WITH_*=yes are passed to make(1) as +# command line arguments. See PR bin/183762. +# +# Because the TESTS option is new and it will default to yes, it's likely +# that people will pass WITHOUT_TESTS=yes to make(1) directly and get a broken +# build. So, just in case, it's better to explicitly handle this case here. +# +# TODO(jmmv): Either fix make to allow us putting this override where it +# belongs above or fix this file to cope with the make bug. +MK_TESTS:= no +.endif + # # Set defaults for the MK_*_SUPPORT variables. #