
%
% properties of the supported platforms
%

% HISTORY
% 28-Feb-97  Wilson Hsieh (whsieh) at the University of Washington
%	clean up Platforms by indexing by BASETARGET, not TARGET
%
% 03-Feb-97  Wilson Hsieh (whsieh) at the University of Washington
%	Marc added lanai
%	I added ref counting platforms for ALPHA, plus HACK
%
% 05-May-96  Charles Garrett (garrett) at the University of Washington
%	ALPHA_SPIN_PROF added.
%
% 22-Feb-96  Charles Garrett (garrett) at the University of Washington
%	Added ALPHA_SPIN platform.
%


readonly Platforms = {
  "AIX386"                : [ "POSIX", "32BITS", "i486-ibm-aix"       ],
  "ALPHA_OSF"             : [ "POSIX", "64BITS", "alpha-dec-osf"      ],
  "ALPHA_SPIN"            : [ "SPIN",  "64BITS", "alpha-spin"         ],
  "AP3000"                : [ "POSIX", "32BITS", "apollo68-bsd"       ],
  "ARM"                   : [ "POSIX", "32BITS", "arm--riscos"        ],
  "DS3100"                : [ "POSIX", "32BITS", "decstation"         ],
  "FreeBSD"               : [ "POSIX", "32BITS", "i486-unknown-bsd"   ],
  "FreeBSD2"              : [ "POSIX", "32BITS", "i486-unknown-bsd"   ],
  "FreeBSD2_SPIN"         : [ "SPIN",  "32BITS", "i486-unknown-spin"  ],
  "HP300"                 : [ "POSIX", "32BITS", "m68k-hp-hpux"       ],
  "HPPA"                  : [ "POSIX", "32BITS", "hppa1.1-hp-hpux"    ],
  "IBMR2"                 : [ "POSIX", "32BITS", "rs6000-ibm-aix3.2"  ],
  "IBMRT"                 : [ "POSIX", "32BITS", "romp-ibm-aos"       ],
  "IRIX5"                 : [ "POSIX", "32BITS", "mips-sgi-irix5"     ],
  "IX86_SPIN"             : [ "SPIN",  "32BITS", "i486-unknown-spin"  ],
  "IX86_SPIN_PROF"        : [ "SPIN",  "32BITS", "i486-unknown-spin"  ],
  "Lanai3.1"      	  : [ "POSIX", "32BITS", "lanai3-myricom-coff"],
  "LINUX"                 : [ "POSIX", "32BITS", "i486--linux"        ],
# not yet  "LINUXELF"              : [ "POSIX", "32BITS", "i486--linuxelf"     ],
  "LINUXELF"              : [ "POSIX", "32BITS", "i486-unknown-bsd"     ],
  "LINUXELFFreeBSD2"      : [ "POSIX", "32BITS", "i486-unknown-bsd"   ],
  "LINUXELFLanai3.1"      : [ "POSIX", "32BITS", "lanai3-myricom-coff"],
  "LINUXELF_SPIN"         : [ "SPIN",  "32BITS", "i486--linuxelf"     ],
  "NEXT"                  : [ "POSIX", "32BITS", "next-bsd"           ],
  "NT386"                 : [ "WIN32", "32BITS", "i486--nt"           ],
  "OKI"                   : [ "POSIX", "32BITS", "i860--sysv4.0"      ],
  "SEQUENT"               : [ "POSIX", "32BITS", "i386-sequent-bsd"   ],
  "SOLgnu"                : [ "POSIX", "32BITS", "sparc-sun-solaris2" ],
  "SOLsun"                : [ "POSIX", "32BITS", "sparc-sun-solaris2" ],
  "SPARC"                 : [ "POSIX", "32BITS", "sparc-sun-sunos4.1" ],
  "SUN3"                  : [ "POSIX", "32BITS", "m68k-sun-sunos4.1"  ],
  "SUN386"                : [ "POSIX", "32BITS", "i386-sun-sunos4.1"  ],
  "UMAX"                  : [ "POSIX", "32BITS", "encore-bsd"         ],
  "VAX"                   : [ "POSIX", "32BITS", "vax-dec-ultrix"     ]
}

readonly OS_TYPE   = Platforms{BASETARGET}[0]
readonly WORD_SIZE = Platforms{BASETARGET}[1]

readonly proc gnu_platform (x) is
  if Platforms contains x
    return Platforms{x}[2]
  else
    error ("GNU platform is not known for \"" & x & "\"")
    return "unknown-unknown-unknown"
  end
end

readonly proc _ifdef (nm, a, b) is
  if defined (nm)
    return a
  else
    return b
  end
end

readonly proc _pack_args (x) is
  local result = "@"
  foreach y in x
    result = format ("%s%s@", result, y)
  end
  return result
end


