diff options
Diffstat (limited to 'mk/db1.builtin.mk')
-rw-r--r-- | mk/db1.builtin.mk | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/mk/db1.builtin.mk b/mk/db1.builtin.mk new file mode 100644 index 00000000000..dee2f8cf3cd --- /dev/null +++ b/mk/db1.builtin.mk @@ -0,0 +1,72 @@ +# $NetBSD: db1.builtin.mk,v 1.1 2004/11/15 17:54:49 jlam Exp $ + +.for _lib_ in db db1 +. if !defined(_BLNK_LIB_FOUND.${_lib_}) +_BLNK_LIB_FOUND.${_lib_}!= \ + if ${TEST} `${ECHO} /usr/lib/lib${_lib_}.*` = "/usr/lib/lib${_lib_}.*"; then \ + ${ECHO} "no"; \ + elif ${TEST} `${ECHO} /lib/lib${_lib_}.*` = "/lib/lib${_lib_}.*"; then \ + ${ECHO} "no"; \ + else \ + ${ECHO} "yes"; \ + fi +BUILDLINK_VARS+= _BLNK_LIB_FOUND.${_lib_} +. endif +.endfor +.undef _lib_ + +.if !defined(IS_BUILTIN.db1) +IS_BUILTIN.db1= no +# +# The builtin Berkeley database library must support hash version 2 or +# else it doesn't support db-1.85 databases. +# +_BLNK_NATIVE_DB1_OK= no +. for _inc_ in /usr/include/db.h /usr/include/db1/db.h +. if exists(${_inc_}) +_BLNK_NATIVE_DB1_OK.${_inc_}!= \ + if ${GREP} -q "^\#define.*HASHVERSION.*2$$" ${_inc_}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +_BLNK_NATIVE_DB1_OK+= ${_BLNK_NATIVE_DB1_OK.${_inc_}} +. endfor +. undef _inc_ +. if !empty(_BLNK_NATIVE_DB1_OK:M[yY][eE][sS]) +IS_BUILTIN.db1= yes +. endif +BUILDLINK_VARS+= IS_BUILTIN.db1 +.endif # IS_BUILTIN.db1 + +.if !defined(USE_BUILTIN.db1) +USE_BUILTIN.db1?= ${IS_BUILTIN.db1} +_INCOMPAT_DB1?= # empty +. for _pattern_ in ${_INCOMPAT_DB1} ${INCOMPAT_DB1} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +USE_BUILTIN.db1= no +. endif +. endfor +. undef _pattern_ +BUILDLINK_VARS+= USE_BUILTIN.db1 +.endif # USE_BUILTIN.db1 + +CHECK_BUILTIN.db1?= no +.if !empty(CHECK_BUILTIN.db1:M[nN][oO]) +. if !empty(USE_BUILTIN.db1:M[yY][eE][sS]) +BUILDLINK_PREFIX.db1= /usr +. if exists(/usr/include/db.h) +BUILDLINK_INCDIRS.db1= include +. elif exists(/usr/include/db1/db.h) +BUILDLINK_INCDIRS.db1= include/db1 +. endif +. if !empty(_BLNK_LIB_FOUND.db:M[yY][eE][sS]) +BUILDLINK_LIBS.db1= -ldb +. endif +. if !empty(_BLNK_LIB_FOUND.db1:M[yY][eE][sS]) +BUILDLINK_LIBS.db1= -ldb1 +BUILDLINK_TRANSFORM+= l:db:db1 +. endif +. endif # USE_BUILTIN.db1 == yes +.endif # CHECK_BUILTIN.db1 |