1 # $NetBSD: pf.buildlink3.mk,v 1.1 2008/06/26 20:58:48 peter Exp $
3 # Makefile fragment for packages using pf.
5 # The following variables are set by this file:
7 # PFVAR_H The path to the pfvar.h header file.
8 # PFCTL The path to the pfctl program.
9 # PF_VERSION The detected PF version (as in OpenBSD).
12 .if !defined(PF_BUILDLINK3_MK)
13 PF_BUILDLINK3_MK= #defined
15 .include "../../mk/bsd.fast.prefs.mk"
17 # Platforms where pf is available on.
18 ONLY_FOR_PLATFORM?= NetBSD-[3-9]*-* OpenBSD-[3-9]*-* FreeBSD-[5-9]*-* \
21 # Detect the pfvar.h header.
22 .if exists(/usr/include/net/pfvar.h)
23 _PFVAR_H= /usr/include/net/pfvar.h
24 .elif exists(/usr/include/net/pf/pfvar.h)
25 _PFVAR_H= /usr/include/net/pf/pfvar.h
27 PKG_FAIL_REASON+= "Couldn't find pfvar.h header; please make sure that this header is available in /usr/include/net."
33 # Compute the version number of the PF API by checking for the presence
34 # of symbols added in newer versions and store the result in ${PF_VERSION}.
36 # Default to the first version with PF, which was OpenBSD 3.0.
40 # OpenBSD 4.2: pf_statelist added
41 _PF_4_2!= ${GREP} -c pf_statelist ${PFVAR_H} || ${TRUE}
42 # OpenBSD 4.1: PF_OSFP_INET6 added
43 _PF_4_1!= ${GREP} -c PF_OSFP_INET6 ${PFVAR_H} || ${TRUE}
44 # OpenBSD 3.8: pf_socket_lookup added
45 _PF_3_8!= ${GREP} -c pf_socket_lookup ${PFVAR_H} || ${TRUE}
46 # OpenBSD 3.7: pf_threshold added
47 _PF_3_7!= ${GREP} -c pf_threshold ${PFVAR_H} || ${TRUE}
48 # OpenBSD 3.6: pf_cksum_fixup added
49 _PF_3_6!= ${GREP} -c pf_cksum_fixup ${PFVAR_H} || ${TRUE}
50 # OpenBSD 3.5: pfi_lookup_if added
51 _PF_3_5!= ${GREP} -c pfi_lookup_if ${PFVAR_H} || ${TRUE}
53 . if ${_PF_4_2} != "0"
55 . elif ${_PF_4_1} != "0"
57 . elif ${_PF_3_8} != "0"
59 . elif ${_PF_3_7} != "0"
61 . elif ${_PF_3_6} != "0"
63 . elif ${_PF_3_5} != "0"
68 .endif # PF_BUILDLINK3_MK