diff options
Diffstat (limited to 'mk')
-rw-r--r-- | mk/termcap.buildlink3.mk | 21 | ||||
-rw-r--r-- | mk/termcap.builtin.mk | 19 |
2 files changed, 32 insertions, 8 deletions
diff --git a/mk/termcap.buildlink3.mk b/mk/termcap.buildlink3.mk index 29f531c8525..4533ec38e33 100644 --- a/mk/termcap.buildlink3.mk +++ b/mk/termcap.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: termcap.buildlink3.mk,v 1.1 2008/02/29 22:41:13 jlam Exp $ +# $NetBSD: termcap.buildlink3.mk,v 1.2 2008/03/02 07:05:28 jlam Exp $ # # This Makefile fragment is meant to be included by packages that require # a termcap implementation that supports the basic termcap functions: @@ -16,6 +16,11 @@ TERMCAP_BUILDLINK3_MK:= ${TERMCAP_BUILDLINK3_MK}+ .if !empty(TERMCAP_BUILDLINK3_MK:M+) +# _TERMCAP_TYPES is an exhaustive list of all of the termcap implementations +# that may be found. +# +_TERMCAP_TYPES?= curses termcap termlib tinfo + CHECK_BUILTIN.termcap:= yes . include "termcap.builtin.mk" CHECK_BUILTIN.termcap:= no @@ -29,14 +34,24 @@ TERMCAP_TYPE= none . else TERMCAP_TYPE= curses . endif - BUILD_DEFS+= TERMCAP_TYPE +# Most GNU configure scripts will try finding every termcap implementation, +# so prevent them from finding any except for the one we decide upon. +# +.for _tcap_ in ${_TERMCAP_TYPES:Ntermcap} +. if empty(TERMCAP_TYPE:M${_tcap_}) +BUILDLINK_TRANSFORM+= rm:-l${_tcap_} +. endif +.endfor +BUILDLINK_TRANSFORM+= l:termcap:${BUILDLINK_LIBNAME.termcap} + .endif # TERMCAP_BUILDLINK3_MK .if ${TERMCAP_TYPE} == "none" PKG_FAIL_REASON= "No usable termcap library found on the system." -.elif (${TERMCAP_TYPE} == "termcap") || \ +.elif (${TERMCAP_TYPE} == "termlib") || \ + (${TERMCAP_TYPE} == "termcap") || \ (${TERMCAP_TYPE} == "tinfo") BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntermcap} BUILDLINK_PACKAGES+= termcap diff --git a/mk/termcap.builtin.mk b/mk/termcap.builtin.mk index 3f8ad0eb407..52417f64ead 100644 --- a/mk/termcap.builtin.mk +++ b/mk/termcap.builtin.mk @@ -1,8 +1,8 @@ -# $NetBSD: termcap.builtin.mk,v 1.1 2008/02/29 22:41:13 jlam Exp $ +# $NetBSD: termcap.builtin.mk,v 1.2 2008/03/02 07:05:28 jlam Exp $ BUILTIN_PKG:= termcap -BUILTIN_FIND_LIBS:= termcap tinfo curses +BUILTIN_FIND_LIBS:= curses termcap termlib tinfo .include "buildlink3/bsd.builtin.mk" @@ -12,9 +12,10 @@ BUILTIN_FIND_LIBS:= termcap tinfo curses ### .if !defined(IS_BUILTIN.termcap) IS_BUILTIN.termcap= no -. if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \ - !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) || \ - !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) +. if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) || \ + !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \ + !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) || \ + !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) IS_BUILTIN.termcap= yes . endif .endif @@ -36,12 +37,20 @@ MAKEVARS+= USE_BUILTIN.termcap # Define BUILTIN_LIBNAME.termcap to be the base name of the built-in # termcap library. # +# XXX This needs to be more sophisticated. We will want to do what +# XXX most packages do: test for tgetent() in the following libraries +# XXX in order: c, curses, termcap, termlib. Since we can't test for +# XXX symbols in libraries, we'll need to be clever with looking at +# XXX headers. +# .if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) BUILTIN_LIBNAME.termcap= termcap .elif !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) BUILTIN_LIBNAME.termcap= tinfo .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) BUILTIN_LIBNAME.termcap= curses +.elif !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) +BUILTIN_LIBNAME.termcap= termlib .endif ### |