aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/main.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1999-03-01 06:01:05 +0000
committerWarner Losh <imp@FreeBSD.org>1999-03-01 06:01:05 +0000
commitac3efb6afc3eec0ac2e14da1934a3d5ab849ac96 (patch)
treefd6814d988836a8ce4cc46465e6ae7e294597ee7 /usr.bin/make/main.c
parent12c89890812ad7a3c4b7138fa7e17a4a8c101b50 (diff)
Notes
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r--usr.bin/make/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 02447e5c42c6..6f9f8f6ef650 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -47,7 +47,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.28 1998/11/14 16:15:04 dg Exp $";
+ "$Id: main.c,v 1.29 1998/11/15 05:55:58 bde Exp $";
#endif /* not lint */
/*-
@@ -449,6 +449,7 @@ main(argc, argv)
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 @@ main(argc, argv)
#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 @@ main(argc, argv)
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.