summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1998-09-09 14:58:30 +0000
committerkato <kato@FreeBSD.org>1998-09-09 14:58:30 +0000
commit9880fc9dc798767b37ac48551a592f7991a3dc2d (patch)
treeb5c2cd14d0291677cbeb73ae8d9e9103084ed397 /usr.bin/make
parentdfa2d1e0c9b7d34b7f3f1f86c08b0b8f620d4404 (diff)
downloadFreeBSD-src-9880fc9dc798767b37ac48551a592f7991a3dc2d.zip
FreeBSD-src-9880fc9dc798767b37ac48551a592f7991a3dc2d.tar.gz
Set the `pc98' string to the MACHINE if machdep.ispc98 != 0.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/main.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 8f82d1d..63dbe1a 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.24 1998/06/13 11:55:57 peter Exp $";
+ "$Id: main.c,v 1.25 1998/07/26 17:06:05 imp Exp $";
#endif /* not lint */
/*-
@@ -83,6 +83,9 @@ static const char rcsid[] =
#include <sys/resource.h>
#include <sys/signal.h>
#include <sys/stat.h>
+#if defined(__i386__)
+#include <sys/sysctl.h>
+#endif
#ifndef MACHINE
#include <sys/utsname.h>
#endif
@@ -473,6 +476,25 @@ main(argc, argv)
(void) strcpy(curdir, pwd);
}
+#if defined(__i386__)
+ /*
+ * PC-98 kernel sets the `i386' string to the utsname.machine and
+ * it cannot be distinguished from IBM-PC by uname(3). Therefore,
+ * we check machine.ispc98 and adjust the machine variable before
+ * using usname(3) below.
+ */
+ if (!machine) {
+ int ispc98;
+ size_t len;
+
+ len = sizeof(ispc98);
+ if (!sysctlbyname("machdep.ispc98", &ispc98, &len, NULL, 0)) {
+ if (ispc98)
+ machine = "pc98";
+ }
+ }
+#endif
+
/*
* Get the name of this type of MACHINE from utsname
* so we can share an executable for similar machines.
OpenPOWER on IntegriCloud