From owner-svn-src-head@freebsd.org Wed Dec 2 00:01:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA68A3E65F; Wed, 2 Dec 2015 00:01:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D25FC1DBC; Wed, 2 Dec 2015 00:01:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB2019tg042985; Wed, 2 Dec 2015 00:01:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB20198S042983; Wed, 2 Dec 2015 00:01:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512020001.tB20198S042983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 2 Dec 2015 00:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291623 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2015 00:01:11 -0000 Author: bdrewery Date: Wed Dec 2 00:01:09 2015 New Revision: 291623 URL: https://svnweb.freebsd.org/changeset/base/291623 Log: Add assertions that capture invalid configurations for new libraries. Fix current findings. Given libfoo: - Ensure that a LIBFOO is set. For INTERNALLIBS advise setting this in src.libnames.mk, otherwise bsd.libnames.mk. - Ensure that a LIBFOODIR is properly set. - Ensure that _DP_foo is set and matches the LIBADD in the build of foo's own Makefile Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Tue Dec 1 22:50:32 2015 (r291622) +++ head/share/mk/bsd.libnames.mk Wed Dec 2 00:01:09 2015 (r291623) @@ -42,6 +42,7 @@ LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt. LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a +LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -98,6 +99,7 @@ LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpai LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a +LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a @@ -117,6 +119,7 @@ LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a +LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a @@ -155,6 +158,13 @@ LDADD:= ${LDADD:N-lc} -lc # Only do this for src builds. .if defined(SRCTOP) +.if defined(_LIBRARIES) && defined(LIB) && \ + ${_LIBRARIES:M${LIB}} != "" +.if !defined(LIB${LIB:tu}) +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a +.endif +.endif + # Derive LIB*SRCDIR from LIB*DIR .for lib in ${_LIBRARIES} LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Dec 1 22:50:32 2015 (r291622) +++ head/share/mk/src.libnames.mk Wed Dec 2 00:01:09 2015 (r291623) @@ -163,6 +163,8 @@ _LIBRARIES= \ ypclnt \ z +# Each library's LIBADD needs to be duplicated here for static linkage of +# 2nd+ order consumers. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml .if ${MK_OPENSSL} != "no" @@ -170,6 +172,7 @@ _DP_archive+= crypto .else _DP_archive+= md .endif +_DP_sqlite3= pthread _DP_ssl= crypto _DP_ssh= crypto crypt .if ${MK_LDNS} != "no" @@ -217,7 +220,7 @@ _DP_fetch= md .endif _DP_execinfo= elf _DP_dwarf= elf -_DP_dpv= dialog figpar util +_DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c @@ -232,16 +235,39 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc \ - pthread +_DP_readline= ncursesw +_DP_roken= crypt +_DP_kadm5clnt= com_err krb5 roken +_DP_kadm5srv= com_err hdb krb5 roken +_DP_heimntlm= crypto com_err krb5 roken +_DP_hx509= asn1 com_err crypto roken wind +_DP_hdb= asn1 com_err krb5 roken sqlite3 +_DP_asn1= com_err roken +_DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto +_DP_wind= com_err roken +_DP_heimbase= pthread +_DP_heimipcc= heimbase roken pthread +_DP_heimipcs= heimbase roken pthread +_DP_kafs5= asn1 krb5 roken +_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err _DP_lzma= pthread _DP_ucl= m _DP_vmmapi= util _DP_ctf= z _DP_proc= rtld_db util -_DP_dtrace= rtld_db pthread +_DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util +# The libc dependencies are not strictly needed but are defined to make the +# assert happy. +_DP_c= compiler_rt +.if ${MK_SSP} != "no" +_DP_c+= ssp_nonshared +.endif +_DP_stdthreads= pthread +_DP_tacplus= md +_DP_panel= ncurses +_DP_panelw= ncursesw # Define spacial cases LDADD_supcplusplus= -lsupc++ @@ -291,6 +317,7 @@ DPADD_dtrace+= ${DPADD_ctf} ${DPADD_elf} LDADD_dtrace+= ${LDADD_ctf} ${LDADD_elf} ${LDADD_proc} # The following depends on libraries which are using pthread +# XXX: These vars are always empty DPADD_hdb+= ${DPADD_pthread} LDADD_hdb+= ${LDADD_pthread} DPADD_kadm5srv+= ${DPADD_pthread} @@ -306,9 +333,10 @@ LDADD+= ${LDADD_${_l}} .endfor .if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} -.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". +.error ${.CURDIR}: Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif +# INTERNALLIB definitions. LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a @@ -352,7 +380,7 @@ LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/l LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts -LIBOTPS?= ${LIBOPTSDIR}/libopts.a +LIBOPTS?= ${LIBOPTSDIR}/libopts.a LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a @@ -416,8 +444,10 @@ LIBFORMDIR= ${OBJTOP}/lib/ncurses/form LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw -LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses -LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses +LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBTERMCAPDIR= ${LIBNCURSESDIR} +LIBTERMCAPWDIR= ${LIBNCURSESWDIR} LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -432,4 +462,18 @@ LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor +# Sanity check that libraries are defined here properly when building them. +.if defined(LIB) && ${_LIBRARIES:M${LIB}} != "" +.if !empty(LIBADD) && \ + (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) +.info ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') +.endif +.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) +.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} +.endif +.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu}) +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a +.endif +.endif + .endif # !target(____)