Source-Changes-HG archive

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

[src/trunk]: src/distrib/sets Convert make variables ${_MKVARS.yes} / ${_MKVA...



details:   https://anonhg.NetBSD.org/src/rev/e1bc430fc161
branches:  trunk
changeset: 749573:e1bc430fc161
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Wed Dec 02 17:51:30 2009 +0000

description:
Convert make variables ${_MKVARS.yes} / ${_MKVARS.no} to environments
${_MKVARS_yes} / ${_MKVARS_no} to make sure assignments done right both in
make and shell.

Extract important make variables not listed in ${_MKVARS.*}.

diffstat:

 distrib/sets/sets.subr |  31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diffs (86 lines):

diff -r 799e49651760 -r e1bc430fc161 distrib/sets/sets.subr
--- a/distrib/sets/sets.subr    Wed Dec 02 17:18:59 2009 +0000
+++ b/distrib/sets/sets.subr    Wed Dec 02 17:51:30 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: sets.subr,v 1.99 2009/12/02 15:52:14 apb Exp $
+#      $NetBSD: sets.subr,v 1.100 2009/12/02 17:51:30 uebayasi Exp $
 #
 
 #
@@ -27,6 +27,10 @@
 # XXX don't hardcode
 MKEXTRAVARS="\
        EXTSRCS         \
+       MKBFD           \
+       MKCOMPAT        \
+       MKDYNAMICROOT   \
+       MKMANPAGES      \
        USE_INET6       \
        USE_KERBEROS    \
        USE_LDAP        \
@@ -125,15 +129,19 @@
 oIFS=$IFS
 IFS="
 "
-for i in _MKVARS.yes _MKVARS.no; do
-       eval $(
-${MAKE} -B -f- all <<EOMAKE
+
+for x in $(
+       ${MAKE} -B -f- all <<EOMAKE
 .include <bsd.own.mk>
 all:
-       @echo "export _MKVARS_${i#*.}=\"\${$i}\""
+       @echo "export _MKVARS_yes=\"\${_MKVARS.yes}\""
+       @echo "export _MKVARS_no=\"\${_MKVARS.no}\""
+
 EOMAKE
-)
+); do
+       eval $x
 done
+
 for x in $(
 ${MAKE} -B -f- all <<EOMAKE
 .include <bsd.own.mk>
@@ -153,17 +161,20 @@
 all:
 .for i in MACHINE MACHINE_ARCH MACHINE_CPU \
                HAVE_BINUTILS HAVE_GCC HAVE_GDB OBJECT_FMT TOOLCHAIN_MISSING \
-               ${MKEXTRAVARS} \${_MKVARS.yes} \${_MKVARS.no}
+               ${MKEXTRAVARS} ${_MKVARS_yes} ${_MKVARS_no}
        @echo "export \$i=\"\${\$i}\""
 .endfor
 
 EOMAKE
 ); do
-#      echo 1>&2 "DEBUG: read $x"
+       echo 1>&2 "DEBUG: read $x"
        eval $x
 done
+
 IFS=$oIFS
 
+MKVARS="$MKEXTRAVARS $_MKVARS_yes $_MKVARS_no"
+
 setsdir=${0%/*}
 obsolete=0
 module=yes
@@ -207,7 +218,7 @@
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-#      # $NetBSD: sets.subr,v 1.99 2009/12/02 15:52:14 apb Exp $
+#      # $NetBSD: sets.subr,v 1.100 2009/12/02 17:51:30 uebayasi Exp $
 #      .                       base-sys-root   [keyword[,...]]
 #      ./altroot               base-sys-root
 #      ./bin                   base-sys-root
@@ -308,7 +319,7 @@
                        if (obsolete)
                                wanted["obsolete"] = 1
                
-                       split("'"${MKEXTRAVARS} ${_MKVARS_yes} ${_MKVARS_no}"'", needvars)
+                       split("'"${MKVARS}"'", needvars)
                        for (vi in needvars) {
                                nv = needvars[vi]
                                kw = tolower(nv)



Home | Main Index | Thread Index | Old Index