pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Don't hardcode /usr/include/db.h and /usr/include/d...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ca8ee1755a6d
branches:  trunk
changeset: 485002:ca8ee1755a6d
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Dec 02 17:40:49 2004 +0000

description:
Don't hardcode /usr/include/db.h and /usr/include/db1/db.h all over the
place.  Also, modify the buildlink-db1-db185-h target to use symlinks
instead of include <db.h> since several bdb implementations might be
buildlinked, and we need to be more precise about exactly which db.h
header is being used.

diffstat:

 mk/db1.builtin.mk |  26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diffs (64 lines):

diff -r b45f7656c469 -r ca8ee1755a6d mk/db1.builtin.mk
--- a/mk/db1.builtin.mk Thu Dec 02 17:25:05 2004 +0000
+++ b/mk/db1.builtin.mk Thu Dec 02 17:40:49 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: db1.builtin.mk,v 1.7 2004/11/28 05:44:34 jlam Exp $
+# $NetBSD: db1.builtin.mk,v 1.8 2004/12/02 17:40:49 jlam Exp $
 
 .for _lib_ in db db1
 .  if !defined(_BLNK_LIB_FOUND.${_lib_})
@@ -15,6 +15,8 @@
 .endfor
 .undef _lib_
 
+_DB_H_HEADERS= /usr/include/db.h /usr/include/db1/db.h
+
 .if !defined(IS_BUILTIN.db1)
 IS_BUILTIN.db1=                no
 #
@@ -22,7 +24,7 @@
 # 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
+.  for _inc_ in ${_DB_H_HEADERS}
 .    if exists(${_inc_})
 _BLNK_NATIVE_DB1_OK.${_inc_}!= \
        if ${GREP} -q "^\#define.*HASHVERSION.*2$$" ${_inc_}; then      \
@@ -56,11 +58,11 @@
 .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
+.    for _inc_ in ${_DB_H_HEADERS}
+.      if exists(${_inc_})
+BUILDLINK_INCDIRS.db1?=        ${_inc_:H:S/^${BUILDLINK_PREFIX.db1}\///}
+.      endif
+.    endfor
 .    if !empty(_BLNK_LIB_FOUND.db:M[yY][eE][sS])
 BUILDLINK_LDADD.db1=   -ldb
 .    elif !empty(_BLNK_LIB_FOUND.db1:M[yY][eE][sS])
@@ -73,12 +75,16 @@
 BUILDLINK_LIBS.db1=    ${BUILDLINK_LDADD.db1}
 
 BUILDLINK_TARGETS+=    buildlink-db1-db185-h
-.    if !target(buildlink-db1-db185-h)
+.    for _inc_ in ${_DB_H_HEADERS}
+.      if !target(buildlink-db1-db185-h)
 .PHONY: buildlink-db1-db185-h
 buildlink-db1-db185-h:
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       ${ECHO} "#include <db.h>" > ${BUILDLINK_DIR}/include/db_185.h
-.    endif
+       if ${TEST} ! -f ${BUILDLINK_DIR}/include/db_185.h; then         \
+               ${LN} -fs ${_inc_} ${BUILDLINK_DIR}/include/db_185.h;   \
+       fi
+.      endif
+.    endfor
 
 .  endif # USE_BUILTIN.db1 == yes
 .endif # CHECK_BUILTIN.db1



Home | Main Index | Thread Index | Old Index