[BACK]Return to pam.buildlink3.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

File: [cvs.NetBSD.org] / pkgsrc / mk / pam.buildlink3.mk (download)

Revision 1.11, Fri Mar 20 19:25:01 2009 UTC (10 years, 8 months ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, pkgsrc-2009Q1-base, pkgsrc-2009Q1
Changes since 1.10: +2 -4 lines

Simply and speed up buildlink3.mk files and processing.
This changes the buildlink3.mk files to use an include guard for the
recursive include. The use of BUILDLINK_DEPTH, BUILDLINK_DEPENDS,
BUILDLINK_PACKAGES and BUILDLINK_ORDER is handled by a single new
variable BUILDLINK_TREE. Each buildlink3.mk file adds a pair of
enter/exit marker, which can be used to reconstruct the tree and
to determine first level includes. Avoiding := for large variables
(BUILDLINK_ORDER) speeds up parse time as += has linear complexity.
The include guard reduces system time by avoiding reading files over and
over again. For complex packages this reduces both %user and %sys time to
half of the former time.

# $NetBSD: pam.buildlink3.mk,v 1.11 2009/03/20 19:25:01 joerg Exp $
# This Makefile fragment is meant to be included by packages that
# require a PAM implementation.
# User-settable variables:
#	The preferred PAM implementation.
#	Possible: linux-pam openpam solaris-pam
#	Default: (from the base system, fallback: linux-pam)
# Package-settable variables:
#	The PAM implementations that this package can use.
#	Possible: (see PAM_DEFAULT)
#	Default: all
# System-provided variables:
#	The PAM implementation that will be used for this package.
#	The directory where the PAM implementation is installed.


.include "bsd.fast.prefs.mk"

.if !empty(PAM_BUILDLINK3_MK:M+)
# This is an exhaustive list of all of the PAM implementations
# that may be used with PAM.buildlink3.mk, in order of precedence.
# OS conditionals can exclude implementations not available on
# some platforms.
.if ${OPSYS} != "Interix"
_PAM_PKGS+=	linux-pam

.if ${OPSYS} != "Interix"
_PAM_PKGS+=	openpam

# builtin only, so no conditional needed
_PAM_PKGS+=	solaris-pam

BUILDLINK_BUILTIN_MK.linux-pam=		../../security/PAM/builtin.mk
BUILDLINK_BUILTIN_MK.openpam=		../../security/openpam/builtin.mk
BUILDLINK_BUILTIN_MK.solaris-pam=	../../mk/solaris-pam.builtin.mk

# If we have a particular PAM implementation in the base system, then
# default to using that PAM type.  Otherwise, default to "linux-pam".
.  for _pam_ in ${_PAM_PKGS}
.    if exists(${BUILDLINK_BUILTIN_MK.${_pam_}})
CHECK_BUILTIN.${_pam_}:=	yes
.      include "${BUILDLINK_BUILTIN_MK.${_pam_}}"
.      if defined(IS_BUILTIN.${_pam_}) && \
PAM_DEFAULT?=	${_pam_}
.      endif
CHECK_BUILTIN.${_pam_}:=	no
.    endif
.  endfor
PAM_DEFAULT?=	linux-pam



.  if !empty(_PAM_ACCEPTED:M${_PAM_TYPE})
.  else
PAM_TYPE=	none
.  endif


.if ${PAM_TYPE} == "none"
	"${_PAM_TYPE} is not an acceptable PAM type for ${PKGNAME}."
.elif ${PAM_TYPE} == "linux-pam"
.  include "../../security/PAM/buildlink3.mk"
.elif ${PAM_TYPE} == "openpam"
.  include "../../security/openpam/buildlink3.mk"
.elif ${PAM_TYPE} == "solaris-pam"
BUILDLINK_TREE+=	solaris-pam -solaris-pam