Use this builtin.mk from pkgsrc-wip, which works for all platforms

and detects a lot of more versions, thanks to Peter Postma.
This commit is contained in:
xtraeme 2005-01-11 21:19:24 +00:00
parent e106bbd12b
commit 5ec25f23e8

View file

@ -1,45 +1,52 @@
# $NetBSD: builtin.mk,v 1.8 2005/01/11 20:35:48 xtraeme Exp $ # $NetBSD: builtin.mk,v 1.9 2005/01/11 21:19:24 xtraeme Exp $
_LIBPCAP_H= /usr/include/pcap.h _LIBPCAP_PKGSRC_PKGNAME= libpcap-0.8.3
_LIBPCAP_PCAP_H= /usr/include/pcap.h
.if !defined(IS_BUILTIN.libpcap) .if !defined(IS_BUILTIN.libpcap)
IS_BUILTIN.libpcap= no IS_BUILTIN.libpcap= no
. if exists(${_LIBPCAP_H}) . if exists(${_LIBPCAP_PCAP_H})
IS_BUILTIN.libpcap!= \ IS_BUILTIN.libpcap= yes
if ${GREP} -q PCAP_VERSION_MAJOR ${_LIBPCAP_H}; then \
${ECHO} "yes"; \ # libpcap>=0.8.3: MODE_MON added
else \ _PCAP_083!= \
${ECHO} "no"; \ ${GREP} -c MODE_MON ${_LIBPCAP_PCAP_H} || ${TRUE}
fi # libpcap>=0.8.1: pcap_get_selectable_fd added
. if !empty(IS_BUILTIN.libpcap:M[yY][eE][sS]) _PCAP_081!= \
# ${GREP} -c pcap_get_selectable_fd ${_LIBPCAP_PCAP_H} || ${TRUE}
# Create an appropriate name for the built-in package distributed # libpcap>=0.8.0: pcap_datalink_val_to_description added
# with the system. This package name can be used to check against _PCAP_080!= \
# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc ${GREP} -c pcap_datalink_val_to_description \
# version or if the built-in one is sufficient. ${_LIBPCAP_PCAP_H} || ${TRUE}
# # libpcap>=0.7.0: pcap_setnonblock added
. if !defined(_LIBPCAP_VERSION) _PCAP_070!= \
_LIBPCAP_VERSIONS= 0.8.3 0.7.2 ${GREP} -c pcap_setnonblock ${_LIBPCAP_PCAP_H} || ${TRUE}
_LIBPCAP_0.8.3= NetBSD-2.99.9* NetBSD-2.99.1[0-9]* NetBSD-[3-9]* \ # libpcap>=0.6.0: prototype change for pcap_freecode
FreeBSD-5.[3-9]* FreeBSD-6* _PCAP_060!= \
_LIBPCAP_0.7.2= NetBSD-1.[56]* NetBSD-2.0* NetBSD-2.99.[1-8] \ ${GREP} -c pcap_freecode.struct.bpf_program \
FreeBSD-4* FreeBSD-5.[12]* ${_LIBPCAP_PCAP_H} || ${TRUE}
. for _libpcap_version_ in ${_LIBPCAP_VERSIONS} # libpcap>=0.5.0: pcap_compile_nopcap added
. for _pattern_ in ${_LIBPCAP_${_libpcap_version_}} _PCAP_050!= \
. if !empty(MACHINE_PLATFORM:M${_pattern_}) ${GREP} -c pcap_compile_nopcap ${_LIBPCAP_PCAP_H} || ${TRUE}
_LIBPCAP_VERSION?= ${_libpcap_version_}
. endif .if ${_PCAP_083} == "1"
. endfor BUILTIN_PKG.libpcap= libpcap-0.8.3
. endfor .elif ${_PCAP_081} == "1"
_LIBPCAP_VERSION?= 0.7.2 BUILTIN_PKG.libpcap= libpcap-0.8.1
. endif .elif ${_PCAP_080} == "1"
BUILTIN_PKG.libpcap= libpcap-${_LIBPCAP_VERSION} BUILTIN_PKG.libpcap= libpcap-0.8.0
MAKEFLAGS+= BUILTIN_PKG.libpcap=${BUILTIN_PKG.libpcap} .elif ${_PCAP_070} == "1"
. endif BUILTIN_PKG.libpcap= libpcap-0.7.0
. endif .elif ${_PCAP_060} == "1"
MAKEFLAGS+= IS_BUILTIN.libpcap=${IS_BUILTIN.libpcap} BUILTIN_PKG.libpcap= libpcap-0.6.0
.elif ${_PCAP_050} == "1"
BUILTIN_PKG.libpcap= libpcap-0.5.0
.else
BUILTIN_PKG.libpcap= libpcap-0.4.0
.endif .endif
.endif # exists({_LIBPCAP_PCAP_H})
.if !defined(USE_BUILTIN.libpcap) .if !defined(USE_BUILTIN.libpcap)
USE_BUILTIN.libpcap?= ${IS_BUILTIN.libpcap} USE_BUILTIN.libpcap?= ${IS_BUILTIN.libpcap}
@ -57,12 +64,4 @@ USE_BUILTIN.libpcap!= \
. endfor . endfor
. endif . endif
.endif # USE_BUILTIN.libpcap .endif # USE_BUILTIN.libpcap
.endif # IS_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