From 30027941a8ebe1df25b59b08e09470770e57f73e Mon Sep 17 00:00:00 2001 From: xtraeme Date: Tue, 11 Jan 2005 19:32:17 +0000 Subject: Better checking of libpcap versions, based in heimdal/builtin.mk. for now we are assumming that: _LIBPCAP_VERSIONS= 0.8.3 0.7.2 _LIBPCAP_0.8.3= NetBSD-2.99.9* NetBSD-2.99.1[0-9]* _LIBPCAP_0.7= NetBSD-1.[56]* NetBSD-2.0* Users of other platforms should update this list eventually. --- net/libpcap/builtin.mk | 64 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-) (limited to 'net/libpcap') diff --git a/net/libpcap/builtin.mk b/net/libpcap/builtin.mk index 8152bf1cdd5..524eb49392a 100644 --- a/net/libpcap/builtin.mk +++ b/net/libpcap/builtin.mk @@ -1,10 +1,66 @@ -# $NetBSD: builtin.mk,v 1.2 2004/03/29 05:43:32 jlam Exp $ +# $NetBSD: builtin.mk,v 1.3 2005/01/11 19:32:17 xtraeme Exp $ + +_LIBPCAP_H= /usr/include/pcap.h .if !defined(IS_BUILTIN.libpcap) IS_BUILTIN.libpcap= no -. if exists(/usr/include/pcap.h) -IS_BUILTIN.libpcap= yes +. if exists(${_LIBPCAP_H}) +IS_BUILTIN.libpcap!= \ + if ${GREP} -q PCAP_VERSION_MAJOR ${_LIBPCAP_H}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. if !empty(IS_BUILTIN.libpcap:M[yY][eE][sS]) +# +# Create an appropriate name for the built-in package distributed +# with the system. This package name can be used to check against +# BUILDLINK_DEPENDS. to see if we need to install the pkgsrc +# version or if the built-in one is sufficient. +# +. if !defined(_LIPCAP_VERSION) +_LIBPCAP_VERSIONS= 0.8.3 0.7.2 +_LIBPCAP_0.8.3= NetBSD-2.99.9* NetBSD-2.99.1[0-9]* +_LIBPCAP_0.7= NetBSD-1.[56]* NetBSD-2.0* +. for _libpcap_version_ in ${_LIBPCAP_VERSIONS} +. for _pattern_ in ${_LIBPCAP_${_libpcap_version_}} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +_LIBPCAP_VERSION?= ${_libpcap_version_} +. endif +. endfor +. endfor +_LIBPCAP_VERSION?= 0.7.2 +. endif +BUILTIN_PKG.libpcap= libpcap-${_LIBPCAP_VERSION} +MAKEFLAGS+= BUILTIN_PKG.libpcap=${BUILTIN_PKG.libpcap} +. endif . endif -.endif # IS_BUILTIN.libpcap +MAKEFLAGS+= IS_BUILTIN.libpcap=${IS_BUILTIN.libpcap} +.endif +.if !defined(USE_BUILTIN.libpcap) USE_BUILTIN.libpcap?= ${IS_BUILTIN.libpcap} + +. if defined(BUILTIN_PKG.libpcap) +USE_BUILTIN.libpcap= yes +. for _depend_ in ${BUILDLINK_DEPENDS.libpcap} +. if !empty(USE_BUILTIN.libpcap:M[yY][eE][sS]) +USE_BUILTIN.libpcap!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.libpcap}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +.endif # USE_BUILTIN.libpcap + +CHECK_BUILTIN.libpcap?= no +.if !empty(CHECK_BUILTIN.libpcap:M[nN][oO]) + +.if !empty(USE_BUILTIN.libpcap:M[nN][oO]) +BUILDLINK_DEPENDS.libpcap+= libpcap>=0.8.3 +.endif + +.endif # CHECK_BUILTIN.libpcap -- cgit v1.2.3