diff options
author | jlam <jlam> | 2004-02-12 01:59:37 +0000 |
---|---|---|
committer | jlam <jlam> | 2004-02-12 01:59:37 +0000 |
commit | db14b05ecdfa92241cb3b9ca1a9c55447e2b1ae4 (patch) | |
tree | f36bdf155011b2521ad9dfd8a23373398462d265 /devel/ncurses | |
parent | 342253e6bd51ec74765e2ef9c6471f0c92aaddba (diff) | |
download | pkgsrc-db14b05ecdfa92241cb3b9ca1a9c55447e2b1ae4.tar.gz |
Reorganize code so that any dependencies are checked as part of deciding
whether the software is built-in or not. This facilitates implementing
the forthcoming PKGSRC_NATIVE variable.
Diffstat (limited to 'devel/ncurses')
-rw-r--r-- | devel/ncurses/buildlink2.mk | 76 | ||||
-rw-r--r-- | devel/ncurses/buildlink3.mk | 80 |
2 files changed, 86 insertions, 70 deletions
diff --git a/devel/ncurses/buildlink2.mk b/devel/ncurses/buildlink2.mk index 3f634b65a69..1455fcc4305 100644 --- a/devel/ncurses/buildlink2.mk +++ b/devel/ncurses/buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink2.mk,v 1.18 2004/02/05 07:17:14 jlam Exp $ +# $NetBSD: buildlink2.mk,v 1.19 2004/02/12 01:59:37 jlam Exp $ # # Optionally define: # @@ -14,45 +14,62 @@ NCURSES_BUILDLINK2_MK= # defined BUILDLINK_DEPENDS.ncurses?= ncurses>=5.3nb1 BUILDLINK_PKGSRCDIR.ncurses?= ../../devel/ncurses -.if defined(USE_NCURSES) -_NEED_NCURSES= YES -.else -_NEED_NCURSES= NO +.if !defined(_BLNK_LIBNCURSES_FOUND) +_BLNK_LIBNCURSES_FOUND!= \ + if [ "`${ECHO} /usr/lib/libncurses.*`" = "/usr/lib/libncurses.*" ]; then \ + ${ECHO} "NO"; \ + else \ + ${ECHO} "YES"; \ + fi +MAKEFLAGS+= _BLNK_LIBNCURSES_FOUND=${_BLNK_LIBNCURSES_FOUND} +.endif -# -# Handle the base system not having (n)curses. -# -. if !(exists(/usr/include/curses.h) || exists(/usr/include/ncurses.h)) -_NEED_NCURSES= YES +.if !defined(BUILDLINK_IS_BUILTIN.ncurses) +BUILDLINK_IS_BUILTIN.ncurses= NO +. if ${_BLNK_LIBNCURSES_FOUND} == "YES" +BUILDLINK_IS_BUILTIN.ncurses= YES +. elif exists(${_NCURSES_H}) +BUILDLINK_IS_BUILTIN.ncurses!= \ + if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi . endif # -# These versions of NetBSD didn't have a curses library that was capable of -# replacing ncurses. -# -_INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-* -_INCOMPAT_CURSES+= NetBSD-1.4.*-* NetBSD-1.4[A-X]-* +# XXX By default, assume that the builtin curses on NetBSD systems +# XXX supports ncurses. # -# This catch-all for SunOS is probably too broad, but better to err on -# the safe side. We can narrow down the match when we have better -# information. +. if ${OPSYS} == "NetBSD" +BUILDLINK_IS_BUILTIN.ncurses= YES # -_INCOMPAT_CURSES+= SunOS-*-* +# These versions of NetBSD didn't have a curses library that was +# capable of replacing ncurses. # -# Similarly for IRIX and Darwin +# XXX In reality, no version of NetBSD has a curses library that can +# XXX completely replace ncurses; however, some version implement +# XXX enough of ncurses that some packages are happy. # -_INCOMPAT_CURSES+= IRIX-*-* -_INCOMPAT_CURSES+= Darwin-*-* -INCOMPAT_CURSES?= # empty -. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) +_INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-* +_INCOMPAT_CURSES+= NetBSD-1.4.*-* NetBSD-1.4[A-X]-* +. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +BUILDLINK_IS_BUILTIN.ncurses= NO +. endif +. endfor +. endif +MAKEFLAGS+= BUILDLINK_IS_BUILTIN.ncurses=${BUILDLINK_IS_BUILTIN.ncurses} +.endif + +.if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS]) +_NEED_NCURSES= NO +.else _NEED_NCURSES= YES -. endif -. endfor .endif .if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ !empty(PREFER_PKGSRC:Mncurses) -_NEED_NCURSES= YES +_NEED_NCURSES= YES .endif .if ${_NEED_NCURSES} == "YES" @@ -87,8 +104,7 @@ BUILDLINK_FILES.ncurses+= lib/libncurses.* BUILDLINK_FILES.ncurses+= lib/libpanel.* .if ${_NEED_NCURSES} == "NO" -_BLNK_LIBNCURSES_LIST!= ${ECHO} /usr/lib/libncurses.* -. if ${_BLNK_LIBNCURSES_LIST} == "/usr/lib/libncurses.*" +. if !empty(_BLNK_LIBNCURSES_FOUND:M[yY][eE][sS]) BUILDLINK_FILES.ncurses+= lib/libcurses.* BUILDLINK_TRANSFORM.ncurses+= -e "s|/curses.h|/ncurses.h|g" BUILDLINK_TRANSFORM+= l:ncurses:curses diff --git a/devel/ncurses/buildlink3.mk b/devel/ncurses/buildlink3.mk index a50c9b6b663..d3f3df47188 100644 --- a/devel/ncurses/buildlink3.mk +++ b/devel/ncurses/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.16 2004/02/11 11:30:50 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.17 2004/02/12 01:59:37 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ NCURSES_BUILDLINK3_MK:= ${NCURSES_BUILDLINK3_MK}+ @@ -30,25 +30,54 @@ BUILDLINK_IS_BUILTIN.ncurses= NO . if ${_BLNK_LIBNCURSES_FOUND} == "YES" BUILDLINK_IS_BUILTIN.ncurses= YES . elif exists(${_NCURSES_H}) -BUILDLINK_IS_BUILTIN.ncurses!= \ +_IS_BUILTIN.ncurses!= \ if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \ ${ECHO} "YES"; \ else \ ${ECHO} "NO"; \ fi +BUILDLINK_IS_BUILTIN.ncurses= ${_IS_BUILTIN.ncurses} +. if !empty(BUILDLINK_CHECK_BUILTIN.ncurses:M[nN][oO]) && \ + !empty(_IS_BUILTIN.ncurses:M[yY][eE][sS]) +# +# Create an appropriate name for the built-in package distributed +# with the system. This package name can be used to check against +# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc +# version or if the built-in one is sufficient. +# +_NCURSES_VERSION!= \ + ${AWK} '/\#define[ ]*NCURSES_VERSION[ ]/ { \ + vers = $$3; \ + gsub("\"", "", vers); \ + print vers; \ + } \ + ' ${_NCURSES_H} +_NCURSES_PKG= ncurses-${_NCURSES_VERSION} +BUILDLINK_IS_BUILTIN.ncurses= YES +. for _depend_ in ${BUILDLINK_DEPENDS.ncurses} +. if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS]) +BUILDLINK_IS_BUILTIN.ncurses!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${_NCURSES_PKG}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi +. endif +. endfor +. endif . endif # -# XXX By default, assume that the builtin curses on NetBSD systems +# XXX By default, assume that the native curses on NetBSD systems # XXX supports ncurses. # . if ${OPSYS} == "NetBSD" -BUILDLINK_USE_BUILTIN.ncurses= YES +BUILDLINK_IS_BUILTIN.ncurses= YES # # These versions of NetBSD didn't have a curses library that was # capable of replacing ncurses. # # XXX In reality, no version of NetBSD has a curses library that can -# XXX completely replace ncurses; however, some version implement +# XXX completely replace ncurses; however, some versions implement # XXX enough of ncurses that some packages are happy. # _INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-* @@ -62,6 +91,12 @@ BUILDLINK_IS_BUILTIN.ncurses= NO MAKEFLAGS+= BUILDLINK_IS_BUILTIN.ncurses=${BUILDLINK_IS_BUILTIN.ncurses} .endif +.if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS]) +BUILDLINK_USE_BUILTIN.ncurses= YES +.else +BUILDLINK_USE_BUILTIN.ncurses= NO +.endif + .if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ !empty(PREFER_PKGSRC:Mncurses) BUILDLINK_USE_BUILTIN.ncurses= NO @@ -75,41 +110,6 @@ BUILDLINK_USE_BUILTIN.ncurses= NO BUILDLINK_USE_BUILTIN.ncurses= YES .endif -.if !defined(BUILDLINK_USE_BUILTIN.ncurses) -. if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[nN][oO]) -BUILDLINK_USE_BUILTIN.ncurses= NO -. else -BUILDLINK_USE_BUILTIN.ncurses= YES -# -# Create an appropriate name for the built-in package distributed -# with the system. This package name can be used to check against -# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc -# version or if the built-in one is sufficient. -# -_NCURSES_VERSION!= \ - ${AWK} '/\#define[ ]*NCURSES_VERSION[ ]/ { \ - vers = $$3; \ - gsub("\"", "", vers); \ - print vers; \ - } \ - ' ${_NCURSES_H} -_NCURSES_PKG= ncurses-${_NCURSES_VERSION} -BUILDLINK_USE_BUILTIN.ncurses?= YES -. for _depend_ in ${BUILDLINK_DEPENDS.ncurses} -. if !empty(BUILDLINK_USE_BUILTIN.ncurses:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.ncurses!= \ - if ${PKG_ADMIN} pmatch '${_depend_}' ${_NCURSES_PKG}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. endif -. endfor -. endif -MAKEFLAGS+= \ - BUILDLINK_USE_BUILTIN.ncurses=${BUILDLINK_USE_BUILTIN.ncurses} -.endif - .if !empty(BUILDLINK_USE_BUILTIN.ncurses:M[nN][oO]) . if !empty(BUILDLINK_DEPTH:M+) BUILDLINK_DEPENDS+= ncurses |