2020-06-29 15:36:50 +02:00
|
|
|
# $NetBSD: bdb.buildlink3.mk,v 1.29 2020/06/29 13:36:50 ryoon Exp $
|
2004-03-10 19:06:06 +01:00
|
|
|
#
|
|
|
|
# This Makefile fragment is meant to be included by packages that
|
2008-01-31 13:45:08 +01:00
|
|
|
# require a Berkeley DB (BDB) implementation and that are not restricted
|
|
|
|
# to a single one. The available BDB implementations are db1
|
2020-05-03 12:00:42 +02:00
|
|
|
# (if builtin) and db[23456].
|
2006-01-03 19:33:07 +01:00
|
|
|
#
|
2020-05-03 12:00:42 +02:00
|
|
|
# This Makefile cannot handle packages that can use only a subset of
|
2020-06-29 15:36:50 +02:00
|
|
|
# { db2 db3 db4 db5 db6 db18 }.
|
2006-01-03 19:33:07 +01:00
|
|
|
#
|
2019-09-02 04:23:02 +02:00
|
|
|
# User-settable variables:
|
2004-03-10 19:06:06 +01:00
|
|
|
#
|
2006-11-04 23:18:41 +01:00
|
|
|
# BDB_DEFAULT
|
|
|
|
# This value represents the package we use when either a db-1.85
|
|
|
|
# interface isn't required, or a db-1.85 interface is required,
|
|
|
|
# but it's not built-in.
|
2005-01-10 00:56:21 +01:00
|
|
|
#
|
2006-11-04 23:18:41 +01:00
|
|
|
# FIXME: Improve the wording of the text above so that one can
|
|
|
|
# understand it.
|
2004-03-10 19:06:06 +01:00
|
|
|
#
|
2020-06-29 15:36:50 +02:00
|
|
|
# Possible: db1 db2 db3 db4 db5 db6 db18
|
2008-01-31 13:45:08 +01:00
|
|
|
# Default: db4
|
|
|
|
#
|
2006-11-04 23:18:41 +01:00
|
|
|
# BDB185_DEFAULT
|
|
|
|
# The package we use when a db-1.85 interface is required.
|
|
|
|
# It defaults to "db1" if it's built-in, or to ${BDB_DEFAULT}
|
|
|
|
# otherwise.
|
|
|
|
#
|
2019-09-02 04:23:02 +02:00
|
|
|
# Package-settable variables:
|
2006-11-04 23:18:41 +01:00
|
|
|
#
|
|
|
|
# BDB_ACCEPTED
|
2008-01-31 13:45:08 +01:00
|
|
|
# The list of Berkeley DB implementations that can be used by the
|
|
|
|
# package.
|
2005-01-10 00:56:21 +01:00
|
|
|
#
|
2008-01-31 13:45:08 +01:00
|
|
|
# FIXME: If the list does not include db1 and does not include
|
|
|
|
# BDB_DEFAULT, the package will not build at the moment.
|
|
|
|
#
|
2019-09-02 04:23:02 +02:00
|
|
|
# System-defined variables:
|
2008-01-31 13:45:08 +01:00
|
|
|
#
|
|
|
|
# BDB_TYPE
|
|
|
|
# The name of the selected BDB implementation.
|
|
|
|
#
|
|
|
|
# BDBBASE
|
|
|
|
# The base directory of the selected BDB implementation. It has
|
|
|
|
# subdirectories include/ and lib/.
|
|
|
|
#
|
|
|
|
# BDB_LIBS
|
|
|
|
# Linker flags to link against the BDB library.
|
|
|
|
|
2005-01-10 00:56:21 +01:00
|
|
|
# Note for when databases/db1 is imported:
|
|
|
|
# (1) Remove the section that conditionally sets the default
|
|
|
|
# value for BDB185_DEFAULT and always set it to be "db1".
|
|
|
|
# (2) Remove the special case for ${BDB_TYPE} == "db1" at the end.
|
|
|
|
# (3) Move mk/db1.builtin.mk to databases/db1/builtin.mk.
|
2004-03-10 19:06:06 +01:00
|
|
|
|
|
|
|
BDB_BUILDLINK3_MK:= ${BDB_BUILDLINK3_MK}+
|
|
|
|
|
2007-10-17 12:43:36 +02:00
|
|
|
.include "bsd.fast.prefs.mk"
|
2004-03-10 19:06:06 +01:00
|
|
|
|
2004-03-18 10:12:08 +01:00
|
|
|
.if !empty(BDB_BUILDLINK3_MK:M+)
|
2004-11-15 18:54:49 +01:00
|
|
|
|
2008-11-26 10:10:30 +01:00
|
|
|
_VARGROUPS+= bdb
|
|
|
|
_USER_VARS.bdb= BDB_DEFAULT BDB185_DEFAULT
|
|
|
|
_PKG_VARS.bdb= BDB_ACCEPTED
|
|
|
|
_SYS_VARS.bdb= BDB_TYPE BDBBASE BDB_LIBS
|
|
|
|
|
2006-01-03 19:33:07 +01:00
|
|
|
# If the package specified a list of acceptable Berkeley DB packages,
|
|
|
|
# set USE_DB185 to yes if db1 is included, and otherwise no, thus
|
|
|
|
# preferring to use db1. Assume that the package's configure process
|
|
|
|
# should know how to probe for the libraries and headers on its own.
|
2004-11-15 18:54:49 +01:00
|
|
|
#
|
|
|
|
. if defined(BDB_ACCEPTED) && empty(BDB_ACCEPTED:Mdb1)
|
|
|
|
USE_DB185?= no
|
|
|
|
. else
|
|
|
|
USE_DB185?= yes
|
|
|
|
. endif
|
|
|
|
|
|
|
|
# _BDB_PKGS is an exhaustive list of all of the Berkeley DB
|
2005-01-10 00:56:21 +01:00
|
|
|
# implementations that may be used with bdb.buildlink3.mk.
|
2004-03-10 19:06:06 +01:00
|
|
|
#
|
2020-06-29 15:36:50 +02:00
|
|
|
_BDB_PKGS?= db1 db2 db3 db4 db5 db6 db18
|
2005-01-10 00:56:21 +01:00
|
|
|
|
|
|
|
BDB_DEFAULT?= db4
|
|
|
|
BDB_ACCEPTED?= ${_BDB_PKGS}
|
|
|
|
|
2006-01-03 19:33:07 +01:00
|
|
|
# Decide what to use when DB185 is required. If builtin db1 is
|
|
|
|
# present, use it, and if not use DBD_DEFAULT.
|
|
|
|
#
|
2004-11-15 18:54:49 +01:00
|
|
|
CHECK_BUILTIN.db1:= yes
|
2007-10-17 12:43:36 +02:00
|
|
|
. include "db1.builtin.mk"
|
2004-11-15 18:54:49 +01:00
|
|
|
CHECK_BUILTIN.db1:= no
|
2005-01-10 00:56:21 +01:00
|
|
|
. if defined(IS_BUILTIN.db1) && !empty(IS_BUILTIN.db1:M[yY][eE][sS])
|
|
|
|
BDB185_DEFAULT?= db1
|
2004-11-15 18:54:49 +01:00
|
|
|
. else
|
2005-01-10 00:56:21 +01:00
|
|
|
BDB185_DEFAULT?= ${BDB_DEFAULT}
|
2004-11-15 18:54:49 +01:00
|
|
|
. endif
|
2004-03-10 19:06:06 +01:00
|
|
|
|
2005-01-10 00:56:21 +01:00
|
|
|
_BDB_PKGSRCDIR.db2= ../../databases/db
|
2004-03-10 19:06:06 +01:00
|
|
|
. for _bdb_ in ${_BDB_PKGS}
|
2004-04-26 11:39:38 +02:00
|
|
|
_BDB_PKGSRCDIR.${_bdb_}?= ../../databases/${_bdb_}
|
2004-03-10 19:06:06 +01:00
|
|
|
. endfor
|
|
|
|
|
2005-01-10 00:56:21 +01:00
|
|
|
_BDB_DEFAULT= ${BDB_DEFAULT}
|
|
|
|
_BDB185_DEFAULT= ${BDB185_DEFAULT}
|
|
|
|
_BDB_ACCEPTED= ${BDB_ACCEPTED}
|
2004-03-10 19:06:06 +01:00
|
|
|
|
2004-03-18 10:12:08 +01:00
|
|
|
. if !defined(_BDB_TYPE)
|
2005-01-10 00:56:21 +01:00
|
|
|
. if !empty(USE_DB185:M[yY][eE][sS])
|
|
|
|
_BDB_TYPE= ${_BDB185_DEFAULT}
|
|
|
|
. else
|
2004-03-18 10:12:08 +01:00
|
|
|
_BDB_TYPE= ${_BDB_DEFAULT}
|
2004-03-10 19:06:06 +01:00
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
|
2006-01-03 19:33:07 +01:00
|
|
|
# Note that if BDB_ACCEPTED does not contain db1 or BDB_DEFAULT, this
|
|
|
|
# results in BDB_TYPE being none (rather than the most preferred value
|
|
|
|
# in BDB_ACCEPTED, which might or might not be better.)
|
2005-01-10 00:56:21 +01:00
|
|
|
. if !empty(_BDB_ACCEPTED:M${_BDB_TYPE})
|
2004-03-18 10:12:08 +01:00
|
|
|
BDB_TYPE= ${_BDB_TYPE}
|
2005-01-10 00:56:21 +01:00
|
|
|
. else
|
|
|
|
BDB_TYPE= none
|
|
|
|
. endif
|
2004-03-10 19:06:06 +01:00
|
|
|
|
2004-11-15 18:54:49 +01:00
|
|
|
# Define some public variables to refer to package-specific variables.
|
2005-07-21 04:54:51 +02:00
|
|
|
BDBBASE= ${BUILDLINK_PREFIX.${BDB_TYPE}}
|
|
|
|
BDB_LIBS= ${BUILDLINK_LDADD.${BDB_TYPE}}
|
2004-11-15 18:54:49 +01:00
|
|
|
|
2006-11-04 23:18:41 +01:00
|
|
|
BUILD_DEFS+= BDB_DEFAULT BDB185_DEFAULT
|
|
|
|
BUILD_DEFS_EFFECTS+= BDBBASE BDB_LIBS BDB_TYPE
|
2005-01-10 00:56:21 +01:00
|
|
|
|
2004-03-18 10:12:08 +01:00
|
|
|
.endif # BDB_BUILDLINK3_MK
|
|
|
|
|
|
|
|
.if ${BDB_TYPE} == "none"
|
2016-04-11 06:22:33 +02:00
|
|
|
PKG_FAIL_REASON+= \
|
2008-11-26 10:10:30 +01:00
|
|
|
"[bdb.buildlink3.mk] ${_BDB_TYPE} is not an acceptable Berkeley DB type for ${PKGNAME}."
|
2004-11-15 18:54:49 +01:00
|
|
|
.elif ${BDB_TYPE} == "db1"
|
2009-03-20 20:23:50 +01:00
|
|
|
BUILDLINK_TREE+= db1 -db1
|
2004-11-15 18:54:49 +01:00
|
|
|
BUILDLINK_BUILTIN_MK.db1= ../../mk/db1.builtin.mk
|
2004-03-18 10:12:08 +01:00
|
|
|
.else
|
2004-11-15 18:54:49 +01:00
|
|
|
. include "${_BDB_PKGSRCDIR.${BDB_TYPE}}/buildlink3.mk"
|
2004-03-18 10:12:08 +01:00
|
|
|
.endif
|