summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>1999-07-08 07:58:42 +0000
committeragc <agc@pkgsrc.org>1999-07-08 07:58:42 +0000
commitf51461529ddbf09070a83e9aaae40a22698c6045 (patch)
treebfc4645d3be5a364bfd6ce5547f60c630146e2b6
parent059c7ea0ce558f21fda26423d6978eedfd1f23a7 (diff)
downloadpkgsrc-f51461529ddbf09070a83e9aaae40a22698c6045.tar.gz
CAPITAL_OPSYS and OS_MAJOR_VERSION are used in one package Makefile,
but calculated every time bsd.prefs.mk is read. Correct the situation, and only calculate these when they are needed. Also save a few more cycles by hardcoding the LOWER_OPSYS values for known operating systems, rather than using expensive shell echo and tr commands every time bsd.prefs.mk is read.
-rw-r--r--mail/postfix/Makefile6
-rw-r--r--mk/bsd.prefs.mk16
2 files changed, 12 insertions, 10 deletions
diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile
index 71f8f888df1..febbdc2d638 100644
--- a/mail/postfix/Makefile
+++ b/mail/postfix/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 1999/07/02 08:37:24 agc Exp $
+# $NetBSD: Makefile,v 1.12 1999/07/08 07:58:43 agc Exp $
DISTNAME= postfix-19990601
CATEGORIES= mail
@@ -23,7 +23,9 @@ pre-configure:
${SED} -e 's:__PREFIX:'${PREFIX}':g' \
< ${WRKSRC}/util/sys_defs.h.dist \
> ${WRKSRC}/util/sys_defs.h
- ${SED} -e 's:@OPSYS@:'${CAPITAL_OPSYS}${OS_MAJOR_VERSION}':g' \
+ capitalopsys=`${ECHO} ${OPSYS} | ${TR} a-z A-Z`; \
+ osmajorversion=`${ECHO} ${OS_VERSION} | ${SED} -e 's/\..*//g'`; \
+ ${SED} -e 's:@OPSYS@:'$$capitalopsys$$osmajorversion':g' \
< ${WRKSRC}/Makefile.inc.dist \
> ${WRKSRC}/Makefile.inc
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 65d8b3529bb..e6d72540ae3 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.9 1999/06/23 17:06:21 christos Exp $
+# $NetBSD: bsd.prefs.mk,v 1.10 1999/07/08 07:58:42 agc Exp $
#
# Make file, included to get the site preferences, if any. Should
# only be included by package Makefiles before any .if defined()
@@ -26,7 +26,6 @@ OPSYS!= ${UNAME} -s
.endif
.ifndef OS_VERSION
OS_VERSION!= ${UNAME} -r
-OS_MAJOR_VERSION!= echo ${OS_VERSION} | sed -e 's/\..*//g'
.endif
# Preload these for architectures not in all variations of bsd.own.mk.
@@ -40,15 +39,16 @@ GNU_ARCH.sparc?= sparc
GNU_ARCH.vax?= vax
MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}}
-.if (${OPSYS} == "SunOS")
+.if ${OPSYS} == "NetBSD"
+LOWER_OPSYS?= netbsd
+.elif ${OPSYS} == "SunOS"
LOWER_VENDOR?= sun
-.endif
-.if !defined(LOWER_OPSYS)
+LOWER_OPSYS?= sunos
+.elif ${OPSYS} == "Linux"
+LOWER_OPSYS?= linux
+.elif !defined(LOWER_OPSYS)
LOWER_OPSYS!= echo ${OPSYS} | tr A-Z a-z
.endif
-.if !defined(CAPITAL_OPSYS)
-CAPITAL_OPSYS!= echo ${OPSYS} | tr a-z A-Z
-.endif
LOWER_VENDOR?=
LOWER_ARCH?= ${MACHINE_GNU_ARCH}