pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Define PKGSRC_TOPDIR as the path to the top of the ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6f88410883f4
branches: trunk
changeset: 481184:6f88410883f4
user: jlam <jlam%pkgsrc.org@localhost>
date: Mon Sep 27 12:00:56 2004 +0000
description:
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:
mk/bsd.prefs.mk | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
diffs (57 lines):
diff -r e0057383a931 -r 6f88410883f4 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk Mon Sep 27 11:54:57 2004 +0000
+++ b/mk/bsd.prefs.mk Mon Sep 27 12:00:56 2004 +0000
@@ -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 @@
. 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 @@
# 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
Home |
Main Index |
Thread Index |
Old Index