[Midnightbsd-cvs] src [6777] trunk/usr.bin/make/main.c: min cpu i486.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Sep 20 13:37:26 EDT 2014
Revision: 6777
http://svnweb.midnightbsd.org/src/?rev=6777
Author: laffer1
Date: 2014-09-20 13:37:25 -0400 (Sat, 20 Sep 2014)
Log Message:
-----------
min cpu i486. use amd64 hack from freebsd
Modified Paths:
--------------
trunk/usr.bin/make/main.c
Modified: trunk/usr.bin/make/main.c
===================================================================
--- trunk/usr.bin/make/main.c 2014-09-19 23:23:36 UTC (rev 6776)
+++ trunk/usr.bin/make/main.c 2014-09-20 17:37:25 UTC (rev 6777)
@@ -47,7 +47,7 @@
#endif /* not lint */
#include <sys/cdefs.h>
/* $FreeBSD: src/usr.bin/make/main.c,v 1.169 2008/07/30 21:18:38 ed Exp $ */
-__MBSDID("$MidnightBSD: src/usr.bin/make/main.c,v 1.3 2011/12/02 04:11:34 laffer1 Exp $");
+__MBSDID("$MidnightBSD$");
/*
* main.c
@@ -147,6 +147,14 @@
time_t now; /* Time at start of make */
struct GNode *DEFAULT; /* .DEFAULT node */
+static struct {
+ const char *foreign_name;
+ const char *freebsd_name;
+} arch_aliases[] = {
+ { "x86_64", "amd64" },
+ { "mipsel", "mips" },
+};
+
/**
* Exit with usage message.
*/
@@ -940,10 +948,19 @@
*/
if ((machine = getenv("MACHINE")) == NULL) {
static struct utsname utsname;
+ unsigned int i;
if (uname(&utsname) == -1)
err(2, "uname");
machine = utsname.machine;
+
+ /* Canonicalize non-FreeBSD naming conventions */
+ for (i = 0; i < sizeof(arch_aliases)
+ / sizeof(arch_aliases[0]); i++)
+ if (!strcmp(machine, arch_aliases[i].foreign_name)) {
+ machine = arch_aliases[i].freebsd_name;
+ break;
+ }
}
if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) {
@@ -960,7 +977,7 @@
*/
if ((machine_cpu = getenv("MACHINE_CPU")) == NULL) {
if (!strcmp(machine_arch, "i386"))
- machine_cpu = "i386";
+ machine_cpu = "i486";
else
machine_cpu = "unknown";
}
More information about the Midnightbsd-cvs
mailing list