pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Instead of saving all of the buildlink3 ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3911faba45a0
branches:  trunk
changeset: 471553:3911faba45a0
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Mar 29 05:21:17 2004 +0000

description:
Instead of saving all of the buildlink3 variables into the command-line
environment, it creates a Makefile fragment that is included within
bsd.buildlink3.mk that contains all of the buildlink3 variable
definitions that we want to pass to make(1) invocations on the same
package Makefile.  Change the make variables that are only relevant
for the current package to use BUILDLINK_VARS instead of MAKEFLAGS.
This avoids overflowing the command line with lots of extra arguments.

diffstat:

 mk/buildlink3/bsd.buildlink3.mk |  34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diffs (80 lines):

diff -r e1359c3dcd65 -r 3911faba45a0 mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Mon Mar 29 05:19:47 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Mon Mar 29 05:21:17 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.129 2004/03/28 22:25:35 xtraeme Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.130 2004/03/29 05:21:17 jlam Exp $
 #
 # An example package buildlink3.mk file:
 #
@@ -53,6 +53,11 @@
 BUILDLINK_X11_DIR=     ${BUILDLINK_DIR:H}/.x11-buildlink
 BUILDLINK_SHELL?=      ${SH}
 BUILDLINK_OPSYS?=      ${OPSYS}
+_BLNK_VARS_MK=         ${BUILDLINK_DIR}/vars.mk
+
+.if exists(${_BLNK_VARS_MK})
+.  include "${_BLNK_VARS_MK}"
+.endif
 
 # Prepend ${BUILDLINK_DIR}/bin to the PATH so that the wrappers are found
 # first when searching for executables.
@@ -309,7 +314,7 @@
 .      endif
 .    endfor
 .    if empty(_BLNK_PKG_DBDIR.${_pkg_}:M*not_found)
-MAKEFLAGS+=    _BLNK_PKG_DBDIR.${_pkg_}=${_BLNK_PKG_DBDIR.${_pkg_}}
+BUILDLINK_VARS+=       _BLNK_PKG_DBDIR.${_pkg_}
 .    endif
 .  endif
 
@@ -340,7 +345,7 @@
 .      endif
 .    endif
 .    if empty(BUILDLINK_PREFIX.${_pkg_}:M*not_found)
-MAKEFLAGS+=    BUILDLINK_PREFIX.${_pkg_}=${BUILDLINK_PREFIX.${_pkg_}}
+BUILDLINK_VARS+=       BUILDLINK_PREFIX.${_pkg_}
 .    endif
 .  endif
 
@@ -500,6 +505,11 @@
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${BUILDLINK_DIR}/include
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${BUILDLINK_DIR}/lib
 
+# Create the saved variables Makefile fragment to pass variables through
+# to sub-make processes invoked on the same Makefile.
+#
+do-buildlink: ${_BLNK_VARS_MK}
+
 # Create the buildlink wrappers before any of the other buildlink targets
 # are run, as the wrappers may need to be used in some of those targets.
 #
@@ -850,7 +860,7 @@
        else                                                            \
                ${ECHO} ${${_var_}};                                    \
        fi
-MAKEFLAGS+=    _BLNK_PHYSICAL_PATH.${_var_}=${_BLNK_PHYSICAL_PATH.${_var_}:Q}
+BUILDLINK_VARS+=       _BLNK_PHYSICAL_PATH.${_var_}
 .  endif
 .endfor
 
@@ -1742,3 +1752,19 @@
        ${_PKG_SILENT}${_PKG_DEBUG}${_BLNK_GEN_TRANSFORM}               \
                ${_BLNK_TRANSFORM}
 .endif # BUILDLINK_PHASES
+
+.PHONY: buildlink-vars-mk
+buildlink-vars-mk: ${_BLNK_VARS_MK}
+${_BLNK_VARS_MK}:
+       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+       ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET}.tmp
+.for _var_ in ${BUILDLINK_VARS}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       ${ECHO} "${_var_}=      ${${_var_}}" >> ${.TARGET}.tmp
+.endfor
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       if [ -f ${.TARGET}.tmp ]; then                                  \
+               ${SORT} -u ${.TARGET}.tmp > ${.TARGET};                 \
+               ${RM} -f ${.TARGET}.tmp;                                \
+       fi 
+       ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET}



Home | Main Index | Thread Index | Old Index