Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/crunch/crunchgen Check for MAKEFLAGS in the env and ...



details:   https://anonhg.NetBSD.org/src/rev/6d46d96651fe
branches:  trunk
changeset: 516334:6d46d96651fe
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sun Oct 21 23:06:59 2001 +0000

description:
Check for MAKEFLAGS in the env and pass those to the test make's run for
finding obj files. Otherwise -m <new mk files> won't get passed and can
cause problems on some cross builds.

diffstat:

 usr.bin/crunch/crunchgen/crunchgen.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 9134127a75e2 -r 6d46d96651fe usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Sun Oct 21 23:04:57 2001 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Sun Oct 21 23:06:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.25 2001/10/05 22:52:56 jmc Exp $       */
+/*     $NetBSD: crunchgen.c,v 1.26 2001/10/21 23:06:59 jmc 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.25 2001/10/05 22:52:56 jmc Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.26 2001/10/21 23:06:59 jmc Exp $");
 #endif
 
 #include <stdlib.h>
@@ -98,6 +98,7 @@
 char *machine;
 char *makeobjdirprefix;
 char *makebin;
+char *makeflags;
 
 /* general library routines */
 
@@ -123,6 +124,9 @@
     if ((makebin = getenv("MAKE")) == NULL)
        makebin = strdup("make");
 
+    if ((makeflags = getenv("MAKEFLAGS")) == NULL)
+       makeflags = strdup("");
+
     if ((machine = getenv("MACHINE")) == NULL) {
        struct utsname utsname;
 
@@ -607,7 +611,8 @@
     fclose(f);
 
     (void)snprintf(line, sizeof(line),
-       "cd %s && %s -f %s crunchgen_objs 2>&1", dirpath, makebin, tempfname);
+       "cd %s && %s -f %s %s crunchgen_objs 2>&1", dirpath, makebin, 
+       tempfname, makeflags);
     if((f = popen(line, "r+")) == NULL) {
        perror("submake pipe");
        goterror = 1;
@@ -804,6 +809,7 @@
 
     fprintf(outmk, "DBG=%s\n", dbg);
     fprintf(outmk, "STRIP?=strip\n");
+    fprintf(outmk, "MAKE?=make\n");
 #ifdef NEW_TOOLCHAIN
     fprintf(outmk, "OBJCOPY?=objcopy\n");
 #else
@@ -852,7 +858,7 @@
            p->ident, p->ident, p->ident);
        fprintf(outmk, "\tprintf \".PATH: ${%s_SRCDIR}\\n.CURDIR:= ${%s_SRCDIR}\\n"
            ".include \\\"\\$${.CURDIR}/Makefile\\\"\\n\" \\\n", p->ident, p->ident);
-       fprintf(outmk, "\t| make DBG=\"${DBG}\" -f- depend ${%s_OBJS}\n\n",
+       fprintf(outmk, "\t| ${MAKE} DBG=\"${DBG}\" -f- depend ${%s_OBJS}\n\n",
            p->ident);
     }
     else



Home | Main Index | Thread Index | Old Index