pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk bdb.buildlink3.mk is used to select a Berkeley DB i...
details: https://anonhg.NetBSD.org/pkgsrc/rev/65e2ed067fb5
branches: trunk
changeset: 470589:65e2ed067fb5
user: jlam <jlam%pkgsrc.org@localhost>
date: Wed Mar 10 18:06:06 2004 +0000
description:
bdb.buildlink3.mk is used to select a Berkeley DB implementation for
use by pkgsrc. It will automatically depend on either db, db3, or db4
if the native one isn't sufficient. The two variables that control its
behaviour are:
BDB_DEFAULT is a user-settable variable whose value is the default
Berkeley DB implementation to use.
BDB_ACCEPTED is a package-settable list of Berkeley DB implementations
that may be used by the package.
E.g., if you always want to use DB4 as the Berkeley DB for all of the
packages, then you can just set:
BDB_DEFAULT= db4
in your /etc/mk.conf.
Packages that currently include db*/buildlink3.mk should be made to
include bdb.buildlink3.mk instead.
diffstat:
databases/db/buildlink3.mk | 54 +++++-------------
databases/db3/buildlink3.mk | 8 ++-
databases/db4/buildlink3.mk | 9 ++-
mk/bdb.buildlink3.mk | 128 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 158 insertions(+), 41 deletions(-)
diffs (245 lines):
diff -r b1b9e5b21025 -r 65e2ed067fb5 databases/db/buildlink3.mk
--- a/databases/db/buildlink3.mk Wed Mar 10 17:58:22 2004 +0000
+++ b/databases/db/buildlink3.mk Wed Mar 10 18:06:06 2004 +0000
@@ -1,48 +1,26 @@
-# $NetBSD: buildlink3.mk,v 1.10 2004/02/06 19:04:24 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2004/03/10 18:06:07 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-DB2_BUILDLINK3_MK:= ${DB2_BUILDLINK3_MK}+
+DB_BUILDLINK3_MK:= ${DB_BUILDLINK3_MK}+
.include "../../mk/bsd.prefs.mk"
-.if !empty(DB2_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= db
-BUILDLINK_DEPENDS.db+= db>=2.7.3
-BUILDLINK_PKGSRCDIR.db?= ../../databases/db
-.endif # DB2_BUILDLINK3_MK
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mdb)
-BUILDLINK_USE_BUILTIN.db= NO
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= db2
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.db)
-BUILDLINK_USE_BUILTIN.db= NO
-. if defined(USE_DB185)
-. if exists(/usr/include/db.h)
-# NetBSD, Darwin
-BUILDLINK_USE_BUILTIN.db= YES
-. elif exists(/usr/include/db1/db.h)
-# Linux
-BUILDLINK_USE_BUILTIN.db= YES
-BUILDLINK_INCDIRS.db?= include/db1
-BUILDLINK_TRANSFORM+= l:db:db1
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.db=${BUILDLINK_USE_BUILTIN.db}
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ndb2}
+BUILDLINK_PACKAGES+= db2
+
+.if !empty(DB_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.db2+= db>=2.7.3
+BUILDLINK_PKGSRCDIR.db2?= ../../databases/db
+
+.if defined(USE_DB185)
+BUILDLINK_INCDIRS.db2?= include/db2
+BUILDLINK_TRANSFORM+= l:db:db2
.endif
-.if !empty(BUILDLINK_USE_BUILTIN.db:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= db
-. endif
-.endif
+.endif # DB_BUILDLINK3_MK
-.if !empty(DB2_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.db:M[nN][oO])
-BUILDLINK_INCDIRS.db= include/db2
-BUILDLINK_TRANSFORM+= l:db:db2
-. endif
-.endif # DB2_BUILDLINK3_MK
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff -r b1b9e5b21025 -r 65e2ed067fb5 databases/db3/buildlink3.mk
--- a/databases/db3/buildlink3.mk Wed Mar 10 17:58:22 2004 +0000
+++ b/databases/db3/buildlink3.mk Wed Mar 10 18:06:06 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.5 2004/03/05 19:25:09 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 18:06:07 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
DB3_BUILDLINK3_MK:= ${DB3_BUILDLINK3_MK}+
@@ -13,6 +13,12 @@
.if !empty(DB3_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.db3+= db3>=2.9.2
BUILDLINK_PKGSRCDIR.db3?= ../../databases/db3
+
+.if defined(USE_DB185)
+BUILDLINK_INCDIRS.db3?= include/db3
+BUILDLINK_TRANSFORM+= l:db:db3
+.endif
+
.endif # DB3_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff -r b1b9e5b21025 -r 65e2ed067fb5 databases/db4/buildlink3.mk
--- a/databases/db4/buildlink3.mk Wed Mar 10 17:58:22 2004 +0000
+++ b/databases/db4/buildlink3.mk Wed Mar 10 18:06:06 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.7 2004/03/05 19:25:09 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.8 2004/03/10 18:06:08 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
DB4_BUILDLINK3_MK:= ${DB4_BUILDLINK3_MK}+
@@ -13,7 +13,12 @@
.if !empty(DB4_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.db4+= db4>=4.2.52
BUILDLINK_PKGSRCDIR.db4?= ../../databases/db4
-BUILDLINK_INCDIRS.db4?= include/db4
+
+.if defined(USE_DB185)
+BUILDLINK_INCDIRS.db3?= include/db4
+BUILDLINK_TRANSFORM+= l:db:db4
+.endif
+
.endif # DB4_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff -r b1b9e5b21025 -r 65e2ed067fb5 mk/bdb.buildlink3.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/bdb.buildlink3.mk Wed Mar 10 18:06:06 2004 +0000
@@ -0,0 +1,128 @@
+# $NetBSD: bdb.buildlink3.mk,v 1.1 2004/03/10 18:06:06 jlam Exp $
+#
+# This Makefile fragment is meant to be included by packages that
+# require a Berkeley DB implementation. db.buildlink3.mk will:
+#
+# * set BDBBASE to the base directory of the Berkeley DB files;
+# * set BDB_TYPE to the Berkeley DB implementation used.
+#
+# There are two variables that can be used to tweak the selection of
+# the Berkeley DB implementation:
+#
+# BDB_DEFAULT is a user-settable variable whose value is the default
+# Berkeley DB implementation to use.
+#
+# BDB_ACCEPTED is a package-settable list of Berkeley DB implementations
+# that may be used by the package.
+
+BDB_BUILDLINK3_MK:= ${BDB_BUILDLINK3_MK}+
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(BDB_BUILDLINK3_MK)
+BDB_DEFAULT?= # empty
+BDB_ACCEPTED?= ${_BDB_PKGS}
+
+# This is an exhaustive list of all of the Berkeley DB implementations
+# that may be used with bdb.buildlink3.mk, in order of precedence.
+#
+_BDB_PKGS?= native db4 db3 db2
+
+_BDB_PKGBASE.db2= db
+. for _bdb_ in ${_BDB_PKGS}
+_BDB_PKGBASE.${_bdb_}?= ${_bdb_}
+. endfor
+
+_BDB_DEFAULT= ${BDB_DEFAULT}
+_BDB_ACCEPTED= ${BDB_ACCEPTED}
+
+# Mark the acceptable Berkeley DB packages and check which, if any, are
+# already installed.
+#
+. for _bdb_ in ${_BDB_ACCEPTED:Nnative}
+_BDB_OK.${_bdb_}= yes
+. if !defined(_BDB_INSTALLED.${_bdb_})
+_BDB_INSTALLED.${_bdb_}!= \
+ if ${PKG_INFO} -qe ${_bdb_}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+MAKEFLAGS+= _BDB_INSTALLED.${_bdb_}=${_BDB_INSTALLED.${_bdb_}}
+. endif
+. endfor
+
+_BDB_OK.native?= no
+_BDB_INSTALLED.native?= no
+. if defined(USE_DB185)
+. if exists(/usr/include/db.h)
+_BDB_OK.native= yes
+_BDB_INSTALLED.native= yes
+_BDB_INCDIRS= include
+_BDB_TRANSFORM= # empty
+. elif exists(/usr/include/db1/db.h)
+_BDB_OK.native= yes
+_BDB_INSTALLED.native= yes
+_BDB_INCDIRS= include/db1
+_BDB_TRANSFORM= l:db:db1
+. endif
+. endif
+
+. if !defined(_BDB)
+#
+# Prefer the default one if it's accepted,...
+#
+. if !empty(_BDB_DEFAULT) && \
+ defined(_BDB_OK.${_BDB_DEFAULT}) && \
+ !empty(_BDB_OK.${_BDB_DEFAULT}:M[yY][eE][sS])
+_BDB= ${_BDB_DEFAULT}
+. endif
+#
+# ...otherwise, use one of the installed Berkeley DB packages,...
+#
+. for _bdb_ in ${_BDB_ACCEPTED}
+. if !empty(_BDB_INSTALLED.${_bdb_}:M[yY][eE][sS])
+_BDB?= ${_bdb_}
+. else
+_BDB_FIRSTACCEPTED?= ${_bdb_}
+. endif
+. endfor
+#
+# ...otherwise, just use the first accepted Berkeley DB package.
+#
+. if defined(_BDB_FIRSTACCEPTED)
+_BDB?= ${_BDB_FIRSTACCEPTED}
+. endif
+_BDB?= none
+MAKEFLAGS+= _BDB=${_BDB}
+. endif
+
+BDB_TYPE= ${_BDB}
+BUILD_DEFS+= BDB_TYPE
+
+. if ${BDB_TYPE} == "none"
+PKG_FAIL_REASON= "No acceptable Berkeley DB implementation found."
+. else
+. if ${BDB_TYPE} == "native"
+IS_BUILTIN.db-native= yes
+USE_BUILTIN.db-native= yes
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ndb-native}
+BUILDLINK_PACKAGES+= db-native
+BUILDLINK_INCDIRS.db-native?= ${_BDB_INCDIRS}
+BUILDLINK_TRANSFORM?= ${_BDB_TRANSFORM}
+BDBBASE= ${BUILDLINK_PREFIX.db-native}
+. include "../../databases/db4/buildlink3.mk"
+. elif ${BDB_TYPE} == "db4"
+BDBBASE= ${BUILDLINK_PREFIX.db4}
+. include "../../databases/db4/buildlink3.mk"
+. elif ${BDB_TYPE} == "db3"
+BDBBASE= ${BUILDLINK_PREFIX.db3}
+. include "../../databases/db3/buildlink3.mk"
+. elif ${BDB_TYPE} == "db"
+BDBBASE= ${BUILDLINK_PREFIX.db2}
+. include "../../databases/db/buildlink3.mk"
+. endif
+. endif
+BUILD_DEFS+= BDBBASE
+
+.endif # BDB_BUILDLINK3_MK
Home |
Main Index |
Thread Index |
Old Index