Subject: xsrc/28885: XF4 Imake.cf cleanup for MACHINE_CPU and MACHINE specific definitions
To: None <xsrc-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 01/06/2005 14:54:01
>Number:         28885
>Category:       xsrc
>Synopsis:       XF4 Imake.cf cleanup for MACHINE_CPU and MACHINE specific definitions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 06 14:54:00 +0000 2005
>Originator:     Izumi Tsutsui
>Release:        NetBSD 2.99.11
>Organization:
>Environment:
System: NetBSD mirage
Architecture: i386, sh3el
Machine: i386, dreamcast
and other arch
>Description:
Current xsrc/xfree/xc/config/cf/Imake.cf has some MACHINE_CPU specific
and MACHINE specific definitions for __NetBSD__, but it is too complicated
to read/maintain, and MACHINE_CPU specific part and MACHINE specific part
should be defined separately.

>How-To-Repeat:
Code inspection.

>Fix:
Patch attached. This patch may be still imcomplete,
but I think this will make further fixes easier.

config/cf/NetBSD.cf also needs cleanup,
but I'll file it in different PR.

--- xsrc/xfree/xc/config/cf/Imake.cf	2005-01-05 18:07:16.000000000 +0900
+++ Imake.cf	2005-01-03 21:08:00.000000000 +0900
@@ -71,7 +71,7 @@
 # define UltrixArchitecture
 #endif /* ultrix */
 
-#if defined(vax) && !defined(UltrixArchitecture) && !defined(__OpenBSD__)
+#if defined(vax) && !defined(UltrixArchitecture) && !defined(__OpenBSD__) && !defined(__NetBSD__)
 # define MacroIncludeFile <bsd.cf>
 # define MacroFile bsd.cf
 # undef vax
@@ -199,60 +199,163 @@
 # undef __NetBSD__
 # define NetBSDArchitecture
 # define KNetBSDArchitecture
-# ifdef __i386__
+  /* MACHINE_CPU specific definitions ("__${MACHINE_CPU}__ is defined by cpp) */
+# if defined(__alpha__) || defined(alpha)
+#  define AlphaArchitecture
+#  define AlphaBsdArchitecture
+#  undef alpha
+# endif
+# if defined(__arm__) || defined(arm)
+#  define armArchitecture
+#  undef arm
+# endif
+# if defined(__hppa__) || defined(hppa)
+#  define HPArchitecture
+#  undef hppa
+# endif
+# if defined(__i386__) || defined(i386)
 #  define i386BsdArchitecture
 #  define i386Architecture
 #  undef i386
 # endif
-# if defined(__sparc64__) || defined(__sparc_v9__) || defined(__arch64__)
-#  define Sparc64Architecture
+# if defined(__m68000__) || defined(m68000)
+#  define m68000Architecture
+#  define Mc68000Architecture
+#  undef m68000
 # endif
-# if defined(__sparc__) || defined(sparc)
+# if defined(__m68k__) || defined(m68k)
+#  define m68kArchitecture
+#  define Mc68020Architecture
+#  undef m68k
+# endif
+# if defined(__mips__) || defined(mips)
+#  define MipsArchitecture
+#  if defined(__MIPSEL__)
+#   define MipselArchitecture
+#  endif
+#  undef mips
+# endif
+# if defined(__ns32k__) || defined(ns32k)
+#  define ns32kArchitecture
+#  undef ns32k
+# endif
+# if defined(__powerpc__) || defined(powerpc)
+#  define PpcArchitecture
+#  undef powerpc
+# endif
+# if defined(__sh__) || defined(sh)
+#  if defined(__BIG_ENDIAN__)
+#   define SuperHebArchitecture
+#  else
+#   define SuperHArchitecture
+#  endif
+#  if defined(__SH5__)
+#   define sh5Architecture
+#  else
+#   define sh3Architecture
+#  endif
+#  undef sh
+# endif
+# if defined(__sparc__)
 #  define SparcArchitecture
 #  undef sparc
 #  if defined(__sparc_v9__) || defined(__arch64__)
-#    define Sparc64Architecture
+#   define Sparc64Architecture
 #  endif
 # endif
-# ifdef __mips__
-#   define MipsArchitecture
-#   define ArcArchitecture
-#   undef __mips__
-#   if defined(__sgimips__)
-#      define SGIMipsArchitecture
-#   endif
+# if defined(__sparc64__) || defined(__sparc_v9__) || defined(sparc64)
+#  define Sparc64Architecture
+#  undef sparc64
 # endif
-# ifdef __alpha__
-#   define AlphaArchitecture
-#   define AlphaBsdArchitecture
-#   undef __alpha__
+# if defined(__vax__) || defined(vax)
+#  define VaxArchitecture
+#  undef vax
 # endif
-# ifdef mc68000
-#   define Mc68020Architecture
+# if defined(__x86_64__) || defined(x86_64)
+#  define x86_64Architecture
+#  undef x86_64
 # endif
-# ifdef __arm32__
-#   define Arm32Architecture
-#   undef __arm32__
-# endif
-# ifdef __cats__
-#   define CatsArchitecture
-#   undef __cats__
+  /* MACHINE specific definitions ("__${MACHINE}__" is defined by imake) */
+# if defined(__acorn32__)
+#  define Arm32Architecture
+#  define acorn32Architecture
 # endif
-# ifdef __vax__
-#   define VaxArchitecture
-#   undef __vax__
+# if defined(__amd64__)
+#  define AMD64Architecture
 # endif
-# ifdef __powerpc__
-#   define PpcArchitecture
-#   undef __powerpc__
+# if defined(__algor__)
+#  define algorArchitecture
 # endif
-# ifdef __macppc__
-#   define macppcArchitecture
-#   undef __macppc__
+# if defined(__amiga__)
+#  define amigaArchitecture
 # endif
-# ifdef __x86_64__
-#  define AMD64Architecture
-#  undef __x86_64__
+# if defined(__atari__)
+#  define atariArchitecture
+# endif
+# if defined(__cats__)
+#  define Arm32Architecture
+#  define CatsArchitecture
+# endif
+# if defined(__cobalt__)
+#  define cobaltArchitecture
+# endif
+# if defined(__dreamcast__)
+#  define dreamcastArchitecture
+# endif
+# if defined(__hp300__)
+#  define hp300Architecture
+# endif
+# if defined(__hpcarm__)
+#  define hpcarmArchitecture
+# endif
+# if defined(__hpcmips__)
+#  define hpcmipsArchitecture
+# endif
+# if defined(__mac68k__)
+#  define mac68kArchitecture
+# endif
+# if defined(__macppc__)
+#  define macppcArchitecture
+# endif
+# if defined(__luna68k__)
+#  define luna68kArchitecture
+# endif
+# if defined(__mipsco__)
+#  define mipscoArchitecture
+# endif
+# if defined(__mvme68k__)
+#  define mvme68kArchitecture
+# endif
+# if defined(__next68k__)
+#  define next68kArchitecture
+# endif
+# if defined(__news68k__)
+#  define news68kArchitecture
+# endif
+# if defined(__pc532__)
+#  define pc532Architecture
+# endif
+# if defined(__pmax__)
+#  define pmaxArchitecture
+# endif
+# if defined(__playstation2__)
+#  define playstation2Architecture
+# endif
+# if defined(__prep__)
+#  define prepArchitecture
+# endif
+# if defined(__sgimips__)
+#  define SGIMipsArchitecture
+# endif
+# if defined(__shark__)
+#  define Arm32Architecture
+#  define sharkArchitecture
+# endif
+# if defined(__sun3__)
+#  define Sun3Architecture
+# endif
+# if defined(__x68k__)
+#  define x68kArchitecture
 # endif
 #endif /* NetBSD */