From owner-freebsd-hackers Mon Feb 1 15:24:58 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA04279 for freebsd-hackers-outgoing; Mon, 1 Feb 1999 15:24:58 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id PAA04273 for ; Mon, 1 Feb 1999 15:24:54 -0800 (PST) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 107Si3-0001M1-00; Mon, 1 Feb 1999 16:24:51 -0700 Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.1/8.8.3) with ESMTP id QAA60809 for ; Mon, 1 Feb 1999 16:25:36 -0700 (MST) Message-Id: <199902012325.QAA60809@harmony.village.org> To: hackers@FreeBSD.ORG Subject: Comments on the following patch Date: Mon, 01 Feb 1999 16:25:35 -0700 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The following patch makes it possible to override MACHINE_ARCH in the same way that we override MACHINE. This is needed for some cross building environments. I have lifted this from OpenBSD's make, but I didn't investigate its origin further. This should have no impact on most people as MACHINE_ARCH will be undefined, or defined to the current machine arcitecture. This allows me to do a make cross-tools TARGET=arc for the OpenBSD tree of today. Well I needed to make a minor hack to the OpenBSD tree, which isn't relevant here... Comments? Warner Index: main.c =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/usr.bin/make/main.c,v retrieving revision 1.29 diff -u -r1.29 main.c --- main.c 1998/11/15 05:55:58 1.29 +++ main.c 1999/02/01 23:11:14 @@ -449,6 +449,7 @@ char obpath[MAXPATHLEN + 1]; char cdpath[MAXPATHLEN + 1]; char *machine = getenv("MACHINE"); + char *machine_arch = getenv("MACHINE_ARCH"); Lst sysMkPath; /* Path of sys.mk */ char *cp = NULL, *start; /* avoid faults on read-only strings */ @@ -528,6 +529,14 @@ #endif } + if (!machine_arch) { +#ifndef MACHINE_ARCH + machine_arch = "unknown"; +#else + machine_arch = MACHINE_ARCH; +#endif + } + /* * The object directory location is determined using the * following order of preference: @@ -626,9 +635,7 @@ Var_Set(MAKEFLAGS, "", VAR_GLOBAL); Var_Set("MFLAGS", "", VAR_GLOBAL); Var_Set("MACHINE", machine, VAR_GLOBAL); -#ifdef MACHINE_ARCH - Var_Set("MACHINE_ARCH", MACHINE_ARCH, VAR_GLOBAL); -#endif + Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL); /* * First snag any flags out of the MAKE environment variable. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message