tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Private library dependencies



I'm trying to make the MKARGON2 stuff work properly with a release
build.

Since libuv was made into a private library for BIND, I thought it
would be a good model to follow.

However, when libcrypt builds, I get the following:

nbmake[7]: nbmake[7]: don't know how to make /home/nia/obj/external/apache2/argon2/lib/libargon2/libargon2_pic.a.
 Stop

What am I doing wrong?
Index: external/apache2/argon2/lib/libargon2/Makefile
===================================================================
RCS file: /cvsroot/src/external/apache2/argon2/lib/libargon2/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- external/apache2/argon2/lib/libargon2/Makefile	21 Oct 2019 02:36:48 -0000	1.2
+++ external/apache2/argon2/lib/libargon2/Makefile	8 Oct 2021 22:43:36 -0000
@@ -1,22 +1,21 @@
-USE_SHLIBDIR=	yes
-SHLIB_MAJOR=  1
-SHLIB_MINOR=  0
+# $NetBSD$
 
-#DIST=../../dist/phc-winner-argon2
+.include <bsd.own.mk>
 
-.PATH: ../../dist/phc-winner-argon2/src ../../dist/phc-winner-argon2/src/blake2 ../../dist/phc-winner-argon2/include
+ARGON2DIR=	${NETBSDSRCDIR}/external/apache2/argon2
 
+.PATH: ${ARGON2DIR}/dist/phc-winner-argon2/src \
+	${ARGON2DIR}/dist/phc-winner-argon2/src/blake2 \
+	${ARGON2DIR}/dist/phc-winner-argon2/include
+
+.if ${LIBISPRIVATE:Uno} == "no"
 INCS=   	argon2.h
 INCSDIR=	/usr/include
+.endif
 
 LIB=	argon2	
 SRCS=	argon2.c core.c blake2b.c thread.c encoding.c ref.c
 
-CPPFLAGS= -std=c89 -O3 -Wall -g -I../../dist/phc-winner-argon2/include -Isrc -fPIC -DARGON2_NO_THREADS
-
-OPTTARGET ?= native
-OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \
-                        -o /dev/null 2>/dev/null; echo $$?)
+CPPFLAGS+=	-I${ARGON2DIR}/dist/phc-winner-argon2/include
 
-install:	all incinstall
 .include <bsd.lib.mk>
Index: lib/libcrypt/Makefile
===================================================================
RCS file: /cvsroot/src/lib/libcrypt/Makefile,v
retrieving revision 1.27
diff -u -r1.27 Makefile
--- lib/libcrypt/Makefile	25 Mar 2020 17:11:06 -0000	1.27
+++ lib/libcrypt/Makefile	8 Oct 2021 22:43:36 -0000
@@ -14,9 +14,14 @@
 SRCS+=	hmac_sha1.c
 
 .if defined(HAVE_ARGON2)
+ARGON2DIR=	${NETBSDSRCDIR}/external/apache2/argon2
+ARGON2OBJDIR!=	cd ${ARGON2DIR}/lib/libargon2 && ${PRINTOBJDIR}
 SRCS+=		crypt-argon2.c
-CFLAGS+=	-DHAVE_ARGON2 -I../../external/apache2/argon2/dist/phc-winner-argon2/include/
-LDADD+=		-largon2 
+CPPFLAGS+=	-DHAVE_ARGON2
+CPPFLAGS+=	-I${ARGON2DIR}/dist/phc-winner-argon2/include
+LDADD+=		-Wl,-Bstatic -L${ARGON2OBJDIR} -largon2_pic
+DPADD+=		${ARGON2OBJDIR}/libargon2_pic.a
+LDADD+=		-Wl,-Bdynamic
 .endif
 
 WARNS?=	5


Home | Main Index | Thread Index | Old Index