2019-11-02 16:37:59 +01:00
|
|
|
# $NetBSD: builtin.mk,v 1.6 2019/11/02 15:38:00 rillig Exp $
|
2011-12-03 09:44:21 +01:00
|
|
|
|
|
|
|
BUILTIN_PKG:= gdbm_compat
|
2013-11-23 11:51:09 +01:00
|
|
|
BUILTIN_FIND_HEADERS_VAR= NDBM_H
|
|
|
|
BUILTIN_FIND_HEADERS.NDBM_H= ndbm.h
|
2011-12-03 09:44:21 +01:00
|
|
|
BUILTIN_FIND_GREP.NDBM_H= This file is part of GDBM
|
|
|
|
|
|
|
|
.include "../../mk/buildlink3/bsd.builtin.mk"
|
|
|
|
|
|
|
|
###
|
|
|
|
### Determine if there is a built-in implementation of the package and
|
|
|
|
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
|
|
|
|
###
|
|
|
|
.if !defined(IS_BUILTIN.gdbm_compat)
|
|
|
|
IS_BUILTIN.gdbm_compat= no
|
|
|
|
. if empty(NDBM_H:M__nonexistent__)
|
|
|
|
IS_BUILTIN.gdbm_compat= yes
|
|
|
|
. endif
|
|
|
|
.endif
|
2019-11-02 16:37:59 +01:00
|
|
|
MAKEVARS+= IS_BUILTIN.gdbm_compat
|
2011-12-03 09:44:21 +01:00
|
|
|
|
2012-01-01 05:22:03 +01:00
|
|
|
##
|
2013-04-08 13:17:08 +02:00
|
|
|
## Include databases/gdbm/builtin.mk so that BUILTIN_PKG.gdbm and
|
2012-01-01 05:22:03 +01:00
|
|
|
## USE_BUILTIN.gdbm are set.
|
|
|
|
.if !defined(BUILTIN_PKG.gdbm) || !defined(USE_BUILTIN.gdbm)
|
|
|
|
. include "../../databases/gdbm/builtin.mk"
|
|
|
|
.endif
|
|
|
|
|
2011-12-03 09:44:21 +01:00
|
|
|
###
|
|
|
|
### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
|
|
|
|
### a package name to represent the built-in package.
|
|
|
|
###
|
|
|
|
.if !defined(BUILTIN_PKG.gdbm_compat) && \
|
|
|
|
!empty(IS_BUILTIN.gdbm_compat:M[yY][eE][sS])
|
|
|
|
BUILTIN_PKG.gdbm_compat:= ${BUILTIN_PKG.gdbm:S/gdbm-/gdbm_compat-/}
|
|
|
|
.endif
|
|
|
|
MAKEVARS+= BUILTIN_PKG.gdbm_compat
|
|
|
|
|
|
|
|
###
|
|
|
|
### Determine whether we should use the built-in implementation if it
|
|
|
|
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
|
|
|
|
###
|
|
|
|
### Don't use builtin gdbm_compat unless also using builtin gdbm.
|
|
|
|
.if !defined(USE_BUILTIN.gdbm_compat)
|
|
|
|
. if ${USE_BUILTIN.gdbm} == "no" || ${PREFER.gdbm_compat} == "pkgsrc"
|
|
|
|
USE_BUILTIN.gdbm_compat= no
|
|
|
|
. else
|
|
|
|
USE_BUILTIN.gdbm_compat= ${IS_BUILTIN.gdbm_compat}
|
|
|
|
. if defined(BUILTIN_PKG.gdbm_compat) && \
|
|
|
|
!empty(IS_BUILTIN.gdbm_compat:M[yY][eE][sS])
|
|
|
|
USE_BUILTIN.gdbm_compat= yes
|
|
|
|
. for _dep_ in ${BUILDLINK_API_DEPENDS.gdbm_compat}
|
|
|
|
. if !empty(USE_BUILTIN.gdbm_compat:M[yY][eE][sS])
|
|
|
|
USE_BUILTIN.gdbm_compat!= \
|
Version 1.13 - 2017-03-11
* gdbm_fetch, gdbm_firstkey, and gdbm_nextkey behavior
If the requested key was not found, these functions return datum with
dptr pointing to NULL and set gdbm_errno to GDBM_ITEM_NOT_FOUND (in
prior releases, gdbm_errno was set to GDBM_NO_ERROR),
If an error occurred, dptr is set to NULL, and gdbm_errno to
the error code.
In any case gdbm_errno is guaranteed to have meaningful value upon
return.
* Error handling
In previous versions of GDBM, fatal errors (such as write error while
storing the key/data pair or bucket) caused immediate termination of
the program via call to exit(3). This is no longer the case.
Starting from this version, if a fatal error occurrs while modifying
the database file, that database is marked as needing recovery and
gdbm_errno is set to GDBM_NEED_RECOVERY. Calls to any GDBM functions,
except gdbm_recover, will then return immediately with the same error
code.
The function gdbm_recover examines the database file and fixes
eventual inconsistencies. Upon successful return it clears the error
state and makes the database operational again.
For backward compatibility, the fatal_func argument to gdbm_open is
retained and its functionality is not changed. If it is not NULL, the
new error handling procedures are disabled, the function it points to
will be called upon fatal errors. When it returns, exit(1) will be
called.
* Per-database error codes
In addition to gdbm_error global variable, the most recent error state
is saved in the GDBM_FILE structure. This facilitates error handling
when operating multiple GDBM databases simultaneously.
2017-03-20 07:02:26 +01:00
|
|
|
if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.gdbm_compat}; then \
|
2011-12-03 09:44:21 +01:00
|
|
|
${ECHO} "yes"; \
|
|
|
|
else \
|
|
|
|
${ECHO} "no"; \
|
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
.endif
|
2019-11-02 16:37:59 +01:00
|
|
|
MAKEVARS+= USE_BUILTIN.gdbm_compat
|