summaryrefslogtreecommitdiff
path: root/net/libpcap
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-03-10 17:57:14 +0000
committerjlam <jlam@pkgsrc.org>2004-03-10 17:57:14 +0000
commitd68193d4743931877544a7e52ed44171707b858d (patch)
tree1226d07b8f66083168895189decc88848b70903f /net/libpcap
parent55bd3391bd2b274e284613fb1e70cd0190dd4ed8 (diff)
downloadpkgsrc-d68193d4743931877544a7e52ed44171707b858d.tar.gz
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal checking for built-in software is much simpler to deal with in pkgsrc. The buildlink3.mk file for a package will be of the usual format regardless of the package, which makes it simpler for packagers to update a package. The builtin.mk file for a package must define a single yes/no variable USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'net/libpcap')
-rw-r--r--net/libpcap/buildlink3.mk54
-rw-r--r--net/libpcap/builtin.mk15
2 files changed, 23 insertions, 46 deletions
diff --git a/net/libpcap/buildlink3.mk b/net/libpcap/buildlink3.mk
index 8acb18903c7..266ab6c3527 100644
--- a/net/libpcap/buildlink3.mk
+++ b/net/libpcap/buildlink3.mk
@@ -1,56 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/03/10 17:57:14 jlam Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
LIBPCAP_BUILDLINK3_MK:= ${LIBPCAP_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= libpcap
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nlibpcap}
+BUILDLINK_PACKAGES+= libpcap
.if !empty(LIBPCAP_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= libpcap
BUILDLINK_DEPENDS.libpcap+= libpcap>=0.7.2
BUILDLINK_PKGSRCDIR.libpcap?= ../../net/libpcap
.endif # LIBPCAP_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.libpcap?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.libpcap)
-BUILDLINK_IS_BUILTIN.libpcap= NO
-. if exists(/usr/include/pcap.h)
-BUILDLINK_IS_BUILTIN.libpcap= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.libpcap)
-. if !empty(BUILDLINK_IS_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-. else
-BUILDLINK_USE_BUILTIN.libpcap= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= NO
-. endif
-. if !empty(PREFER_NATIVE:Mlibpcap) && \
- !empty(BUILDLINK_IS_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mlibpcap)
-BUILDLINK_USE_BUILTIN.libpcap= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.libpcap:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= libpcap
-. endif
-.endif
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/net/libpcap/builtin.mk b/net/libpcap/builtin.mk
new file mode 100644
index 00000000000..546a9dbaa00
--- /dev/null
+++ b/net/libpcap/builtin.mk
@@ -0,0 +1,15 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(IS_BUILTIN.libpcap)
+IS_BUILTIN.libpcap= no
+. if exists(/usr/include/pcap.h)
+IS_BUILTIN.libpcap= yes
+. endif
+.endif
+
+CHECK_BUILTIN.libpcap?= no
+.if !empty(CHECK_BUILTIN.libpcap:M[yY][eE][sS])
+USE_BUILTIN.libpcap= yes
+.endif
+
+USE_BUILTIN.libpcap?= ${IS_BUILTIN.libpcap}