From e8748b797aceab5e98c0b6b1671d2e1f374eedaa Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 17 Aug 2023 15:30:35 +0000 Subject: [PATCH] Don't build with OpenSSL by default because we install in /lib and there is no libcrypto there. --- external/bsd/libpcap/Makefile.inc | 3 ++- external/bsd/libpcap/include/config.h | 4 ++-- external/bsd/libpcap/lib/Makefile | 9 ++++++--- external/bsd/libpcap/sbin/rpcapd/Makefile | 10 +++++++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/external/bsd/libpcap/Makefile.inc b/external/bsd/libpcap/Makefile.inc index 29cce0166f7c..7bbb0fc071fc 100644 --- a/external/bsd/libpcap/Makefile.inc +++ b/external/bsd/libpcap/Makefile.inc @@ -1,6 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.3 2023/08/17 15:18:12 christos Exp $ +# $NetBSD: Makefile.inc,v 1.4 2023/08/17 15:30:35 christos Exp $ SRCDIR := ${.PARSEDIR}/dist +USE_OPENSSL ?= no CPPFLAGS+=-DLBL_ALIGN OPENSSLDIR= ${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR} diff --git a/external/bsd/libpcap/include/config.h b/external/bsd/libpcap/include/config.h index 4fc1df00b2f8..456fb1d1ddf4 100644 --- a/external/bsd/libpcap/include/config.h +++ b/external/bsd/libpcap/include/config.h @@ -136,8 +136,8 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_NET_RAW_H */ -/* Use OpenSSL */ -#define HAVE_OPENSSL 1 +/* Use OpenSSL from the Makefile */ +/* #define HAVE_OPENSSL 1 */ /* if there's an os_proto.h for this platform, to use additional prototypes */ /* #undef HAVE_OS_PROTO_H */ diff --git a/external/bsd/libpcap/lib/Makefile b/external/bsd/libpcap/lib/Makefile index 373741cff9d6..8b79bff64434 100644 --- a/external/bsd/libpcap/lib/Makefile +++ b/external/bsd/libpcap/lib/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2023/08/17 15:18:13 christos Exp $ +# $NetBSD: Makefile,v 1.33 2023/08/17 15:30:36 christos Exp $ USE_SHLIBDIR=yes .include @@ -148,8 +148,7 @@ savefile.c \ scanner.l \ sf-pcap.c \ sf-pcapng.c \ -sockutils.c \ -sslutils.c +sockutils.c INCS= pcap/pcap.h pcap/namedb.h pcap/funcattrs.h \ @@ -181,7 +180,11 @@ grammar.y: grammar.y.in ${_MKTARGET_CREATE} ${TOOL_SED} -e 's/@REENTRANT_PARSER@/%pure-parser/g' < ${.ALLSRC} > ${.TARGET} +.if ${USE_OPENSSL:Uno} == "yes" +CPPFLAGS += -DHAVE_OPENSSL +SRCS += sslutils.c LIBDPLIBS += ssl ${OPENSSLDIR}/lib/libssl \ crypto ${OPENSSLDIR}/lib/libcrypto +.endif .include diff --git a/external/bsd/libpcap/sbin/rpcapd/Makefile b/external/bsd/libpcap/sbin/rpcapd/Makefile index a7f9cc7a3fef..9866809d48a7 100644 --- a/external/bsd/libpcap/sbin/rpcapd/Makefile +++ b/external/bsd/libpcap/sbin/rpcapd/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2023/08/17 15:18:13 christos Exp $ +# $NetBSD: Makefile,v 1.4 2023/08/17 15:30:36 christos Exp $ USE_FORT?= yes # network server @@ -34,8 +34,12 @@ CPPFLAGS+= -DHAVE_CONFIG_H CPPFLAGS+= -DPCAP_DONT_INCLUDE_PCAP_BPF_H PROGDPLIBS+= pcap ${.CURDIR}/../../lib \ - ssl ${OPENSSLDIR}/lib/libssl \ - crypto ${OPENSSLDIR}/lib/libcrypto \ crypt ${NETBSDSRCDIR}/lib/libcrypt +.if ${USE_OPENSSL:Uno} == "yes" +CPPFLAGS+= -DHAVE_OPENSSL +PROGDPLIBS+= ssl ${OPENSSLDIR}/lib/libssl \ + crypto ${OPENSSLDIR}/lib/libcrypto +.endif + .include