From b55e8e6e0dc00b5dc9dcc344d057ab88c98df0f8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 22 Oct 2014 03:39:11 +0000 Subject: [PATCH] My previous commit exposed an issue as it fixed a different issue. lib/atf isn't a prereq_lib, since it isn't required for other libraries to build. Remove it. The old kludge of always building it had effectively been retired. Since we don't want to build the libraries with the tests when we're bootstrapping, invent MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS value, except when explicitly defined. Make lib/atf depend on it being yes. When building the libraries set MK_TESTS to no, and MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages of the build work correctly. This should fix (and does for me) people's issues with parallel builds racing between lib/atf and libexec/atf. Since lib/atf is built during the libraries phase, the race disappears. --- Makefile.inc1 | 7 +------ lib/Makefile | 4 +++- share/mk/src.opts.mk | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c38ec62f5e03..c8474dbadd5f 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -574,7 +574,7 @@ _libraries: @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; \ ${WMAKE} -DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ - MK_PROFILE=no MK_TESTS=no libraries + MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries _depend: @echo @echo "--------------------------------------------------------------" @@ -1535,7 +1535,6 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ ${_kerberos5_lib_libwind} \ - ${_lib_atf} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ ${_lib_libgssapi} \ @@ -1561,10 +1560,6 @@ gnu/lib/libsupc++__L: gnu/lib/libstdc++__L lib/libgeom__L: lib/libexpat__L -.if ${MK_TESTS} != "no" -_lib_atf= lib/atf -.endif - .if ${MK_LIBTHR} != "no" _lib_libthr= lib/libthr .endif diff --git a/lib/Makefile b/lib/Makefile index c558f1188499..b683a90f6ff9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -276,8 +276,10 @@ _libsmutil= libsmutil _libtelnet= libtelnet .endif -.if ${MK_TESTS} != "no" +.if ${MK_TESTS_SUPPORT} != "no" _atf= atf +.endif +.if ${MK_TESTS} != "no" _tests= tests .endif diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index b66187c12542..cb493c96475a 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -330,6 +330,7 @@ MK_CLANG_FULL:= no KVM \ NETGRAPH \ PAM \ + TESTS \ WIRELESS .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no