2014-03-12 09:38:47 +01:00
|
|
|
# $NetBSD: curses.buildlink3.mk,v 1.20 2014/03/12 08:38:47 obache Exp $
|
2004-02-13 02:02:06 +01:00
|
|
|
#
|
2008-02-25 05:19:34 +01:00
|
|
|
# This Makefile fragment is meant to be included by packages that require
|
|
|
|
# any curses implementation instead of one particular one. The available
|
|
|
|
# curses implementations are "curses" if built-in, "ncurses", and
|
|
|
|
# "pdcurses".
|
2004-02-13 02:02:06 +01:00
|
|
|
#
|
2008-02-25 05:19:34 +01:00
|
|
|
# If a package genuinely requires ncurses or pdcurses, then it should
|
|
|
|
# directly include the appropriate buildlink3.mk instead of this file in
|
|
|
|
# the package Makefile.
|
2007-11-03 16:17:42 +01:00
|
|
|
#
|
2008-02-25 05:19:34 +01:00
|
|
|
# === User-settable variables ===
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2014-03-09 11:15:32 +01:00
|
|
|
# Possible: curses, ncurses, ncursesw, pdcurses
|
2008-02-25 05:19:34 +01:00
|
|
|
# Default: (depends)
|
|
|
|
#
|
|
|
|
# === Variables set by this file ===
|
|
|
|
#
|
|
|
|
# CURSES_TYPE
|
|
|
|
# The name of the selected curses implementation.
|
2004-02-13 02:02:06 +01:00
|
|
|
|
2008-02-25 05:19:34 +01:00
|
|
|
CURSES_BUILDLINK3_MK:= ${CURSES_BUILDLINK3_MK}+
|
|
|
|
.include "bsd.fast.prefs.mk"
|
|
|
|
|
|
|
|
.if !empty(CURSES_BUILDLINK3_MK:M+)
|
|
|
|
|
2014-03-09 11:15:32 +01:00
|
|
|
.if !defined(USE_CURSES) && !empty(PKG_OPTIONS:Mwide-curses)
|
|
|
|
USE_CURSES?= wide
|
|
|
|
.endif
|
|
|
|
|
2008-02-25 05:19:34 +01:00
|
|
|
# _CURSES_PKGS is an exhaustive list of all of the curses implementations
|
|
|
|
# that may be used with curses.buildlink3.mk.
|
|
|
|
#
|
2014-03-09 11:15:32 +01:00
|
|
|
_CURSES_PKGS?= curses ncurses ncursesw pdcurses
|
2008-02-25 05:19:34 +01:00
|
|
|
|
|
|
|
CHECK_BUILTIN.curses:= yes
|
|
|
|
. include "curses.builtin.mk"
|
|
|
|
CHECK_BUILTIN.curses:= no
|
|
|
|
|
|
|
|
# Set the value of CURSES_DEFAULT depending on the platform and what's
|
|
|
|
# available in the base system.
|
|
|
|
#
|
2008-02-27 03:26:07 +01:00
|
|
|
.if defined(USE_BUILTIN.curses) && !empty(USE_BUILTIN.curses:M[yY][eE][sS])
|
2008-02-25 05:19:34 +01:00
|
|
|
CURSES_DEFAULT?= curses
|
2014-03-12 09:38:47 +01:00
|
|
|
.elif !empty(USE_CURSES:U:Mwide) || !empty(PKG_OPTIONS:U:Mwide-curses)
|
2014-03-09 11:15:32 +01:00
|
|
|
CURSES_DEFAULT?= ncursesw
|
2004-10-13 22:10:31 +02:00
|
|
|
.else
|
2008-02-25 05:19:34 +01:00
|
|
|
CURSES_DEFAULT?= ncurses
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_CURSES_ACCEPTED= # empty
|
2008-02-27 03:26:07 +01:00
|
|
|
.if defined(USE_BUILTIN.curses) && !empty(USE_BUILTIN.curses:M[yY][eE][sS])
|
2008-02-25 05:19:34 +01:00
|
|
|
_CURSES_ACCEPTED+= curses # system curses exists
|
|
|
|
.endif
|
2014-03-09 11:15:32 +01:00
|
|
|
.if defined(USE_BUILTIN.cursesw) && !empty(USE_BUILTIN.cursesw:M[yY][eE][sS])
|
|
|
|
_CURSES_ACCEPTED+= curses # system curses exists
|
|
|
|
.endif
|
2008-02-25 05:19:34 +01:00
|
|
|
_CURSES_ACCEPTED+= ncurses # pkgsrc ncurses
|
2014-03-09 11:15:32 +01:00
|
|
|
_CURSES_ACCEPTED+= ncursesw # pkgsrc ncursesw
|
2008-02-25 05:19:34 +01:00
|
|
|
_CURSES_ACCEPTED+= pdcurses # pkgsrc pdcurses
|
2004-10-13 22:10:31 +02:00
|
|
|
|
2008-02-25 05:19:34 +01:00
|
|
|
_CURSES_TYPE= ${CURSES_DEFAULT}
|
|
|
|
. if !empty(_CURSES_ACCEPTED:M${_CURSES_TYPE})
|
|
|
|
CURSES_TYPE= ${_CURSES_TYPE}
|
|
|
|
. else
|
|
|
|
CURSES_TYPE= none
|
2004-10-13 22:10:31 +02:00
|
|
|
. endif
|
|
|
|
|
2008-02-25 05:19:34 +01:00
|
|
|
BUILD_DEFS+= CURSES_DEFAULT
|
|
|
|
BUILD_DEFS_EFFECTS+= CURSES_TYPE
|
|
|
|
|
|
|
|
# _PKG_USE_CURSES is a flag for use by the curses packages' buildlink3.mk
|
|
|
|
# files to indicate that the headers and libraries should be usable as
|
|
|
|
# <curses.h> and -lcurses.
|
|
|
|
#
|
|
|
|
_PKG_USE_CURSES= yes
|
|
|
|
|
2014-03-09 11:15:32 +01:00
|
|
|
.PHONY: buildlink-curses-ncurses-h
|
|
|
|
buildlink-curses-ncurses-h:
|
|
|
|
${RUN} \
|
|
|
|
src="${H_CURSES}"; \
|
|
|
|
dest=${BUILDLINK_DIR}"/include/ncurses.h"; \
|
|
|
|
if ${TEST} ! -f "$$dest" -a -f "$$src"; then \
|
|
|
|
${ECHO_BUILDLINK_MSG} "Linking ${H_CURSES} -> ncurses.h.";\
|
|
|
|
${MKDIR} `${DIRNAME} "$$dest"`; \
|
|
|
|
${LN} -s "$$src" "$$dest"; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2008-02-25 05:19:34 +01:00
|
|
|
.endif # CURSES_BUILDLINK3_MK
|
|
|
|
|
|
|
|
.if ${CURSES_TYPE} == "none"
|
|
|
|
PKG_FAIL_REASON= \
|
|
|
|
"${_CURSES_TYPE} is not an acceptable curses type for ${PKGNAME}."
|
|
|
|
.elif ${CURSES_TYPE} == "curses"
|
2014-03-09 11:15:32 +01:00
|
|
|
. include "curses.builtin.mk"
|
2009-03-20 20:23:50 +01:00
|
|
|
BUILDLINK_TREE+= curses -curses
|
2008-02-27 22:32:45 +01:00
|
|
|
BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/:S/^-l$//}
|
2014-03-09 11:15:32 +01:00
|
|
|
BUSILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk
|
|
|
|
# Some packages only look for ncurses
|
|
|
|
# The correct action would be to write a patch and pass it upstream
|
|
|
|
# but by setting FAKE_NCURSES=yes in the package we can temporarily work
|
|
|
|
# around the short-coming.
|
2014-03-10 13:57:03 +01:00
|
|
|
. if defined(FAKE_NCURSES) && !empty(FAKE_NCURSES:M[yY][eE][sS])
|
2014-03-09 11:15:32 +01:00
|
|
|
BUILDLINK_TARGETS+= buildlink-curses-ncurses-h
|
|
|
|
BUILDLINK_TRANSFORM+= l:ncurses:${BUILDLINK_LIBNAME.curses}
|
|
|
|
BUILDLINK_TRANSFORM+= l:ncursesw:${BUILDLINK_LIBNAME.curses}
|
|
|
|
. endif
|
2008-02-25 05:19:34 +01:00
|
|
|
.elif ${CURSES_TYPE} == "ncurses"
|
|
|
|
USE_NCURSES= yes
|
2010-02-07 11:28:13 +01:00
|
|
|
. include "../../devel/ncurses/buildlink3.mk"
|
2008-02-29 17:29:04 +01:00
|
|
|
BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.ncurses}
|
+ The termlib.buildlink3.mk file is meant to be included by packages
that need basic termlib functionality, i.e. tgetent(), tgoto(),
tputs(), etc. Together with the termlib.builtin.mk file, they will
use either a built-in termcap library, a built-in X/Open "enhanced"
curses library, or ncurses to provide these functions.
+ Add BUILDLINK_LIBNAME.* definitions to the various curses buildlink3.mk
and builtin.mk files that give the "base" library name of the curses
library, e.g. curses, ncurses, etc. These are used by the termlib
files to set BUILDLINK_LIBNAME.termlib.
2008-02-27 05:47:02 +01:00
|
|
|
BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses}
|
2008-02-25 05:19:34 +01:00
|
|
|
BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncurses}
|
2014-03-09 11:15:32 +01:00
|
|
|
.elif ${CURSES_TYPE} == "ncursesw"
|
|
|
|
. include "../../devel/ncursesw/buildlink3.mk"
|
|
|
|
BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.ncursesw}
|
|
|
|
BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncursesw}
|
|
|
|
BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncursesw}
|
2008-02-25 05:19:34 +01:00
|
|
|
.elif ${CURSES_TYPE} == "pdcurses"
|
|
|
|
. include "../../devel/pdcurses/buildlink3.mk"
|
2008-02-29 17:29:04 +01:00
|
|
|
BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.pdcurses}
|
+ The termlib.buildlink3.mk file is meant to be included by packages
that need basic termlib functionality, i.e. tgetent(), tgoto(),
tputs(), etc. Together with the termlib.builtin.mk file, they will
use either a built-in termcap library, a built-in X/Open "enhanced"
curses library, or ncurses to provide these functions.
+ Add BUILDLINK_LIBNAME.* definitions to the various curses buildlink3.mk
and builtin.mk files that give the "base" library name of the curses
library, e.g. curses, ncurses, etc. These are used by the termlib
files to set BUILDLINK_LIBNAME.termlib.
2008-02-27 05:47:02 +01:00
|
|
|
BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses}
|
2008-02-25 05:19:34 +01:00
|
|
|
BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses}
|
2004-03-18 10:12:08 +01:00
|
|
|
.endif
|