diff --git a/mk/buildlink3/bsd.builtin.mk b/mk/buildlink3/bsd.builtin.mk index 7469253..8e97504 100644 --- a/mk/buildlink3/bsd.builtin.mk +++ b/mk/buildlink3/bsd.builtin.mk @@ -124,14 +124,29 @@ .for _pkg_ in ${BUILTIN_PKG} # -# Define PREFER. to be either "pkgsrc" or "native" depending on -# whether to prefer the pkgsrc or native versions of software that's -# also part of the base system. Its value is determined from the -# user-settable values PREFER_PKGSRC and PREFER_NATIVE. Preferences are -# determined by the most specific instance of the package in either -# PREFER_PKGSRC or PREFER_NATIVE. If a package is specified in neither -# or in both variables, then PREFER_PKGSRC has precedence over -# PREFER_NATIVE. +# Define PREFER. to be either "pkgsrc" or "native" depending on whether +# to prefer the pkgsrc or native version of a particular package. Its value +# is determined by a number of variables described below. +# +# PREFER. +# This variable has the highest precedence, and should generally only be +# used by packages when it is known that a specific version should always +# be used or avoided. +# +# PREFER_PKGSRC +# PREFER_NATIVE +# These user-settable variables either take "yes" or a list of package +# names. The "yes" form has a lower precedence than a specific package, +# so the most common case is to set one variable to "yes" and then override +# specific packages in the other variable. +# +# If a package is specified in neither or in both variables, then the +# PREFER_PKGSRC setting takes precedence. +# +# _OPSYS_PREFER. +# This variable should only be set in mk/platform files, and provides a +# per-platform default that takes precedence over "yes" in PREFER_* but is +# overridden by a more specific package name match. # _BLTN_PREFER.${_pkg_}= pkgsrc . if !empty(PREFER_NATIVE:M[yY][eE][sS]) @@ -140,6 +155,9 @@ _BLTN_PREFER.${_pkg_}= native . if !empty(PREFER_PKGSRC:M[yY][eE][sS]) _BLTN_PREFER.${_pkg_}= pkgsrc . endif +. if defined(_OPSYS_PREFER.${_pkg_}) +_BLTN_PREFER.${_pkg_}= ${_OPSYS_PREFER.${_pkg_}} +. endif . if !empty(PREFER_NATIVE:M${_pkg_}) _BLTN_PREFER.${_pkg_}= native . endif diff --git a/mk/platform/Darwin.mk b/mk/platform/Darwin.mk index 405fb38..dab8613 100644 --- a/mk/platform/Darwin.mk +++ b/mk/platform/Darwin.mk @@ -96,8 +96,8 @@ _USE_RPATH= no # don't add rpath to LDFLAGS KRB5_DEFAULT?= mit-krb5 # Builtin defaults which make sense for this platform. -PREFER.linux-pam?= native -PREFER.mit-krb5?= native +_OPSYS_PREFER.linux-pam?= native +_OPSYS_PREFER.mit-krb5?= native # flags passed to the linker to extract all symbols from static archives. # this is GNU ld. diff --git a/mk/platform/HPUX.mk b/mk/platform/HPUX.mk index 04dc6ce..57ea214 100644 --- a/mk/platform/HPUX.mk +++ b/mk/platform/HPUX.mk @@ -70,8 +70,8 @@ KRB5_DEFAULT?= mit-krb5 # Builtin openssl and zlib have issues. Prefer pkgsrc's until we know which # versions work. -PREFER.openssl?= pkgsrc -PREFER.zlib?= pkgsrc +_OPSYS_PREFER.openssl?= pkgsrc +_OPSYS_PREFER.zlib?= pkgsrc _STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U} # cc(1) option to strip _STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U} # install(1) option to strip diff --git a/mk/platform/QNX.mk b/mk/platform/QNX.mk index dd2b557..48b7bca 100644 --- a/mk/platform/QNX.mk +++ b/mk/platform/QNX.mk @@ -100,7 +100,7 @@ GAMEDIRMODE= 0775 PAM_DEFAULT?= openpam -PREFER.zlib?= pkgsrc -PREFER.bzip2?= pkgsrc -PREFER.curses?= pkgsrc -PREFER.termcap?= pkgsrc +_OPSYS_PREFER.zlib?= pkgsrc +_OPSYS_PREFER.bzip2?= pkgsrc +_OPSYS_PREFER.curses?= pkgsrc +_OPSYS_PREFER.termcap?= pkgsrc diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk index ff494b9..928ce83 100644 --- a/mk/platform/SunOS.mk +++ b/mk/platform/SunOS.mk @@ -41,10 +41,10 @@ MOTIF_TYPE_DEFAULT?= motif KRB5_DEFAULT?= mit-krb5 # Builtin defaults which make sense for this platform. -PREFER.libexecinfo?= native -PREFER.mit-krb5?= native -PREFER.openssl?= pkgsrc -PREFER.solaris-pam?= native +_OPSYS_PREFER.libexecinfo?= native +_OPSYS_PREFER.mit-krb5?= native +_OPSYS_PREFER.openssl?= pkgsrc +_OPSYS_PREFER.solaris-pam?= native _OPSYS_EMULDIR.solaris= # empty _OPSYS_EMULDIR.solaris32= # empty