pkgsrc/devel/ncurses/buildlink3.mk
jlam 6c632be065 + Introduce a way for a user to set the default curses implementation
used by packages that need curses.  From curses.buildlink3.mk:

  CURSES_DEFAULT
	This value represents the type of curses we wish to use on the
	system.  Setting this to "curses" means that the system curses
	implementation is fine.

	Possible: curses, ncurses, pdcurses

+ Move all code to detect a built-in version of curses into a
  curses.builtin.mk file.

+ Add code to {n,pd}curses/buildlink3.mk so make the headers and
  libraries usable as <curses.h> and -lcurses if _PKG_USE_CURSES is
  defined.  _PKG_USE_CURSES is only defined by curses.buildlink3.mk.

+ Improve the detection of native ncurses in ncurses/builtin.mk and
  allow headers and libraries to be usable as <ncurses.h> and -lncurses.
2008-02-25 04:19:34 +00:00

41 lines
1.3 KiB
Makefile

# $NetBSD: buildlink3.mk,v 1.28 2008/02/25 04:19:34 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
NCURSES_BUILDLINK3_MK:= ${NCURSES_BUILDLINK3_MK}+
.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= ncurses
.endif
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nncurses}
BUILDLINK_PACKAGES+= ncurses
BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}ncurses
.if !empty(NCURSES_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.ncurses+= ncurses>=5.3nb1
BUILDLINK_ABI_DEPENDS.ncurses+= ncurses>=5.4nb1
BUILDLINK_PKGSRCDIR.ncurses?= ../../devel/ncurses
BUILDLINK_LDADD.ncurses?= -lncurses
# _PKG_USE_CURSES is defined by curses.buildlink3.mk to indicate that
# the headers and libraries should be usable as <curses.h> and -lcurses.
#
. if defined(_PKG_USE_CURSES)
BUILDLINK_TARGETS+= buildlink-ncurses-curses-h
BUILDLINK_TRANSFORM+= l:curses:ncurses
. endif
.PHONY: buildlink-ncurses-curses-h
buildlink-ncurses-curses-h:
${RUN} \
src=${BUILDLINK_PREFIX.ncurses:Q}"/include/ncurses.h"; \
dest=${BUILDLINK_DIR:Q}"/include/curses.h"; \
if ${TEST} ! -f "$$dest" -a -f "$$src"; then \
${ECHO_BUILDLINK_MSG} "Linking curses.h -> ncurses.h."; \
${MKDIR} `${DIRNAME} "$$dest"`; \
${LN} -s "$$src" "$$dest"; \
fi
.endif # NCURSES_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}