Source-Changes-HG archive

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

[src/netbsd-7]: src Pull up following revision(s) (requested by apb in ticket...



details:   https://anonhg.NetBSD.org/src/rev/57852d8dc9bb
branches:  netbsd-7
changeset: 798256:57852d8dc9bb
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Aug 15 23:59:24 2014 +0000

description:
Pull up following revision(s) (requested by apb in ticket #27):
        build.sh: revision 1.295
Only the -m command line option, not MACHINE from the environment,
is supposed override MACHINE_ARCH from the environment with the
default MACHINE_ARCH for the requested machine.
Add and use an opt_m variable to enforce this.

diffstat:

 build.sh |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r ac66a5ccc26c -r 57852d8dc9bb build.sh
--- a/build.sh  Fri Aug 15 23:57:51 2014 +0000
+++ b/build.sh  Fri Aug 15 23:59:24 2014 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#      $NetBSD: build.sh,v 1.294 2014/08/10 05:56:36 matt Exp $
+#      $NetBSD: build.sh,v 1.294.2.1 2014/08/15 23:59:24 riz Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1100,6 +1100,7 @@
 {
        opts='a:B:C:D:Ehj:M:m:N:nO:oR:rS:T:UuV:w:X:xY:yZ:'
        opt_a=false
+       opt_m=false
 
        if type getopts >/dev/null 2>&1; then
                # Use POSIX getopts.
@@ -1177,6 +1178,7 @@
                -m)
                        eval ${optargcmd}
                        MACHINE="${OPTARG}"
+                       opt_m=true
                        ;;
 
                -N)
@@ -1372,16 +1374,17 @@
 
        # Set up MACHINE*.  On a NetBSD host, these are allowed to be unset.
        #
-       # MACHINE_ARCH from the environment may be overridden by getarch
-       # (based on the MACHINE), but MACHINE_ARCH from the -a option should
-       # not be overridden.
-       #
        if [ -z "${MACHINE}" ]; then
                [ "${uname_s}" = "NetBSD" ] ||
                    bomb "MACHINE must be set, or -m must be used, for cross builds."
                MACHINE=${uname_m}
        fi
-       $opt_a || getarch
+       if $opt_m && ! $opt_a; then
+               # Settings implied by the command line -m option
+               # override MACHINE_ARCH from the environment (if any).
+               getarch
+       fi
+       [ -n "${MACHINE_ARCH}" ] || getarch
        validatearch
 
        # Set up default make(1) environment.
@@ -1864,7 +1867,7 @@
        eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.294 2014/08/10 05:56:36 matt Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.294.2.1 2014/08/15 23:59:24 riz Exp $
 # with these arguments: ${_args}
 #
 



Home | Main Index | Thread Index | Old Index