From cab4769a9493bed0e1d1a307cdb5603c3a4ca410 Mon Sep 17 00:00:00 2001 From: KATO Takenori Date: Wed, 9 Sep 1998 14:58:30 +0000 Subject: [PATCH] Set the `pc98' string to the MACHINE if machdep.ispc98 != 0. --- usr.bin/make/main.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 8f82d1dafe01..63dbe1acea14 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 #include #include +#if defined(__i386__) +#include +#endif #ifndef MACHINE #include #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.