pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Merge down deferred PREPEND_PATH handling from the ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/be2b82ca9b25
branches: trunk
changeset: 488084:be2b82ca9b25
user: tv <tv%pkgsrc.org@localhost>
date: Mon Jan 24 19:32:33 2005 +0000
description:
Merge down deferred PREPEND_PATH handling from the tv-derecurse branch.
Also merge in deferred CLASSPATH handling, which can now be moved back
to java-vm.mk for cleanliness.
diffstat:
mk/bsd.pkg.mk | 62 +++++++++++++++++++++-------------------------------------
mk/java-vm.mk | 22 ++++++++++++++------
2 files changed, 38 insertions(+), 46 deletions(-)
diffs (131 lines):
diff -r 5ddbd0c265a7 -r be2b82ca9b25 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk Mon Jan 24 19:21:48 2005 +0000
+++ b/mk/bsd.pkg.mk Mon Jan 24 19:32:33 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1570 2005/01/24 18:44:38 tv Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1571 2005/01/24 19:32:33 tv Exp $
#
# This file is in the public domain.
#
@@ -955,24 +955,6 @@
. endif
.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.
-#
-.if defined(USE_JAVA)
-. if exists(${PKG_JAVA_HOME}/lib/${_JAVA_BASE_CLASSES})
-_JAVA_CLASSES_ZIP= ${PKG_JAVA_HOME}/lib/${_JAVA_BASE_CLASSES}:
-. endif
-. if exists(${PKG_JAVA_HOME}/lib/tools.jar)
-_JAVA_TOOLS_JAR= ${PKG_JAVA_HOME}/lib/tools.jar:
-. endif
-CLASSPATH?= ${_JAVA_CLASSES_ZIP}${_JAVA_TOOLS_JAR}.
-
-MAKE_ENV+= CLASSPATH=${CLASSPATH}
-CONFIGURE_ENV+= CLASSPATH=${CLASSPATH}
-SCRIPTS_ENV+= CLASSPATH=${CLASSPATH}
-.endif
-
# Include popular master sites
.include "../../mk/bsd.sites.mk"
@@ -1178,18 +1160,6 @@
. 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}
@@ -1207,19 +1177,33 @@
. include "../../mk/dirs.mk"
.endif
-_PREPENDED_TO_PATH?= # empty
-.for _dir_ in ${PREPEND_PATH}
-. if empty(_PREPENDED_TO_PATH:M${_dir_})
-_PREPENDED_TO_PATH+= ${_dir_}
-PATH:= ${_dir_}:${PATH}
-. endif
-.endfor
+# 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(_PATH_ORIG)
+_PATH_ORIG:= ${PATH}
+MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q}
+
+# This is very Special. Because PREPEND_PATH is set with += in reverse order,
+# the awk expression reverses the order again (since bootstrap bmake doesn't
+# yet support the :[-1..1] construct).
+_PATH_CMD= ${ECHO} `${ECHO} ${PREPEND_PATH:Q} | ${AWK} '{ORS=":";for (i=NF;i>0;i--) print $$i}'`${_PATH_ORIG}
+PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation
+.endif
# Add these bits to the environment use when invoking the sub-make
# processes for build-related phases.
#
BUILD_ENV+= PATH=${PATH:Q}
-BUILD_ENV+= _PREPENDED_TO_PATH=${_PREPENDED_TO_PATH:Q}
.MAIN: all
diff -r 5ddbd0c265a7 -r be2b82ca9b25 mk/java-vm.mk
--- a/mk/java-vm.mk Mon Jan 24 19:21:48 2005 +0000
+++ b/mk/java-vm.mk Mon Jan 24 19:32:33 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: java-vm.mk,v 1.36 2005/01/12 17:23:46 tv Exp $
+# $NetBSD: java-vm.mk,v 1.37 2005/01/24 19:32:33 tv Exp $
#
# This Makefile fragment handles Java dependencies and make variables,
# and is meant to be included by packages that require Java either at
@@ -315,12 +315,20 @@
.else
PKG_JAVA_HOME?= ${_JAVA_HOME}
.endif
-BUILD_DEFS+= PKG_JVM PKG_JAVA_HOME
-PATH:= ${PKG_JAVA_HOME}/bin:${PATH}
-MAKEFLAGS+= PKG_JVM=${PKG_JVM}
+.if !defined(CLASSPATH)
+CLASSPATH_cmd= ${ECHO} `for p in \
+ ${PKG_JAVA_HOME}/lib/${_JAVA_BASE_CLASSES} \
+ ${PKG_JAVA_HOME}/lib/tools.jar; do \
+ ${TEST} ! -f $$p || ${ECHO} $$p; done` \
+ . | ${TR} ' ' :
+CLASSPATH?= ${CLASSPATH_cmd:sh}
+.endif
-MAKE_ENV+= JAVA_HOME=${PKG_JAVA_HOME}
-CONFIGURE_ENV+= JAVA_HOME=${PKG_JAVA_HOME}
-SCRIPTS_ENV+= JAVA_HOME=${PKG_JAVA_HOME}
+CONFIGURE_ENV+= CLASSPATH=${CLASSPATH:Q} JAVA_HOME=${PKG_JAVA_HOME}
+MAKE_ENV+= CLASSPATH=${CLASSPATH:Q} JAVA_HOME=${PKG_JAVA_HOME}
+SCRIPTS_ENV+= CLASSPATH=${CLASSPATH:Q} JAVA_HOME=${PKG_JAVA_HOME}
+BUILD_DEFS+= PKG_JVM PKG_JAVA_HOME
+MAKEFLAGS+= PKG_JVM=${PKG_JVM}
+PREPEND_PATH+= ${PKG_JAVA_HOME}/bin
.endif # JAVA_VM_MK
Home |
Main Index |
Thread Index |
Old Index