1 # $NetBSD: bdb.buildlink3.mk,v 1.13 2005/01/09 23:56:21 jlam Exp $
3 # This Makefile fragment is meant to be included by packages that
4 # require a Berkeley DB implementation. bdb.buildlink3.mk will:
6 # * set BDBBASE to the base directory of the Berkeley DB files;
7 # * set BDB_LIBS to the library option needed to link against
8 # the Berkeley DB library;
9 # * set BDB_TYPE to the Berkeley DB implementation used.
11 # There are two variables that can be used to tweak the selection of
12 # the Berkeley DB implementation:
14 # BDB_DEFAULT is a user-settable variable whose value represents the
15 # package we use when either a db-1.85 interface isn't required,
16 # or a db-1.85 interface is required, but it's not built-in.
18 # BDB185_DEFAULT is a user-settable variable whose value represents the
19 # package we use when a db-1.85 interface is required. It defaults
20 # to "db1" if it's built-in, or to ${BDB_DEFAULT} otherwise.
22 # BDB_ACCEPTED is a package-settable list of Berkeley DB implementations
23 # that may be used by the package.
25 # Note for when databases/db1 is imported:
26 # (1) Remove the section that conditionally sets the default
27 # value for BDB185_DEFAULT and always set it to be "db1".
28 # (2) Remove the special case for ${BDB_TYPE} == "db1" at the end.
29 # (3) Move mk/db1.builtin.mk to databases/db1/builtin.mk.
31 BDB_BUILDLINK3_MK:= ${BDB_BUILDLINK3_MK}+
33 .include "../../mk/bsd.prefs.mk"
35 .if !empty(BDB_BUILDLINK3_MK:M+)
37 # If we've specified a list of acceptable Berkeley DB packages and it
38 # doesn't include db1, then don't set USE_DB185 to yes. The package's
39 # configure process should know how to probe for the libraries and
42 . if defined(BDB_ACCEPTED) && empty(BDB_ACCEPTED:Mdb1)
48 # _BDB_PKGS is an exhaustive list of all of the Berkeley DB
49 # implementations that may be used with bdb.buildlink3.mk.
51 _BDB_PKGS?= db1 db2 db3 db4
54 BDB_ACCEPTED?= ${_BDB_PKGS}
56 CHECK_BUILTIN.db1:= yes
57 . include "../../mk/db1.builtin.mk"
58 CHECK_BUILTIN.db1:= no
59 . if defined(IS_BUILTIN.db1) && !empty(IS_BUILTIN.db1:M[yY][eE][sS])
62 BDB185_DEFAULT?= ${BDB_DEFAULT}
65 _BDB_PKGSRCDIR.db2= ../../databases/db
66 . for _bdb_ in ${_BDB_PKGS}
67 _BDB_PKGSRCDIR.${_bdb_}?= ../../databases/${_bdb_}
70 _BDB_DEFAULT= ${BDB_DEFAULT}
71 _BDB185_DEFAULT= ${BDB185_DEFAULT}
72 _BDB_ACCEPTED= ${BDB_ACCEPTED}
74 . if !defined(_BDB_TYPE)
75 . if !empty(USE_DB185:M[yY][eE][sS])
76 _BDB_TYPE= ${_BDB185_DEFAULT}
78 _BDB_TYPE= ${_BDB_DEFAULT}
82 . if !empty(_BDB_ACCEPTED:M${_BDB_TYPE})
83 BDB_TYPE= ${_BDB_TYPE}
88 # Define some public variables to refer to package-specific variables.
89 BDBBASE= ${BUILDLINK_PREFIX.${BDB_TYPE}}
90 BDB_LIBS= ${BUILDLINK_LDADD.${BDB_TYPE}}
95 .endif # BDB_BUILDLINK3_MK
97 .if ${BDB_TYPE} == "none"
99 "${_BDB_TYPE} is not an acceptable Berkeley DB type for ${PKGNAME}."
100 .elif ${BDB_TYPE} == "db1"
101 BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ndb1}
102 BUILDLINK_PACKAGES+= db1
103 BUILDLINK_BUILTIN_MK.db1= ../../mk/db1.builtin.mk
105 . include "${_BDB_PKGSRCDIR.${BDB_TYPE}}/buildlink3.mk"