Source-Changes-HG archive

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

[src/netbsd-1-5]: src Approved by jhawk



details:   https://anonhg.NetBSD.org/src/rev/4977030e2b1e
branches:  netbsd-1-5
changeset: 489420:4977030e2b1e
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Sep 09 05:51:23 2000 +0000

description:
Approved by jhawk
>Make this work with MAKEOBJDIRPREFIX.

diffstat:

 sys/arch/i386/stand/lib/Makefile.inc |   5 +++--
 usr.bin/crunch/crunchgen/crunchgen.c |  26 ++++++++++++++++++--------
 2 files changed, 21 insertions(+), 10 deletions(-)

diffs (83 lines):

diff -r 6f4fd9052d19 -r 4977030e2b1e sys/arch/i386/stand/lib/Makefile.inc
--- a/sys/arch/i386/stand/lib/Makefile.inc      Sat Sep 09 02:11:30 2000 +0000
+++ b/sys/arch/i386/stand/lib/Makefile.inc      Sat Sep 09 05:51:23 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.4 2000/02/01 05:25:33 tsutsui Exp $
+#      $NetBSD: Makefile.inc,v 1.4.6.1 2000/09/09 06:01:44 matt Exp $
 #
 #      Configuration variables (default values are below):
 #
@@ -20,7 +20,8 @@
 I386LIB=               ${I386DST}/libi386.a
 
 I386MAKE= \
-       cd ${I386DIR} && MAKEOBJDIR=${I386DST} ${MAKE} \
+       cd ${I386DIR} && unset MAKEOBJDIRPREFIX && \
+         MAKEOBJDIR=${I386DST} ${MAKE} \
            CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
            AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
            LD=${LD:Q} STRIP=${STRIP:Q} \
diff -r 6f4fd9052d19 -r 4977030e2b1e usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Sat Sep 09 02:11:30 2000 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Sat Sep 09 05:51:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.16 2000/06/11 14:31:11 mycroft Exp $   */
+/*     $NetBSD: crunchgen.c,v 1.16.2.1 2000/09/09 05:51:23 matt Exp $  */
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: crunchgen.c,v 1.16 2000/06/11 14:31:11 mycroft Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.16.2.1 2000/09/09 05:51:23 matt Exp $");
 #endif
 
 #include <stdlib.h>
@@ -95,6 +95,7 @@
 int verbose, readcache;        /* options */
 int reading_cache;
 char *machine;
+char *makeobjdirprefix;
 
 /* general library routines */
 
@@ -125,6 +126,7 @@
        }
        machine = utsname.machine;
     }
+    makeobjdirprefix = getenv("MAKEOBJDIRPREFIX");
     verbose = 1;
     readcache = 1;
     *outmkname = *outcfname = *execfname = '\0';
@@ -514,15 +516,23 @@
        }
     }
     if(!p->objdir && p->srcdir) {
-       (void)snprintf(path, sizeof(path), "%s/obj.%s", p->srcdir, machine);
-       if(is_dir(path))
-           p->objdir = strdup(path);
-       else {
+       if (makeobjdirprefix) {
+           (void)snprintf(path, sizeof(path), "%s/%s", makeobjdirprefix, p->srcdir);
+           if (is_dir(path))
+               p->objdir = strdup(path);
+       }
+       if (!p->objdir) {
+           (void)snprintf(path, sizeof(path), "%s/obj.%s", p->srcdir, machine);
+           if (is_dir(path))
+               p->objdir = strdup(path);
+       }
+       if (!p->objdir) {
            (void)snprintf(path, sizeof(path), "%s/obj", p->srcdir);
            if(is_dir(path))
                p->objdir = strdup(path);
-           else
-               p->objdir = p->srcdir;
+       }
+       if (!p->objdir) {
+           p->objdir = p->srcdir;
         }
     }
 



Home | Main Index | Thread Index | Old Index