2009-03-20 20:23:50 +01:00
|
|
|
# $NetBSD: termcap.builtin.mk,v 1.6 2009/03/20 19:25:01 joerg Exp $
|
+ 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
|
|
|
|
2008-02-29 23:41:13 +01:00
|
|
|
BUILTIN_PKG:= termcap
|
+ 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
|
|
|
|
2008-03-11 16:39:16 +01:00
|
|
|
BUILTIN_FIND_LIBS:= curses termcap termlib tinfo
|
|
|
|
BUILTIN_FIND_FILES_VAR:= H_TERM H_TERMCAP H_TERMLIB
|
|
|
|
BUILTIN_FIND_FILES.H_TERM:= /usr/include/term.h
|
|
|
|
BUILTIN_FIND_GREP.H_TERM:= tgetent
|
|
|
|
BUILTIN_FIND_FILES.H_TERMCAP:= /usr/include/termcap.h
|
|
|
|
BUILTIN_FIND_GREP.H_TERMCAP:= tgetent
|
|
|
|
BUILTIN_FIND_FILES.H_TERMLIB:= /usr/include/termlib.h
|
|
|
|
BUILTIN_FIND_GREP.H_TERMLIB:= tgetent
|
+ 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
|
|
|
|
|
|
|
.include "buildlink3/bsd.builtin.mk"
|
|
|
|
|
|
|
|
###
|
|
|
|
### Determine if there is a built-in implementation of the package and
|
|
|
|
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
|
|
|
|
###
|
2008-02-29 23:41:13 +01:00
|
|
|
.if !defined(IS_BUILTIN.termcap)
|
|
|
|
IS_BUILTIN.termcap= no
|
2008-03-02 08:05:28 +01:00
|
|
|
. 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])
|
2008-02-29 23:41:13 +01:00
|
|
|
IS_BUILTIN.termcap= yes
|
+ 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
|
|
|
. endif
|
|
|
|
.endif
|
2008-02-29 23:41:13 +01:00
|
|
|
MAKEVARS+= IS_BUILTIN.termcap
|
+ 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
|
|
|
|
|
|
|
###
|
|
|
|
### Determine whether we should use the built-in implementation if it
|
|
|
|
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
|
|
|
|
###
|
2008-02-29 23:41:13 +01:00
|
|
|
.if !defined(USE_BUILTIN.termcap)
|
|
|
|
. if ${PREFER.termcap} == "pkgsrc"
|
|
|
|
USE_BUILTIN.termcap= no
|
+ 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
|
|
|
. else
|
2008-02-29 23:41:13 +01:00
|
|
|
USE_BUILTIN.termcap= ${IS_BUILTIN.termcap}
|
|
|
|
. endif # PREFER.termcap
|
+ 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
|
|
|
.endif
|
2008-02-29 23:41:13 +01:00
|
|
|
MAKEVARS+= USE_BUILTIN.termcap
|
+ 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
|
|
|
|
2008-02-29 23:41:13 +01:00
|
|
|
# Define BUILTIN_LIBNAME.termcap to be the base name of the built-in
|
|
|
|
# termcap library.
|
+ 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
|
|
|
#
|
2008-03-11 16:39:16 +01:00
|
|
|
# The way this is determined is:
|
2008-03-02 08:05:28 +01:00
|
|
|
#
|
2008-03-11 16:39:16 +01:00
|
|
|
# (1) If <term.h> exists and libtinfo exists, then it's "tinfo".
|
|
|
|
# (2) If <term.h> exists and libcurses exists, then it's "curses".
|
|
|
|
# (3) If <term.h> exists and lib{curses,tinfo} don't, then it's "c".
|
|
|
|
# (4) If <termcap.h> exists and libtermcap exists, then it's "termcap".
|
|
|
|
# (5) If <termcap.h> exists and libtermcap doesn't, then it's "c".
|
|
|
|
# (6) If <termlib.h> exists and libtermlib exists, then it's "termlib".
|
|
|
|
# (7) If <termlib.h> exists and libtermlib doesn't, then it's "c".
|
|
|
|
# (8) If libtermlib exists by itself, then it's "termlib".
|
|
|
|
#
|
|
|
|
.if empty(H_TERM:M__nonexistent__) && empty(H_TERM:M${LOCALBASE}/*)
|
|
|
|
. if !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS])
|
2008-02-29 23:41:13 +01:00
|
|
|
BUILTIN_LIBNAME.termcap= tinfo
|
2008-03-11 16:39:16 +01:00
|
|
|
. elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
|
2008-02-29 23:41:13 +01:00
|
|
|
BUILTIN_LIBNAME.termcap= curses
|
2008-03-11 16:39:16 +01:00
|
|
|
. else
|
|
|
|
BUILTIN_LIBNAME.termcap= c
|
|
|
|
. endif
|
|
|
|
.elif empty(H_TERMCAP:M__nonexistent__) && empty(H_TERMCAP:M${LOCALBASE}/*)
|
|
|
|
. if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS])
|
|
|
|
BUILTIN_LIBNAME.termcap= termcap
|
|
|
|
. else
|
|
|
|
BUILTIN_LIBNAME.termcap= c
|
|
|
|
. endif
|
|
|
|
.elif empty(H_TERMLIB:M__nonexistent__) && empty(H_TERMLIB:M${LOCALBASE}/*)
|
|
|
|
. if !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS])
|
|
|
|
BUILTIN_LIBNAME.termcap= termlib
|
|
|
|
. else
|
|
|
|
BUILTIN_LIBNAME.termcap= c
|
|
|
|
. endif
|
2008-03-02 08:05:28 +01:00
|
|
|
.elif !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS])
|
|
|
|
BUILTIN_LIBNAME.termcap= termlib
|
+ 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
|
|
|
.endif
|
2008-02-27 16:26:34 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
### The section below only applies if we are not including this file
|
|
|
|
### solely to determine whether a built-in implementation exists.
|
|
|
|
###
|
2008-02-29 23:41:13 +01:00
|
|
|
CHECK_BUILTIN.termcap?= no
|
|
|
|
.if !empty(CHECK_BUILTIN.termcap:M[nN][oO])
|
2008-02-27 16:26:34 +01:00
|
|
|
|
2008-02-29 23:41:13 +01:00
|
|
|
. if !empty(USE_BUILTIN.termcap:M[yY][eE][sS])
|
|
|
|
BUILDLINK_LIBNAME.termcap= ${BUILTIN_LIBNAME.termcap}
|
2008-02-27 16:26:34 +01:00
|
|
|
. endif
|
|
|
|
|
2008-03-05 17:23:52 +01:00
|
|
|
# If the package wants both "termcap" and "curses", then we must not
|
|
|
|
# remove the -l options for the curses libraries; otherwise, we should
|
|
|
|
# remove them as GNU configure scripts commonly check for one or both
|
|
|
|
# of those library options.
|
2008-03-05 08:10:26 +01:00
|
|
|
#
|
2009-03-20 20:23:50 +01:00
|
|
|
. if empty(BUILDLINK_TREE:Mcurses) && empty(BUILDLINK_TREE:Mncurses)
|
2008-03-05 08:10:26 +01:00
|
|
|
BUILDLINK_TRANSFORM+= rm:-lcurses
|
|
|
|
BUILDLINK_TRANSFORM+= rm:-lncurses
|
|
|
|
. endif
|
|
|
|
|
2008-02-29 23:41:13 +01:00
|
|
|
.endif # CHECK_BUILTIN.termcap
|