[BACK]Return to main.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/main.c between version 1.11 and 1.12

version 1.11, 1997/01/27 05:24:09 version 1.12, 1997/04/01 07:28:13
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*      $NetBSD: main.c,v 1.31 1996/11/06 17:59:12 christos Exp $       */  /*      $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $    */
   
 /*  /*
  * Copyright (c) 1988, 1989, 1990, 1993   * Copyright (c) 1988, 1989, 1990, 1993
Line 86 
Line 86 
 #include <sys/resource.h>  #include <sys/resource.h>
 #include <sys/signal.h>  #include <sys/signal.h>
 #include <sys/stat.h>  #include <sys/stat.h>
 #ifndef MACHINE  #ifndef MAKE_BOOTSTRAP
 #include <sys/utsname.h>  #include <sys/utsname.h>
 #endif  #endif
 #include <sys/wait.h>  #include <sys/wait.h>
 #include <errno.h>  #include <errno.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <stdio.h>  #include <stdio.h>
 #if __STDC__  #include <stdlib.h>
   #ifdef __STDC__
 #include <stdarg.h>  #include <stdarg.h>
 #else  #else
 #include <varargs.h>  #include <varargs.h>
Line 444 
Line 445 
         char obpath[MAXPATHLEN + 1];          char obpath[MAXPATHLEN + 1];
         char cdpath[MAXPATHLEN + 1];          char cdpath[MAXPATHLEN + 1];
         char *machine = getenv("MACHINE");          char *machine = getenv("MACHINE");
           char *machine_arch = getenv("MACHINE_ARCH");
         Lst sysMkPath;                  /* Path of sys.mk */          Lst sysMkPath;                  /* Path of sys.mk */
         char *cp = NULL, *start;          char *cp = NULL, *start;
                                         /* avoid faults on read-only strings */                                          /* avoid faults on read-only strings */
Line 490 
Line 492 
          * so we can share an executable for similar machines.           * so we can share an executable for similar machines.
          * (i.e. m68k: amiga hp300, mac68k, sun3, ...)           * (i.e. m68k: amiga hp300, mac68k, sun3, ...)
          *           *
          * Note that both MACHINE and MACHINE_ARCH can be overridden           * Note that both MACHINE and MACHINE_ARCH are decided at
          * by environment variables.  MACHINE through the getenv()           * run-time.
          * above and MACHINE_ARCH, below.  
          */           */
         if (!machine) {          if (!machine) {
 #ifndef MACHINE  #ifndef MAKE_BOOTSTRAP
             struct utsname utsname;              struct utsname utsname;
   
             if (uname(&utsname) == -1) {              if (uname(&utsname) == -1) {
Line 508 
Line 509 
 #endif  #endif
         }          }
   
           if (!machine_arch) {
   #ifndef MACHINE_ARCH
               machine_arch = "unknown";   /* XXX: no uname -p yet */
   #else
               machine_arch = MACHINE_ARCH;
   #endif
           }
   
         /*          /*
          * If the MAKEOBJDIR (or by default, the _PATH_OBJDIR) directory           * If the MAKEOBJDIR (or by default, the _PATH_OBJDIR) directory
          * exists, change into it and build there.  (If a .${MACHINE} suffix           * exists, change into it and build there.  (If a .${MACHINE} suffix
Line 599 
Line 608 
         Var_Set(MAKEFLAGS, "", VAR_GLOBAL);          Var_Set(MAKEFLAGS, "", VAR_GLOBAL);
         Var_Set("MFLAGS", "", VAR_GLOBAL);          Var_Set("MFLAGS", "", VAR_GLOBAL);
         Var_Set("MACHINE", machine, VAR_GLOBAL);          Var_Set("MACHINE", machine, VAR_GLOBAL);
 #ifdef MACHINE_ARCH          Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL);
         if (NULL == getenv("MACHINE_ARCH")) {  
                 Var_Set("MACHINE_ARCH", MACHINE_ARCH, VAR_GLOBAL);  
         }  
 #endif  
   
         /*          /*
          * First snag any flags out of the MAKE environment variable.           * First snag any flags out of the MAKE environment variable.
Line 1021 
Line 1026 
  */   */
 /* VARARGS */  /* VARARGS */
 void  void
 #if __STDC__  #ifdef __STDC__
 Error(char *fmt, ...)  Error(char *fmt, ...)
 #else  #else
 Error(va_alist)  Error(va_alist)
Line 1029 
Line 1034 
 #endif  #endif
 {  {
         va_list ap;          va_list ap;
 #if __STDC__  #ifdef __STDC__
         va_start(ap, fmt);          va_start(ap, fmt);
 #else  #else
         char *fmt;          char *fmt;
Line 1056 
Line 1061 
  */   */
 /* VARARGS */  /* VARARGS */
 void  void
 #if __STDC__  #ifdef __STDC__
 Fatal(char *fmt, ...)  Fatal(char *fmt, ...)
 #else  #else
 Fatal(va_alist)  Fatal(va_alist)
Line 1064 
Line 1069 
 #endif  #endif
 {  {
         va_list ap;          va_list ap;
 #if __STDC__  #ifdef __STDC__
         va_start(ap, fmt);          va_start(ap, fmt);
 #else  #else
         char *fmt;          char *fmt;
Line 1098 
Line 1103 
  */   */
 /* VARARGS */  /* VARARGS */
 void  void
 #if __STDC__  #ifdef __STDC__
 Punt(char *fmt, ...)  Punt(char *fmt, ...)
 #else  #else
 Punt(va_alist)  Punt(va_alist)
Line 1106 
Line 1111 
 #endif  #endif
 {  {
         va_list ap;          va_list ap;
 #if __STDC__  #ifdef __STDC__
         va_start(ap, fmt);          va_start(ap, fmt);
 #else  #else
         char *fmt;          char *fmt;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12