Refactored enums handling
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11186 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8c04b766d4
commit
da5ade3143
4 changed files with 158 additions and 222 deletions
|
|
@ -43,7 +43,7 @@
|
|||
%typemap(ctype) SWIGTYPE * [ANY], SWIGTYPE ** "SwigObj **"
|
||||
%typemap(ctype) SWIGTYPE * [ANY][ANY], SWIGTYPE *** "SwigObj ***"
|
||||
%typemap(ctype) SWIGTYPE *& "SwigObj **"
|
||||
%typemap(ctype) enum SWIGTYPE "$1_type"
|
||||
%typemap(ctype) enum SWIGTYPE "int"
|
||||
|
||||
%fragment("stdbool_inc", "proxy_header") {#include <stdbool.h>}
|
||||
%typemap(ctype, fragment="stdbool_inc") bool, bool *, bool **, const bool, const bool *, bool * [ANY] "$1_type"
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
%typemap(couttype) SWIGTYPE [ANY] "SwigObj **"
|
||||
%typemap(couttype) SWIGTYPE * [ANY], SWIGTYPE ** "SwigObj **"
|
||||
%typemap(couttype) SWIGTYPE * [ANY][ANY], SWIGTYPE *** "SwigObj ***"
|
||||
%typemap(couttype) enum SWIGTYPE "$1_type"
|
||||
%typemap(couttype) enum SWIGTYPE "int"
|
||||
|
||||
%typemap(couttype, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$1_type"
|
||||
%typemap(couttype, fragment="stdbool_inc") bool & "$1_basetype*"
|
||||
|
|
|
|||
|
|
@ -28,12 +28,9 @@ class C:public Language {
|
|||
|
||||
String *empty_string;
|
||||
String *int_string;
|
||||
String *enum_values;
|
||||
String *create_object;
|
||||
String *destroy_object;
|
||||
|
||||
int enum_id;
|
||||
|
||||
bool proxy_flag;
|
||||
bool except_flag;
|
||||
|
||||
|
|
@ -46,10 +43,8 @@ public:
|
|||
C() :
|
||||
empty_string(NewString("")),
|
||||
int_string(NewString("int")),
|
||||
enum_values(0),
|
||||
create_object(0),
|
||||
destroy_object(0),
|
||||
enum_id(1),
|
||||
proxy_flag(true),
|
||||
except_flag(true) {
|
||||
}
|
||||
|
|
@ -258,8 +253,6 @@ public:
|
|||
return SWIG_OK;
|
||||
String *name = Getattr(n, "name");
|
||||
SwigType *type = Getattr(n, "type");
|
||||
if (SwigType_isenum(type))
|
||||
type = make_enum_type(n, type);
|
||||
String *type_str = Copy(SwigType_str(type, 0));
|
||||
if (SwigType_isarray(type)) {
|
||||
String *dims = Strchr(type_str, '[');
|
||||
|
|
@ -397,35 +390,6 @@ ready:
|
|||
return result;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* make_enum_type()
|
||||
*
|
||||
* given C++ enum type this function returns its C representation
|
||||
* ---------------------------------------------------------------------- */
|
||||
|
||||
String *make_enum_type(Node *n, SwigType *enumtype) {
|
||||
Symtab *symtab = Getattr(n, "sym:symtab");
|
||||
String *unnamed = Getattr(n, "unnamed");
|
||||
String *newtype = 0;
|
||||
String *query = 0;
|
||||
|
||||
if (!unnamed)
|
||||
query = Swig_scopename_last(SwigType_str(enumtype, 0));
|
||||
else {
|
||||
Replaceall(unnamed, "$unnamed", "enum");
|
||||
Replaceall(unnamed, "$", "");
|
||||
query = unnamed;
|
||||
}
|
||||
|
||||
Node *node = Swig_symbol_clookup(query, symtab);
|
||||
if (node)
|
||||
newtype = NewStringf("enum %s", Getattr(node, "name"));
|
||||
else
|
||||
newtype = SwigType_str(enumtype, 0);
|
||||
|
||||
return newtype;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* functionWrapper()
|
||||
* ---------------------------------------------------------------------- */
|
||||
|
|
@ -534,10 +498,6 @@ ready:
|
|||
if (Cmp(Getattr(n, "c:objstruct"), "1") == 0) {
|
||||
Printv(return_type, SwigType_str(type, 0), NIL);
|
||||
}
|
||||
else if (SwigType_isenum(type)) {
|
||||
type = return_type = make_enum_type(n, type);
|
||||
Setattr(n, "type", return_type);
|
||||
}
|
||||
else if ((tm = Swig_typemap_lookup("couttype", n, "", 0))) {
|
||||
String *ctypeout = Getattr(n, "tmap:couttype:out");
|
||||
if (ctypeout)
|
||||
|
|
@ -662,18 +622,9 @@ ready:
|
|||
String *arg_name = NewString("");
|
||||
|
||||
Printf(arg_name, "c%s", lname);
|
||||
bool dont_apply_tmap = false;
|
||||
|
||||
// set the appropriate type for parameter
|
||||
if (SwigType_isenum(type)) {
|
||||
c_parm_type = make_enum_type(n, type);
|
||||
if (Getattr(n, "unnamed")) {
|
||||
type = int_string;
|
||||
Setattr(p, "type", type);
|
||||
dont_apply_tmap = true;
|
||||
}
|
||||
}
|
||||
else if ((tm = Getattr(p, "tmap:ctype"))) {
|
||||
if ((tm = Getattr(p, "tmap:ctype"))) {
|
||||
Printv(c_parm_type, tm, NIL);
|
||||
}
|
||||
else {
|
||||
|
|
@ -699,14 +650,9 @@ ready:
|
|||
p = Getattr(p, "tmap:in:next");
|
||||
}
|
||||
else if ((tm = Getattr(p, "tmap:in"))) {
|
||||
if (dont_apply_tmap) {
|
||||
Printv(wrapper->code, lname, " = ", arg_name, ";\n", NIL);
|
||||
}
|
||||
else {
|
||||
Replaceall(tm, "$input", arg_name);
|
||||
Setattr(p, "emit:input", arg_name);
|
||||
Printf(wrapper->code, "%s\n", tm);
|
||||
}
|
||||
Replaceall(tm, "$input", arg_name);
|
||||
Setattr(p, "emit:input", arg_name);
|
||||
Printf(wrapper->code, "%s\n", tm);
|
||||
p = Getattr(p, "tmap:in:next");
|
||||
}
|
||||
else {
|
||||
|
|
@ -1321,82 +1267,10 @@ ready:
|
|||
|
||||
/* ---------------------------------------------------------------------
|
||||
* enumDeclaration()
|
||||
*
|
||||
* for enums declared inside class we create global enum declaration
|
||||
* and change enum parameter and return value names
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
virtual int enumDeclaration(Node *n) {
|
||||
if (!proxy_flag)
|
||||
return SWIG_OK;
|
||||
String *newclassname = Getattr(Swig_methodclass(n), "sym:name");
|
||||
String *name = Getattr(n, "sym:name");
|
||||
String *code = NewString("");
|
||||
String *tdname = Getattr(n, "tdname");
|
||||
|
||||
if (tdname) {
|
||||
Printf(code, "typedef ");
|
||||
name = Getattr(n, "name");
|
||||
String *td_def_name = NewStringf("enum %s", name);
|
||||
SwigType_typedef(td_def_name, name);
|
||||
Delete(td_def_name);
|
||||
SwigType_istypedef(name);
|
||||
}
|
||||
|
||||
Symtab *symtab = Getattr(n, "sym:symtab");
|
||||
String *newname = newclassname ? NewStringf("%s_", newclassname) : Copy(name);
|
||||
|
||||
Printf(code, "enum ");
|
||||
|
||||
if (!name) {
|
||||
String *anonymous_name = NewStringf("enum%d ", enum_id++);
|
||||
Setattr(n, "sym:name", anonymous_name);
|
||||
Setattr(n, "unnamed", "1");
|
||||
name = Getattr(n, "sym:name");
|
||||
Delete(anonymous_name);
|
||||
}
|
||||
if (Delattr(n, "unnamed")) {
|
||||
// unnamed enum declaration: create new symbol
|
||||
Replaceall(name, "$unnamed", "enum");
|
||||
Delitem(name, DOH_END);
|
||||
|
||||
Node *entry = NewHash();
|
||||
set_nodeType(entry, "enum");
|
||||
Setattr(entry, "name", name);
|
||||
Setattr(entry, "sym:name", name);
|
||||
Setattr(entry, "sym:symtab", symtab);
|
||||
Swig_symbol_add(name, entry);
|
||||
}
|
||||
if (newclassname) {
|
||||
if (symtab) {
|
||||
Node *node = Swig_symbol_clookup(name, symtab);
|
||||
if (node)
|
||||
Append(newname, name);
|
||||
}
|
||||
else
|
||||
Append(newname, "enum");
|
||||
|
||||
Setattr(n, "name", newname);
|
||||
}
|
||||
else {
|
||||
Delete(newname);
|
||||
newname = name;
|
||||
}
|
||||
Printv(code, newname ? newname : "", " {\n$enumvalues\n} ", tdname ? tdname : "", ";\n\n", NIL);
|
||||
emit_children(n);
|
||||
|
||||
if (enum_values) {
|
||||
Replaceall(code, "$enumvalues", enum_values);
|
||||
Append(f_proxy_header, code);
|
||||
if (newclassname)
|
||||
Append(f_header, code);
|
||||
Delete(enum_values);
|
||||
enum_values = 0;
|
||||
}
|
||||
|
||||
Delete(newname);
|
||||
Delete(code);
|
||||
return SWIG_OK;
|
||||
return Language::enumDeclaration(n);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
|
|
@ -1404,55 +1278,14 @@ ready:
|
|||
* --------------------------------------------------------------------- */
|
||||
|
||||
virtual int enumvalueDeclaration(Node *n) {
|
||||
String *name = Getattr(n, "sym:name");
|
||||
String *enumvalue = Getattr(n, "enumvalue");
|
||||
String *init = 0;
|
||||
if (enumvalue) {
|
||||
char *value_repr = Char(enumvalue);
|
||||
if (value_repr)
|
||||
if (!isdigit(*value_repr) && *value_repr != '+' && *value_repr != '-') {
|
||||
init = NewStringf(" = '%c'", *value_repr);
|
||||
}
|
||||
else
|
||||
init = NewStringf(" = %s", enumvalue);
|
||||
}
|
||||
|
||||
String *newclassname = Getattr(Swig_methodclass(parentNode(n)), "sym:name");
|
||||
String *newname = NewStringf("%s_%s", newclassname, name);
|
||||
int gencomma = 1;
|
||||
if (!enum_values) {
|
||||
enum_values = NewString("");
|
||||
gencomma = 0;
|
||||
}
|
||||
Printv(enum_values, gencomma ? ",\n " : " ", newclassname ? newname : name, enumvalue ? init : "", NIL);
|
||||
Delete(newname);
|
||||
if (init)
|
||||
Delete(init);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* typedefHandler()
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
virtual int typedefHandler(Node *n) {
|
||||
if (!proxy_flag)
|
||||
return SWIG_OK;
|
||||
String *name = Getattr(n, "sym:name");
|
||||
String *type = Getattr(n, "type");
|
||||
char *c = Char(SwigType_str(type, 0));
|
||||
|
||||
if (!name)
|
||||
name = Getattr(n, "name");
|
||||
|
||||
if (strncmp(c, "enum", 4) != 0) {
|
||||
if (name && type) {
|
||||
String *code = NewStringf("typedef %s %s;\n\n", name, type);
|
||||
Append(f_proxy_header, code);
|
||||
Delete(code);
|
||||
SwigType_typedef(type, name);
|
||||
}
|
||||
}
|
||||
if (Cmp(Getattr(n, "ismember"), "1") == 0 && Cmp(Getattr(n, "access"), "public") != 0)
|
||||
return SWIG_NOWRAP;
|
||||
Swig_require("enumvalueDeclaration", n, "*value", "?enumvalueex", "?enumvalue", NIL);
|
||||
String *name = Getattr(n, "value");
|
||||
String *value = Getattr(n, "enumvalueex");
|
||||
value = value ? value : Getattr(n, "enumvalue");
|
||||
Printv(f_proxy_header, "#define ", Swig_name_mangle(name), " ", value, "\n", NIL);
|
||||
Swig_restore(n);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
84
Tools/config/config.guess
vendored
84
Tools/config/config.guess
vendored
|
|
@ -1,10 +1,10 @@
|
|||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2006-07-02'
|
||||
timestamp='2008-11-15'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
|
|
@ -56,8 +56,8 @@ version="\
|
|||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
|
@ -161,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
sh5el) machine=sh5le-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
|
|
@ -329,8 +330,21 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
eval $set_cc_for_build
|
||||
SUN_ARCH="i386"
|
||||
# If there is a compiler, see if it is configured for 64-bit objects.
|
||||
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
|
||||
# This test works for both compilers.
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
SUN_ARCH="x86_64"
|
||||
fi
|
||||
fi
|
||||
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
|
|
@ -531,7 +545,7 @@ EOF
|
|||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[45])
|
||||
*:AIX:*:[456])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
|
|
@ -780,7 +794,7 @@ EOF
|
|||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
i*:MINGW*:*)
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
|
|
@ -790,12 +804,18 @@ EOF
|
|||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[3456]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T:Interix*:[3456]*)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd | genuineintel)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
|
|
@ -829,7 +849,14 @@ EOF
|
|||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
|
|
@ -921,6 +948,9 @@ EOF
|
|||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
|
|
@ -950,6 +980,9 @@ EOF
|
|||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
|
|
@ -968,9 +1001,6 @@ EOF
|
|||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit ;;
|
||||
"")
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||
# one that does not give us useful --help.
|
||||
|
|
@ -1199,6 +1229,9 @@ EOF
|
|||
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
|
||||
echo i586-pc-beos
|
||||
exit ;;
|
||||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||
echo i586-pc-haiku
|
||||
exit ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
|
@ -1208,6 +1241,15 @@ EOF
|
|||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-7:SUPER-UX:*:*)
|
||||
echo sx7-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
|
@ -1458,9 +1500,9 @@ This script, last modified $timestamp, has failed to recognize
|
|||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
and
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
|
|
|||
99
Tools/config/config.sub
vendored
99
Tools/config/config.sub
vendored
|
|
@ -1,10 +1,10 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2006-09-20'
|
||||
timestamp='2008-09-08'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
|
|
@ -72,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
|
@ -245,17 +245,19 @@ case $basic_machine in
|
|||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64octeon | mips64octeonel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64r5900 | mips64r5900el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
|
|
@ -286,7 +288,7 @@ case $basic_machine in
|
|||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
|
|
@ -324,19 +326,21 @@ case $basic_machine in
|
|||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64octeon-* | mips64octeonel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64r5900-* | mips64r5900el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
|
|
@ -364,14 +368,18 @@ case $basic_machine in
|
|||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
| z8k-* | z80-*)
|
||||
;;
|
||||
# Recognize the basic CPU types without company name, with glob match.
|
||||
xtensa*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
|
|
@ -443,10 +451,22 @@ case $basic_machine in
|
|||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
blackfin)
|
||||
basic_machine=bfin-unknown
|
||||
os=-linux
|
||||
;;
|
||||
blackfin-*)
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cegcc)
|
||||
basic_machine=arm-unknown
|
||||
os=-cegcc
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
|
|
@ -475,8 +495,8 @@ case $basic_machine in
|
|||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
cr16)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
|
|
@ -514,6 +534,10 @@ case $basic_machine in
|
|||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dicos)
|
||||
basic_machine=i686-pc
|
||||
os=-dicos
|
||||
;;
|
||||
djgpp)
|
||||
basic_machine=i586-pc
|
||||
os=-msdosdjgpp
|
||||
|
|
@ -668,6 +692,14 @@ case $basic_machine in
|
|||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
;;
|
||||
m68knommu-*)
|
||||
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
|
|
@ -683,6 +715,10 @@ case $basic_machine in
|
|||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
|
|
@ -809,6 +845,14 @@ case $basic_machine in
|
|||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
parisc)
|
||||
basic_machine=hppa-unknown
|
||||
os=-linux
|
||||
;;
|
||||
parisc-*)
|
||||
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
|
|
@ -925,6 +969,9 @@ case $basic_machine in
|
|||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh5el)
|
||||
basic_machine=sh5le-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
|
|
@ -1014,6 +1061,10 @@ case $basic_machine in
|
|||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
|
|
@ -1089,6 +1140,10 @@ case $basic_machine in
|
|||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
;;
|
||||
z80-*-coff)
|
||||
basic_machine=z80-unknown
|
||||
os=-sim
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
|
|
@ -1209,7 +1264,7 @@ case $os in
|
|||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
|
|
@ -1219,7 +1274,7 @@ case $os in
|
|||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
|
@ -1349,6 +1404,9 @@ case $os in
|
|||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
-dicos*)
|
||||
os=-dicos
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
|
|
@ -1414,6 +1472,9 @@ case $basic_machine in
|
|||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue