diff options
-rw-r--r-- | mk/buildlink2/NOTES | 21 | ||||
-rw-r--r-- | mk/buildlink2/README | 36 | ||||
-rw-r--r-- | mk/buildlink2/bsd.buildlink2.mk | 202 | ||||
-rw-r--r-- | mk/buildlink2/ld-logic | 5 | ||||
-rw-r--r-- | mk/buildlink2/ld-post-cache | 6 | ||||
-rw-r--r-- | mk/buildlink2/libtool-do-install | 17 | ||||
-rw-r--r-- | mk/buildlink2/libtool-fix-la | 52 | ||||
-rw-r--r-- | mk/buildlink2/libtool.sh | 69 | ||||
-rw-r--r-- | mk/buildlink2/logic | 75 | ||||
-rw-r--r-- | mk/buildlink2/post-cache | 55 | ||||
-rw-r--r-- | mk/buildlink2/pre-cache | 9 | ||||
-rw-r--r-- | mk/buildlink2/private-pre-cache | 3 | ||||
-rw-r--r-- | mk/buildlink2/wrapper.sh | 34 |
13 files changed, 343 insertions, 241 deletions
diff --git a/mk/buildlink2/NOTES b/mk/buildlink2/NOTES index 8047ad10786..a1879ca05a2 100644 --- a/mk/buildlink2/NOTES +++ b/mk/buildlink2/NOTES @@ -1,4 +1,4 @@ -$NetBSD: NOTES,v 1.7 2002/12/23 17:31:15 jlam Exp $ +$NetBSD: NOTES,v 1.8 2002/12/26 17:08:55 jlam Exp $ Caching ======= @@ -15,20 +15,21 @@ The test process for buildlink2 consists of building and installing: shells/tcsh tests handling of specially-quoted arguments devel/gettext-lib same as above, but uses libtool + x11/xearth tests imake wrapper -Full caching can be tested be adding ${OPSYS} to _BLNK_CACHE_ALL and -performing the tests above, but only building the packages is needed. +Full caching can be tested be adding ${MACHINE_PLATFORM} to _BLNK_CACHE_ALL +and performing the tests above, but only building the packages is needed. Platform Working? Full caching? -------- -------- ------------- FreeBSD 4.7 N/A N/A -IRIX 6.5 (jschauma) Yes! Yes! +IRIX 6.5 (jschauma) N/A N/A Linux N/A N/A -Darwin 5.5 (schmonz) Yes! No -Darwin 6.2 (grant) Yes! No -NetBSD 1.5.x (gendalia) Yes! Yes! +Darwin 5.5 (schmonz) N/A N/A +Darwin 6.2 (grant) N/A N/A +NetBSD 1.5.x (gendalia) N/A N/A NetBSD 1.6 (jlam) Yes! Yes! -OpenBSD (cjep) Yes! N/A +OpenBSD (cjep) N/A N/A Solaris 7 N/A N/A -Solaris 8 (grant) Yes! Yes! -Solaris 9 (salo) Yes! Yes! +Solaris 8 (grant) N/A N/A +Solaris 9 (salo) N/A N/A diff --git a/mk/buildlink2/README b/mk/buildlink2/README index 9f7596ddce9..bbdf38a4561 100644 --- a/mk/buildlink2/README +++ b/mk/buildlink2/README @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.4 2002/10/05 22:06:32 wiz Exp $ +$NetBSD: README,v 1.5 2002/12/26 17:08:56 jlam Exp $ For more general information about the use of buildlink2, see the file buildlink2.txt in this directory. @@ -11,8 +11,8 @@ compiler tool with scripts that tranlate any arguments into their buildlink equivalents, then invoke the actual compiler tools with the translated arguments. The pkgsrc/mk/buildlink2 directory contains bits of the wrapper script system for the buildlink2 framework. The wrapper script system is -composed of four parts: the main wrapper script, the "cache", the "logic" -script generated from the cache, and a wrapper-specific "logic" script. +composed of three parts: the main wrapper script, the "cache", and the +"logic" script. 0.1 Main wrapper script ======================= @@ -25,24 +25,22 @@ files that translate arguments into their buildlink equivalents. 0.2 Cache ========= -The cache contains a series of lines that may be directly used as the -contents of a Bourne shell "case" statement. They contain only arguments -that have already been seen and their buildlink equivalents. +The cache is a giant Bourne shell "case" statement that stores +pre-translated arguments from previous wrapper invocations. This allows +speedy translation of already-seen arguments without having to run the +utilities needed to perform a translation from scratch. There are two +caches: the common cache and a wrapper-specific cache. The common cache +is used by all wrapper scripts. The wrapper-specific cache is read before +the common cache and contains wrapper-specific argument translation that +shouldn't be used by other wrapper scripts. 0.3 Logic script ================ The logic script contains a large "case" statement that handles the -translation of an argument into its buildlink equivalent. It is generated -from three files: the pre-cache, cache, and post-cache files. The cache is -described above. The pre- and post-cache files simply complete the "case" -statement. The post-cache also contains the final case that performs the -actual argument translation and, as an optimization, saves the result into -the cache. - - 0.4 Wrapper-specifc logic script - ================================ - -The wrapper-specific logic script contains extra shell commands that -typically perform an extra uncached translation of an argument after the -main translation has been performed by the logic script. +actual translation of an argument into its buildlink equivalent. The logic +script also invokes a wrapper-specific logic script which may contain extra +commands that perform further translation of an argument after the main +translation has been performed by the logic script. Finally, the logic +script may save the translations results into a cache file if requested by +the wrapper script. diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk index 5af8b7d5342..c90c1819c24 100644 --- a/mk/buildlink2/bsd.buildlink2.mk +++ b/mk/buildlink2/bsd.buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink2.mk,v 1.66 2002/12/23 22:33:16 jschauma Exp $ +# $NetBSD: bsd.buildlink2.mk,v 1.67 2002/12/26 17:08:56 jlam Exp $ # # An example package buildlink2.mk file: # @@ -562,22 +562,25 @@ _ALIASES.LD= ld # _BLNK_SANITIZED_PATH!= ${ECHO} ${PATH} | ${SED} \ -e "s|:${BUILDLINK_DIR}[^:]*||" -e "s|${BUILDLINK_DIR}[^:]*:||" -_BLNK_WRAP_SANITIZE_PATH= PATH="${_BLNK_SANITIZED_PATH}" -_BLNK_WRAP_ENV?= ${BUILDLINK_WRAPPER_ENV} -_BLNK_WRAP_PRE_CACHE= ${BUILDLINK_DIR}/bin/.pre-cache -_BLNK_WRAP_POST_CACHE= ${BUILDLINK_DIR}/bin/.post-cache -_BLNK_WRAP_CACHE= ${BUILDLINK_DIR}/bin/.cache -_BLNK_WRAP_LOGIC= ${BUILDLINK_DIR}/bin/.logic -_BLNK_WRAP_POST_CACHE_TRANSFORM= ${BUILDLINK_DIR}/bin/.post-cache-trans -_BLNK_WRAP_CACHE_TRANSFORM= ${BUILDLINK_DIR}/bin/.cache-trans -_BLNK_WRAP_LOGIC_TRANSFORM= ${BUILDLINK_DIR}/bin/.logic-trans -_BLNK_WRAP_SPECIFIC_LOGIC= ${BUILDLINK_DIR}/bin/.std-logic -_BLNK_WRAP_LOG= ${BUILDLINK_DIR}/.wrapper.log -_BLNK_LIBTOOL_FIX_LA= ${BUILDLINK_DIR}/bin/.libtool-fix-la -_BLNK_FAKE_LA= ${BUILDLINK_DIR}/bin/.fake-la -_BLNK_GEN_TRANSFORM= ${BUILDLINK_DIR}/bin/.gen-transform -_BLNK_TRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.transform.sed -_BLNK_UNTRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.untransform.sed +_BLNK_WRAP_SANITIZE_PATH= PATH="${_BLNK_SANITIZED_PATH}" +_BLNK_EMPTY_FILE?= ${BUILDLINK_DIR}/bin/.empty +_BLNK_WRAP_ENV?= ${BUILDLINK_WRAPPER_ENV} +_BLNK_WRAP_PRIVATE_PRE_CACHE= ${BUILDLINK_DIR}/bin/.private-pre-cache +_BLNK_WRAP_PRE_CACHE= ${BUILDLINK_DIR}/bin/.pre-cache +_BLNK_WRAP_CACHE_ADD= ${BUILDLINK_DIR}/bin/.cache-add +_BLNK_WRAP_CACHE= ${BUILDLINK_DIR}/bin/.cache +_BLNK_WRAP_CACHE_ADD_TRANSFORM= ${BUILDLINK_DIR}/bin/.cache-add-trans +_BLNK_WRAP_CACHE_TRANSFORM= ${BUILDLINK_DIR}/bin/.cache-trans +_BLNK_WRAP_POST_CACHE= ${BUILDLINK_DIR}/bin/.post-cache +_BLNK_WRAP_LOGIC= ${BUILDLINK_DIR}/bin/.logic +_BLNK_WRAP_LOGIC_TRANSFORM= ${BUILDLINK_DIR}/bin/.logic-trans +_BLNK_WRAP_LOG= ${BUILDLINK_DIR}/.wrapper.log +_BLNK_LIBTOOL_DO_INSTALL= ${BUILDLINK_DIR}/bin/.libtool-do-install +_BLNK_LIBTOOL_FIX_LA= ${BUILDLINK_DIR}/bin/.libtool-fix-la +_BLNK_FAKE_LA= ${BUILDLINK_DIR}/bin/.fake-la +_BLNK_GEN_TRANSFORM= ${BUILDLINK_DIR}/bin/.gen-transform +_BLNK_TRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.transform.sed +_BLNK_UNTRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.untransform.sed .for _wrappee_ in ${_BLNK_WRAPPEES} # @@ -586,13 +589,16 @@ _BLNK_UNTRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.untransform.sed # _BLNK_WRAPPER_SH.${_wrappee_}= ${.CURDIR}/../../mk/buildlink2/wrapper.sh _BLNK_WRAP_SETENV.${_wrappee_}= ${_wrappee_}="${BUILDLINK_${_wrappee_}:T}" -_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}= ${_BLNK_WRAP_SANITIZE_PATH} -_BLNK_WRAP_ENV.${_wrappee_}= ${_BLNK_WRAP_ENV} -_BLNK_WRAP_PRE_CACHE.${_wrappee_}= ${_BLNK_WRAP_PRE_CACHE} -_BLNK_WRAP_POST_CACHE.${_wrappee_}= ${_BLNK_WRAP_POST_CACHE_TRANSFORM} -_BLNK_WRAP_CACHE.${_wrappee_}= ${_BLNK_WRAP_CACHE_TRANSFORM} -_BLNK_WRAP_LOGIC.${_wrappee_}= ${_BLNK_WRAP_LOGIC_TRANSFORM} -_BLNK_WRAP_SPECIFIC_LOGIC.${_wrappee_}= ${_BLNK_WRAP_SPECIFIC_LOGIC} +_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}= ${_BLNK_WRAP_SANITIZE_PATH} +_BLNK_WRAP_ENV.${_wrappee_}= ${_BLNK_WRAP_ENV} +_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE} +_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}= ${_BLNK_EMPTY_FILE} +_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE} +_BLNK_WRAP_PRIVATE_POST_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE} +_BLNK_WRAP_CACHE_ADD.${_wrappee_}= ${_BLNK_WRAP_CACHE_ADD_TRANSFORM} +_BLNK_WRAP_CACHE.${_wrappee_}= ${_BLNK_WRAP_CACHE_TRANSFORM} +_BLNK_WRAP_LOGIC.${_wrappee_}= ${_BLNK_WRAP_LOGIC_TRANSFORM} +_BLNK_WRAP_POST_LOGIC.${_wrappee_}= ${_BLNK_EMPTY_FILE} .endfor # Don't bother adding AS, CPP to the configure or make environments as @@ -617,8 +623,11 @@ _BLNK_WRAP_SANITIZE_PATH.LIBTOOL= # empty # We need to "unbuildlinkify" any libtool archives. _BLNK_WRAP_LT_UNTRANSFORM_SED= ${_REPLACE_BUILDLINK_SED} -# The ld wrapper script accepts "-Wl,*" arguments. -_BLNK_WRAP_SPECIFIC_LOGIC.LD= ${BUILDLINK_DIR}/bin/.ld-logic +_BLNK_WRAP_PRIVATE_PRE_CACHE.LD= ${_BLNK_WRAP_PRIVATE_PRE_CACHE} +_BLNK_WRAP_PRIVATE_CACHE_ADD.LD= ${BUILDLINK_DIR}/bin/.ld-cache-add +_BLNK_WRAP_PRIVATE_CACHE.LD= ${BUILDLINK_DIR}/bin/.ld-cache +_BLNK_WRAP_PRIVATE_POST_CACHE.LD= ${BUILDLINK_DIR}/bin/.ld-post-cache +_BLNK_WRAP_POST_LOGIC.LD= ${BUILDLINK_DIR}/bin/.ld-logic # Allow BUILDLINK_SETENV.<wrappee> to override _BLNK_WRAP_SETENV.<wrappee>. .for _wrappee_ in ${_BLNK_WRAPPEES} @@ -631,16 +640,12 @@ _BLNK_WRAP_SETENV.${_wrappee_}= ${BUILDLINK_SETENV.${_wrappee_}} # to generate Makefiles, so that imake will find its config files. # .if defined(USE_X11) -_BLNK_WRAP_PRE_CACHE.IMAKE= ${_BLNK_WRAP_PRE_CACHE} -_BLNK_WRAP_POST_CACHE.IMAKE= ${_BLNK_WRAP_POST_CACHE} +_BLNK_WRAP_CACHE_ADD.IMAKE= ${_BLNK_WRAP_CACHE_ADD} _BLNK_WRAP_CACHE.IMAKE= ${_BLNK_WRAP_CACHE} _BLNK_WRAP_LOGIC.IMAKE= ${_BLNK_WRAP_LOGIC} .endif -buildlink-wrappers: ${_BLNK_WRAP_CACHE} -buildlink-wrappers: ${_BLNK_WRAP_CACHE_TRANSFORM} -buildlink-wrappers: ${_BLNK_WRAP_LOGIC} -buildlink-wrappers: ${_BLNK_WRAP_LOGIC_TRANSFORM} +buildlink-wrappers: ${_BLNK_LIBTOOL_DO_INSTALL} buildlink-wrappers: ${_BLNK_LIBTOOL_FIX_LA} buildlink-wrappers: ${_BLNK_FAKE_LA} @@ -654,18 +659,26 @@ BUILDLINK_${_wrappee_}= \ _BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}= \ -e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g" \ -e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g" \ + -e "s|@WRKDIR@|${WRKDIR}|g" \ + -e "s|@WRKSRC@|${WRKSRC}|g" \ -e "s|@CAT@|${CAT:Q}|g" \ -e "s|@ECHO@|${ECHO:Q}|g" \ -e "s|@SED@|${SED:Q}|g" \ -e "s|@TEST@|${TEST:Q}|g" \ -e "s|@TOUCH@|${TOUCH:Q}|g" \ + -e "s|@_BLNK_LIBTOOL_DO_INSTALL@|${_BLNK_LIBTOOL_DO_INSTALL:Q}|g" \ -e "s|@_BLNK_LIBTOOL_FIX_LA@|${_BLNK_LIBTOOL_FIX_LA:Q}|g" \ -e "s|@_BLNK_WRAP_LOG@|${_BLNK_WRAP_LOG:Q}|g" \ - -e "s|@_BLNK_WRAP_PRE_CACHE@|${_BLNK_WRAP_PRE_CACHE.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_POST_CACHE@|${_BLNK_WRAP_POST_CACHE.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_PRIVATE_PRE_CACHE@|${_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_PRIVATE_CACHE_ADD@|${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_PRIVATE_CACHE@|${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_PRIVATE_POST_CACHE@|${_BLNK_WRAP_PRIVATE_POST_CACHE.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_PRE_CACHE@|${_BLNK_WRAP_PRE_CACHE:Q}|g" \ + -e "s|@_BLNK_WRAP_CACHE_ADD@|${_BLNK_WRAP_CACHE_ADD.${_wrappee_}:Q}|g" \ -e "s|@_BLNK_WRAP_CACHE@|${_BLNK_WRAP_CACHE.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_POST_CACHE@|${_BLNK_WRAP_POST_CACHE:Q}|g" \ -e "s|@_BLNK_WRAP_LOGIC@|${_BLNK_WRAP_LOGIC.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_SPECIFIC_LOGIC@|${_BLNK_WRAP_SPECIFIC_LOGIC.${_wrappee_}:Q}|g" \ + -e "s|@_BLNK_WRAP_POST_LOGIC@|${_BLNK_WRAP_POST_LOGIC.${_wrappee_}:Q}|g" \ -e "s|@_BLNK_WRAP_ENV@|${_BLNK_WRAP_ENV.${_wrappee_}:Q}|g" \ -e "s|@_BLNK_WRAP_SANITIZE_PATH@|${_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}:Q}|g" @@ -673,9 +686,10 @@ buildlink-wrappers: ${BUILDLINK_${_wrappee_}} .if !target(${BUILDLINK_${_wrappee_}}) ${BUILDLINK_${_wrappee_}}: \ ${_BLNK_WRAPPER_SH.${_wrappee_}} \ - ${_BLNK_WRAP_PRE_CACHE.${_wrappee_}} \ - ${_BLNK_WRAP_POST_CACHE.${_wrappee_}} \ - ${_BLNK_WRAP_SPECIFIC_LOGIC.${_wrappee_}} + ${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}} \ + ${_BLNK_WRAP_CACHE.${_wrappee_}} \ + ${_BLNK_WRAP_LOGIC.${_wrappee_}} \ + ${_BLNK_WRAP_POST_LOGIC.${_wrappee_}} ${_PKG_SILENT}${_PKG_DEBUG}${ECHO_BUILDLINK_MSG} \ "Creating wrapper: ${.TARGET}" ${_PKG_SILENT}${_PKG_DEBUG} \ @@ -759,70 +773,97 @@ buildlink-${_BLNK_OPSYS}-wrappers: buildlink-wrappers fi .endfor -${_BLNK_WRAP_PRE_CACHE}: ${.CURDIR}/../../mk/buildlink2/pre-cache +${_BLNK_EMPTY_FILE}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@WRKDIR@|${WRKDIR}|g" \ - -e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g" \ - -e "s|@BUILDLINK_X11_DIR@|${BUILDLINK_X11_DIR}|g" \ - ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} -${_BLNK_WRAP_POST_CACHE}: ${.CURDIR}/../../mk/buildlink2/post-cache +${_BLNK_WRAP_PRIVATE_PRE_CACHE}: \ + ${.CURDIR}/../../mk/buildlink2/private-pre-cache ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@LOCALBASE@|${LOCALBASE}|g" \ - -e "s|@X11BASE@|${X11BASE}|g" \ - -e 's|@CAT@|${CAT}|g' \ - -e 's|@ECHO@|${ECHO}|g' \ - -e 's|@_BLNK_TRANSFORM_SED@||g' \ - ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} -${_BLNK_WRAP_POST_CACHE_TRANSFORM}: \ - ${.CURDIR}/../../mk/buildlink2/post-cache \ - ${_BLNK_TRANSFORM_SEDFILE} +.for _wrappee_ in ${_BLNK_WRAPPEES} +. if !target(${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}}) +${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@LOCALBASE@|${LOCALBASE}|g" \ - -e "s|@X11BASE@|${X11BASE}|g" \ - -e 's|@CAT@|${CAT}|g' \ - -e 's|@ECHO@|${ECHO}|g' \ - -e 's|@_BLNK_TRANSFORM_SED@|${_BLNK_TRANSFORM_SED:Q}|g' \ - ${.CURDIR}/../../mk/buildlink2/post-cache > ${.TARGET}.tmp + ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} +. endif +. if !target(${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}}) +${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}}: \ + ${_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}} \ + ${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}} \ + ${_BLNK_WRAP_PRIVATE_POST_CACHE.${_wrappee_}} + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET}.tmp ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} +. endif +.endfor -${_BLNK_WRAP_CACHE}: +${_BLNK_WRAP_PRIVATE_POST_CACHE.LD}: \ + ${.CURDIR}/../../mk/buildlink2/ld-post-cache ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} -${_BLNK_WRAP_CACHE_TRANSFORM}: +${_BLNK_WRAP_PRE_CACHE}: ${.CURDIR}/../../mk/buildlink2/pre-cache + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} + +${_BLNK_WRAP_CACHE_ADD}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} -${_BLNK_WRAP_LOGIC}: \ +${_BLNK_WRAP_CACHE}: \ ${_BLNK_WRAP_PRE_CACHE} \ + ${_BLNK_WRAP_CACHE_ADD} \ ${_BLNK_WRAP_POST_CACHE} ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET}.tmp + ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} -${_BLNK_WRAP_LOGIC_TRANSFORM}: \ +${_BLNK_WRAP_CACHE_ADD_TRANSFORM}: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} + +${_BLNK_WRAP_CACHE_TRANSFORM}: \ ${_BLNK_WRAP_PRE_CACHE} \ - ${_BLNK_WRAP_POST_CACHE_TRANSFORM} + ${_BLNK_WRAP_CACHE_ADD_TRANSFORM} \ + ${_BLNK_WRAP_POST_CACHE} ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET}.tmp + ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} -${_BLNK_WRAP_SPECIFIC_LOGIC}: +${_BLNK_WRAP_POST_CACHE}: ${.CURDIR}/../../mk/buildlink2/post-cache ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} -${_BLNK_WRAP_SPECIFIC_LOGIC.LD}: ${.CURDIR}/../../mk/buildlink2/ld-logic +${_BLNK_WRAP_LOGIC}: ${.CURDIR}/../../mk/buildlink2/logic ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@ECHO@|${ECHO:Q}|g" \ + -e "s|@LOCALBASE@|${LOCALBASE}|g" \ + -e "s|@X11BASE@|${X11BASE}|g" \ + -e 's|@_BLNK_TRANSFORM_SED@||g' \ ${.ALLSRC} > ${.TARGET}.tmp ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} +${_BLNK_WRAP_LOGIC_TRANSFORM}: \ + ${.CURDIR}/../../mk/buildlink2/logic \ + ${_BLNK_TRANSFORM_SEDFILE} + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ + -e "s|@LOCALBASE@|${LOCALBASE}|g" \ + -e "s|@X11BASE@|${X11BASE}|g" \ + -e 's|@_BLNK_TRANSFORM_SED@|${_BLNK_TRANSFORM_SED:Q}|g' \ + ${.CURDIR}/../../mk/buildlink2/logic > ${.TARGET}.tmp + ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} + +${_BLNK_WRAP_POST_LOGIC.LD}: ${.CURDIR}/../../mk/buildlink2/ld-logic + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} + +${_BLNK_LIBTOOL_DO_INSTALL}: ${.CURDIR}/../../mk/buildlink2/libtool-do-install + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} + ${_BLNK_LIBTOOL_FIX_LA}: \ ${.CURDIR}/../../mk/buildlink2/libtool-fix-la \ ${_BLNK_UNTRANSFORM_SEDFILE} @@ -830,15 +871,12 @@ ${_BLNK_LIBTOOL_FIX_LA}: \ ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ -e "s|@WRKSRC@|${WRKSRC}|g" \ -e "s|@BASENAME@|${BASENAME:Q}|g" \ - -e "s|@CAT@|${CAT:Q}|g" \ -e "s|@CP@|${CP:Q}|g" \ -e "s|@DIRNAME@|${DIRNAME:Q}|g" \ - -e "s|@ECHO@|${ECHO:Q}|g" \ -e "s|@EGREP@|${EGREP:Q}|g" \ -e "s|@MV@|${MV:Q}|g" \ -e "s|@RM@|${RM:Q}|g" \ -e "s|@SED@|${SED:Q}|g" \ - -e "s|@TEST@|${TEST:Q}|g" \ -e "s|@TOUCH@|${TOUCH:Q}|g" \ -e 's|@_BLNK_WRAP_LT_UNTRANSFORM_SED@|${_BLNK_WRAP_LT_UNTRANSFORM_SED:Q}|g' \ -e 's|@_BLNK_UNTRANSFORM_SED@|${_BLNK_UNTRANSFORM_SED:Q}|g' \ @@ -889,12 +927,6 @@ ${_BLNK_TRANSFORM_SEDFILE} ${_BLNK_UNTRANSFORM_SEDFILE}: ${_BLNK_GEN_TRANSFORM} ${_PKG_SILENT}${_PKG_DEBUG}${_BLNK_GEN_TRANSFORM} \ ${_BLNK_TRANSFORM} -clear-buildlink-cache: remove-buildlink-cache buildlink-wrappers - -remove-buildlink-cache: - ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${_BLNK_WRAP_CACHE_TRANSFORM} - ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${_BLNK_WRAP_LOGIC_TRANSFORM} - _BLNK_CHECK_PATTERNS+= -e "-I${LOCALBASE}/[a-rt-z]" _BLNK_CHECK_PATTERNS+= -e "-L${LOCALBASE}/[a-rt-z]" _BLNK_CHECK_PATTERNS+= -e "-I${X11BASE}/" diff --git a/mk/buildlink2/ld-logic b/mk/buildlink2/ld-logic index 91c0a998091..f2edf7a6135 100644 --- a/mk/buildlink2/ld-logic +++ b/mk/buildlink2/ld-logic @@ -1,7 +1,8 @@ -# $NetBSD: ld-logic,v 1.2 2002/12/22 19:02:44 jlam Exp $ +# $NetBSD: ld-logic,v 1.3 2002/12/26 17:08:56 jlam Exp $ case $arg in -Wl,*) - arg=`@ECHO@ "X$arg" | $Xsed -e "s|^-Wl,||g" -e "s|,| |g"` + arg=`$echo "X$arg" | $Xsed -e "s|^-Wl,||g" -e "s|,| |g"` + addtoprivatecache=yes ;; esac diff --git a/mk/buildlink2/ld-post-cache b/mk/buildlink2/ld-post-cache new file mode 100644 index 00000000000..356befab748 --- /dev/null +++ b/mk/buildlink2/ld-post-cache @@ -0,0 +1,6 @@ +# $NetBSD: ld-post-cache,v 1.1 2002/12/26 17:08:56 jlam Exp $ + +-Wl,*) + skipcache=yes + ;; +esac diff --git a/mk/buildlink2/libtool-do-install b/mk/buildlink2/libtool-do-install new file mode 100644 index 00000000000..66384509755 --- /dev/null +++ b/mk/buildlink2/libtool-do-install @@ -0,0 +1,17 @@ +# $NetBSD: libtool-do-install,v 1.1 2002/12/26 17:08:56 jlam Exp $ + +cmd="$cmd $arg" +while $test $# -gt 0; do + arg="$1"; shift + case $arg in + *[\`\"\$\\]*) + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + ;; + esac + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + cmd="$cmd $arg" +done diff --git a/mk/buildlink2/libtool-fix-la b/mk/buildlink2/libtool-fix-la index 1ddbabf4ade..7341b89836c 100644 --- a/mk/buildlink2/libtool-fix-la +++ b/mk/buildlink2/libtool-fix-la @@ -1,4 +1,4 @@ -# $NetBSD: libtool-fix-la,v 1.13 2002/12/22 19:02:44 jlam Exp $ +# $NetBSD: libtool-fix-la,v 1.14 2002/12/26 17:08:56 jlam Exp $ # # For *.la files, in the "relink_command" line, we make the following # replacements: @@ -16,7 +16,7 @@ labase=`@BASENAME@ $lafile .la` ladir=`@DIRNAME@ $lafile` latimestamp=${ladir}/.${labase}.la.timestamp laifile=${ladir}/.libs/${labase}.lai -if @TEST@ -f $lafile; then +if $test -f $lafile; then . ${ladir}/${labase}.la deps= @@ -44,7 +44,7 @@ if @TEST@ -f $lafile; then fixla=1 ;; esac - if @TEST@ $fixla -gt 0; then + if $test $fixla -gt 0; then case "$deps" in *"-L$ltlibsdir "*) ;; *"-L$ltlibsdir") ;; @@ -89,7 +89,7 @@ if @TEST@ -f $lafile; then fixla=1 ;; esac - if @TEST@ $fixla -gt 0; then + if $test $fixla -gt 0; then case "$relink" in *"-L$ltlibsdir "*) ;; *"-L$ltlibsdir") ;; @@ -103,33 +103,33 @@ if @TEST@ -f $lafile; then ;; esac done - if @TEST@ -n "$deps" || @TEST@ -n "$relink" && \ + if $test -n "$deps" || $test -n "$relink" && \ ! @EGREP@ "^#.*modified by buildlink2" $lafile >/dev/null 2>&1; then @MV@ -f $lafile ${lafile}.blsav - if @TEST@ -n "$deps"; then + if $test -n "$deps"; then ( - @CAT@ ${lafile}.blsav | @SED@ -e '/^dependency_libs=/,$d' - @ECHO@ "dependency_libs='$deps'" - @CAT@ ${lafile}.blsav | @SED@ -e '1,/^dependency_libs=/d' + $cat ${lafile}.blsav | @SED@ -e '/^dependency_libs=/,$d' + $echo "dependency_libs='$deps'" + $cat ${lafile}.blsav | @SED@ -e '1,/^dependency_libs=/d' ) > ${lafile}.tmp else - @CAT@ ${lafile}.blsav > ${lafile}.tmp + $cat ${lafile}.blsav > ${lafile}.tmp fi - if @TEST@ -n "$relink"; then + if $test -n "$relink"; then ( - @CAT@ ${lafile}.tmp | @SED@ -e '/^relink_command=/,$d' - @ECHO@ "relink_command='$relink'" - @CAT@ ${lafile}.tmp | @SED@ -e '1,/^relink_command=/d' + $cat ${lafile}.tmp | @SED@ -e '/^relink_command=/,$d' + $echo "relink_command='$relink'" + $cat ${lafile}.tmp | @SED@ -e '1,/^relink_command=/d' ) > $lafile else - @CAT@ ${lafile}.tmp > $lafile + $cat ${lafile}.tmp > $lafile fi - @ECHO@ >> $lafile - @ECHO@ "# This file has been modified by buildlink2." >> $lafile + $echo >> $lafile + $echo "# This file has been modified by buildlink2." >> $lafile @RM@ ${lafile}.tmp - @ECHO@ "==> Fixed $lafile" >> $wrapperlog + $echo "==> Fixed $lafile" >> $wrapperlog fi - if @TEST@ -n "$laifile" && @TEST@ -f "$laifile" && \ + if $test -n "$laifile" && $test -f "$laifile" && \ ! @EGREP@ "^#.*modified by buildlink2" $laifile >/dev/null 2>&1; then @SED@ @_BLNK_WRAP_LT_UNTRANSFORM_SED@ \ @_BLNK_UNTRANSFORM_SED@ \ @@ -163,19 +163,19 @@ if @TEST@ -f $lafile; then esac prev="$i" done - if @TEST@ -z "$lexist"; then + if $test -z "$lexist"; then L= fi deps="$L$l" @MV@ -f $laifile ${laifile}.blsav ( - @CAT@ ${laifile}.tmp | @SED@ -e '/^dependency_libs=/,$d' - @ECHO@ "dependency_libs='$deps'" - @CAT@ ${laifile}.tmp | @SED@ -e '1,/^dependency_libs=/d' - @ECHO@ - @ECHO@ "# This file has been modified by buildlink2." + $cat ${laifile}.tmp | @SED@ -e '/^dependency_libs=/,$d' + $echo "dependency_libs='$deps'" + $cat ${laifile}.tmp | @SED@ -e '1,/^dependency_libs=/d' + $echo + $echo "# This file has been modified by buildlink2." ) > ${laifile} @RM@ -f ${laifile}.tmp - @ECHO@ "==> Fixed $laifile" >> $wrapperlog + $echo "==> Fixed $laifile" >> $wrapperlog fi fi diff --git a/mk/buildlink2/libtool.sh b/mk/buildlink2/libtool.sh index a005bb62216..1e5b20e76fa 100644 --- a/mk/buildlink2/libtool.sh +++ b/mk/buildlink2/libtool.sh @@ -1,30 +1,47 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: libtool.sh,v 1.7 2002/12/22 19:02:44 jlam Exp $ +# $NetBSD: libtool.sh,v 1.8 2002/12/26 17:08:57 jlam Exp $ Xsed='@SED@ -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' +private_pre_cache="@_BLNK_WRAP_PRIVATE_PRE_CACHE@" +private_cache_add="@_BLNK_WRAP_PRIVATE_CACHE_ADD@" +private_cache="@_BLNK_WRAP_PRIVATE_CACHE@" +private_post_cache="@_BLNK_WRAP_PRIVATE_POST_CACHE@" pre_cache="@_BLNK_WRAP_PRE_CACHE@" +cache_add="@_BLNK_WRAP_CACHE_ADD@" cache="@_BLNK_WRAP_CACHE@" post_cache="@_BLNK_WRAP_POST_CACHE@" logic="@_BLNK_WRAP_LOGIC@" -specificlogic="@_BLNK_WRAP_SPECIFIC_LOGIC@" -libtool_fix_la="@_BLNK_LIBTOOL_FIX_LA@" +post_logic="@_BLNK_WRAP_POST_LOGIC@" wrapperlog="@_BLNK_WRAP_LOG@" + +libtool_fix_la="@_BLNK_LIBTOOL_FIX_LA@" +libtool_do_install="@_BLNK_LIBTOOL_DO_INSTALL@" +fixlibpath=${BUILDLINK_FIX_IMPROPER_LIBTOOL_LIBPATH-yes} + updatecache=${BUILDLINK_UPDATE_CACHE-yes} cacheall=${BUILDLINK_CACHE_ALL-no} +cat="@CAT@" +echo="@ECHO@" +test="@TEST@" + +BUILDLINK_DIR="@BUILDLINK_DIR@" +BUILDLINK_X11_DIR="@BUILDLINK_X11_DIR@" +WRKDIR="@WRKDIR@" +WRKSRC="@WRKSRC@" + cmd="@WRAPPEE@" lafile= -doinstall= case "$1" in *install|*cp|*install-sh|*install.sh) arg="$1"; shift - doinstall=yes + . $libtool_do_install ;; *) - while @TEST@ $# -gt 0; do + while $test $# -gt 0; do arg="$1"; shift case $arg in --fix-la) @@ -37,9 +54,9 @@ case "$1" in esac ;; --mode|--mode=install) - if @TEST@ "$arg" = "--mode=install" || \ - @TEST@ "$arg" = "--mode" -a "$1" = "install"; then - doinstall=yes + if $test "$arg" = "--mode=install" || \ + $test "$arg" = "--mode" -a "$1" = "install"; then + . $libtool_do_install break fi ;; @@ -49,44 +66,30 @@ case "$1" in esac ;; *) - cacheupdated= - . $logic - case "$cacheupdated" in - yes) @CAT@ $pre_cache $cache $post_cache > $logic ;; + cachehit=no + skipcache=no + . $private_cache + case $skipcache,$cachehit in + no,no) . $cache ;; + esac + case $cachehit in + no) . $logic ;; esac ;; esac - . $specificlogic cmd="$cmd $arg" done ;; esac -if @TEST@ -n "$doinstall"; then - cmd="$cmd $arg" - while @TEST@ $# -gt 0; do - arg="$1"; shift - case $arg in - *[\`\"\$\\]*) - arg=`@ECHO@ "X$arg" | $Xsed -e "$sed_quote_subst"` - ;; - esac - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - cmd="$cmd $arg" - done -fi @_BLNK_WRAP_ENV@ @_BLNK_WRAP_SANITIZE_PATH@ -@ECHO@ $cmd >> $wrapperlog +$echo $cmd >> $wrapperlog eval $cmd wrapper_result=$? -if @TEST@ -n "$lafile" && @TEST@ -f "$lafile"; then +if $test -n "$lafile" && $test -f "$lafile"; then . $libtool_fix_la fi diff --git a/mk/buildlink2/logic b/mk/buildlink2/logic new file mode 100644 index 00000000000..a3b5aecef82 --- /dev/null +++ b/mk/buildlink2/logic @@ -0,0 +1,75 @@ +# $NetBSD: logic,v 1.1 2002/12/26 17:08:57 jlam Exp $ + +quotedarg=no +addtocache=no +addtoprivatecache=no +cachesettings='arg="$cachearg"; cachehit=yes' + +# $qarg contains a correctly-quoted $arg +case $arg in +*[\`\"\$\\]*) + qarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + quotedarg=yes + ;; +*) + qarg="$arg" + ;; +esac +case $qarg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg="\"$qarg\"" + quotedarg=yes + ;; +esac +searcharg="$qarg" + +case $arg in +-D*) + arg="$qarg" + addtocache=yes + ;; + -[ILRl]*|-Wl,*|/usr/lib/lib*|@LOCALBASE@/*/lib*|@X11BASE@/*/lib*) + arg=`$echo "X$qarg" | $Xsed @_BLNK_TRANSFORM_SED@` + addtocache=yes + ;; +*) + arg="$qarg" + addtocache=no + ;; +esac + +. $post_logic + +case $updatecache,$addtocache,$cacheall,$quotedarg in +yes,yes,yes,*|yes,yes,no,no) + case $arg in + *[\`\"\$\\]*) + cachearg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + ;; + *) + cachearg="$arg" + ;; + esac + case $addtoprivatecache in + yes) + pre_cachefile=$private_pre_cache + cachefile_add=$private_cache_add + cachefile=$private_cache + post_cachefile=$private_post_cache + ;; + *) + pre_cachefile=$pre_cache + cachefile_add=$cache_add + cachefile=$cache + post_cachefile=$post_cache + ;; + esac + $cat >> $cachefile_add << EOF +$searcharg) + cachearg="$cachearg" + $cachesettings + ;; +EOF + $cat $pre_cachefile $cachefile_add $post_cachefile > $cachefile + ;; +esac diff --git a/mk/buildlink2/post-cache b/mk/buildlink2/post-cache index 64e455b33b2..2c8370b4d72 100644 --- a/mk/buildlink2/post-cache +++ b/mk/buildlink2/post-cache @@ -1,55 +1,4 @@ -# $NetBSD: post-cache,v 1.8 2002/12/22 19:02:44 jlam Exp $ +# $NetBSD: post-cache,v 1.9 2002/12/26 17:08:57 jlam Exp $ -*) - # $qarg contains a correctly-quoted $arg - case $arg in - *[\`\"\$\\]*) - qarg=`@ECHO@ "X$arg" | $Xsed -e "$sed_quote_subst"` - quotedarg=yes - ;; - *) - qarg="$arg" - ;; - esac - case $qarg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg="\"$qarg\"" - quotedarg=yes - ;; - esac - searcharg="$qarg" - - case $arg in - -D*) - arg="$qarg" - addtocache=yes - ;; - -[ILRl]*|-Wl,*|/usr/lib/lib*|@LOCALBASE@/*/lib*|@X11BASE@/*/lib*) - arg=`@ECHO@ "X$qarg" | $Xsed @_BLNK_TRANSFORM_SED@` - addtocache=yes - ;; - *) - arg="$qarg" - addtocache=no - ;; - esac - case $updatecache,$addtocache,$cacheall,$quotedarg in - yes,yes,yes,*|yes,yes,no,no) - case $arg in - *[\`\"\$\\]*) - cachearg=`@ECHO@ "X$arg" | $Xsed -e "$sed_quote_subst"` - ;; - *) - cachearg="$arg" - ;; - esac - @CAT@ >> $cache << EOF -$searcharg) - arg="$cachearg" - ;; -EOF - cacheupdated=yes - ;; - esac - ;; +*) ;; esac diff --git a/mk/buildlink2/pre-cache b/mk/buildlink2/pre-cache index 0247abdc193..553dbcbf71c 100644 --- a/mk/buildlink2/pre-cache +++ b/mk/buildlink2/pre-cache @@ -1,10 +1,9 @@ -# $NetBSD: pre-cache,v 1.6 2002/12/22 19:02:45 jlam Exp $ - -quotedarg=no -addtocache=no +# $NetBSD: pre-cache,v 1.7 2002/12/26 17:08:57 jlam Exp $ case $arg in --[IL]@WRKDIR@*|-[IL]@BUILDLINK_DIR@*|-[IL]@BUILDLINK_X11_DIR@*) +-[IL]${WRKDIR}*|-[IL]${BUILDLINK_DIR}*|-[IL]${BUILDLINK_X11_DIR}*) + cachehit=yes ;; -[IL].|-[IL]./*|-[IL]..*) + cachehit=yes ;; diff --git a/mk/buildlink2/private-pre-cache b/mk/buildlink2/private-pre-cache new file mode 100644 index 00000000000..1f0f65a08d3 --- /dev/null +++ b/mk/buildlink2/private-pre-cache @@ -0,0 +1,3 @@ +# $NetBSD: private-pre-cache,v 1.1 2002/12/26 17:08:57 jlam Exp $ + +case $arg in diff --git a/mk/buildlink2/wrapper.sh b/mk/buildlink2/wrapper.sh index e1f02a3f634..1d8323bf3cb 100644 --- a/mk/buildlink2/wrapper.sh +++ b/mk/buildlink2/wrapper.sh @@ -1,32 +1,50 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: wrapper.sh,v 1.5 2002/12/22 19:02:45 jlam Exp $ +# $NetBSD: wrapper.sh,v 1.6 2002/12/26 17:08:57 jlam Exp $ Xsed='@SED@ -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' +private_pre_cache="@_BLNK_WRAP_PRIVATE_PRE_CACHE@" +private_cache_add="@_BLNK_WRAP_PRIVATE_CACHE_ADD@" +private_cache="@_BLNK_WRAP_PRIVATE_CACHE@" +private_post_cache="@_BLNK_WRAP_PRIVATE_POST_CACHE@" pre_cache="@_BLNK_WRAP_PRE_CACHE@" +cache_add="@_BLNK_WRAP_CACHE_ADD@" cache="@_BLNK_WRAP_CACHE@" post_cache="@_BLNK_WRAP_POST_CACHE@" logic="@_BLNK_WRAP_LOGIC@" -specificlogic="@_BLNK_WRAP_SPECIFIC_LOGIC@" +post_logic="@_BLNK_WRAP_POST_LOGIC@" wrapperlog="@_BLNK_WRAP_LOG@" + updatecache=${BUILDLINK_UPDATE_CACHE-yes} cacheall=${BUILDLINK_CACHE_ALL-no} +cat="@CAT@" +echo="@ECHO@" +test="@TEST@" + +BUILDLINK_DIR="@BUILDLINK_DIR@" +BUILDLINK_X11_DIR="@BUILDLINK_X11_DIR@" +WRKDIR="@WRKDIR@" +WRKSRC="@WRKSRC@" + cmd="@WRAPPEE@" for arg do - cacheupdated=no - . $logic - case "$cacheupdated" in - yes) @CAT@ $pre_cache $cache $post_cache > $logic ;; + cachehit=no + skipcache=no + . $private_cache + case $skipcache,$cachehit in + no,no) . $cache ;; + esac + case $cachehit in + no) . $logic ;; esac - . $specificlogic cmd="$cmd $arg" done @_BLNK_WRAP_ENV@ @_BLNK_WRAP_SANITIZE_PATH@ -@ECHO@ $cmd >> $wrapperlog +$echo $cmd >> $wrapperlog eval exec $cmd |