summaryrefslogtreecommitdiff
path: root/x11/xinit/builtin.mk
blob: 5c030be67a6e1b24223f9e54a5d7302337a60592 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# $NetBSD: builtin.mk,v 1.2 2022/12/04 15:35:27 wiz Exp $

BUILTIN_PKG:=	xinit

BUILTIN_FIND_FILES_VAR:=	XINIT
BUILTIN_FIND_FILES.XINIT=	${X11BASE}/bin/xinit

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

###
### Determine if there is a built-in implementation of the package and
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
###
.if !defined(IS_BUILTIN.xinit)
.  if empty(XINIT:M__nonexistent__)
IS_BUILTIN.xinit=	yes
.  else
IS_BUILTIN.xinit=	no
.  endif
.endif
MAKEVARS+=		IS_BUILTIN.xinit

###
### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
### a package name to represent the built-in package.
###
.if !defined(BUILTIN_PKG.xinit) && \
    ${IS_BUILTIN.xinit:tl} == yes && \
    empty(XINIT:M__nonexistent__)

# we're more worried about existence, rather than actual version
BUILTIN_VERSION.xinit=	11.7

BUILTIN_PKG.xinit=	xinit-${BUILTIN_VERSION.xinit}
.endif
MAKEVARS+=		BUILTIN_PKG.xinit

###
### Determine whether we should use the built-in implementation if it
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
###
.if !defined(USE_BUILTIN.xinit)
.  if ${PREFER.xinit} == "pkgsrc"
USE_BUILTIN.xinit=	no
.  else
USE_BUILTIN.xinit=	${IS_BUILTIN.xinit}
.    if defined(BUILTIN_PKG.xinit) && \
        ${IS_BUILTIN.xinit:tl} == yes
USE_BUILTIN.xinit=	yes
.      for _dep_ in ${BUILDLINK_API_DEPENDS.xinit}
.        if ${USE_BUILTIN.xinit:tl} == yes
USE_BUILTIN.xinit!=							\
	if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.xinit:Q}; then \
		${ECHO} yes;						\
	else								\
		${ECHO} no;						\
	fi
.        endif
.      endfor
.    endif
.  endif  # PREFER.xinit
.endif

# Now set up the appropriate prefix for xinit
.if ${USE_BUILTIN.xinit:tl} == yes
XINITBASE=		${X11BASE}
.else
XINITBASE=		${PREFIX}
.endif