summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-08-10 21:10:54 +0000
committerjlam <jlam>2005-08-10 21:10:54 +0000
commita5a1f7cdfeb6f3d23249b5abfef4d8445ed45935 (patch)
tree02aec023352af8d7a178139a9cb7be2df839ff06 /mk
parent04f9be9ec5b5fba24c3d084ec4eb4756d34c24ab (diff)
downloadpkgsrc-a5a1f7cdfeb6f3d23249b5abfef4d8445ed45935.tar.gz
Add a buildlink3.mk file that will choose between the two FAM
implementations -- SGI FAM and GNOME gamin.
Diffstat (limited to 'mk')
-rw-r--r--mk/fam.buildlink3.mk54
1 files changed, 54 insertions, 0 deletions
diff --git a/mk/fam.buildlink3.mk b/mk/fam.buildlink3.mk
new file mode 100644
index 00000000000..3c7d3363e8e
--- /dev/null
+++ b/mk/fam.buildlink3.mk
@@ -0,0 +1,54 @@
+# $NetBSD: fam.buildlink3.mk,v 1.1 2005/08/10 21:10:54 jlam Exp $
+#
+# This Makefile fragment is meant to be included by packages that
+# require a FAM implementation. fam.buildlink3.mk will:
+#
+# * set FAMBASE to the base directory of the FAM files;
+# * set FAM_TYPE to the FAM implementation used.
+#
+# There are two variables that can be used to tweak the selection of
+# the FAM implementation:
+#
+# FAM_DEFAULT is a user-settable variable whose value is the default
+# FAM implementation to use.
+#
+# FAM_ACCEPTED is a package-settable list of FAM implementations that
+# may be used by the package.
+
+FAM_BUILDLINK3_MK:= ${FAM_BUILDLINK3_MK}+
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(FAM_BUILDLINK3_MK:M+)
+FAM_DEFAULT?= fam
+FAM_ACCEPTED?= ${_FAM_PKGS}
+
+# This is an exhaustive list of all of the FAM implementations that may
+# be used with fam.buildlink3.mk, in order of precedence.
+#
+_FAM_PKGS?= fam gamin
+
+_FAM_DEFAULT= ${FAM_DEFAULT}
+_FAM_ACCEPTED= ${FAM_ACCEPTED}
+
+_FAM_TYPE?= ${_FAM_DEFAULT}
+
+. if !empty(_FAM_ACCEPTED:M${_FAM_TYPE})
+FAM_TYPE= ${_FAM_TYPE}
+. else
+FAM_TYPE= none
+. endif
+FAMBASE= ${BUILDLINK_PREFIX.${FAM_TYPE}}
+
+BUILD_DEFS+= FAM_TYPE
+BUILD_DEFS+= FAMBASE
+.endif # FAM_BUILDLINK3_MK
+
+.if ${FAM_TYPE} == "none"
+PKG_FAIL_REASON= \
+ "${_FAM_TYPE} is not an acceptable FAM type for ${PKGNAME}."
+.elif ${FAM_TYPE} == "fam"
+. include "../../sysutils/fam/buildlink3.mk"
+.elif ${FAM_TYPE} == "gamin"
+. include "../../sysutils/gamin/buildlink3.mk"
+.endif