summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2012-07-02 15:49:41 +0000
committerjperkin <jperkin@pkgsrc.org>2012-07-02 15:49:41 +0000
commit3c727f41e07aa6bf4b5855ae7b327e02b53a586e (patch)
tree057307d0977c97e388693b2d5f619bfb2a3b6df9 /mk
parente4dedb831470cda416d3b4fb9f648807a9491a00 (diff)
downloadpkgsrc-3c727f41e07aa6bf4b5855ae7b327e02b53a586e.tar.gz
Introduce OS_VARIANT. This variable can be used to differentiate operating
systems which share the same base system but offer contrasting environments, for example the various illumos forks which all identify as "SunOS 5.11". Detect SmartOS and set OS_VARIANT accordingly.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.prefs.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 4efd4aa4b25..b0794b2e444 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.323 2012/06/14 21:57:37 jperkin Exp $
+# $NetBSD: bsd.prefs.mk,v 1.324 2012/07/02 15:49:41 jperkin Exp $
#
# This file includes the mk.conf file, which contains the user settings.
#
@@ -74,6 +74,11 @@ OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g}
MAKEFLAGS+= OPSYS=${OPSYS:Q}
.endif
+# OS_VARIANT is used to differentiate operating systems which have a common
+# basis but offer contrasting environments, for example Linux distributions
+# or illumos forks.
+OS_VARIANT?= # empty
+
# The _CMD indirection allows code below to modify these values
# without executing the commands at all. Later, recursed make
# invocations will skip these blocks entirely thanks to MAKEFLAGS.
@@ -275,6 +280,10 @@ MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
LOWER_VENDOR?= sun
LOWER_OPSYS?= solaris
LOWER_OPSYS_VERSUFFIX= 2.${OS_VERSION:C/5.//}
+_UNAME_V!= ${UNAME} -v
+. if !empty(_UNAME_V:Mjoyent_*)
+OS_VARIANT= SmartOS
+. endif
.elif !defined(LOWER_OPSYS)
LOWER_OPSYS:= ${OPSYS:tl}