Create private variables _TCLCONFIG_SED and _TKCONFIG_SED that hold the

sed expression used to convert tclConfig.sh and tkConfig.sh into forms
usable by buildlink.
This commit is contained in:
jlam 2001-10-23 13:02:11 +00:00
parent c93d2988cf
commit 936b41aaa1
2 changed files with 23 additions and 10 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink.mk,v 1.6 2001/07/27 13:33:32 jlam Exp $
# $NetBSD: buildlink.mk,v 1.7 2001/10/23 13:02:11 jlam Exp $
#
# This Makefile fragment is included by packages that use tcl.
#
@ -35,16 +35,22 @@ BUILDLINK_TARGETS+= ${BUILDLINK_TARGETS.tcl}
pre-configure: ${BUILDLINK_TARGETS.tcl}
tcl-buildlink: _BUILDLINK_USE
_TCLCONFIG_SED= \
-e "/^TCL_PREFIX/s|${BUILDLINK_PREFIX.tcl}|${BUILDLINK_DIR}|g"
_TCLCONFIG_SED+= \
-e "s|-L${BUILDLINK_PREFIX.tcl}/lib|-L${BUILDLINK_DIR}/lib|g"
_TCLCONFIG_SED+= \
-e "s|${BUILDLINK_PREFIX.tcl}/lib/libtclstub|${BUILDLINK_DIR}/lib/libtclstub|g"
tclConfig-buildlink:
${_PKG_SILENT}${_PKG_DEBUG} \
cookie=${BUILDLINK_DIR}/.tclConfig_buildlink_done; \
if [ ! -f $${cookie} ]; then \
file=lib/tclConfig.sh; \
${ECHO_MSG} "Creating script ${BUILDLINK_DIR}/$${file}."; \
${SED} -e "/^TCL_PREFIX/s|${BUILDLINK_PREFIX.tcl}|${BUILDLINK_DIR}|g" \
-e "s|-L${BUILDLINK_PREFIX.tcl}/lib|-L${BUILDLINK_DIR}/lib|g" \
-e "s|${BUILDLINK_PREFIX.tcl}/lib/libtclstub|${BUILDLINK_DIR}/lib/libtclstub|g" \
${BUILDLINK_PREFIX.tcl}/$${file} > ${BUILDLINK_DIR}/$${file}; \
${SED} ${_TCLCONFIG_SED} \
${BUILDLINK_PREFIX.tcl}/$${file} \
> ${BUILDLINK_DIR}/$${file}; \
${CHMOD} +x ${BUILDLINK_DIR}/$${file}; \
${ECHO} ${BUILDLINK_PREFIX.tcl}/$${file} >> $${cookie}; \
fi

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink.mk,v 1.6 2001/07/27 13:33:39 jlam Exp $
# $NetBSD: buildlink.mk,v 1.7 2001/10/23 13:02:11 jlam Exp $
#
# This Makefile fragment is included by packages that use tk.
#
@ -39,16 +39,23 @@ BUILDLINK_TARGETS+= ${BUILDLINK_TARGETS.tk}
pre-configure: ${BUILDLINK_TARGETS.tk}
tk-buildlink: _BUILDLINK_USE
_TKCONFIG_SED= -e "/^TK_PREFIX/s|${BUILDLINK_PREFIX.tcl}|${BUILDLINK_DIR}|g"
_TKCONFIG_SED+= -e "s|-L${BUILDLINK_PREFIX.tk}/lib|-L${BUILDLINK_DIR}/lib|g"
_TKCONFIG_SED+= -e "s|${BUILDLINK_PREFIX.tk}/lib/libtkstub|-L${BUILDLINK_DIR}/lib/libtkstub|g"
.if defined(X11_BUILDLINK_MK)
_TKCONFIG_SED+= -e "s|-I${X11BASE}/|-I${BUILDLINK_X11_DIR}/|g"
_TKCONFIG_SED+= -e "s|-L${X11BASE}/|-L${BUILDLINK_X11_DIR}/|g"
.endif
tkConfig-buildlink:
${_PKG_SILENT}${_PKG_DEBUG} \
cookie=${BUILDLINK_DIR}/.tkConfig_buildlink_done; \
if [ ! -f $${cookie} ]; then \
file=lib/tkConfig.sh; \
${ECHO_MSG} "Creating script ${BUILDLINK_DIR}/$${file}."; \
${SED} -e "/^TK_PREFIX/s|${BUILDLINK_PREFIX.tcl}|${BUILDLINK_DIR}|g" \
-e "s|-L${BUILDLINK_PREFIX.tk}/lib|-L${BUILDLINK_DIR}/lib|g" \
-e "s|${BUILDLINK_PREFIX.tk}/lib/libtkstub|-L${BUILDLINK_DIR}/lib/libtkstub|g" \
${BUILDLINK_PREFIX.tk}/$${file} > ${BUILDLINK_DIR}/$${file}; \
${SED} ${_TKCONFIG_SED} \
${BUILDLINK_PREFIX.tk}/$${file} \
> ${BUILDLINK_DIR}/$${file}; \
${CHMOD} +x ${BUILDLINK_DIR}/$${file}; \
${ECHO} ${BUILDLINK_PREFIX.tk}/$${file} >> $${cookie}; \
${TOUCH} ${TOUCH_FLAGS} $${cookie}; \