1 # $NetBSD: builtin.mk,v 1.7 2008/01/28 01:15:26 bjs Exp $
5 BUILTIN_FIND_FILES_VAR
:= H_OPENPAM
6 BUILTIN_FIND_FILES.H_OPENPAM
= /usr
/include/security
/openpam_version.h
8 .
include "../../mk/buildlink3/bsd.builtin.mk"
11 ### Determine if there is a built-in implementation of the package and
12 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
14 .if
!defined
(IS_BUILTIN.openpam
)
15 IS_BUILTIN.openpam
= no
16 . if empty
(H_OPENPAM
:M__nonexistent__
) && empty
(H_OPENPAM
:M
${LOCALBASE}/*)
17 IS_BUILTIN.openpam
= yes
20 MAKEVARS
+= IS_BUILTIN.openpam
23 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
24 ### a package name to represent the built-in package.
26 .if
!defined
(BUILTIN_PKG.openpam
) && \
27 !empty
(IS_BUILTIN.openpam
:M
[yY
][eE
][sS
]) && \
28 empty
(H_OPENPAM
:M__nonexistent__
)
29 BUILTIN_VERSION.openpam
!= \
30 ${AWK} '/\#define[ ]*_?OPENPAM_VERSION[ ]/ {print $$3; }' \
32 BUILTIN_PKG.openpam
= openpam-
${BUILTIN_VERSION.openpam
}
34 MAKEVARS
+= BUILTIN_PKG.openpam
37 ### Determine whether we should use the built-in implementation if it
38 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
40 .if
!defined
(USE_BUILTIN.openpam
)
41 . if
${PREFER.openpam
} == "pkgsrc"
42 USE_BUILTIN.openpam
= no
44 USE_BUILTIN.openpam
= ${IS_BUILTIN.openpam
}
45 . if defined
(BUILTIN_PKG.openpam
) && \
46 !empty
(IS_BUILTIN.openpam
:M
[yY
][eE
][sS
])
47 USE_BUILTIN.openpam
= yes
48 . for _dep_ in
${BUILDLINK_API_DEPENDS.openpam
}
49 . if
!empty
(USE_BUILTIN.openpam
:M
[yY
][eE
][sS
])
50 USE_BUILTIN.openpam
!= \
51 if
${PKG_ADMIN} pmatch
${_dep_
:Q
} ${BUILTIN_PKG.openpam
:Q
}; then \
59 .
endif # PREFER.openpam
61 MAKEVARS
+= USE_BUILTIN.openpam