Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 2002 14:15:19 -0700 (PDT)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 19489 for review
Message-ID:  <200210172115.g9HLFJLD086648@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=19489

Change 19489 by jmallett@jmallett_luna on 2002/10/17 14:15:03

	Add a platform symlink, a close cousin to the machine symlink,
	except it points to superconfiguration information, say we want to
	do something like:
		<machine/endian.h>::
			\#include <platform/endian.h>
			\#if _BYTE_ORDER == _BIG_ENDIAN
			....
		<conf/GENERIC>::
			machine mips
			platform sgimips
		<sgimips/endian.h>
			\#define _BYTE_ORDER _BIG_ENDIAN
	
	To pull in information specific to a platform under a given machine
	architecture.

Affected files ...

.. //depot/projects/mips/sys/conf/kmod.mk#2 edit
.. //depot/projects/mips/sys/mips/conf/GENERIC#2 edit
.. //depot/projects/mips/usr.sbin/config/config.h#2 edit
.. //depot/projects/mips/usr.sbin/config/config.y#2 edit
.. //depot/projects/mips/usr.sbin/config/lang.l#2 edit
.. //depot/projects/mips/usr.sbin/config/main.c#2 edit

Differences ...

==== //depot/projects/mips/sys/conf/kmod.mk#2 (text+ko) ====

@@ -145,7 +145,7 @@
 .endif
 .endif
 
-_ILINKS=@ machine
+_ILINKS=@ machine platform
 
 all: objwarn ${PROG}
 
@@ -174,6 +174,8 @@
 	@case ${.TARGET} in \
 	machine) \
 		path=${SYSDIR}/${MACHINE_ARCH}/include ;; \
+	platform) \
+		path=${SYSDIR}/${MACHINE_ARCH}/${MACHINE} ;; \
 	@) \
 		path=${SYSDIR} ;; \
 	esac ; \

==== //depot/projects/mips/sys/mips/conf/GENERIC#2 (text+ko) ====

@@ -11,6 +11,7 @@
 makeoptions	WERROR=-Wno-error	#XXX: We don't want -Werror just now
 
 # Platform support
+platform	sgimips			#SGI MIPS guts
 options 	SGI			#SGI MIPS hardware
 
 # Hardware support

==== //depot/projects/mips/usr.sbin/config/config.h#2 (text+ko) ====

@@ -91,9 +91,11 @@
  * being used.  It uses the name of the machine in choosing
  * files and directories.  Thus if the name of the machine is ``i386'',
  * it will build from ``Makefile.i386'' and use ``../i386/inline''
- * in the makerules, etc.
+ * in the makerules, etc.  It also *may* know about a platform, which
+ * is a superconfiguration of a given machine.
  */
 char	*machinename;
+char	*platformname;
 
 /*
  * For each machine, a set of CPU's may be specified as supported.

==== //depot/projects/mips/usr.sbin/config/config.y#2 (text+ko) ====

@@ -14,6 +14,7 @@
 %token	HINTS
 %token	IDENT
 %token	MAXUSERS
+%token	PLATFORM
 %token	PROFILE
 %token	OPTIONS
 %token	MAKEOPTIONS
@@ -136,6 +137,10 @@
 		cp->cpu_next = cputype;
 		cputype = cp;
 	      } |
+	PLATFORM Save_id
+	    = {
+		platformname = $2;
+	      } |
 	OPTIONS Opt_list
 		|
 	MAKEOPTIONS Mkopt_list

==== //depot/projects/mips/usr.sbin/config/lang.l#2 (text+ko) ====

@@ -73,6 +73,7 @@
 	{ "machine",	ARCH }, /* MACHINE is defined in /sys/param.h */
 	{ "makeoptions", MAKEOPTIONS },
 	{ "maxusers",	MAXUSERS },
+	{ "platform",	PLATFORM },
 	{ "profile",	PROFILE },
 	{ "option",	OPTIONS },
 	{ "options",	OPTIONS },

==== //depot/projects/mips/usr.sbin/config/main.c#2 (text+ko) ====

@@ -164,6 +164,19 @@
 		    srcdir, machinename);
 	(void) unlink(path("machine"));
 	(void) symlink(xxx, path("machine"));
+	/*
+	 * make symbolic link for the platform, if we have one.
+	 */
+	if (platformname != NULL) {
+		if (*srcdir == '\0')
+			(void)snprintf(xxx, sizeof(xxx), "../../%s",
+			    platformname);
+		else
+			(void)snprintf(xxx, sizeof(xxx), "%s/%s/%s",
+			    srcdir, machinename, platformname);
+	}
+	(void) unlink(path("platform"));
+	(void) symlink(xxx, path("platform"));
 	options();			/* make options .h files */
 	makefile();			/* build Makefile */
 	headers();			/* make a lot of .h files */

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210172115.g9HLFJLD086648>