From e680b230a7235016fc8c322137f9d4dd4331065f Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 24 Jan 2005 18:20:57 +0000 Subject: Merge down deferred EVAL_PREFIX handling from tv-derecurse branch. Also move its definition later in bsd.pkg.mk, so that it actually works for compiler/*.mk (which is why those files originally had to provide "defaults" for their variables -- they never did get evaluated). --- mk/bsd.pkg.mk | 32 +++++++++++++------------------- mk/compiler/ccache.mk | 3 +-- mk/compiler/distcc.mk | 3 +-- mk/compiler/f2c.mk | 3 +-- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 47883b8dd36..b3f111f81e4 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1568 2005/01/24 09:31:06 xtraeme Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1569 2005/01/24 18:20:57 tv Exp $ # # This file is in the public domain. # @@ -955,24 +955,6 @@ RMAN?= ${X11BASE}/bin/rman . endif .endif -.if defined(EVAL_PREFIX) -. for def in ${EVAL_PREFIX} -. if !defined(${def:C/=.*//}_DEFAULT) -${def:C/=.*//}_DEFAULT= ${X11PREFIX} -. endif -. if !defined(${def:C/=.*//}) -_depend_${def:C/=.*//} != ${PKG_INFO} -e ${def:C/.*=//} 2>/dev/null; ${ECHO} -. if (${_depend_${def:C/=.*//}} == "") -${def:C/=.*//}=${${def:C/=.*//}_DEFAULT} -. else -_dir_${def:C/=.*//} != (${PKG_INFO} -qp ${def:C/.*=//} 2>/dev/null) | ${AWK} '{ print $$2; exit }' -${def:C/=.*//}=${_dir_${def:C/=.*//}} -MAKEFLAGS+= ${def:C/=.*//}=${_dir_${def:C/=.*//}} -. endif -. endif -. endfor -.endif - # Set the CLASSPATH for Java packages. This must come after EVAL_PREFIX # is evaluated because PKG_JAVA_HOME is used in a .if.endif conditional, # and its value is indirectly set by EVAL_PREFIX. @@ -1196,6 +1178,18 @@ USE_LANGUAGES?= # empty . include "../../mk/wrapper/bsd.wrapper.mk" .endif +# Find out the PREFIX of dependencies where the PREFIX is needed at build time. +.if defined(EVAL_PREFIX) +. for def in ${EVAL_PREFIX} +. if !defined(${def:C/=.*$//}) +${def:C/=.*$//}_DEFAULT?=${LOCALBASE} +_${def:C/=.*$//}_CMD= ${PKG_INFO} -qp ${def:C/^.*=//} 2>/dev/null | ${AWK} '{ print $$2; exit }' | grep '' || ${ECHO} ${${def:C/=.*$//}_DEFAULT} +${def:C/=.*$//}= ${_${def:C/=.*$//}_CMD:sh} +MAKEFLAGS+= ${def:C/=.*//}=${_${def:C/=.*$//}_CMD:sh} +. endif +. endfor +.endif + .if defined(RECOMMENDED) . if !empty(IGNORE_RECOMMENDED:M[nN][oO]) DEPENDS+= ${RECOMMENDED} diff --git a/mk/compiler/ccache.mk b/mk/compiler/ccache.mk index 613f70d4d3d..2bd70bd6f22 100644 --- a/mk/compiler/ccache.mk +++ b/mk/compiler/ccache.mk @@ -1,4 +1,4 @@ -# $NetBSD: ccache.mk,v 1.25 2005/01/12 22:56:41 jlam Exp $ +# $NetBSD: ccache.mk,v 1.26 2005/01/24 18:20:57 tv Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -69,7 +69,6 @@ _USE_CCACHE= YES .if !empty(_USE_CCACHE:M[yY][eE][sS]) EVAL_PREFIX+= _CCACHEBASE=ccache _CCACHEBASE_DEFAULT= ${LOCALBASE} -_CCACHEBASE?= ${LOCALBASE} _CCACHE_DIR= ${WRKDIR}/.ccache _CCACHE_VARS= # empty diff --git a/mk/compiler/distcc.mk b/mk/compiler/distcc.mk index 998100f9c70..1bdd6b7436a 100644 --- a/mk/compiler/distcc.mk +++ b/mk/compiler/distcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: distcc.mk,v 1.26 2005/01/12 22:56:41 jlam Exp $ +# $NetBSD: distcc.mk,v 1.27 2005/01/24 18:20:57 tv Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -69,7 +69,6 @@ _USE_DISTCC= YES .if !empty(_USE_DISTCC:M[yY][eE][sS]) EVAL_PREFIX+= _DISTCCBASE=distcc _DISTCCBASE_DEFAULT= ${LOCALBASE} -_DISTCCBASE?= ${LOCALBASE} _DISTCC_DIR= ${WRKDIR}/.distcc _DISTCC_VARS= # empty diff --git a/mk/compiler/f2c.mk b/mk/compiler/f2c.mk index 541aca015de..13134219f1e 100644 --- a/mk/compiler/f2c.mk +++ b/mk/compiler/f2c.mk @@ -1,4 +1,4 @@ -# $NetBSD: f2c.mk,v 1.3 2005/01/12 22:56:41 jlam Exp $ +# $NetBSD: f2c.mk,v 1.4 2005/01/24 18:20:57 tv Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -70,7 +70,6 @@ _USE_F2C= YES .if !empty(_USE_F2C:M[yY][eE][sS]) EVAL_PREFIX+= _F2CBASE=f2c _F2CBASE_DEFAULT= ${LOCALBASE} -_F2CBASE?= ${LOCALBASE} _F2C_DIR= ${WRKDIR}/.f2c _F2C_VARS= # empty -- cgit v1.2.3