LIBPRIV: Introduce PRIVATELIB knob (just like INTERNALLIB).
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 9 Nov 2016 15:36:05 +0000 (17:36 +0200)
committerzrj <zrj@dragonflybsd.org>
Thu, 10 Nov 2016 14:09:40 +0000 (16:09 +0200)
Collect common private libraries path handling bits into share/mk/bsd.lib.mk.
It is cleaner this way, prevents issues like manual paths and/or ignoring stale
.depend for /usr/obj/usr/src/world_x86_64/usr/lib/priv/priv/libprivate_ncurses.a

lib/libedit/libedit/Makefile
lib/libldns/Makefile
lib/libncurses/libncurses/Makefile
lib/libncurses/libpanel/Makefile
lib/librecrypto/Makefile
lib/libressl/Makefile
lib/libssh/Makefile
share/mk/bsd.lib.mk

index 3f2ac4a..c0079b9 100644 (file)
@@ -3,9 +3,8 @@
 
 LIB=           private_edit
 SHLIB_MAJOR=   5
-SHLIBDIR?=     /lib/priv
-LIBDIR?=       /usr/lib/priv
-PROFLIBDIR?=   /usr/lib/priv/profile
+SHLIBDIR?=     /lib
+PRIVATELIB=
 
 SRCDIR=        ${BASEDIR}/src
 .PATH:         ${SRCDIR}
index f9cdbcf..ebce4fd 100644 (file)
@@ -4,9 +4,8 @@ LDNS=           ${.CURDIR}/../../contrib/ldns
 
 LIB=           private_ldns
 SHLIB_MAJOR=   1
-SHLIBDIR?=     /usr/lib/priv
-LIBDIR?=       ${SHLIBDIR}
-PROFLIBDIR?=   ${SHLIBDIR}/profile
+PRIVATELIB=
+
 NO_STRICT_ALIASING=
 
 SRCS  =                rdata.c util.c rr.c packet.c wire2host.c \
index f48f20d..4c7398a 100644 (file)
@@ -1,8 +1,7 @@
 LIB=    private_ncurses${LIB_SUFFIX}
+PRIVATELIB=
 
-SHLIBDIR?=     /lib/priv
-LIBDIR?=       /usr/lib/priv
-PROFLIBDIR?=   /usr/lib/priv/profile
+SHLIBDIR?=     /lib
 
 NCURSESBASEDIR=                ${NCURSESDIR}/ncurses/base
 NCURSESSERIALDIR=      ${NCURSESDIR}/ncurses/tty
index 135b1f8..325e611 100644 (file)
@@ -1,10 +1,9 @@
 ZPANEL=        yes
 
 LIB=    private_panel${LIB_SUFFIX}
+PRIVATELIB=
 
-SHLIBDIR?=     /lib/priv
-LIBDIR?=       /usr/lib/priv
-PROFLIBDIR?=   /usr/lib/priv/profile
+SHLIBDIR?=     /lib
 
 SRCS=  ncurses_def.h \
        p_above.c \
index 2dd2833..8e4d29f 100644 (file)
@@ -3,9 +3,9 @@
 
 LIB=            private_crypto
 SHLIB_MAJOR=    38
-SHLIBDIR?=     /lib/priv
-LIBDIR?=       /usr/lib/priv
-PROFLIBDIR?=   /usr/lib/priv/profile
+PRIVATELIB=
+
+SHLIBDIR?=     /lib
 WARNS?=                2
 NO_STRICT_ALIASING=
 
index 4813365..03d503a 100644 (file)
@@ -3,9 +3,9 @@
 
 LIB=           private_ssl
 SHLIB_MAJOR=   39
-SHLIBDIR?=     /lib/priv
-LIBDIR?=       /usr/lib/priv
-PROFLIBDIR?=   /usr/lib/priv/profile
+PRIVATELIB=
+
+SHLIBDIR?=     /lib
 WARNS?=                2
 
 # from vendor makefile
@@ -23,9 +23,8 @@ SRCS= ${libssl_la_SOURCES}
 INCS=  dtls1.h srtp.h ssl.h ssl2.h ssl23.h ssl3.h tls1.h
 INCSDIR=       ${INCLUDEDIR}/priv/openssl
 
-# We can't use ${LIBRECRYPTO} because of LIBDIR definition, so recreate it
 LDADD=         -lprivate_crypto
-DPADD=         ${DESTDIR}${LIBDIR}/libprivate_crypto.a
+DPADD=         ${LIBRECRYPTO}
 LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .PATH: ${LSSL_SRC} ${LIBRESSL_SRC}/include/openssl
index c0e98d7..a729cb8 100644 (file)
@@ -1,5 +1,7 @@
 LIB=   private_ssh
 SHLIB_MAJOR= 4
+PRIVATELIB=
+
 SRCS=  ssh_api.c \
        ssherr.c \
        sshbuf.c \
@@ -48,9 +50,5 @@ MAN=  moduli.5
 WARNS?=        2
 NO_STRICT_ALIASING=
 
-SHLIBDIR?=     /usr/lib/priv
-LIBDIR?=       ${SHLIBDIR}
-PROFLIBDIR?=   ${SHLIBDIR}/profile
-
 .include "../../Makefile.ssh.common"
 .include <bsd.lib.mk>
index 8240fb2..c01b1b8 100644 (file)
@@ -29,10 +29,17 @@ STRIP?=     -s
 
 .include <bsd.libnames.mk>
 
+.if !defined(PRIVATELIB)
 TARGET_LIBDIR?=                ${LIBDIR}
 TARGET_DEBUGLIBDIR?=   ${DEBUGLIBDIR}
 TARGET_PROFLIBDIR?=    ${PROFLIBDIR}
 TARGET_SHLIBDIR?=      ${SHLIBDIR}
+.else
+TARGET_LIBDIR?=                ${LIBDIR}/priv
+TARGET_DEBUGLIBDIR?=   ${DEBUGLIBDIR:S!/debug$!/priv/debug!}
+TARGET_PROFLIBDIR?=    ${PROFLIBDIR:S!/profile$!/priv/profile!}
+TARGET_SHLIBDIR?=      ${SHLIBDIR}/priv
+.endif
 
 # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
 # .So used for PIC object files