Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Set .MAKE.OS to utsname.sysname so we can tell ...



details:   https://anonhg.NetBSD.org/src/rev/164956eafd94
branches:  trunk
changeset: 784973:164956eafd94
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 16 02:11:11 2013 +0000

description:
Set .MAKE.OS to utsname.sysname so we can tell bogus OS's apart early in
the build process.

diffstat:

 usr.bin/make/main.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 633cb0c8b83d -r 164956eafd94 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Fri Feb 15 23:56:32 2013 +0000
+++ b/usr.bin/make/main.c       Sat Feb 16 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $      */
+/*     $NetBSD: main.c,v 1.206 2013/02/16 02:11:11 christos Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.206 2013/02/16 02:11:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.206 2013/02/16 02:11:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -817,6 +817,12 @@
        }
 #endif
 
+       if (uname(&utsname) == -1) {
+           (void)fprintf(stderr, "%s: uname failed (%s).\n", progname,
+               strerror(errno));
+           exit(2);
+       }
+
        /*
         * Get the name of this type of MACHINE from utsname
         * so we can share an executable for similar machines.
@@ -827,11 +833,6 @@
         */
        if (!machine) {
 #ifdef MAKE_NATIVE
-           if (uname(&utsname) == -1) {
-               (void)fprintf(stderr, "%s: uname failed (%s).\n", progname,
-                   strerror(errno));
-               exit(2);
-           }
            machine = utsname.machine;
 #else
 #ifdef MAKE_MACHINE
@@ -861,6 +862,7 @@
         */
        Var_Init();             /* Initialize the lists of variables for
                                 * parsing arguments */
+       Var_Set(".MAKE.OS", utsname.sysname, VAR_GLOBAL, 0);
        Var_Set("MACHINE", machine, VAR_GLOBAL, 0);
        Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL, 0);
 #ifdef MAKE_VERSION



Home | Main Index | Thread Index | Old Index