summaryrefslogtreecommitdiff
path: root/mk/readline.builtin.mk
blob: 560dbff57407481d5dd31dc3aebcc91dd0d1612c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# $NetBSD: readline.builtin.mk,v 1.5 2020/12/17 09:44:24 ryoon Exp $
#

BUILTIN_PKG:=	editlinereadline

BUILTIN_FIND_LIBS:=		edit readline history
BUILTIN_FIND_HEADERS_VAR:=	H_EDITLINE H_READLINE
BUILTIN_FIND_HEADERS.H_READLINE=	readline/readline.h	\
					readline.h
BUILTIN_FIND_HEADERS.H_EDITLINE=	editline/readline.h	\
					readline/readline.h
BUILTIN_FIND_GREP.H_EDITLINE=	NetBSD
BUILTIN_FIND_GREP.H_READLINE=	\#define[ 	]*RL_VERSION_MAJOR

.include "../../mk/buildlink3/bsd.builtin.mk"

.if !defined(IS_BUILTIN.editlinereadline)
IS_BUILTIN.editlinereadline=	no
.  if empty(H_EDITLINE:M__nonexistent__) && \
      !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS])
IS_BUILTIN.editline=	yes
IS_BUILTIN.editlinereadline=	yes
.  elif empty(H_READLINE:M__nonexistent__) && \
	   !empty(BUILTIN_LIB_FOUND.readline:M[yY][eE][sS])
IS_BUILTIN.readline=	yes
IS_BUILTIN.editlinereadline=	yes
.  else
IS_BUILTIN.editline=	no
IS_BUILTIN.readline=	no
IS_BUILTIN.editlinereadline=	no
.  endif
.endif

.if !defined(USE_BUILTIN.editlinereadline)
.  if ${PREFER.editlinereadline} == "pkgsrc"
USE_BUILTIN.editlinereadline=	no
.  else
USE_BUILTIN.editlinereadline=	${IS_BUILTIN.editlinereadline}
.  endif
.endif

CHECK_BUILTIN.editlinereadline=	no
.if empty(CHECK_BUILTIN.editlinereadline:M[Nn][Oo])
.  if !empty(USE_BUILTIN.editlinereadline:M[Yy][Ee][Ss])
.    if !empty(_READLINE_TYPE:Meditline)
.      include "../../devel/editline/builtin.mk"
IS_BUILTIN.editlinereadline=	${USE_BUILTIN.editline}
.    elif !empty(_READLINE_TYPE:Mreadline)
.      include "../../devel/readline/builtin.mk"
IS_BUILTIN.editlinereadline=	${USE_BUILTIN.readline}
.    endif
.  endif
.endif