View | Details | Raw Unified | Return to bug 89023
Collapse All | Expand All

(-)Mk/bsd.database.mk (-6 / +84 lines)
Lines 52-57 Link Here
52
#                 by the user via defined variable), try to find the
52
#                 by the user via defined variable), try to find the
53
#                 currently installed version.  Fall back to default if
53
#                 currently installed version.  Fall back to default if
54
#                 necessary (db41+).
54
#                 necessary (db41+).
55
# BROKEN_WITH_BDB	- This variable can be defined when the port doesn't
56
#			  support one or more versions of Berkley DB.
57
# WANT_BDB_VER		- Maintainer can set a version of Berkley DB to always
58
#			  build this port with (overrides WITH_BDB_VER).
59
# WITH_BDB_VER		- User defined variable to set Berkley DB version.
60
# BDB_LIB_NAME		- This variable is automatically set to the name of the
61
#			  Berkley DB library (default: db41)
62
# BDB_LIB_CXX_NAME	- This variable is automatically set to the name of the
63
#			  Berkley DB c++ library (default: db41_cxx)
64
# BDB_INCLUDE_DIR	- This variable is automatically set to the location of
65
#			  the Berkley DB include directory.
66
#			  (default: ${LOCALBASE}/include/db41)
67
#
55
##
68
##
56
# USE_SQLITE	- Add dependency on sqlite library. Valid values are:
69
# USE_SQLITE	- Add dependency on sqlite library. Valid values are:
57
#				  3 and 2. If version is not specified directly then
70
#				  3 and 2. If version is not specified directly then
Lines 170-175 Link Here
170
_DB_41P=	41 42 43
183
_DB_41P=	41 42 43
171
_DB_42P=	42 43
184
_DB_42P=	42 43
172
185
186
.if defined(WITH_BDB_VER)
187
. if ${WITH_BDB_VER} == 4
188
USE_BDB=	40
189
. elif ${WITH_BDB_VER} != 1
190
USE_BDB=	${WITH_BDB_VER}
191
. endif
192
.endif
173
_WANT_BDB_VER=	${USE_BDB}
193
_WANT_BDB_VER=	${USE_BDB}
174
194
175
# Assume the default bdb version as 41
195
# Assume the default bdb version as 41
Lines 179-212 Link Here
179
199
180
# Detect bdb version
200
# Detect bdb version
181
_FOUND=	no
201
_FOUND=	no
202
_BDB_BROKEN=	no
182
203
204
# Override the user defined WITH_BDB_VER with the WANT_BDB_VER
205
.if defined(WANT_BDB_VER)
206
.for bdb in ${_DB_PORTS}
207
.if ${WANT_BDB_VER} == "${bdb}" && ${_FOUND} == "no"
208
_FOUND=	${WANT_BDB_VER}
209
.endif
210
.endfor
211
USE_BDB=	${WANT_BDB_VER}
212
.else
183
.for bdb in ${_DB_PORTS}
213
.for bdb in ${_DB_PORTS}
184
.if ${_WANT_BDB_VER} == "${bdb}" && ${_FOUND} == "no"
214
.if ${_WANT_BDB_VER} == "${bdb}" && ${_FOUND} == "no"
185
_MATCHED_DB_VER:=	${bdb:S/+//}
215
_MATCHED_DB_VER:=	${bdb:S/+//}
186
. if ${_MATCHED_DB_VER} == "${bdb}"
216
. if ${_MATCHED_DB_VER} == "${bdb}"
187
# USE_BDB is exactly specified
217
# USE_BDB is exactly specified
188
LIB_DEPENDS+=	${db${bdb}_DEPENDS}
218
_FOUND=	${bdb}
189
_FOUND=	yes
190
.else
219
.else
191
# USE_BDB is specified as VER+
220
# USE_BDB is specified as VER+
192
.  for db4 in ${_DB_${_MATCHED_DB_VER}P}
221
.  for db4 in ${_DB_${_MATCHED_DB_VER}P}
193
.   if exists(${db${db4}_FIND}) && ${_FOUND} == "no"
222
.   if exists(${db${db4}_FIND}) && ${_FOUND} == "no"
194
LIB_DEPENDS+=   ${db${db4}_DEPENDS}
223
_FOUND=	${db4}
195
_FOUND=	yes
196
.   endif
224
.   endif
197
.  endfor
225
.  endfor
198
.  if ${_FOUND} == "no"
226
.  if ${_FOUND} == "no"
199
# No existing db4 version is detected in system
227
# No existing db4 version is detected in system
200
LIB_DEPENDS+=	${db${_MATCHED_DB_VER}_DEPENDS}
228
_FOUND=	${_MATCHED_DB_VER}
201
_FOUND=	yes
202
.  endif
229
.  endif
203
. endif
230
. endif
204
.endif
231
.endif
205
.endfor
232
.endfor
233
.endif
206
234
207
# USE_BDB is specified incorrectly, so mark this as IGNORE
235
# USE_BDB is specified incorrectly, so mark this as IGNORE
208
.if ${_FOUND} == "no"
236
.if ${_FOUND} == "no"
209
IGNORE=	"Unknown bdb version: ${USE_BDB}"
237
IGNORE=	"Unknown bdb version: ${USE_BDB}"
238
.else
239
# Now check if we can use it
240
. if defined(BROKEN_WITH_BDB)
241
.  for VER in ${BROKEN_WITH_BDB}
242
.   if ${_FOUND} == "${VER}"
243
_BDB_BROKEN=	yes
244
.   endif
245
.  endfor
246
. endif
247
. if ${_BDB_BROKEN} == "yes"
248
IGNORE= "Does not work with Berkley DB ${_FOUND} \(${BROKEN_WITH_BDB} not supported\)"
249
. else
250
# Now add the dependancy on Berkley DB ${_FOUND) version
251
LIB_DEPENDS+=	${db${_FOUND}_DEPENDS}
252
.  if ${_FOUND} == 40
253
BDB_LIB_NAME=		db4
254
BDB_LIB_CXX_NAME=	db4_cxx
255
BDB_INCLUDE_DIR=	${LOCALBASE}/include/db4
256
.  elif ${_FOUND} == 42
257
BDB_LIB_NAME=		db-4.2
258
BDB_LIB_CXX_NAME=	db_cxx-4.2
259
BDB_LIB_DIR=		${LOCALBASE}/lib/db42
260
.  elif ${_FOUND} == 43
261
BDB_LIB_NAME=		db-4.3
262
BDB_LIB_CXX_NAME=	db_cxx-4.3
263
BDB_LIB_DIR=		${LOCALBASE}/lib/db43
264
.  endif
265
BDB_LIB_NAME?=		db${_FOUND}
266
BDB_LIB_CXX_NAME?=	db${_FOUND}_cxx
267
BDB_INCLUDE_DIR?=	${LOCALBASE}/include/db${_FOUND}
268
BDB_LIB_DIR?=		${LOCALBASE}/lib
269
. endif
270
.endif
271
272
# Obsolete variables
273
.for var in DB DB2 DB3 DB4 DB40 DB41 DB42 DB43 BDB2 BDB3 BDB4 BDB40 BDB41 BDB42 BDB43
274
.if defined(WITH_${var})
275
BAD_VAR+=" WITH_${var},"
276
.endif
277
.if defined(USE_${var})
278
BAD_VAR+==" USE_${var},"
279
.endif
280
.endfor
281
.for var in BERKELEYDB_PORT BERKELEYDB_LIB SENDMAIL_WITH_BERKELEYDB_VER
282
.if defined(${var})
283
BAD_VAR+=" ${var},"
284
.endif
285
.endfor
286
.if defined(BAD_VAR)
287
IGNORE="Obsolete variable(s)${BAD_VAR} use WITH_BDB_VER instead"
210
.endif
288
.endif
211
289
212
.endif # USE_BDB
290
.endif # USE_BDB

Return to bug 89023