summaryrefslogtreecommitdiff
path: root/mk/bsd.prefs.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-09-27 12:00:56 +0000
committerjlam <jlam@pkgsrc.org>2004-09-27 12:00:56 +0000
commit48816eb26fbee95a39266b521946274105b82406 (patch)
tree79a979c192970ea2113be5a5c66c4522a1f00e7b /mk/bsd.prefs.mk
parent84483ac4f070016bd29f3ec904e39a60b3d5563a (diff)
downloadpkgsrc-48816eb26fbee95a39266b521946274105b82406.tar.gz
Define PKGSRC_TOPDIR as the path to the top of the pkgsrc tree relative
to the Makefile on which make is invoked. Use it instead of doing the same dance for finding defs.${OPSYS}.mk and bsd.pkg.defaults.mk.
Diffstat (limited to 'mk/bsd.prefs.mk')
-rw-r--r--mk/bsd.prefs.mk35
1 files changed, 16 insertions, 19 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 1e13e8d5e0f..ee14836868c 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.166 2004/09/21 15:01:39 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.167 2004/09/27 12:00:56 jlam Exp $
#
# Make file, included to get the site preferences, if any. Should
# only be included by package Makefiles before any .if defined()
@@ -212,13 +212,18 @@ OBJECT_FMT?= a.out
. endif
.endif
+# Calculate depth
+.if exists(${.CURDIR}/../../mk/bsd.pkg.mk)
+PKGSRC_TOPDIR= ${.CURDIR}/../..
+.elif exists(${.CURDIR}/../mk/bsd.pkg.mk)
+PKGSRC_TOPDIR= ${.CURDIR}/..
+.elif exists(${.CURDIR}/mk/bsd.pkg.mk)
+PKGSRC_TOPDIR= ${.CURDIR}
+.endif
+
# include the defaults file
-.if exists(${.CURDIR}/../../mk/bsd.pkg.defaults.mk)
-. include "${.CURDIR}/../../mk/bsd.pkg.defaults.mk"
-.elif exists(${.CURDIR}/../mk/bsd.pkg.defaults.mk)
-. include "${.CURDIR}/../mk/bsd.pkg.defaults.mk"
-.elif exists(${.CURDIR}/mk/bsd.pkg.defaults.mk)
-. include "${.CURDIR}/mk/bsd.pkg.defaults.mk"
+.if exists(${PKGSRC_TOPDIR}/mk/bsd.pkg.defaults.mk)
+. include "${PKGSRC_TOPDIR}/mk/bsd.pkg.defaults.mk"
.endif
.if ${OPSYS} == "NetBSD"
@@ -252,18 +257,10 @@ SHAREMODE?= ${DOCMODE}
# Load the OS-specific definitions for program variables. Default to loading
# the NetBSD ones if an OS-specific file doesn't exist.
-.if exists(${.CURDIR}/../../mk/defs.${OPSYS}.mk)
-. include "${.CURDIR}/../../mk/defs.${OPSYS}.mk"
-.elif exists(${.CURDIR}/../mk/defs.${OPSYS}.mk)
-. include "${.CURDIR}/../mk/defs.${OPSYS}.mk"
-.elif exists(${.CURDIR}/mk/defs.${OPSYS}.mk)
-. include "${.CURDIR}/mk/defs.${OPSYS}.mk"
-.elif exists(${.CURDIR}/../../mk/defs.NetBSD.mk)
-. include "${.CURDIR}/../../mk/defs.NetBSD.mk"
-.elif exists(${.CURDIR}/../mk/defs.NetBSD.mk)
-. include "${.CURDIR}/../mk/defs.NetBSD.mk"
-.elif exists(${.CURDIR}/mk/defs.NetBSD.mk)
-. include "${.CURDIR}/mk/defs.NetBSD.mk"
+.if exists(${PKGSRC_TOPDIR}/mk/defs.${OPSYS}.mk)
+. include "${PKGSRC_TOPDIR}/mk/defs.${OPSYS}.mk"
+.elif exists(${PKGSRC_TOPDIR}/mk/defs.NetBSD.mk)
+. include "${PKGSRC_TOPDIR}/mk/defs.NetBSD.mk"
.endif
PKGDIRMODE?= 755