summaryrefslogtreecommitdiff
path: root/mk/bsd.prefs.mk
diff options
context:
space:
mode:
authortv <tv>2005-11-01 16:30:05 +0000
committertv <tv>2005-11-01 16:30:05 +0000
commite3ea7a133ae98055f473cb25ffe3ea90f94af1f0 (patch)
treeb27482d548fea865c79b953c4e82902edfbe5187 /mk/bsd.prefs.mk
parent9b90cd28cd43183b08e85a22ac9b833d4e46222a (diff)
downloadpkgsrc-e3ea7a133ae98055f473cb25ffe3ea90f94af1f0.tar.gz
Abstract [LOWER_]OS_VERSION into a ${...:sh} construct, so that other OS
blocks can override it without running the commands at all. Move Interix [LOWER_]OS_VERSION speedup hack into bsd.prefs.mk, since it must happen early at runtime. While here, speed up the OS_VERSION calculation slightly for OSF1.
Diffstat (limited to 'mk/bsd.prefs.mk')
-rw-r--r--mk/bsd.prefs.mk32
1 files changed, 24 insertions, 8 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index c5ec07b297c..3f1ca3102d9 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.202 2005/11/01 16:18:33 tv Exp $
+# $NetBSD: bsd.prefs.mk,v 1.203 2005/11/01 16:30:05 tv Exp $
#
# Make file, included to get the site preferences, if any. Should
# only be included by package Makefiles before any .if defined()
@@ -54,12 +54,18 @@ CUT=echo Unknown
OPSYS!= ${UNAME} -s | tr -d /
MAKEFLAGS+= OPSYS=${OPSYS}
.endif
+
+# 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.
.if !defined(OS_VERSION)
-OS_VERSION!= ${UNAME} -r
+_OS_VERSION_CMD= ${UNAME} -r
+OS_VERSION= ${_OS_VERSION_CMD:sh}
MAKEFLAGS+= OS_VERSION=${OS_VERSION}
.endif
.if !defined(LOWER_OS_VERSION)
-LOWER_OS_VERSION!= echo ${OS_VERSION} | tr 'A-Z' 'a-z'
+_LOWER_OS_VERSION_CMD= echo ${OS_VERSION} | tr 'A-Z' 'a-z'
+LOWER_OS_VERSION= ${_LOWER_OS_VERSION_CMD:sh}
MAKEFLAGS+= LOWER_OS_VERSION=${LOWER_OS_VERSION}
.endif
@@ -124,13 +130,20 @@ MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH}
LOWER_OPSYS_VERSUFFIX!= echo ${LOWER_OS_VERSION} | ${CUT} -c -1
. if ${LOWER_ARCH} == "i386"
LOWER_VENDOR?= pc
-. else
-LOWER_VENDOR?= unknown
. endif
+LOWER_VENDOR?= unknown
.elif ${OPSYS} == "Interix"
LOWER_OPSYS?= interix3
LOWER_VENDOR?= pc
+. if exists(/usr/lib/libc.so.3.5)
+OS_VERSION= 3.5
+. elif exists(/usr/lib/libc.so.3.1)
+OS_VERSION= 3.1
+. else
+OS_VERSION= 3.0
+. endif
+LOWER_OS_VERSION= ${OS_VERSION}
.elif !empty(OPSYS:MIRIX*)
LOWER_ARCH!= ${UNAME} -p
@@ -158,15 +171,14 @@ LOWER_VENDOR?= redhat
LOWER_VENDOR?= slackware
. elif ${LOWER_ARCH} == "i386"
LOWER_VENDOR?= pc
-. else
-LOWER_VENDOR?= unknown
. endif
+LOWER_VENDOR?= unknown
.elif ${OPSYS} == "OSF1"
LOWER_ARCH!= ${UNAME} -p
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH}
MACHINE_ARCH?= ${LOWER_ARCH}
-OS_VERSION!= echo ${OS_VERSION} | sed -e 's/^V//'
+OS_VERSION:= ${OS_VERSION:C/^V//}
LOWER_OPSYS?= osf${OS_VERSION}
LOWER_VENDOR?= dec
@@ -192,6 +204,10 @@ LOWER_OPSYS_VERSUFFIX= 2
LOWER_OPSYS!= echo ${OPSYS} | tr A-Z a-z
.endif
+# Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh
+LOWER_OS_VERSION:= ${LOWER_OS_VERSION}
+OS_VERSION:= ${OS_VERSION}
+
MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS}
LOWER_VENDOR?= # empty ("arch--opsys")