xref: /AOO41X/main/libtextcat/libtextcat-2.2.patch (revision ddc94e00a9d8407cad28cc2beaa95bd6ec2f53a4)
1cdf0e10cSrcweir--- misc/libtextcat-2.2/configure   Thu May 22 13:39:55 2003
2cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/configure Mon Mar 31 11:29:14 2008
3cdf0e10cSrcweir@@ -3451,7 +3451,7 @@
4cdf0e10cSrcweir   ;;
5cdf0e10cSrcweir
6cdf0e10cSrcweir # This must be Linux ELF.
7cdf0e10cSrcweir-linux-gnu*)
8cdf0e10cSrcweir+linux-gnu*|k*bsd*-gnu*)
9cdf0e10cSrcweir   case $host_cpu in
10cdf0e10cSrcweir   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
11cdf0e10cSrcweir     lt_cv_deplibs_check_method=pass_all ;;
12cdf0e10cSrcweir@@ -5391,7 +5391,8 @@
13cdf0e10cSrcweir allow_undefined_flag=
14cdf0e10cSrcweir no_undefined_flag=
15cdf0e10cSrcweir need_lib_prefix=unknown
16cdf0e10cSrcweir-need_version=unknown
17cdf0e10cSrcweir+#need_version=unknown
18cdf0e10cSrcweir+need_version=no
19cdf0e10cSrcweir # when you set need_version to no, make sure it does not cause -set_version
20cdf0e10cSrcweir # flags to be left without arguments
21cdf0e10cSrcweir archive_cmds=
22cdf0e10cSrcweir@@ -5785,7 +5786,7 @@
23cdf0e10cSrcweir     #        cross-compilation, but unfortunately the echo tests do not
24cdf0e10cSrcweir     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
25cdf0e10cSrcweir     #       `"' quotes if we put them in here... so don't!
26cdf0e10cSrcweir-    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
27cdf0e10cSrcweir+    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$compiler_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
28cdf0e10cSrcweir     # We need to add '_' to the symbols in $export_symbols first
29cdf0e10cSrcweir     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
30cdf0e10cSrcweir     hardcode_direct=yes
31cdf0e10cSrcweir@@ -6280,7 +6281,7 @@
32cdf0e10cSrcweir   ;;
33cdf0e10cSrcweir
34cdf0e10cSrcweir freebsd*)
35cdf0e10cSrcweir-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
36cdf0e10cSrcweir+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
37cdf0e10cSrcweir   version_type=freebsd-$objformat
38cdf0e10cSrcweir   case $version_type in
39cdf0e10cSrcweir     freebsd-elf*)
40cdf0e10cSrcweir@@ -6365,7 +6365,7 @@
41cdf0e10cSrcweir   ;;
42cdf0e10cSrcweir
43cdf0e10cSrcweir # This must be Linux ELF.
44cdf0e10cSrcweir-linux-gnu*)
45cdf0e10cSrcweir+linux-gnu*|k*bsd*-gnu*)
46cdf0e10cSrcweir   version_type=linux
47cdf0e10cSrcweir   need_lib_prefix=no
48cdf0e10cSrcweir   need_version=no
49cdf0e10cSrcweir--- misc/libtextcat-2.2/src/Makefile.in Thu May 22 13:39:52 2003
50cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/Makefile.in   Mon Mar 31 11:29:14 2008
51cdf0e10cSrcweir@@ -124,20 +124,20 @@
52cdf0e10cSrcweir target_vendor = @target_vendor@
53cdf0e10cSrcweir AUTOMAKE_OPTIONS = 1.4 foreign
54cdf0e10cSrcweir
55cdf0e10cSrcweir-WARNS = -W -Wall -Wshadow -Wpointer-arith
56cdf0e10cSrcweir-IFLAGS =
57cdf0e10cSrcweir-FLAGS = -g -O3 -funroll-loops -D_THREAD_SAFE -D_GNU_SOURCE
58cdf0e10cSrcweir+#WARNS = -W -Wall -Wshadow -Wpointer-arith
59cdf0e10cSrcweir+IFLAGS =
60cdf0e10cSrcweir+#FLAGS = -g -O3 -funroll-loops -D_THREAD_SAFE -D_GNU_SOURCE
61cdf0e10cSrcweir VERBOSE = -DVERBOSE
62cdf0e10cSrcweir AM_CFLAGS = $(IFLAGS) $(VERBOSE) $(WARNS) $(FLAGS)
63cdf0e10cSrcweir AM_LDFLAGS = -g
64cdf0e10cSrcweir
65cdf0e10cSrcweir noinst_HEADERS = \
66cdf0e10cSrcweir-   common.h constants.h fingerprint.h textcat.h wg_mempool.h
67cdf0e10cSrcweir+        common.h constants.h fingerprint.h textcat.h wg_mempool.h utf8misc.h
68cdf0e10cSrcweir
69cdf0e10cSrcweir
70cdf0e10cSrcweir lib_LTLIBRARIES = libtextcat.la
71cdf0e10cSrcweir libtextcat_la_SOURCES = \
72cdf0e10cSrcweir-   common.c fingerprint.c textcat.c wg_mempool.c
73cdf0e10cSrcweir+        common.c fingerprint.c textcat.c wg_mempool.c utf8misc.c
74cdf0e10cSrcweir
75cdf0e10cSrcweir
76cdf0e10cSrcweir bin_PROGRAMS = createfp
77cdf0e10cSrcweir@@ -156,7 +156,7 @@
78cdf0e10cSrcweir libtextcat_la_LDFLAGS =
79cdf0e10cSrcweir libtextcat_la_LIBADD =
80cdf0e10cSrcweir am_libtextcat_la_OBJECTS = common.lo fingerprint.lo textcat.lo \
81cdf0e10cSrcweir-   wg_mempool.lo
82cdf0e10cSrcweir+        wg_mempool.lo utf8misc.lo
83cdf0e10cSrcweir libtextcat_la_OBJECTS = $(am_libtextcat_la_OBJECTS)
84cdf0e10cSrcweir bin_PROGRAMS = createfp$(EXEEXT)
85cdf0e10cSrcweir noinst_PROGRAMS = testtextcat$(EXEEXT)
86cdf0e10cSrcweir@@ -177,7 +177,8 @@
87cdf0e10cSrcweir @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/common.Plo ./$(DEPDIR)/createfp.Po \
88cdf0e10cSrcweir @AMDEP_TRUE@   ./$(DEPDIR)/fingerprint.Plo \
89cdf0e10cSrcweir @AMDEP_TRUE@   ./$(DEPDIR)/testtextcat.Po ./$(DEPDIR)/textcat.Plo \
90cdf0e10cSrcweir-@AMDEP_TRUE@   ./$(DEPDIR)/wg_mempool.Plo
91cdf0e10cSrcweir+@AMDEP_TRUE@    ./$(DEPDIR)/wg_mempool.Plo \
92cdf0e10cSrcweir+@AMDEP_TRUE@    ./$(DEPDIR)/utf8misc.Plo
93cdf0e10cSrcweir COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
94cdf0e10cSrcweir    $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
95cdf0e10cSrcweir LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
96cdf0e10cSrcweir@@ -213,7 +214,7 @@
97cdf0e10cSrcweir    @rm -f stamp-h1
98cdf0e10cSrcweir    cd $(top_builddir) && $(SHELL) ./config.status src/config.h
99cdf0e10cSrcweir
100cdf0e10cSrcweir-$(srcdir)/config.h.in:  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
101cdf0e10cSrcweir+$(srcdir)/config.h.in:  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
102cdf0e10cSrcweir    cd $(top_srcdir) && $(AUTOHEADER)
103cdf0e10cSrcweir    touch $(srcdir)/config.h.in
104cdf0e10cSrcweir
105cdf0e10cSrcweir@@ -247,8 +248,8 @@
106cdf0e10cSrcweir      echo "rm -f \"$${dir}/so_locations\""; \
107cdf0e10cSrcweir      rm -f "$${dir}/so_locations"; \
108cdf0e10cSrcweir    done
109cdf0e10cSrcweir-libtextcat.la: $(libtextcat_la_OBJECTS) $(libtextcat_la_DEPENDENCIES)
110cdf0e10cSrcweir-   $(LINK) -rpath $(libdir) $(libtextcat_la_LDFLAGS) $(libtextcat_la_OBJECTS) $(libtextcat_la_LIBADD) $(LIBS)
111cdf0e10cSrcweir+libtextcat.la: $(libtextcat_la_OBJECTS) $(libtextcat_la_DEPENDENCIES)
112cdf0e10cSrcweir+   $(LINK) -avoid-version -rpath $(libdir) $(libtextcat_la_LDFLAGS) $(libtextcat_la_OBJECTS) $(libtextcat_la_LIBADD) $(LIBS)
113cdf0e10cSrcweir binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
114cdf0e10cSrcweir install-binPROGRAMS: $(bin_PROGRAMS)
115cdf0e10cSrcweir    @$(NORMAL_INSTALL)
116cdf0e10cSrcweir@@ -285,10 +286,10 @@
117cdf0e10cSrcweir      echo " rm -f $$p $$f"; \
118cdf0e10cSrcweir      rm -f $$p $$f ; \
119cdf0e10cSrcweir    done
120cdf0e10cSrcweir-createfp$(EXEEXT): $(createfp_OBJECTS) $(createfp_DEPENDENCIES)
121cdf0e10cSrcweir+createfp$(EXEEXT): $(createfp_OBJECTS) $(createfp_DEPENDENCIES)
122cdf0e10cSrcweir    @rm -f createfp$(EXEEXT)
123cdf0e10cSrcweir    $(LINK) $(createfp_LDFLAGS) $(createfp_OBJECTS) $(createfp_LDADD) $(LIBS)
124cdf0e10cSrcweir-testtextcat$(EXEEXT): $(testtextcat_OBJECTS) $(testtextcat_DEPENDENCIES)
125cdf0e10cSrcweir+testtextcat$(EXEEXT): $(testtextcat_OBJECTS) $(testtextcat_DEPENDENCIES)
126cdf0e10cSrcweir    @rm -f testtextcat$(EXEEXT)
127cdf0e10cSrcweir    $(LINK) $(testtextcat_LDFLAGS) $(testtextcat_OBJECTS) $(testtextcat_LDADD) $(LIBS)
128cdf0e10cSrcweir
129cdf0e10cSrcweir@@ -304,6 +305,7 @@
130cdf0e10cSrcweir @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtextcat.Po@am__quote@
131cdf0e10cSrcweir @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textcat.Plo@am__quote@
132cdf0e10cSrcweir @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wg_mempool.Plo@am__quote@
133cdf0e10cSrcweir+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8misc.Plo@am__quote@
134cdf0e10cSrcweir
135cdf0e10cSrcweir distclean-depend:
136cdf0e10cSrcweir    -rm -rf ./$(DEPDIR)
137cdf0e10cSrcweir--- misc/libtextcat-2.2/src/common.c    Thu May 22 13:32:43 2003
138cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/common.c  Mon Mar 31 11:29:14 2008
139cdf0e10cSrcweir@@ -3,23 +3,23 @@
140cdf0e10cSrcweir  *
141cdf0e10cSrcweir  * Copyright (c) 2003, WiseGuys Internet B.V.
142cdf0e10cSrcweir  * All rights reserved.
143cdf0e10cSrcweir- *
144cdf0e10cSrcweir+ *
145cdf0e10cSrcweir  * Redistribution and use in source and binary forms, with or without
146cdf0e10cSrcweir  * modification, are permitted provided that the following conditions
147cdf0e10cSrcweir  * are met:
148cdf0e10cSrcweir- *
149cdf0e10cSrcweir+ *
150cdf0e10cSrcweir  * - Redistributions of source code must retain the above copyright
151cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer.
152cdf0e10cSrcweir- *
153cdf0e10cSrcweir+ *
154cdf0e10cSrcweir  * - Redistributions in binary form must reproduce the above copyright
155cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer in the
156cdf0e10cSrcweir  * documentation and/or other materials provided with the
157cdf0e10cSrcweir  * distribution.
158cdf0e10cSrcweir- *
159cdf0e10cSrcweir+ *
160cdf0e10cSrcweir  * - Neither the name of the WiseGuys Internet B.V. nor the names of
161cdf0e10cSrcweir  * its contributors may be used to endorse or promote products derived
162cdf0e10cSrcweir  * from this software without specific prior written permission.
163cdf0e10cSrcweir- *
164cdf0e10cSrcweir+ *
165cdf0e10cSrcweir  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
166cdf0e10cSrcweir  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
167cdf0e10cSrcweir  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
168cdf0e10cSrcweir@@ -114,11 +114,11 @@
169cdf0e10cSrcweir        wgmem_error( "Error while strduping %u bytes.\n", strlen(s) );
170cdf0e10cSrcweir    }
171cdf0e10cSrcweir
172cdf0e10cSrcweir-   return( result );
173cdf0e10cSrcweir+   return( result );
174cdf0e10cSrcweir }
175cdf0e10cSrcweir
176cdf0e10cSrcweir-extern void* wg_realloc( void *ptr, size_t size )
177cdf0e10cSrcweir-{
178cdf0e10cSrcweir+extern void* wg_realloc( void *ptr, size_t size )
179cdf0e10cSrcweir+{
180cdf0e10cSrcweir    void *result;
181cdf0e10cSrcweir
182cdf0e10cSrcweir    if (!size) {
183cdf0e10cSrcweir@@ -131,7 +131,7 @@
184cdf0e10cSrcweir        wgmem_error( "Error while reallocing %u bytes.\n", size );
185cdf0e10cSrcweir    }
186cdf0e10cSrcweir
187cdf0e10cSrcweir-   return( result );
188cdf0e10cSrcweir+   return( result );
189cdf0e10cSrcweir }
190cdf0e10cSrcweir
191cdf0e10cSrcweir extern void wg_free( void *mem )
192cdf0e10cSrcweir@@ -148,12 +148,12 @@
193cdf0e10cSrcweir         if ( fgets(line, size, fp) == NULL ) {
194cdf0e10cSrcweir        return NULL;
195cdf0e10cSrcweir    }
196cdf0e10cSrcweir-
197cdf0e10cSrcweir+
198cdf0e10cSrcweir         /** kill term null **/
199cdf0e10cSrcweir         if ( (p = strpbrk( line, "\n\r" )) ) {
200cdf0e10cSrcweir                 *p = '\0';
201cdf0e10cSrcweir-        }
202cdf0e10cSrcweir-
203cdf0e10cSrcweir+        }
204cdf0e10cSrcweir+
205cdf0e10cSrcweir         return line;
206cdf0e10cSrcweir }
207cdf0e10cSrcweir
208cdf0e10cSrcweir@@ -164,39 +164,39 @@
209cdf0e10cSrcweir  *
210cdf0e10cSrcweir  * ARGUMENTS:
211cdf0e10cSrcweir  * - result:
212cdf0e10cSrcweir- *
213cdf0e10cSrcweir+ *
214cdf0e10cSrcweir  *  After the split, this array contains pointers to the start of each
215cdf0e10cSrcweir  *  detected segment. Must be preallocated and at least as large as
216cdf0e10cSrcweir  *  maxsegments. The pointers point into the dest buffer.
217cdf0e10cSrcweir- *
218cdf0e10cSrcweir- * - dest:
219cdf0e10cSrcweir- *
220cdf0e10cSrcweir+ *
221cdf0e10cSrcweir+ * - dest:
222cdf0e10cSrcweir+ *
223cdf0e10cSrcweir  *  String into which result points as an index. Must be preallocated, and
224cdf0e10cSrcweir  *  at least as big as src. You can use src as dest, but in that case src
225cdf0e10cSrcweir  *  is overwritten!
226cdf0e10cSrcweir- *
227cdf0e10cSrcweir- * - src:
228cdf0e10cSrcweir- *
229cdf0e10cSrcweir+ *
230cdf0e10cSrcweir+ * - src:
231cdf0e10cSrcweir+ *
232cdf0e10cSrcweir  *  The string to split. Sequences of whitespace are treated as separators, unless
233cdf0e10cSrcweir  *  escaped. There are two ways to escape: by using single quotes (anything
234cdf0e10cSrcweir  *  between single quotes is treated as one segment), or by using a backslash
235cdf0e10cSrcweir  *  to escape the next character. The backslash escape works inside quotation
236cdf0e10cSrcweir  *  as well.
237cdf0e10cSrcweir- *
238cdf0e10cSrcweir+ *
239cdf0e10cSrcweir  *  Example:
240cdf0e10cSrcweir- *
241cdf0e10cSrcweir+ *
242cdf0e10cSrcweir  *  "It\'s   very\ easy   'to  use WiseGuys\' wg_split()' function" is split into:
243cdf0e10cSrcweir- *
244cdf0e10cSrcweir+ *
245cdf0e10cSrcweir  *  "It's"
246cdf0e10cSrcweir  *  "very easy"
247cdf0e10cSrcweir  *  "to  use WiseGuys' wg_split()"
248cdf0e10cSrcweir  *  "function"
249cdf0e10cSrcweir- *
250cdf0e10cSrcweir- * - maxsegments:
251cdf0e10cSrcweir- *
252cdf0e10cSrcweir+ *
253cdf0e10cSrcweir+ * - maxsegments:
254cdf0e10cSrcweir+ *
255cdf0e10cSrcweir  *  The maximum number of segments. If the splitter runs out of segments,
256cdf0e10cSrcweir  *  the remainder of the string is stored in the last segment.
257cdf0e10cSrcweir- *
258cdf0e10cSrcweir+ *
259cdf0e10cSrcweir  * RETURN VALUE:
260cdf0e10cSrcweir  * The number of segments found.
261cdf0e10cSrcweir  */
262cdf0e10cSrcweir@@ -218,12 +218,12 @@
263cdf0e10cSrcweir        switch (state) {
264cdf0e10cSrcweir        case 0:
265cdf0e10cSrcweir            /*** Skip spaces ***/
266cdf0e10cSrcweir-           while ( isspace((int) *p) ) {
267cdf0e10cSrcweir+           while ( isspace((unsigned char) *p) ) {
268cdf0e10cSrcweir                p++;
269cdf0e10cSrcweir            }
270cdf0e10cSrcweir            state = 1;
271cdf0e10cSrcweir
272cdf0e10cSrcweir-       case 1:
273cdf0e10cSrcweir+       case 1:
274cdf0e10cSrcweir            /*** Start segment ***/
275cdf0e10cSrcweir            result[cnt] = w;
276cdf0e10cSrcweir            cnt++;
277cdf0e10cSrcweir@@ -232,12 +232,12 @@
278cdf0e10cSrcweir        case 2:
279cdf0e10cSrcweir            /*** Unquoted segment ***/
280cdf0e10cSrcweir            while (*p) {
281cdf0e10cSrcweir-               if ( isspace((int) *p) ) {
282cdf0e10cSrcweir+               if ( isspace((unsigned char) *p) ) {
283cdf0e10cSrcweir                    *w++ = '\0';
284cdf0e10cSrcweir                    p++;
285cdf0e10cSrcweir                    state = 0;
286cdf0e10cSrcweir                    break;
287cdf0e10cSrcweir-               }
288cdf0e10cSrcweir+               }
289cdf0e10cSrcweir                else if ( *p == '\'' ) {
290cdf0e10cSrcweir                    /*** Start quotation ***/
291cdf0e10cSrcweir                    p++;
292cdf0e10cSrcweir@@ -292,17 +292,17 @@
293cdf0e10cSrcweir }
294cdf0e10cSrcweir
295cdf0e10cSrcweir
296cdf0e10cSrcweir+#ifdef HAVE_GETTIMEOFDAY    /* TL : no struct timeval under Win32 */
297cdf0e10cSrcweir extern void wg_timerstart(wgtimer_t *t)
298cdf0e10cSrcweir {
299cdf0e10cSrcweir-#ifdef HAVE_GETTIMEOFDAY
300cdf0e10cSrcweir         gettimeofday( &(t->start), NULL );
301cdf0e10cSrcweir-#endif
302cdf0e10cSrcweir }
303cdf0e10cSrcweir+#endif  /* TL : no struct timeval under Win32 */
304cdf0e10cSrcweir
305cdf0e10cSrcweir
306cdf0e10cSrcweir+#ifdef HAVE_GETTIMEOFDAY    /* TL : no struct timeval under Win32 */
307cdf0e10cSrcweir extern uint4 wg_timerstop(wgtimer_t *t)
308cdf0e10cSrcweir {
309cdf0e10cSrcweir-#ifdef HAVE_GETTIMEOFDAY
310cdf0e10cSrcweir    uint4 result;
311cdf0e10cSrcweir         gettimeofday( &(t->stop), NULL );
312cdf0e10cSrcweir         result = (t->stop.tv_sec - t->start.tv_sec) * 1000000 +
313cdf0e10cSrcweir@@ -312,25 +312,23 @@
314cdf0e10cSrcweir    t->start.tv_usec = t->stop.tv_usec;
315cdf0e10cSrcweir
316cdf0e10cSrcweir    return result;
317cdf0e10cSrcweir-#else
318cdf0e10cSrcweir-   return 0;
319cdf0e10cSrcweir-#endif
320cdf0e10cSrcweir }
321cdf0e10cSrcweir+#endif  /* TL : no struct timeval under Win32 */
322cdf0e10cSrcweir
323cdf0e10cSrcweir
324cdf0e10cSrcweir /**
325cdf0e10cSrcweir  * wg_strgmov -- a guarded strcpy() variation
326cdf0e10cSrcweir- *
327cdf0e10cSrcweir+ *
328cdf0e10cSrcweir  * copies src to dest (including terminating zero), and returns
329cdf0e10cSrcweir  * pointer to position of terminating zero in dest. The function is
330cdf0e10cSrcweir  * guaranteed not to write past destlimit. If the copy couldn't be
331cdf0e10cSrcweir- * finished, the function returns NULL after restoring the first
332cdf0e10cSrcweir- * character in dest for your convenience (since this is usually a zero).
333cdf0e10cSrcweir+ * finished, the function returns NULL after restoring the first
334cdf0e10cSrcweir+ * character in dest for your convenience (since this is usually a zero).
335cdf0e10cSrcweir  */
336cdf0e10cSrcweir char *wg_strgmov( char *dest, const char *src, const char *destlimit )
337cdf0e10cSrcweir {
338cdf0e10cSrcweir    char tmp, *w;
339cdf0e10cSrcweir-
340cdf0e10cSrcweir+
341cdf0e10cSrcweir    if ( !dest || dest >= destlimit ) {
342cdf0e10cSrcweir        return NULL;
343cdf0e10cSrcweir    }
344cdf0e10cSrcweir@@ -355,7 +353,7 @@
345cdf0e10cSrcweir }
346cdf0e10cSrcweir
347cdf0e10cSrcweir /*
348cdf0e10cSrcweir- * wg_trim() -- remove whitespace surrounding a string.
349cdf0e10cSrcweir+ * wg_trim() -- remove whitespace surrounding a string.
350cdf0e10cSrcweir  *
351cdf0e10cSrcweir  * Example: "   bla   bla   bla   " becomes "bla   bla   bla" after trimming.
352cdf0e10cSrcweir  *
353cdf0e10cSrcweir@@ -373,12 +371,12 @@
354cdf0e10cSrcweir    char *lastnonspace = &dest[-1];
355cdf0e10cSrcweir    const char *p = src;
356cdf0e10cSrcweir    char *w = dest;
357cdf0e10cSrcweir-
358cdf0e10cSrcweir-   while ( isspace((int)*p) ) {
359cdf0e10cSrcweir+
360cdf0e10cSrcweir+   while ( isspace((unsigned char)*p) ) {
361cdf0e10cSrcweir        p++;
362cdf0e10cSrcweir    }
363cdf0e10cSrcweir    while (*p) {
364cdf0e10cSrcweir-       if ( !isspace((int)*p) ) {
365cdf0e10cSrcweir+       if ( !isspace((unsigned char)*p) ) {
366cdf0e10cSrcweir            lastnonspace = w;
367cdf0e10cSrcweir        }
368cdf0e10cSrcweir        *w++ = *p++;
369cdf0e10cSrcweir--- misc/libtextcat-2.2/src/common.h    Thu May 22 15:02:29 2003
370cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/common.h  Mon Mar 31 11:29:14 2008
371cdf0e10cSrcweir@@ -1,28 +1,28 @@
372cdf0e10cSrcweir #ifndef _COMMON_H_
373cdf0e10cSrcweir #define _COMMON_H_
374cdf0e10cSrcweir /**
375cdf0e10cSrcweir- * common.h -- a mixed bag of helper functions
376cdf0e10cSrcweir+ * common.h -- a mixed bag of helper functions
377cdf0e10cSrcweir  *
378cdf0e10cSrcweir  * Copyright (C) 2003 WiseGuys Internet B.V.
379cdf0e10cSrcweir  *
380cdf0e10cSrcweir  * THE BSD LICENSE
381cdf0e10cSrcweir- *
382cdf0e10cSrcweir+ *
383cdf0e10cSrcweir  * Redistribution and use in source and binary forms, with or without
384cdf0e10cSrcweir  * modification, are permitted provided that the following conditions
385cdf0e10cSrcweir  * are met:
386cdf0e10cSrcweir- *
387cdf0e10cSrcweir+ *
388cdf0e10cSrcweir  * - Redistributions of source code must retain the above copyright
389cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer.
390cdf0e10cSrcweir- *
391cdf0e10cSrcweir+ *
392cdf0e10cSrcweir  * - Redistributions in binary form must reproduce the above copyright
393cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer in the
394cdf0e10cSrcweir  * documentation and/or other materials provided with the
395cdf0e10cSrcweir  * distribution.
396cdf0e10cSrcweir- *
397cdf0e10cSrcweir+ *
398cdf0e10cSrcweir  * - Neither the name of the WiseGuys Internet B.V. nor the names of
399cdf0e10cSrcweir  * its contributors may be used to endorse or promote products derived
400cdf0e10cSrcweir  * from this software without specific prior written permission.
401cdf0e10cSrcweir- *
402cdf0e10cSrcweir+ *
403cdf0e10cSrcweir  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
404cdf0e10cSrcweir  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
405cdf0e10cSrcweir  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
406cdf0e10cSrcweir@@ -86,10 +86,12 @@
407cdf0e10cSrcweir typedef char       boole;
408cdf0e10cSrcweir #endif
409cdf0e10cSrcweir
410cdf0e10cSrcweir+#ifdef HAVE_GETTIMEOFDAY    /* TL : no struct timeval under Win32 */
411cdf0e10cSrcweir typedef struct wgtimer_s {
412cdf0e10cSrcweir         struct timeval start;
413cdf0e10cSrcweir         struct timeval stop;
414cdf0e10cSrcweir } wgtimer_t;
415cdf0e10cSrcweir+#endif  /* TL : no struct timeval under Win32 */
416cdf0e10cSrcweir
417cdf0e10cSrcweir
418cdf0e10cSrcweir extern void *wg_malloc( size_t size );
419cdf0e10cSrcweir@@ -101,13 +103,15 @@
420cdf0e10cSrcweir
421cdf0e10cSrcweir extern char *wg_getline( char *line, int size, FILE *fp );
422cdf0e10cSrcweir
423cdf0e10cSrcweir+#ifdef HAVE_GETTIMEOFDAY    /* TL : no struct timeval under Win32 */
424cdf0e10cSrcweir extern void wg_timerstart(wgtimer_t *t);
425cdf0e10cSrcweir extern uint4 wg_timerstop(wgtimer_t *t);
426cdf0e10cSrcweir+#endif  /* TL : no struct timeval under Win32 */
427cdf0e10cSrcweir
428cdf0e10cSrcweir extern unsigned int wg_split( char **result, char *dest, char *src, int maxsegments );
429cdf0e10cSrcweir extern char *wg_strgmov( char *dest, const char *src, const char *destlimit );
430cdf0e10cSrcweir extern char *wg_trim( char *dest, const char *src );
431cdf0e10cSrcweir
432cdf0e10cSrcweir-
433cdf0e10cSrcweir+
434cdf0e10cSrcweir #endif
435cdf0e10cSrcweir
436cdf0e10cSrcweir--- misc/libtextcat-2.2/src/constants.h Thu May 22 13:32:43 2003
437cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/constants.h   Mon Mar 31 11:29:14 2008
438cdf0e10cSrcweir@@ -39,6 +39,8 @@
439cdf0e10cSrcweir  */
440cdf0e10cSrcweir #include <limits.h>
441cdf0e10cSrcweir
442cdf0e10cSrcweir+#define _UTF8_
443cdf0e10cSrcweir+
444cdf0e10cSrcweir #define DESCRIPTION "out of place"
445cdf0e10cSrcweir
446cdf0e10cSrcweir /* Reported matches are those fingerprints with a score less than best
447cdf0e10cSrcweir@@ -59,14 +61,21 @@
448cdf0e10cSrcweir /* Maximum number of n-grams in a fingerprint */
449cdf0e10cSrcweir #define MAXNGRAMS  400
450cdf0e10cSrcweir
451cdf0e10cSrcweir-/* Maximum size of an n-gram? */
452cdf0e10cSrcweir-#define MAXNGRAMSIZE 5
453cdf0e10cSrcweir+/* Maximum number of character of an n-gram? */
454cdf0e10cSrcweir+#define MAXNGRAMSYMBOL 5
455cdf0e10cSrcweir+
456cdf0e10cSrcweir+/* Maximum size of the string representing an n-gram (must be greater than number of symbol) */
457cdf0e10cSrcweir+#ifdef _UTF8_
458cdf0e10cSrcweir+#define MAXNGRAMSIZE 20
459cdf0e10cSrcweir+#else
460cdf0e10cSrcweir+#define MAXNGRAMSIZE MAXNGRAMSYMBOL
461cdf0e10cSrcweir+#endif
462cdf0e10cSrcweir
463cdf0e10cSrcweir /* Which characters are not acceptable in n-grams? */
464cdf0e10cSrcweir-#define INVALID(c) (isspace((int)c) || isdigit((int)c))
465cdf0e10cSrcweir+#define INVALID(c) (isspace((unsigned char)c) || isdigit((unsigned char)c))
466cdf0e10cSrcweir
467cdf0e10cSrcweir /* Minimum size (in characters) for accepting a document */
468cdf0e10cSrcweir-#define MINDOCSIZE  25
469cdf0e10cSrcweir+#define MINDOCSIZE  6
470cdf0e10cSrcweir
471cdf0e10cSrcweir /* Maximum penalty for missing an n-gram in fingerprint */
472cdf0e10cSrcweir #define MAXOUTOFPLACE 400
473cdf0e10cSrcweir@@ -75,5 +84,8 @@
474cdf0e10cSrcweir #define TABLEPOW  13
475cdf0e10cSrcweir
476cdf0e10cSrcweir #define MAXSCORE  INT_MAX
477cdf0e10cSrcweir+
478cdf0e10cSrcweir+/* where the fingerprints files are stored */
479cdf0e10cSrcweir+#define DEFAULT_FINGERPRINTS_PATH ""
480cdf0e10cSrcweir
481cdf0e10cSrcweir #endif
482cdf0e10cSrcweir--- misc/libtextcat-2.2/src/fingerprint.c   Thu May 22 13:32:43 2003
483cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/fingerprint.c Mon Mar 31 11:29:14 2008
484cdf0e10cSrcweir@@ -6,23 +6,23 @@
485cdf0e10cSrcweir  * All rights reserved.
486cdf0e10cSrcweir  *
487cdf0e10cSrcweir  * THE BSD LICENSE
488cdf0e10cSrcweir- *
489cdf0e10cSrcweir+ *
490cdf0e10cSrcweir  * Redistribution and use in source and binary forms, with or without
491cdf0e10cSrcweir  * modification, are permitted provided that the following conditions
492cdf0e10cSrcweir  * are met:
493cdf0e10cSrcweir- *
494cdf0e10cSrcweir+ *
495cdf0e10cSrcweir  * - Redistributions of source code must retain the above copyright
496cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer.
497cdf0e10cSrcweir- *
498cdf0e10cSrcweir+ *
499cdf0e10cSrcweir  * - Redistributions in binary form must reproduce the above copyright
500cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer in the
501cdf0e10cSrcweir  * documentation and/or other materials provided with the
502cdf0e10cSrcweir  * distribution.
503cdf0e10cSrcweir- *
504cdf0e10cSrcweir+ *
505cdf0e10cSrcweir  * - Neither the name of the WiseGuys Internet B.V. nor the names of
506cdf0e10cSrcweir  * its contributors may be used to endorse or promote products derived
507cdf0e10cSrcweir  * from this software without specific prior written permission.
508cdf0e10cSrcweir- *
509cdf0e10cSrcweir+ *
510cdf0e10cSrcweir  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
511cdf0e10cSrcweir  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
512cdf0e10cSrcweir  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
513cdf0e10cSrcweir@@ -51,7 +51,7 @@
514cdf0e10cSrcweir  * The reason why we go through the trouble of doing a partial
515cdf0e10cSrcweir  * (heap)sort is that a full quicksort behaves horribly on the data:
516cdf0e10cSrcweir  * most n-grams have a very low count, resulting in a data set in
517cdf0e10cSrcweir- * nearly-sorted order. This causes quicksort to behave very badly.
518cdf0e10cSrcweir+ * nearly-sorted order. This causes quicksort to behave very badly.
519cdf0e10cSrcweir  * Heapsort, on the other hand, behaves handsomely: worst case is
520cdf0e10cSrcweir  * Mlog(N) for M n-grams filtered through a N-sized heap.
521cdf0e10cSrcweir  *
522cdf0e10cSrcweir@@ -63,6 +63,10 @@
523cdf0e10cSrcweir  * - put table/heap datastructure in a separate file.
524cdf0e10cSrcweir  */
525cdf0e10cSrcweir
526cdf0e10cSrcweir+#ifndef _UTF8_
527cdf0e10cSrcweir+#define _UTF8_
528cdf0e10cSrcweir+#endif
529cdf0e10cSrcweir+
530cdf0e10cSrcweir #include "config.h"
531cdf0e10cSrcweir #include <stdio.h>
532cdf0e10cSrcweir #ifdef HAVE_STDLIB_H
533cdf0e10cSrcweir@@ -80,10 +84,12 @@
534cdf0e10cSrcweir #include "wg_mempool.h"
535cdf0e10cSrcweir #include "constants.h"
536cdf0e10cSrcweir
537cdf0e10cSrcweir+#include "utf8misc.h"
538cdf0e10cSrcweir
539cdf0e10cSrcweir #define TABLESIZE  (1<<TABLEPOW)
540cdf0e10cSrcweir #define TABLEMASK  ((TABLESIZE)-1)
541cdf0e10cSrcweir
542cdf0e10cSrcweir+
543cdf0e10cSrcweir typedef struct {
544cdf0e10cSrcweir
545cdf0e10cSrcweir    sint2 rank;
546cdf0e10cSrcweir@@ -96,7 +102,7 @@
547cdf0e10cSrcweir    const char *name;
548cdf0e10cSrcweir    ngram_t *fprint;
549cdf0e10cSrcweir    uint4 size;
550cdf0e10cSrcweir-
551cdf0e10cSrcweir+
552cdf0e10cSrcweir } fp_t;
553cdf0e10cSrcweir
554cdf0e10cSrcweir typedef struct entry_s {
555cdf0e10cSrcweir@@ -105,13 +111,13 @@
556cdf0e10cSrcweir    struct entry_s *next;
557cdf0e10cSrcweir } entry_t;
558cdf0e10cSrcweir
559cdf0e10cSrcweir-typedef struct table_s {
560cdf0e10cSrcweir+typedef struct table_s {
561cdf0e10cSrcweir    void *pool;
562cdf0e10cSrcweir    entry_t **table;
563cdf0e10cSrcweir    entry_t *heap;
564cdf0e10cSrcweir
565cdf0e10cSrcweir    struct table_s *next;
566cdf0e10cSrcweir-
567cdf0e10cSrcweir+
568cdf0e10cSrcweir    uint4 heapsize;
569cdf0e10cSrcweir    uint4 size;
570cdf0e10cSrcweir } table_t;
571cdf0e10cSrcweir@@ -122,7 +128,7 @@
572cdf0e10cSrcweir  * fast and furious little hash function
573cdf0e10cSrcweir  *
574cdf0e10cSrcweir  * (Note that we could use some kind of rolling checksum, and update it
575cdf0e10cSrcweir- * during n-gram construction)
576cdf0e10cSrcweir+ * during n-gram construction)
577cdf0e10cSrcweir  */
578cdf0e10cSrcweir static uint4 simplehash( const char *p, int len )
579cdf0e10cSrcweir {
580cdf0e10cSrcweir@@ -134,29 +140,14 @@
581cdf0e10cSrcweir }
582cdf0e10cSrcweir
583cdf0e10cSrcweir
584cdf0e10cSrcweir-/* checks if n-gram lex is a prefix of key and of length len */
585cdf0e10cSrcweir-inline int issame( char *lex, char *key, int len )
586cdf0e10cSrcweir-{
587cdf0e10cSrcweir-   int i;
588cdf0e10cSrcweir-   for (i=0; i<len; i++) {
589cdf0e10cSrcweir-       if ( key[i] != lex[i] ) {
590cdf0e10cSrcweir-           return 0;
591cdf0e10cSrcweir-       }
592cdf0e10cSrcweir-   }
593cdf0e10cSrcweir-   if ( lex[i] != 0 ) {
594cdf0e10cSrcweir-       return 0;
595cdf0e10cSrcweir-   }
596cdf0e10cSrcweir-   return 1;
597cdf0e10cSrcweir-}
598cdf0e10cSrcweir-
599cdf0e10cSrcweir
600cdf0e10cSrcweir /* increases frequency of ngram(p,len) */
601cdf0e10cSrcweir-static inline int increasefreq( table_t *t, char *p, int len )
602cdf0e10cSrcweir-{
603cdf0e10cSrcweir-   uint4 hash = simplehash( p, len ) & TABLEMASK;
604cdf0e10cSrcweir+static int increasefreq( table_t *t, char *p, int len )
605cdf0e10cSrcweir+{
606cdf0e10cSrcweir+   uint4 hash = simplehash( p, len ) & TABLEMASK;
607cdf0e10cSrcweir    entry_t *entry = t->table[ hash ];
608cdf0e10cSrcweir-
609cdf0e10cSrcweir-   while ( entry ) {
610cdf0e10cSrcweir+
611cdf0e10cSrcweir+   while ( entry ) {
612cdf0e10cSrcweir        if ( issame( entry->str, p, len ) ) {
613cdf0e10cSrcweir            /*** Found it! ***/
614cdf0e10cSrcweir            entry->cnt++;
615cdf0e10cSrcweir@@ -168,7 +159,7 @@
616cdf0e10cSrcweir    }
617cdf0e10cSrcweir
618cdf0e10cSrcweir    /*** Not found, so create ***/
619cdf0e10cSrcweir-   entry = wgmempool_alloc( t->pool, sizeof(entry_t) );
620cdf0e10cSrcweir+        entry = (entry_t*)(wgmempool_alloc( t->pool, sizeof(entry_t) ));
621cdf0e10cSrcweir    strcpy( entry->str, p );
622cdf0e10cSrcweir    entry->cnt = 1;
623cdf0e10cSrcweir
624cdf0e10cSrcweir@@ -181,12 +172,12 @@
625cdf0e10cSrcweir #if 0
626cdf0e10cSrcweir
627cdf0e10cSrcweir /* looks up ngram(p,len) */
628cdf0e10cSrcweir-static entry_t *findfreq( table_t *t, char *p, int len )
629cdf0e10cSrcweir-{
630cdf0e10cSrcweir-   uint4 hash = simplehash( p, len ) & TABLEMASK;
631cdf0e10cSrcweir+static entry_t *findfreq( table_t *t, char *p, int len )
632cdf0e10cSrcweir+{
633cdf0e10cSrcweir+   uint4 hash = simplehash( p, len ) & TABLEMASK;
634cdf0e10cSrcweir    entry_t *entry = t->table[ hash ];
635cdf0e10cSrcweir-
636cdf0e10cSrcweir-   while ( entry ) {
637cdf0e10cSrcweir+
638cdf0e10cSrcweir+   while ( entry ) {
639cdf0e10cSrcweir        if ( issame( entry->str, p, len ) ) {
640cdf0e10cSrcweir            return entry;
641cdf0e10cSrcweir        }
642cdf0e10cSrcweir@@ -219,7 +210,7 @@
643cdf0e10cSrcweir #define GREATER(x,y) ((x).cnt > (y).cnt)
644cdf0e10cSrcweir #define LESS(x,y)    ((x).cnt < (y).cnt)
645cdf0e10cSrcweir
646cdf0e10cSrcweir-inline static void siftup( table_t *t, unsigned int child )
647cdf0e10cSrcweir+static void siftup( table_t *t, unsigned int child )
648cdf0e10cSrcweir {
649cdf0e10cSrcweir    entry_t *heap = t->heap;
650cdf0e10cSrcweir    unsigned int parent = (child-1) >> 1;
651cdf0e10cSrcweir@@ -241,7 +232,7 @@
652cdf0e10cSrcweir }
653cdf0e10cSrcweir
654cdf0e10cSrcweir
655cdf0e10cSrcweir-inline static void siftdown( table_t *t, unsigned int heapsize, uint4 parent )
656cdf0e10cSrcweir+static void siftdown( table_t *t, unsigned int heapsize, uint4 parent )
657cdf0e10cSrcweir {
658cdf0e10cSrcweir    entry_t *heap = t->heap;
659cdf0e10cSrcweir    unsigned int child = parent*2 + 1;
660cdf0e10cSrcweir@@ -273,7 +264,7 @@
661cdf0e10cSrcweir    if (t->size < t->heapsize) {
662cdf0e10cSrcweir        memcpy( &(heap[t->size]), item, sizeof(entry_t));
663cdf0e10cSrcweir        siftup( t, t->size );
664cdf0e10cSrcweir-       t->size++;
665cdf0e10cSrcweir+       t->size++;
666cdf0e10cSrcweir        return 0;
667cdf0e10cSrcweir    }
668cdf0e10cSrcweir
669cdf0e10cSrcweir@@ -316,18 +307,18 @@
670cdf0e10cSrcweir
671cdf0e10cSrcweir    /*** Fill result heap ***/
672cdf0e10cSrcweir    for (i=0; i<TABLESIZE; i++) {
673cdf0e10cSrcweir-       entry_t *p = t->table[i];
674cdf0e10cSrcweir+       entry_t *p = t->table[i];
675cdf0e10cSrcweir        while (p) {
676cdf0e10cSrcweir            heapinsert(t, p);
677cdf0e10cSrcweir            p = p->next;
678cdf0e10cSrcweir        }
679cdf0e10cSrcweir-   }
680cdf0e10cSrcweir+   }
681cdf0e10cSrcweir    return 1;
682cdf0e10cSrcweir }
683cdf0e10cSrcweir
684cdf0e10cSrcweir
685cdf0e10cSrcweir static table_t *inittable(uint4 maxngrams)
686cdf0e10cSrcweir-{
687cdf0e10cSrcweir+{
688cdf0e10cSrcweir    table_t *result = (table_t *)wg_zalloc( sizeof(table_t) );
689cdf0e10cSrcweir    result->table = (entry_t **)wg_zalloc( sizeof(entry_t*) * TABLESIZE );
690cdf0e10cSrcweir    result->pool = wgmempool_Init( 10000, 10 );
691cdf0e10cSrcweir@@ -347,14 +338,14 @@
692cdf0e10cSrcweir    wgmempool_Done(t->pool);
693cdf0e10cSrcweir    wg_free(t->table);
694cdf0e10cSrcweir    wg_free(t->heap);
695cdf0e10cSrcweir-   wg_free(t);
696cdf0e10cSrcweir+   wg_free(t);
697cdf0e10cSrcweir }
698cdf0e10cSrcweir
699cdf0e10cSrcweir
700cdf0e10cSrcweir extern void *fp_Init(const char *name)
701cdf0e10cSrcweir {
702cdf0e10cSrcweir    fp_t *h = (fp_t *)wg_zalloc( sizeof(fp_t) );
703cdf0e10cSrcweir-
704cdf0e10cSrcweir+
705cdf0e10cSrcweir    if ( name ) {
706cdf0e10cSrcweir        h->name = wg_strdup(name);
707cdf0e10cSrcweir    }
708cdf0e10cSrcweir@@ -458,21 +449,27 @@
709cdf0e10cSrcweir    return dest;
710cdf0e10cSrcweir }
711cdf0e10cSrcweir
712cdf0e10cSrcweir-
713cdf0e10cSrcweir+/**
714cdf0e10cSrcweir+* this function extract all n-gram from past buffer and put them into the table "t"
715cdf0e10cSrcweir+* [modified] by Jocelyn Merand to accept utf-8 multi-character symbols to be used in OpenOffice
716cdf0e10cSrcweir+*/
717cdf0e10cSrcweir static void createngramtable( table_t *t, const char *buf )
718cdf0e10cSrcweir {
719cdf0e10cSrcweir    char n[MAXNGRAMSIZE+1];
720cdf0e10cSrcweir    const char *p = buf;
721cdf0e10cSrcweir    int i;
722cdf0e10cSrcweir+        int pointer = 0;
723cdf0e10cSrcweir
724cdf0e10cSrcweir    /*** Get all n-grams where 1<=n<=MAXNGRAMSIZE. Allow underscores only at borders. ***/
725cdf0e10cSrcweir-   for (;;p++) {
726cdf0e10cSrcweir+   while(1) {
727cdf0e10cSrcweir
728cdf0e10cSrcweir-       const char *q = p;
729cdf0e10cSrcweir+     const char *q = &p[pointer];   /*[modified] previously p++ above (for(;;p++)) now, it's pointer wich is increased so we have to get the new pointer on the buffer*/
730cdf0e10cSrcweir        char *m = n;
731cdf0e10cSrcweir
732cdf0e10cSrcweir        /*** First char may be an underscore ***/
733cdf0e10cSrcweir-       *m++ = *q++;
734cdf0e10cSrcweir+                int decay = charcopy(q, m); /*[modified] previously *q++ = *m++*/
735cdf0e10cSrcweir+                q = &(p[pointer+decay]);    /*[modified] the old copying method do not manage multi-character symbols*/
736cdf0e10cSrcweir+                m += decay; /*[modified]*/
737cdf0e10cSrcweir        *m = '\0';
738cdf0e10cSrcweir
739cdf0e10cSrcweir        increasefreq( t, n, 1 );
740cdf0e10cSrcweir@@ -482,19 +479,22 @@
741cdf0e10cSrcweir        }
742cdf0e10cSrcweir
743cdf0e10cSrcweir        /*** Let the compiler unroll this ***/
744cdf0e10cSrcweir-       for ( i=2; i<=MAXNGRAMSIZE; i++) {
745cdf0e10cSrcweir+       for ( i=2; i<=MAXNGRAMSYMBOL; i++) {
746cdf0e10cSrcweir
747cdf0e10cSrcweir-           *m++ = *q;
748cdf0e10cSrcweir+                        decay = charcopy(q, m); /*[modified] like above*/
749cdf0e10cSrcweir+                        m += decay;
750cdf0e10cSrcweir            *m = '\0';
751cdf0e10cSrcweir
752cdf0e10cSrcweir            increasefreq( t, n, i );
753cdf0e10cSrcweir
754cdf0e10cSrcweir            if ( *q == '_' ) break;
755cdf0e10cSrcweir-           q++;
756cdf0e10cSrcweir+                        q += decay;
757cdf0e10cSrcweir            if ( *q == '\0' ) {
758cdf0e10cSrcweir                return;
759cdf0e10cSrcweir            }
760cdf0e10cSrcweir        }
761cdf0e10cSrcweir+
762cdf0e10cSrcweir+  pointer = nextcharstart(p,pointer);   /*[modified] p[pointer] must point on the next start of symbol, but whith utf next start is not surely next char*/
763cdf0e10cSrcweir    }
764cdf0e10cSrcweir    return;
765cdf0e10cSrcweir }
766cdf0e10cSrcweir@@ -514,7 +514,7 @@
767cdf0e10cSrcweir {
768cdf0e10cSrcweir    ngram_t *x = (ngram_t *)a;
769cdf0e10cSrcweir    ngram_t *y = (ngram_t *)b;
770cdf0e10cSrcweir-
771cdf0e10cSrcweir+
772cdf0e10cSrcweir    return mystrcmp( x->str, y->str );
773cdf0e10cSrcweir }
774cdf0e10cSrcweir
775cdf0e10cSrcweir@@ -522,12 +522,12 @@
776cdf0e10cSrcweir {
777cdf0e10cSrcweir    ngram_t *x = (ngram_t *)a;
778cdf0e10cSrcweir    ngram_t *y = (ngram_t *)b;
779cdf0e10cSrcweir-
780cdf0e10cSrcweir+
781cdf0e10cSrcweir    return x->rank - y->rank;
782cdf0e10cSrcweir }
783cdf0e10cSrcweir
784cdf0e10cSrcweir /**
785cdf0e10cSrcweir- * Create a fingerprint:
786cdf0e10cSrcweir+ * Create a fingerprint:
787cdf0e10cSrcweir  * - record the frequency of each unique n-gram in a hash table
788cdf0e10cSrcweir  * - take the most frequent n-grams
789cdf0e10cSrcweir  * - sort them alphabetically, recording their relative rank
790cdf0e10cSrcweir@@ -544,20 +544,21 @@
791cdf0e10cSrcweir    }
792cdf0e10cSrcweir
793cdf0e10cSrcweir    /*** Throw out all invalid chars ***/
794cdf0e10cSrcweir-   tmp = prepbuffer( buffer, bufsize );
795cdf0e10cSrcweir+   tmp = prepbuffer( buffer, bufsize );
796cdf0e10cSrcweir+    /*printf("Cleaned buffer : %s\n",tmp);*/
797cdf0e10cSrcweir    if ( tmp == NULL ) {
798cdf0e10cSrcweir        return 0;
799cdf0e10cSrcweir    }
800cdf0e10cSrcweir-
801cdf0e10cSrcweir    h = (fp_t*)handle;
802cdf0e10cSrcweir    t = inittable(maxngrams);
803cdf0e10cSrcweir+    /*printf("Table initialized\n");*/
804cdf0e10cSrcweir
805cdf0e10cSrcweir    /*** Create a hash table containing n-gram counts ***/
806cdf0e10cSrcweir    createngramtable(t, tmp);
807cdf0e10cSrcweir-
808cdf0e10cSrcweir+    /*printf("Table created\n");*/
809cdf0e10cSrcweir    /*** Take the top N n-grams and add them to the profile ***/
810cdf0e10cSrcweir-   table2heap(t);
811cdf0e10cSrcweir-   maxngrams = WGMIN( maxngrams, t->size );
812cdf0e10cSrcweir+   table2heap(t);
813cdf0e10cSrcweir+   maxngrams = WGMIN( maxngrams, t->size );
814cdf0e10cSrcweir
815cdf0e10cSrcweir    h->fprint = (ngram_t *)wg_malloc( sizeof(ngram_t) * maxngrams );
816cdf0e10cSrcweir    h->size = maxngrams;
817cdf0e10cSrcweir@@ -568,7 +569,7 @@
818cdf0e10cSrcweir        entry_t tmp2;
819cdf0e10cSrcweir
820cdf0e10cSrcweir        heapextract(t, &tmp2);
821cdf0e10cSrcweir-
822cdf0e10cSrcweir+
823cdf0e10cSrcweir        /*** the string and its rank is all we need ***/
824cdf0e10cSrcweir        strcpy( h->fprint[i].str, tmp2.str );
825cdf0e10cSrcweir        h->fprint[i].rank = i;
826cdf0e10cSrcweir@@ -578,7 +579,7 @@
827cdf0e10cSrcweir    wg_free(tmp);
828cdf0e10cSrcweir
829cdf0e10cSrcweir    /*** Sort n-grams alphabetically, for easy comparison ***/
830cdf0e10cSrcweir-   qsort( h->fprint, h->size, sizeof(ngram_t), ngramcmp_str );
831cdf0e10cSrcweir+   qsort( h->fprint, h->size, sizeof(ngram_t), ngramcmp_str );
832cdf0e10cSrcweir    return 1;
833cdf0e10cSrcweir }
834cdf0e10cSrcweir
835cdf0e10cSrcweir@@ -608,7 +609,7 @@
836cdf0e10cSrcweir #endif
837cdf0e10cSrcweir        return 0;
838cdf0e10cSrcweir    }
839cdf0e10cSrcweir-
840cdf0e10cSrcweir+
841cdf0e10cSrcweir    h->fprint = (ngram_t *)wg_malloc(maxngrams * sizeof(ngram_t));
842cdf0e10cSrcweir
843cdf0e10cSrcweir    while (cnt < maxngrams && wg_getline(line,1024,fp)) {
844cdf0e10cSrcweir@@ -635,7 +636,7 @@
845cdf0e10cSrcweir    h->size = cnt;
846cdf0e10cSrcweir
847cdf0e10cSrcweir    /*** Sort n-grams, for easy comparison later on ***/
848cdf0e10cSrcweir-   qsort( h->fprint, h->size, sizeof(ngram_t), ngramcmp_str );
849cdf0e10cSrcweir+   qsort( h->fprint, h->size, sizeof(ngram_t), ngramcmp_str );
850cdf0e10cSrcweir
851cdf0e10cSrcweir    fclose(fp);
852cdf0e10cSrcweir
853cdf0e10cSrcweir@@ -648,14 +649,15 @@
854cdf0e10cSrcweir {
855cdf0e10cSrcweir    uint4 i;
856cdf0e10cSrcweir    fp_t *h = (fp_t *)handle;
857cdf0e10cSrcweir-   ngram_t *tmp = wg_malloc( sizeof(ngram_t) * h->size );
858cdf0e10cSrcweir-
859cdf0e10cSrcweir+        ngram_t *tmp = (ngram_t*)wg_malloc( sizeof(ngram_t) * h->size );
860cdf0e10cSrcweir+
861cdf0e10cSrcweir    /*** Make a temporary and sort it on rank ***/
862cdf0e10cSrcweir    memcpy( tmp, h->fprint, h->size * sizeof(ngram_t) );
863cdf0e10cSrcweir-   qsort( tmp, h->size, sizeof(ngram_t), ngramcmp_rank );
864cdf0e10cSrcweir+   qsort( tmp, h->size, sizeof(ngram_t), ngramcmp_rank );
865cdf0e10cSrcweir
866cdf0e10cSrcweir    for (i=0; i<h->size; i++) {
867cdf0e10cSrcweir-       fprintf( fp, "%s\n", tmp[i].str );
868cdf0e10cSrcweir+        /*fprintf( fp, "%s\t%i\n", tmp[i].str, tmp[i].rank );*/
869cdf0e10cSrcweir+                fprintf( fp, "%s\n", tmp[i].str);
870cdf0e10cSrcweir    }
871cdf0e10cSrcweir    wg_free( tmp );
872cdf0e10cSrcweir }
873cdf0e10cSrcweir@@ -669,7 +671,7 @@
874cdf0e10cSrcweir    uint4 i = 0;
875cdf0e10cSrcweir    uint4 j = 0;
876cdf0e10cSrcweir    sint4 sum = 0;
877cdf0e10cSrcweir-
878cdf0e10cSrcweir+
879cdf0e10cSrcweir    /*** Compare the profiles in mergesort fashion ***/
880cdf0e10cSrcweir    while ( i < c->size && j < u->size ) {
881cdf0e10cSrcweir
882cdf0e10cSrcweir@@ -705,7 +707,7 @@
883cdf0e10cSrcweir    }
884cdf0e10cSrcweir
885cdf0e10cSrcweir    return sum;
886cdf0e10cSrcweir-
887cdf0e10cSrcweir+
888cdf0e10cSrcweir }
889cdf0e10cSrcweir
890cdf0e10cSrcweir
891cdf0e10cSrcweir--- misc/libtextcat-2.2/src/fingerprint.h   Mon May 19 14:16:31 2003
892cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/fingerprint.h Mon Mar 31 11:29:14 2008
893cdf0e10cSrcweir@@ -41,7 +41,13 @@
894cdf0e10cSrcweir extern int fp_Read( void *handle, const char *fname, int maxngrams );
895cdf0e10cSrcweir extern sint4 fp_Compare( void *cat, void *unknown, int cutoff );
896cdf0e10cSrcweir extern void fp_Show( void *handle );
897cdf0e10cSrcweir+#ifdef __cplusplus
898cdf0e10cSrcweir+extern "C" {
899cdf0e10cSrcweir+#endif
900cdf0e10cSrcweir extern const char *fp_Name( void *handle );
901cdf0e10cSrcweir+#ifdef __cplusplus
902cdf0e10cSrcweir+}
903cdf0e10cSrcweir+#endif
904cdf0e10cSrcweir extern void fp_Print( void *handle, FILE *fp );
905cdf0e10cSrcweir
906cdf0e10cSrcweir #endif
907cdf0e10cSrcweir--- misc/libtextcat-2.2/src/libtextcat.map  Mon Mar 31 11:30:06 2008
908cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/libtextcat.map    Mon Mar 31 11:29:14 2008
909cdf0e10cSrcweir@@ -1 +1,40 @@
910cdf0e10cSrcweir-dummy
911cdf0e10cSrcweir+{
912cdf0e10cSrcweir+   global:
913cdf0e10cSrcweir+       charcopy
914cdf0e10cSrcweir+       issame
915cdf0e10cSrcweir+       nextcharstart
916cdf0e10cSrcweir+       utfstrlen
917cdf0e10cSrcweir+       wgmempool_Done
918cdf0e10cSrcweir+       wgmempool_Init
919cdf0e10cSrcweir+       wgmempool_Reset
920cdf0e10cSrcweir+       wgmempool_alloc
921cdf0e10cSrcweir+       wgmempool_getline
922cdf0e10cSrcweir+       wgmempool_strdup
923cdf0e10cSrcweir+       special_textcat_Init
924cdf0e10cSrcweir+       textcat_Classify
925cdf0e10cSrcweir+       textcat_Done
926cdf0e10cSrcweir+       textcat_Init
927cdf0e10cSrcweir+       textcat_Version
928cdf0e10cSrcweir+       fp_Compare
929cdf0e10cSrcweir+       fp_Create
930cdf0e10cSrcweir+       fp_Debug
931cdf0e10cSrcweir+       fp_Done
932cdf0e10cSrcweir+       fp_Init
933cdf0e10cSrcweir+       fp_Name
934cdf0e10cSrcweir+       fp_Print
935cdf0e10cSrcweir+       fp_Read
936cdf0e10cSrcweir+       heapextract
937cdf0e10cSrcweir+       wg_calloc
938cdf0e10cSrcweir+       wg_free
939cdf0e10cSrcweir+       wg_getline
940cdf0e10cSrcweir+       wg_malloc
941cdf0e10cSrcweir+       wg_split
942cdf0e10cSrcweir+       wg_strdup
943cdf0e10cSrcweir+       wg_strgmov
944cdf0e10cSrcweir+       wg_trim
945cdf0e10cSrcweir+       wg_zalloc
946cdf0e10cSrcweir+       wgmem_error
947cdf0e10cSrcweir+
948cdf0e10cSrcweir+   local:
949cdf0e10cSrcweir+       *;
950cdf0e10cSrcweir+}
951cdf0e10cSrcweir--- misc/libtextcat-2.2/src/makefile.mk Mon Mar 31 11:30:06 2008
952cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/makefile.mk   Mon Mar 31 11:29:42 2008
953*ddc94e00SAriel Constenla-Haile@@ -1 +1,81 @@
954cdf0e10cSrcweir-dummy
955e76eebc6SAndrew Rist+#**************************************************************
956cdf0e10cSrcweir+#
957e76eebc6SAndrew Rist+#  Licensed to the Apache Software Foundation (ASF) under one
958e76eebc6SAndrew Rist+#  or more contributor license agreements.  See the NOTICE file
959e76eebc6SAndrew Rist+#  distributed with this work for additional information
960e76eebc6SAndrew Rist+#  regarding copyright ownership.  The ASF licenses this file
961e76eebc6SAndrew Rist+#  to you under the Apache License, Version 2.0 (the
962e76eebc6SAndrew Rist+#  "License"); you may not use this file except in compliance
963e76eebc6SAndrew Rist+#  with the License.  You may obtain a copy of the License at
964cdf0e10cSrcweir+#
965e76eebc6SAndrew Rist+#    http://www.apache.org/licenses/LICENSE-2.0
966cdf0e10cSrcweir+#
967e76eebc6SAndrew Rist+#  Unless required by applicable law or agreed to in writing,
968e76eebc6SAndrew Rist+#  software distributed under the License is distributed on an
969e76eebc6SAndrew Rist+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
970e76eebc6SAndrew Rist+#  KIND, either express or implied.  See the License for the
971e76eebc6SAndrew Rist+#  specific language governing permissions and limitations
972e76eebc6SAndrew Rist+#  under the License.
973cdf0e10cSrcweir+#
974e76eebc6SAndrew Rist+#**************************************************************
975cdf0e10cSrcweir+
976cdf0e10cSrcweir+PRJ = ..$/..$/..$/..$/..
977cdf0e10cSrcweir+
978cdf0e10cSrcweir+PRJNAME = libtextcat
979cdf0e10cSrcweir+TARGET  = libtextcat
980cdf0e10cSrcweir+CFLAGSCALL=gsd
981cdf0e10cSrcweir+
982cdf0e10cSrcweir+USE_DEFFILE=TRUE
983cdf0e10cSrcweir+EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
984cdf0e10cSrcweir+UWINAPILIB=
985cdf0e10cSrcweir+
986cdf0e10cSrcweir+.INCLUDE : settings.mk
987cdf0e10cSrcweir+
988cdf0e10cSrcweir+# --- Files --------------------------------------------------------
989cdf0e10cSrcweir+
990cdf0e10cSrcweir+# !! not to be compiled because those belong to a stand alone programs: !!
991cdf0e10cSrcweir+#        $(SLO)$/createfp.obj\
992cdf0e10cSrcweir+#        $(SLO)$/testtextcat.obj
993cdf0e10cSrcweir+
994cdf0e10cSrcweir+SLOFILES=   \
995cdf0e10cSrcweir+        $(SLO)$/common.obj\
996cdf0e10cSrcweir+        $(SLO)$/fingerprint.obj\
997cdf0e10cSrcweir+        $(SLO)$/textcat.obj\
998cdf0e10cSrcweir+        $(SLO)$/wg_mempool.obj\
999cdf0e10cSrcweir+        $(SLO)$/utf8misc.obj
1000cdf0e10cSrcweir+
1001cdf0e10cSrcweir+#SHL1TARGET= $(TARGET)$(UPD)$(DLLPOSTFIX)
1002cdf0e10cSrcweir+SHL1TARGET= $(TARGET)
1003cdf0e10cSrcweir+
1004cdf0e10cSrcweir+SHL1STDLIBS=
1005cdf0e10cSrcweir+
1006cdf0e10cSrcweir+# build DLL
1007cdf0e10cSrcweir+SHL1LIBS=       $(SLB)$/$(TARGET).lib
1008cdf0e10cSrcweir+SHL1IMPLIB=     i$(TARGET)
1009cdf0e10cSrcweir+SHL1DEPN=       $(SHL1LIBS)
1010cdf0e10cSrcweir+SHL1DEF=        $(MISC)$/$(SHL1TARGET).def
1011cdf0e10cSrcweir+
1012cdf0e10cSrcweir+# build DEF file
1013cdf0e10cSrcweir+DEF1NAME=       $(SHL1TARGET)
1014cdf0e10cSrcweir+DEF1DEPN=$(MISC)$/$(SHL1TARGET).flt
1015cdf0e10cSrcweir+
1016cdf0e10cSrcweir+SHL1VERSIONMAP= libtextcat.map
1017cdf0e10cSrcweir+
1018cdf0e10cSrcweir+# --- Targets ------------------------------------------------------
1019cdf0e10cSrcweir+
1020cdf0e10cSrcweir+.INCLUDE : target.mk
1021cdf0e10cSrcweir+
1022cdf0e10cSrcweir+# copy hand supplied configuration file for Win32 builds to the file
1023cdf0e10cSrcweir+# which is included in the source code
1024cdf0e10cSrcweir+$(SLOFILES) : config.h
1025cdf0e10cSrcweir+config.h :
1026cdf0e10cSrcweir+    $(GNUCOPY) $(OUT)$/misc$/build$/libtextcat-2.2$/src$/win32_config.h   $(OUT)$/misc$/build$/libtextcat-2.2$/src$/config.h
1027cdf0e10cSrcweir+
1028cdf0e10cSrcweir+
1029cdf0e10cSrcweir+$(MISC)$/$(SHL1TARGET).flt:  makefile.mk
1030cdf0e10cSrcweir+    @echo ------------------------------
1031cdf0e10cSrcweir+    @echo Making: $@
1032cdf0e10cSrcweir+    @echo Imp>$@
1033cdf0e10cSrcweir+    @echo __CT>>$@
1034cdf0e10cSrcweir+    @echo _real>>$@
1035cdf0e10cSrcweir+    @echo unnamed>>$@
1036cdf0e10cSrcweir--- misc/libtextcat-2.2/src/textcat.c   Thu May 22 13:32:43 2003
1037cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/textcat.c Mon Mar 31 11:29:14 2008
1038cdf0e10cSrcweir@@ -4,23 +4,23 @@
1039cdf0e10cSrcweir  * Copyright (C) 2003 WiseGuys Internet B.V.
1040cdf0e10cSrcweir  *
1041cdf0e10cSrcweir  * THE BSD LICENSE
1042cdf0e10cSrcweir- *
1043cdf0e10cSrcweir+ *
1044cdf0e10cSrcweir  * Redistribution and use in source and binary forms, with or without
1045cdf0e10cSrcweir  * modification, are permitted provided that the following conditions
1046cdf0e10cSrcweir  * are met:
1047cdf0e10cSrcweir- *
1048cdf0e10cSrcweir+ *
1049cdf0e10cSrcweir  * - Redistributions of source code must retain the above copyright
1050cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer.
1051cdf0e10cSrcweir- *
1052cdf0e10cSrcweir+ *
1053cdf0e10cSrcweir  * - Redistributions in binary form must reproduce the above copyright
1054cdf0e10cSrcweir  * notice, this list of conditions and the following disclaimer in the
1055cdf0e10cSrcweir  * documentation and/or other materials provided with the
1056cdf0e10cSrcweir  * distribution.
1057cdf0e10cSrcweir- *
1058cdf0e10cSrcweir+ *
1059cdf0e10cSrcweir  * - Neither the name of the WiseGuys Internet B.V. nor the names of
1060cdf0e10cSrcweir  * its contributors may be used to endorse or promote products derived
1061cdf0e10cSrcweir  * from this software without specific prior written permission.
1062cdf0e10cSrcweir- *
1063cdf0e10cSrcweir+ *
1064cdf0e10cSrcweir  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1065cdf0e10cSrcweir  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1066cdf0e10cSrcweir  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1067cdf0e10cSrcweir@@ -74,6 +74,7 @@
1068cdf0e10cSrcweir typedef struct {
1069cdf0e10cSrcweir
1070cdf0e10cSrcweir    void **fprint;
1071cdf0e10cSrcweir+        char *fprint_disable;
1072cdf0e10cSrcweir    uint4 size;
1073cdf0e10cSrcweir    uint4 maxsize;
1074cdf0e10cSrcweir
1075cdf0e10cSrcweir@@ -112,11 +113,21 @@
1076cdf0e10cSrcweir        fp_Done( h->fprint[i] );
1077cdf0e10cSrcweir    }
1078cdf0e10cSrcweir    wg_free( h->fprint );
1079cdf0e10cSrcweir+        wg_free( h->fprint_disable );
1080cdf0e10cSrcweir    wg_free( h );
1081cdf0e10cSrcweir
1082cdf0e10cSrcweir }
1083cdf0e10cSrcweir
1084cdf0e10cSrcweir-extern void *textcat_Init( const char *conffile )
1085cdf0e10cSrcweir+/** Replaces older function */
1086cdf0e10cSrcweir+extern void *textcat_Init( const char *conffile ){
1087cdf0e10cSrcweir+    return special_textcat_Init( conffile, DEFAULT_FINGERPRINTS_PATH );
1088cdf0e10cSrcweir+}
1089cdf0e10cSrcweir+
1090cdf0e10cSrcweir+/**
1091cdf0e10cSrcweir+ * Originaly this function had only one parameter (conffile) it has been modified since OOo use
1092cdf0e10cSrcweir+ * Basicaly prefix is the directory path where fingerprints are stored
1093cdf0e10cSrcweir+ */
1094cdf0e10cSrcweir+extern void *special_textcat_Init( const char *conffile, const char *prefix )
1095cdf0e10cSrcweir {
1096cdf0e10cSrcweir    textcat_t *h;
1097cdf0e10cSrcweir    char line[1024];
1098cdf0e10cSrcweir@@ -134,11 +145,13 @@
1099cdf0e10cSrcweir    h->size = 0;
1100cdf0e10cSrcweir    h->maxsize = 16;
1101cdf0e10cSrcweir    h->fprint = (void **)wg_malloc( sizeof(void*) * h->maxsize );
1102cdf0e10cSrcweir+ h->fprint_disable = (char *)wg_malloc( sizeof(char*) * h->maxsize );   /*added to store the state of languages*/
1103cdf0e10cSrcweir
1104cdf0e10cSrcweir    while ( wg_getline( line, 1024, fp ) ) {
1105cdf0e10cSrcweir        char *p;
1106cdf0e10cSrcweir        char *segment[4];
1107cdf0e10cSrcweir-       int res;
1108cdf0e10cSrcweir+                char finger_print_file_name[512];
1109cdf0e10cSrcweir+                int res;
1110cdf0e10cSrcweir
1111cdf0e10cSrcweir        /*** Skip comments ***/
1112cdf0e10cSrcweir #ifdef HAVE_STRCHR
1113cdf0e10cSrcweir@@ -156,17 +169,23 @@
1114cdf0e10cSrcweir        /*** Ensure enough space ***/
1115cdf0e10cSrcweir        if ( h->size == h->maxsize ) {
1116cdf0e10cSrcweir            h->maxsize *= 2;
1117cdf0e10cSrcweir-           h->fprint = (void *)wg_realloc( h->fprint, sizeof(void*) * h->maxsize );
1118cdf0e10cSrcweir+           h->fprint = (void **)wg_realloc( h->fprint, sizeof(void*) * h->maxsize );
1119cdf0e10cSrcweir+                        h->fprint_disable = (char *)wg_realloc( h->fprint_disable, sizeof(char*) * h->maxsize );
1120cdf0e10cSrcweir        }
1121cdf0e10cSrcweir
1122cdf0e10cSrcweir        /*** Load data ***/
1123cdf0e10cSrcweir        if ((h->fprint[ h->size ] = fp_Init( segment[1] ))==NULL) {
1124cdf0e10cSrcweir            goto ERROR;
1125cdf0e10cSrcweir        }
1126cdf0e10cSrcweir-       if ( fp_Read( h->fprint[h->size], segment[0], 400 ) == 0 ) {
1127cdf0e10cSrcweir+                finger_print_file_name[0] = '\0';
1128cdf0e10cSrcweir+                strcat(finger_print_file_name, prefix);
1129cdf0e10cSrcweir+                strcat(finger_print_file_name, segment[0]);
1130cdf0e10cSrcweir+
1131cdf0e10cSrcweir+                if ( fp_Read( h->fprint[h->size], finger_print_file_name, 400 ) == 0 ) {
1132cdf0e10cSrcweir            textcat_Done(h);
1133cdf0e10cSrcweir            goto ERROR;
1134cdf0e10cSrcweir-       }
1135cdf0e10cSrcweir+       }
1136cdf0e10cSrcweir+                h->fprint_disable[h->size] = 0xF0;  /*0xF0 is the code for enabled languages, 0x0F is for disabled*/
1137cdf0e10cSrcweir        h->size++;
1138cdf0e10cSrcweir    }
1139cdf0e10cSrcweir
1140cdf0e10cSrcweir@@ -203,11 +222,18 @@
1141cdf0e10cSrcweir        result = _TEXTCAT_RESULT_SHORT;
1142cdf0e10cSrcweir        goto READY;
1143cdf0e10cSrcweir    }
1144cdf0e10cSrcweir-
1145cdf0e10cSrcweir+
1146cdf0e10cSrcweir    /*** Calculate the score for each category. ***/
1147cdf0e10cSrcweir    for (i=0; i<h->size; i++) {
1148cdf0e10cSrcweir-       int score = fp_Compare( h->fprint[i], unknown, threshold );
1149cdf0e10cSrcweir-       candidates[i].score = score;
1150cdf0e10cSrcweir+                int score;
1151cdf0e10cSrcweir+                if(h->fprint_disable[i] & 0x0F){    /*if this language is disabled*/
1152cdf0e10cSrcweir+                    score = MAXSCORE;
1153cdf0e10cSrcweir+                }
1154cdf0e10cSrcweir+                else{
1155cdf0e10cSrcweir+                    score = fp_Compare( h->fprint[i], unknown, threshold );
1156cdf0e10cSrcweir+                    /*printf("Score for %s : %i\n", fp_Name(h->fprint[i]), score);*/
1157cdf0e10cSrcweir+                }
1158cdf0e10cSrcweir+                candidates[i].score = score;
1159cdf0e10cSrcweir        candidates[i].name = fp_Name( h->fprint[i] );
1160cdf0e10cSrcweir        if ( score < minscore ) {
1161cdf0e10cSrcweir            minscore = score;
1162cdf0e10cSrcweir@@ -218,7 +244,6 @@
1163cdf0e10cSrcweir    /*** Find the best performers ***/
1164cdf0e10cSrcweir    for (i=0; i<h->size; i++) {
1165cdf0e10cSrcweir        if ( candidates[i].score < threshold ) {
1166cdf0e10cSrcweir-
1167cdf0e10cSrcweir            if ( ++cnt == MAXCANDIDATES+1 ) {
1168cdf0e10cSrcweir                break;
1169cdf0e10cSrcweir            }
1170cdf0e10cSrcweir@@ -235,7 +260,7 @@
1171cdf0e10cSrcweir    else {
1172cdf0e10cSrcweir        char *p = result;
1173cdf0e10cSrcweir        char *plimit = result+MAXOUTPUTSIZE;
1174cdf0e10cSrcweir-
1175cdf0e10cSrcweir+
1176cdf0e10cSrcweir        qsort( candidates, cnt, sizeof(candidate_t), cmpcandidates );
1177cdf0e10cSrcweir
1178cdf0e10cSrcweir        *p = '\0';
1179cdf0e10cSrcweir@@ -247,7 +272,7 @@
1180cdf0e10cSrcweir    }
1181cdf0e10cSrcweir  READY:
1182cdf0e10cSrcweir    fp_Done(unknown);
1183cdf0e10cSrcweir-#ifdef SHOULD_FREE
1184cdf0e10cSrcweir+#ifdef SHOULD_FREE
1185cdf0e10cSrcweir    free(candidates);
1186cdf0e10cSrcweir #undef SHOULD_FREE
1187cdf0e10cSrcweir #endif
1188cdf0e10cSrcweir--- misc/libtextcat-2.2/src/textcat.h   Mon May 19 14:16:31 2003
1189cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/textcat.h Mon Mar 31 11:29:14 2008
1190cdf0e10cSrcweir@@ -40,6 +40,9 @@
1191cdf0e10cSrcweir #define _TEXTCAT_RESULT_UNKOWN        "UNKNOWN"
1192cdf0e10cSrcweir #define _TEXTCAT_RESULT_SHORT         "SHORT"
1193cdf0e10cSrcweir
1194cdf0e10cSrcweir+#ifdef __cplusplus
1195cdf0e10cSrcweir+extern "C" {
1196cdf0e10cSrcweir+#endif
1197cdf0e10cSrcweir
1198cdf0e10cSrcweir /**
1199cdf0e10cSrcweir  * textcat_Init() - Initialize the text classifier. The textfile
1200cdf0e10cSrcweir@@ -51,10 +54,19 @@
1201cdf0e10cSrcweir  * Returns: handle on success, NULL on error. (At the moment, the
1202cdf0e10cSrcweir  * only way errors can occur, is when the library cannot read the
1203cdf0e10cSrcweir  * conffile, or one of the fingerprint files listed in it.)
1204cdf0e10cSrcweir+ *
1205cdf0e10cSrcweir+ * Replace older function (and has exacly the same behaviour)
1206cdf0e10cSrcweir+ * see below
1207cdf0e10cSrcweir  */
1208cdf0e10cSrcweir extern void *textcat_Init( const char *conffile );
1209cdf0e10cSrcweir
1210cdf0e10cSrcweir /**
1211cdf0e10cSrcweir+ * Originaly this function had only one parameter (conffile) it has been modified since OOo must be able to load alternativ DB
1212cdf0e10cSrcweir+ * Basicaly prefix is the directory path where fingerprints are stored
1213cdf0e10cSrcweir+ */
1214cdf0e10cSrcweir+extern void *special_textcat_Init( const char *conffile, const char *prefix );
1215cdf0e10cSrcweir+
1216cdf0e10cSrcweir+/**
1217cdf0e10cSrcweir  * textcat_Done() - Free up resources for handle
1218cdf0e10cSrcweir  */
1219cdf0e10cSrcweir extern void textcat_Done( void *handle );
1220cdf0e10cSrcweir@@ -77,4 +89,8 @@
1221cdf0e10cSrcweir  * textcat_Version() - Returns a string describing the version of this classifier.
1222cdf0e10cSrcweir  */
1223cdf0e10cSrcweir extern char *textcat_Version();
1224cdf0e10cSrcweir+
1225cdf0e10cSrcweir+#ifdef __cplusplus
1226cdf0e10cSrcweir+}
1227cdf0e10cSrcweir+#endif
1228cdf0e10cSrcweir #endif
1229cdf0e10cSrcweir--- misc/libtextcat-2.2/src/utf8misc.c  Mon Mar 31 11:30:06 2008
1230cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/utf8misc.c    Mon Mar 31 11:29:14 2008
1231cdf0e10cSrcweir@@ -1 +1,132 @@
1232cdf0e10cSrcweir-dummy
1233cdf0e10cSrcweir+/***************************************************************************
1234cdf0e10cSrcweir+ *   Copyright (C) 2006 by Jocelyn Merand                                  *
1235cdf0e10cSrcweir+ *   joc.mer@gmail.com                                                     *
1236cdf0e10cSrcweir+ *                                                                         *
1237cdf0e10cSrcweir+ * THE BSD LICENSE
1238cdf0e10cSrcweir+ *
1239cdf0e10cSrcweir+ * Redistribution and use in source and binary forms, with or without
1240cdf0e10cSrcweir+ * modification, are permitted provided that the following conditions
1241cdf0e10cSrcweir+ * are met:
1242cdf0e10cSrcweir+ *
1243cdf0e10cSrcweir+ * - Redistributions of source code must retain the above copyright
1244cdf0e10cSrcweir+ * notice, this list of conditions and the following disclaimer.
1245cdf0e10cSrcweir+ *
1246cdf0e10cSrcweir+ * - Redistributions in binary form must reproduce the above copyright
1247cdf0e10cSrcweir+ * notice, this list of conditions and the following disclaimer in the
1248cdf0e10cSrcweir+ * documentation and/or other materials provided with the
1249cdf0e10cSrcweir+ * distribution.
1250cdf0e10cSrcweir+ *
1251cdf0e10cSrcweir+ * - Neither the name of the WiseGuys Internet B.V. nor the names of
1252cdf0e10cSrcweir+ * its contributors may be used to endorse or promote products derived
1253cdf0e10cSrcweir+ * from this software without specific prior written permission.
1254cdf0e10cSrcweir+ *
1255cdf0e10cSrcweir+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1256cdf0e10cSrcweir+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1257cdf0e10cSrcweir+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1258cdf0e10cSrcweir+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1259cdf0e10cSrcweir+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1260cdf0e10cSrcweir+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1261cdf0e10cSrcweir+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1262cdf0e10cSrcweir+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1263cdf0e10cSrcweir+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1264cdf0e10cSrcweir+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1265cdf0e10cSrcweir+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1266cdf0e10cSrcweir+ ***************************************************************************/
1267cdf0e10cSrcweir+
1268cdf0e10cSrcweir+#ifndef _UTF8_MISC_H_
1269cdf0e10cSrcweir+#include "utf8misc.h"
1270cdf0e10cSrcweir+#endif
1271cdf0e10cSrcweir+
1272cdf0e10cSrcweir+
1273cdf0e10cSrcweir+int nextcharstart(const char *str, int position){
1274cdf0e10cSrcweir+    int pointer = position;
1275cdf0e10cSrcweir+
1276cdf0e10cSrcweir+    if(str[pointer] & ESCAPE_MASK){ /*if the first bit of the current char is 1*/
1277cdf0e10cSrcweir+
1278cdf0e10cSrcweir+        /*then str[pointer] is an escape character*/
1279cdf0e10cSrcweir+
1280cdf0e10cSrcweir+    char escape_char = ((str[pointer] & WEIGHT_MASK) << 1); /*and we use it to count (by bit translation) following characters (only the weightest part)*/
1281cdf0e10cSrcweir+
1282cdf0e10cSrcweir+    while(escape_char & ESCAPE_MASK && str[pointer]){/*every step, we move the byte of 1 bit left, when first bit is 0, it's finished*/
1283cdf0e10cSrcweir+        escape_char = escape_char <<1;
1284cdf0e10cSrcweir+        ++pointer;
1285cdf0e10cSrcweir+    }
1286cdf0e10cSrcweir+    }
1287cdf0e10cSrcweir+    if(str[pointer]){   /*finaly, if we are not on the \0 character, we jump to the next character*/
1288cdf0e10cSrcweir+        ++pointer;
1289cdf0e10cSrcweir+    }
1290cdf0e10cSrcweir+    return pointer;
1291cdf0e10cSrcweir+}
1292cdf0e10cSrcweir+
1293cdf0e10cSrcweir+
1294cdf0e10cSrcweir+int charcopy(const char *str, char *dest){
1295cdf0e10cSrcweir+
1296cdf0e10cSrcweir+    int pointer = 0;
1297cdf0e10cSrcweir+    if(str[pointer] & ESCAPE_MASK){ /*if the first bit of the current char is 1*/
1298cdf0e10cSrcweir+
1299cdf0e10cSrcweir+        /*then str[pointer] is an escape character*/
1300cdf0e10cSrcweir+
1301cdf0e10cSrcweir+        char escape_char = ((str[pointer] & WEIGHT_MASK) << 1); /*and we use it to count following characters (only the weightest part)*/
1302cdf0e10cSrcweir+
1303cdf0e10cSrcweir+        while(escape_char & ESCAPE_MASK && str[pointer]){   /*every step, we move the byte of 1 bit left, when first bit is 0, it's finished*/
1304cdf0e10cSrcweir+            dest[pointer] = str[pointer];
1305cdf0e10cSrcweir+            escape_char = escape_char <<1;
1306cdf0e10cSrcweir+            ++pointer;
1307cdf0e10cSrcweir+        }
1308cdf0e10cSrcweir+    }
1309cdf0e10cSrcweir+    if(str[pointer]){
1310cdf0e10cSrcweir+        dest[pointer] = str[pointer];
1311cdf0e10cSrcweir+        ++pointer;
1312cdf0e10cSrcweir+    }
1313cdf0e10cSrcweir+
1314cdf0e10cSrcweir+    return pointer;
1315cdf0e10cSrcweir+}
1316cdf0e10cSrcweir+
1317cdf0e10cSrcweir+
1318cdf0e10cSrcweir+int issame( char *lex, char *key, int len )
1319cdf0e10cSrcweir+{
1320cdf0e10cSrcweir+    /*printf("[%s] prefix of [%s] with length %i", lex, key, len);*/
1321cdf0e10cSrcweir+    int char_counter = 0;
1322cdf0e10cSrcweir+    int pointer = 0;
1323cdf0e10cSrcweir+    while(char_counter < len) {
1324cdf0e10cSrcweir+
1325cdf0e10cSrcweir+        if(key[pointer] & ESCAPE_MASK){ /*if the first bit of the current char is 1*/
1326cdf0e10cSrcweir+
1327cdf0e10cSrcweir+            /*then key[pointer] is an escap character*/
1328cdf0e10cSrcweir+
1329cdf0e10cSrcweir+            char escape_char = ((key[pointer] & WEIGHT_MASK) << 1);     /*and we use it to count (only the weightest part)*/
1330cdf0e10cSrcweir+
1331cdf0e10cSrcweir+            while(escape_char & ESCAPE_MASK && key[pointer] == lex[pointer] ){
1332cdf0e10cSrcweir+                escape_char = escape_char <<1;
1333cdf0e10cSrcweir+                ++pointer;
1334cdf0e10cSrcweir+            }
1335cdf0e10cSrcweir+        }
1336cdf0e10cSrcweir+        ++char_counter; /*and we are on a new utf8 character*/
1337cdf0e10cSrcweir+        if ( key[pointer] != lex[pointer] ) {
1338cdf0e10cSrcweir+            return 0;
1339cdf0e10cSrcweir+            /*printf(" NO\n", lex, key, len);*/
1340cdf0e10cSrcweir+        }
1341cdf0e10cSrcweir+        ++pointer;
1342cdf0e10cSrcweir+    }
1343cdf0e10cSrcweir+    if ( lex[pointer] != '\0' ) {
1344cdf0e10cSrcweir+        return 0;
1345cdf0e10cSrcweir+        /*printf(" NO\n");*/
1346cdf0e10cSrcweir+    }
1347cdf0e10cSrcweir+
1348cdf0e10cSrcweir+    /*printf(" YES\n");*/
1349cdf0e10cSrcweir+
1350cdf0e10cSrcweir+    return 1;
1351cdf0e10cSrcweir+}
1352cdf0e10cSrcweir+
1353cdf0e10cSrcweir+
1354cdf0e10cSrcweir+extern int utfstrlen(const char* str){
1355cdf0e10cSrcweir+    int char_counter = 0;
1356cdf0e10cSrcweir+    int pointer = 0;
1357cdf0e10cSrcweir+    while(str[pointer]) {
1358cdf0e10cSrcweir+        pointer = nextcharstart(str, pointer);
1359cdf0e10cSrcweir+
1360cdf0e10cSrcweir+        ++char_counter; /*and we are on a new utf8 character*/
1361cdf0e10cSrcweir+    }
1362cdf0e10cSrcweir+    return char_counter;
1363cdf0e10cSrcweir+}
1364cdf0e10cSrcweir+
1365cdf0e10cSrcweir--- misc/libtextcat-2.2/src/utf8misc.h  Mon Mar 31 11:30:06 2008
1366cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/utf8misc.h    Mon Mar 31 11:29:14 2008
1367cdf0e10cSrcweir@@ -1 +1,88 @@
1368cdf0e10cSrcweir-dummy
1369cdf0e10cSrcweir+/***************************************************************************
1370cdf0e10cSrcweir+ *   Copyright (C) 2006 by Jocelyn Merand                                  *
1371cdf0e10cSrcweir+ *   joc.mer@gmail.com                                                     *
1372cdf0e10cSrcweir+ *                                                                         *
1373cdf0e10cSrcweir+ * THE BSD LICENSE
1374cdf0e10cSrcweir+ *
1375cdf0e10cSrcweir+ * Redistribution and use in source and binary forms, with or without
1376cdf0e10cSrcweir+ * modification, are permitted provided that the following conditions
1377cdf0e10cSrcweir+ * are met:
1378cdf0e10cSrcweir+ *
1379cdf0e10cSrcweir+ * - Redistributions of source code must retain the above copyright
1380cdf0e10cSrcweir+ * notice, this list of conditions and the following disclaimer.
1381cdf0e10cSrcweir+ *
1382cdf0e10cSrcweir+ * - Redistributions in binary form must reproduce the above copyright
1383cdf0e10cSrcweir+ * notice, this list of conditions and the following disclaimer in the
1384cdf0e10cSrcweir+ * documentation and/or other materials provided with the
1385cdf0e10cSrcweir+ * distribution.
1386cdf0e10cSrcweir+ *
1387cdf0e10cSrcweir+ * - Neither the name of the WiseGuys Internet B.V. nor the names of
1388cdf0e10cSrcweir+ * its contributors may be used to endorse or promote products derived
1389cdf0e10cSrcweir+ * from this software without specific prior written permission.
1390cdf0e10cSrcweir+ *
1391cdf0e10cSrcweir+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1392cdf0e10cSrcweir+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1393cdf0e10cSrcweir+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1394cdf0e10cSrcweir+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1395cdf0e10cSrcweir+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1396cdf0e10cSrcweir+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1397cdf0e10cSrcweir+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1398cdf0e10cSrcweir+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1399cdf0e10cSrcweir+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1400cdf0e10cSrcweir+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1401cdf0e10cSrcweir+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1402cdf0e10cSrcweir+ ***************************************************************************/
1403cdf0e10cSrcweir+
1404cdf0e10cSrcweir+#ifndef _UTF8_MISC_H_
1405cdf0e10cSrcweir+#define _UTF8_MISC_H_
1406cdf0e10cSrcweir+
1407cdf0e10cSrcweir+/**
1408cdf0e10cSrcweir+ * These variables are used in character processing functions
1409cdf0e10cSrcweir+ * These have been added to manage utf-8 symbols, particularly escape chars
1410cdf0e10cSrcweir+ */
1411cdf0e10cSrcweir+#ifdef _UTF8_
1412cdf0e10cSrcweir+#define ESCAPE_MASK 0x80
1413cdf0e10cSrcweir+#define WEIGHT_MASK 0xF0
1414cdf0e10cSrcweir+#else
1415cdf0e10cSrcweir+#define ESCAPE_MASK 0xFF
1416cdf0e10cSrcweir+#define WEIGHT_MASK 0x00
1417cdf0e10cSrcweir+#endif
1418cdf0e10cSrcweir+
1419cdf0e10cSrcweir+
1420cdf0e10cSrcweir+/*
1421cdf0e10cSrcweir+ * Is used to jump to the next start of char
1422cdf0e10cSrcweir+ * of course it's only usefull when encoding is utf-8
1423cdf0e10cSrcweir+ * This function have been added by Jocelyn Merand to use libtextcat in OOo
1424cdf0e10cSrcweir+ */
1425cdf0e10cSrcweir+int nextcharstart(const char *str, int position);
1426cdf0e10cSrcweir+
1427cdf0e10cSrcweir+
1428cdf0e10cSrcweir+/*Copy the char in str to dest
1429cdf0e10cSrcweir+ * of course it's only usefull when encoding is utf8 and the symbol is encoded with more than 1 char
1430cdf0e10cSrcweir+ * return the number of char jumped
1431cdf0e10cSrcweir+ * This function have been added by Jocelyn Merand to use libtextcat in OOo
1432cdf0e10cSrcweir+ */
1433cdf0e10cSrcweir+int charcopy(const char *str, char *dest);
1434cdf0e10cSrcweir+
1435cdf0e10cSrcweir+
1436cdf0e10cSrcweir+/* checks if n-gram lex is a prefix of key and of length len
1437cdf0e10cSrcweir+* if _UTF8_ is defined, it uses escap characters and len is not realy the length of lex
1438cdf0e10cSrcweir+* in this case, len is the number of utf-8 char strlen("€") == 3 but len == 1
1439cdf0e10cSrcweir+*/
1440cdf0e10cSrcweir+int issame( char *lex, char *key, int len );
1441cdf0e10cSrcweir+
1442cdf0e10cSrcweir+
1443cdf0e10cSrcweir+/* Counts the number of characters
1444cdf0e10cSrcweir+* if _UTF8_ is defined, it uses escap characters and the result is not realy the length of str
1445cdf0e10cSrcweir+* in this case, the result is the number of utf-8 char strlen("€") == 3 but utfstrlen("€") == 1
1446cdf0e10cSrcweir+*/
1447cdf0e10cSrcweir+#ifdef __cplusplus
1448cdf0e10cSrcweir+extern "C" {
1449cdf0e10cSrcweir+#endif
1450cdf0e10cSrcweir+extern int utfstrlen(const char* str);
1451cdf0e10cSrcweir+#ifdef __cplusplus
1452cdf0e10cSrcweir+}
1453cdf0e10cSrcweir+#endif
1454cdf0e10cSrcweir+
1455cdf0e10cSrcweir+#endif
1456cdf0e10cSrcweir+
1457cdf0e10cSrcweir--- misc/libtextcat-2.2/src/win32_config.h  Mon Mar 31 11:30:06 2008
1458cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/src/win32_config.h    Mon Mar 31 11:29:14 2008
1459cdf0e10cSrcweir@@ -1 +1,136 @@
1460cdf0e10cSrcweir-dummy
1461cdf0e10cSrcweir+/* src/config.h.  Generated by configure.  */
1462cdf0e10cSrcweir+/* src/config.h.in.  Generated from configure.ac by autoheader.  */
1463cdf0e10cSrcweir+
1464cdf0e10cSrcweir+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
1465cdf0e10cSrcweir+   systems. This function is required for `alloca.c' support on those systems.
1466cdf0e10cSrcweir+   */
1467cdf0e10cSrcweir+/* #undef CRAY_STACKSEG_END */
1468cdf0e10cSrcweir+
1469cdf0e10cSrcweir+/* Define to 1 if using `alloca.c'. */
1470cdf0e10cSrcweir+/* #undef C_ALLOCA */
1471cdf0e10cSrcweir+
1472cdf0e10cSrcweir+/* Define to 1 if you have `alloca', as a function or macro. */
1473cdf0e10cSrcweir+/* #undef HAVE_ALLOCA */
1474cdf0e10cSrcweir+
1475cdf0e10cSrcweir+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
1476cdf0e10cSrcweir+   */
1477cdf0e10cSrcweir+/* #undef HAVE_ALLOCA_H */
1478cdf0e10cSrcweir+
1479cdf0e10cSrcweir+/* Define to 1 if you have the <dlfcn.h> header file. */
1480cdf0e10cSrcweir+#define HAVE_DLFCN_H 1
1481cdf0e10cSrcweir+
1482cdf0e10cSrcweir+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
1483cdf0e10cSrcweir+/* #undef HAVE_DOPRNT */
1484cdf0e10cSrcweir+
1485cdf0e10cSrcweir+/* Define to 1 if you have the `gettimeofday' function. */
1486cdf0e10cSrcweir+/* #undef  HAVE_GETTIMEOFDAY */
1487cdf0e10cSrcweir+
1488cdf0e10cSrcweir+/* Define to 1 if you have the <inttypes.h> header file. */
1489cdf0e10cSrcweir+/* #undef  HAVE_INTTYPES_H */
1490cdf0e10cSrcweir+
1491cdf0e10cSrcweir+/* Define to 1 if you have the <limits.h> header file. */
1492cdf0e10cSrcweir+#define HAVE_LIMITS_H 1
1493cdf0e10cSrcweir+
1494cdf0e10cSrcweir+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
1495cdf0e10cSrcweir+   to 0 otherwise. */
1496cdf0e10cSrcweir+#define HAVE_MALLOC 1
1497cdf0e10cSrcweir+
1498cdf0e10cSrcweir+/* Define to 1 if you have the <memory.h> header file. */
1499cdf0e10cSrcweir+#define HAVE_MEMORY_H 1
1500cdf0e10cSrcweir+
1501cdf0e10cSrcweir+/* Define to 1 if you have the `memset' function. */
1502cdf0e10cSrcweir+#define HAVE_MEMSET 1
1503cdf0e10cSrcweir+
1504cdf0e10cSrcweir+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
1505cdf0e10cSrcweir+   and to 0 otherwise. */
1506cdf0e10cSrcweir+#define HAVE_REALLOC 1
1507cdf0e10cSrcweir+
1508cdf0e10cSrcweir+/* Define to 1 if you have the <stdint.h> header file. */
1509cdf0e10cSrcweir+/* #undef  HAVE_STDINT_H */
1510cdf0e10cSrcweir+
1511cdf0e10cSrcweir+/* Define to 1 if you have the <stdlib.h> header file. */
1512cdf0e10cSrcweir+#define HAVE_STDLIB_H 1
1513cdf0e10cSrcweir+
1514cdf0e10cSrcweir+/* Define to 1 if you have the `strchr' function. */
1515cdf0e10cSrcweir+#define HAVE_STRCHR 1
1516cdf0e10cSrcweir+
1517cdf0e10cSrcweir+/* Define to 1 if you have the `strdup' function. */
1518cdf0e10cSrcweir+#define HAVE_STRDUP 1
1519cdf0e10cSrcweir+
1520cdf0e10cSrcweir+/* Define to 1 if you have the <strings.h> header file. */
1521cdf0e10cSrcweir+/* #undef HAVE_STRINGS_H */
1522cdf0e10cSrcweir+
1523cdf0e10cSrcweir+/* Define to 1 if you have the <string.h> header file. */
1524cdf0e10cSrcweir+#define HAVE_STRING_H 1
1525cdf0e10cSrcweir+
1526cdf0e10cSrcweir+/* Define to 1 if you have the `strpbrk' function. */
1527cdf0e10cSrcweir+#define HAVE_STRPBRK 1
1528cdf0e10cSrcweir+
1529cdf0e10cSrcweir+/* Define to 1 if you have the <sys/stat.h> header file. */
1530cdf0e10cSrcweir+#define HAVE_SYS_STAT_H 1
1531cdf0e10cSrcweir+
1532cdf0e10cSrcweir+/* Define to 1 if you have the <sys/time.h> header file. */
1533cdf0e10cSrcweir+/* #undef  HAVE_SYS_TIME_H */
1534cdf0e10cSrcweir+
1535cdf0e10cSrcweir+/* Define to 1 if you have the <sys/types.h> header file. */
1536cdf0e10cSrcweir+#define HAVE_SYS_TYPES_H 1
1537cdf0e10cSrcweir+
1538cdf0e10cSrcweir+/* Define to 1 if you have the <unistd.h> header file. */
1539cdf0e10cSrcweir+#define HAVE_UNISTD_H 1
1540cdf0e10cSrcweir+
1541cdf0e10cSrcweir+/* Define to 1 if you have the `vprintf' function. */
1542cdf0e10cSrcweir+#define HAVE_VPRINTF 1
1543cdf0e10cSrcweir+
1544cdf0e10cSrcweir+/* Name of package */
1545cdf0e10cSrcweir+#define PACKAGE "libtextcat"
1546cdf0e10cSrcweir+
1547cdf0e10cSrcweir+/* Define to the address where bug reports for this package should be sent. */
1548cdf0e10cSrcweir+#define PACKAGE_BUGREPORT ""
1549cdf0e10cSrcweir+
1550cdf0e10cSrcweir+/* Define to the full name of this package. */
1551cdf0e10cSrcweir+#define PACKAGE_NAME "libtextcat"
1552cdf0e10cSrcweir+
1553cdf0e10cSrcweir+/* Define to the full name and version of this package. */
1554cdf0e10cSrcweir+#define PACKAGE_STRING "libtextcat 2.2"
1555cdf0e10cSrcweir+
1556cdf0e10cSrcweir+/* Define to the one symbol short name of this package. */
1557cdf0e10cSrcweir+#define PACKAGE_TARNAME "libtextcat"
1558cdf0e10cSrcweir+
1559cdf0e10cSrcweir+/* Define to the version of this package. */
1560cdf0e10cSrcweir+#define PACKAGE_VERSION "2.2"
1561cdf0e10cSrcweir+
1562cdf0e10cSrcweir+/* If using the C implementation of alloca, define if you know the
1563cdf0e10cSrcweir+   direction of stack growth for your system; otherwise it will be
1564cdf0e10cSrcweir+   automatically deduced at run-time.
1565cdf0e10cSrcweir+        STACK_DIRECTION > 0 => grows toward higher addresses
1566cdf0e10cSrcweir+        STACK_DIRECTION < 0 => grows toward lower addresses
1567cdf0e10cSrcweir+        STACK_DIRECTION = 0 => direction of growth unknown */
1568cdf0e10cSrcweir+/* #undef STACK_DIRECTION */
1569cdf0e10cSrcweir+
1570cdf0e10cSrcweir+/* Define to 1 if you have the ANSI C header files. */
1571cdf0e10cSrcweir+#define STDC_HEADERS 1
1572cdf0e10cSrcweir+
1573cdf0e10cSrcweir+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
1574cdf0e10cSrcweir+#define TIME_WITH_SYS_TIME 1
1575cdf0e10cSrcweir+
1576cdf0e10cSrcweir+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
1577cdf0e10cSrcweir+/* #undef TM_IN_SYS_TIME */
1578cdf0e10cSrcweir+
1579cdf0e10cSrcweir+/* Version number of package */
1580cdf0e10cSrcweir+#define VERSION "2.2"
1581cdf0e10cSrcweir+
1582cdf0e10cSrcweir+/* Define to empty if `const' does not conform to ANSI C. */
1583cdf0e10cSrcweir+/* #undef const */
1584cdf0e10cSrcweir+
1585cdf0e10cSrcweir+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
1586cdf0e10cSrcweir+   if it is not supported. */
1587cdf0e10cSrcweir+/* #undef inline */
1588cdf0e10cSrcweir+
1589cdf0e10cSrcweir+/* Define to rpl_malloc if the replacement function should be used. */
1590cdf0e10cSrcweir+/* #undef malloc */
1591cdf0e10cSrcweir+
1592cdf0e10cSrcweir+/* Define to rpl_realloc if the replacement function should be used. */
1593cdf0e10cSrcweir+/* #undef realloc */
1594cdf0e10cSrcweir+
1595cdf0e10cSrcweir+/* Define to `unsigned' if <sys/types.h> does not define. */
1596cdf0e10cSrcweir+/* #undef size_t */
1597cdf0e10cSrcweir--- misc/libtextcat-2.2/config.guess    2010-04-15 09:20:04.000000000 +0000
1598cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/config.guess  2010-04-15 09:20:41.000000000 +0000
1599cdf0e10cSrcweir@@ -1,9 +1,10 @@
1600cdf0e10cSrcweir #! /bin/sh
1601cdf0e10cSrcweir # Attempt to guess a canonical system name.
1602cdf0e10cSrcweir #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
1603cdf0e10cSrcweir-#   2000, 2001, 2002 Free Software Foundation, Inc.
1604cdf0e10cSrcweir+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
1605cdf0e10cSrcweir+#   Free Software Foundation, Inc.
1606cdf0e10cSrcweir
1607cdf0e10cSrcweir-timestamp='2002-10-21'
1608cdf0e10cSrcweir+timestamp='2009-12-30'
1609cdf0e10cSrcweir
1610cdf0e10cSrcweir # This file is free software; you can redistribute it and/or modify it
1611cdf0e10cSrcweir # under the terms of the GNU General Public License as published by
1612cdf0e10cSrcweir@@ -17,23 +18,25 @@
1613cdf0e10cSrcweir #
1614cdf0e10cSrcweir # You should have received a copy of the GNU General Public License
1615cdf0e10cSrcweir # along with this program; if not, write to the Free Software
1616cdf0e10cSrcweir-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1617cdf0e10cSrcweir+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
1618cdf0e10cSrcweir+# 02110-1301, USA.
1619cdf0e10cSrcweir #
1620cdf0e10cSrcweir # As a special exception to the GNU General Public License, if you
1621cdf0e10cSrcweir # distribute this file as part of a program that contains a
1622cdf0e10cSrcweir # configuration script generated by Autoconf, you may include it under
1623cdf0e10cSrcweir # the same distribution terms that you use for the rest of that program.
1624cdf0e10cSrcweir
1625cdf0e10cSrcweir-# Originally written by Per Bothner <per@bothner.com>.
1626cdf0e10cSrcweir-# Please send patches to <config-patches@gnu.org>.  Submit a context
1627cdf0e10cSrcweir-# diff and a properly formatted ChangeLog entry.
1628cdf0e10cSrcweir+
1629cdf0e10cSrcweir+# Originally written by Per Bothner.  Please send patches (context
1630cdf0e10cSrcweir+# diff format) to <config-patches@gnu.org> and include a ChangeLog
1631cdf0e10cSrcweir+# entry.
1632cdf0e10cSrcweir #
1633cdf0e10cSrcweir # This script attempts to guess a canonical system name similar to
1634cdf0e10cSrcweir # config.sub.  If it succeeds, it prints the system name on stdout, and
1635cdf0e10cSrcweir # exits with 0.  Otherwise, it exits with 1.
1636cdf0e10cSrcweir #
1637cdf0e10cSrcweir-# The plan is that this can be called by configure scripts if you
1638cdf0e10cSrcweir-# don't specify an explicit build system type.
1639cdf0e10cSrcweir+# You can get the latest version of this script from:
1640cdf0e10cSrcweir+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1641cdf0e10cSrcweir
1642cdf0e10cSrcweir me=`echo "$0" | sed -e 's,.*/,,'`
1643cdf0e10cSrcweir
1644cdf0e10cSrcweir@@ -53,8 +56,9 @@
1645cdf0e10cSrcweir GNU config.guess ($timestamp)
1646cdf0e10cSrcweir
1647cdf0e10cSrcweir Originally written by Per Bothner.
1648cdf0e10cSrcweir-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
1649cdf0e10cSrcweir-Free Software Foundation, Inc.
1650cdf0e10cSrcweir+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
1651cdf0e10cSrcweir+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
1652cdf0e10cSrcweir+Software Foundation, Inc.
1653cdf0e10cSrcweir
1654cdf0e10cSrcweir This is free software; see the source for copying conditions.  There is NO
1655cdf0e10cSrcweir warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1656cdf0e10cSrcweir@@ -66,11 +70,11 @@
1657cdf0e10cSrcweir while test $# -gt 0 ; do
1658cdf0e10cSrcweir   case $1 in
1659cdf0e10cSrcweir     --time-stamp | --time* | -t )
1660cdf0e10cSrcweir-       echo "$timestamp" ; exit 0 ;;
1661cdf0e10cSrcweir+       echo "$timestamp" ; exit ;;
1662cdf0e10cSrcweir     --version | -v )
1663cdf0e10cSrcweir-       echo "$version" ; exit 0 ;;
1664cdf0e10cSrcweir+       echo "$version" ; exit ;;
1665cdf0e10cSrcweir     --help | --h* | -h )
1666cdf0e10cSrcweir-       echo "$usage"; exit 0 ;;
1667cdf0e10cSrcweir+       echo "$usage"; exit ;;
1668cdf0e10cSrcweir     -- )     # Stop option processing
1669cdf0e10cSrcweir        shift; break ;;
1670cdf0e10cSrcweir     - )    # Use stdin as input.
1671cdf0e10cSrcweir@@ -98,14 +102,18 @@
1672cdf0e10cSrcweir # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1673cdf0e10cSrcweir # use `HOST_CC' if defined, but it is deprecated.
1674cdf0e10cSrcweir
1675cdf0e10cSrcweir-# This shell variable is my proudest work .. or something. --bje
1676cdf0e10cSrcweir+# Portable tmp directory creation inspired by the Autoconf team.
1677cdf0e10cSrcweir
1678cdf0e10cSrcweir-set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
1679cdf0e10cSrcweir-(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
1680cdf0e10cSrcweir-   || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
1681cdf0e10cSrcweir-dummy=$tmpdir/dummy ;
1682cdf0e10cSrcweir-files="$dummy.c $dummy.o $dummy.rel $dummy" ;
1683cdf0e10cSrcweir-trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
1684cdf0e10cSrcweir+set_cc_for_build='
1685cdf0e10cSrcweir+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1686cdf0e10cSrcweir+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1687cdf0e10cSrcweir+: ${TMPDIR=/tmp} ;
1688cdf0e10cSrcweir+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1689cdf0e10cSrcweir+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1690cdf0e10cSrcweir+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1691cdf0e10cSrcweir+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1692cdf0e10cSrcweir+dummy=$tmp/dummy ;
1693cdf0e10cSrcweir+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1694cdf0e10cSrcweir case $CC_FOR_BUILD,$HOST_CC,$CC in
1695cdf0e10cSrcweir  ,,)    echo "int x;" > $dummy.c ;
1696cdf0e10cSrcweir    for c in cc gcc c89 c99 ; do
1697cdf0e10cSrcweir@@ -113,15 +121,13 @@
1698cdf0e10cSrcweir         CC_FOR_BUILD="$c"; break ;
1699cdf0e10cSrcweir      fi ;
1700cdf0e10cSrcweir    done ;
1701cdf0e10cSrcweir-   rm -f $files ;
1702cdf0e10cSrcweir    if test x"$CC_FOR_BUILD" = x ; then
1703cdf0e10cSrcweir      CC_FOR_BUILD=no_compiler_found ;
1704cdf0e10cSrcweir    fi
1705cdf0e10cSrcweir    ;;
1706cdf0e10cSrcweir  ,,*)   CC_FOR_BUILD=$CC ;;
1707cdf0e10cSrcweir  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1708cdf0e10cSrcweir-esac ;
1709cdf0e10cSrcweir-unset files'
1710cdf0e10cSrcweir+esac ; set_cc_for_build= ;'
1711cdf0e10cSrcweir
1712cdf0e10cSrcweir # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1713cdf0e10cSrcweir # (ghazi@noc.rutgers.edu 1994-08-24)
1714cdf0e10cSrcweir@@ -156,6 +162,7 @@
1715cdf0e10cSrcweir        arm*) machine=arm-unknown ;;
1716cdf0e10cSrcweir        sh3el) machine=shl-unknown ;;
1717cdf0e10cSrcweir        sh3eb) machine=sh-unknown ;;
1718cdf0e10cSrcweir+       sh5el) machine=sh5le-unknown ;;
1719cdf0e10cSrcweir        *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1720cdf0e10cSrcweir    esac
1721cdf0e10cSrcweir    # The Operating System including object format, if it has switched
1722cdf0e10cSrcweir@@ -164,7 +171,7 @@
1723cdf0e10cSrcweir        arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1724cdf0e10cSrcweir        eval $set_cc_for_build
1725cdf0e10cSrcweir        if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1726cdf0e10cSrcweir-           | grep __ELF__ >/dev/null
1727cdf0e10cSrcweir+           | grep -q __ELF__
1728cdf0e10cSrcweir        then
1729cdf0e10cSrcweir            # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1730cdf0e10cSrcweir            # Return netbsd for either.  FIX?
1731cdf0e10cSrcweir@@ -178,144 +185,128 @@
1732cdf0e10cSrcweir        ;;
1733cdf0e10cSrcweir    esac
1734cdf0e10cSrcweir    # The OS release
1735cdf0e10cSrcweir-   release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1736cdf0e10cSrcweir+   # Debian GNU/NetBSD machines have a different userland, and
1737cdf0e10cSrcweir+   # thus, need a distinct triplet. However, they do not need
1738cdf0e10cSrcweir+   # kernel version information, so it can be replaced with a
1739cdf0e10cSrcweir+   # suitable tag, in the style of linux-gnu.
1740cdf0e10cSrcweir+   case "${UNAME_VERSION}" in
1741cdf0e10cSrcweir+       Debian*)
1742cdf0e10cSrcweir+       release='-gnu'
1743cdf0e10cSrcweir+       ;;
1744cdf0e10cSrcweir+       *)
1745cdf0e10cSrcweir+       release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1746cdf0e10cSrcweir+       ;;
1747cdf0e10cSrcweir+   esac
1748cdf0e10cSrcweir    # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
1749cdf0e10cSrcweir    # contains redundant information, the shorter form:
1750cdf0e10cSrcweir    # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
1751cdf0e10cSrcweir    echo "${machine}-${os}${release}"
1752cdf0e10cSrcweir-   exit 0 ;;
1753cdf0e10cSrcweir-    amiga:OpenBSD:*:*)
1754cdf0e10cSrcweir-   echo m68k-unknown-openbsd${UNAME_RELEASE}
1755cdf0e10cSrcweir-   exit 0 ;;
1756cdf0e10cSrcweir-    arc:OpenBSD:*:*)
1757cdf0e10cSrcweir-   echo mipsel-unknown-openbsd${UNAME_RELEASE}
1758cdf0e10cSrcweir-   exit 0 ;;
1759cdf0e10cSrcweir-    hp300:OpenBSD:*:*)
1760cdf0e10cSrcweir-   echo m68k-unknown-openbsd${UNAME_RELEASE}
1761cdf0e10cSrcweir-   exit 0 ;;
1762cdf0e10cSrcweir-    mac68k:OpenBSD:*:*)
1763cdf0e10cSrcweir-   echo m68k-unknown-openbsd${UNAME_RELEASE}
1764cdf0e10cSrcweir-   exit 0 ;;
1765cdf0e10cSrcweir-    macppc:OpenBSD:*:*)
1766cdf0e10cSrcweir-   echo powerpc-unknown-openbsd${UNAME_RELEASE}
1767cdf0e10cSrcweir-   exit 0 ;;
1768cdf0e10cSrcweir-    mvme68k:OpenBSD:*:*)
1769cdf0e10cSrcweir-   echo m68k-unknown-openbsd${UNAME_RELEASE}
1770cdf0e10cSrcweir-   exit 0 ;;
1771cdf0e10cSrcweir-    mvme88k:OpenBSD:*:*)
1772cdf0e10cSrcweir-   echo m88k-unknown-openbsd${UNAME_RELEASE}
1773cdf0e10cSrcweir-   exit 0 ;;
1774cdf0e10cSrcweir-    mvmeppc:OpenBSD:*:*)
1775cdf0e10cSrcweir-   echo powerpc-unknown-openbsd${UNAME_RELEASE}
1776cdf0e10cSrcweir-   exit 0 ;;
1777cdf0e10cSrcweir-    pmax:OpenBSD:*:*)
1778cdf0e10cSrcweir-   echo mipsel-unknown-openbsd${UNAME_RELEASE}
1779cdf0e10cSrcweir-   exit 0 ;;
1780cdf0e10cSrcweir-    sgi:OpenBSD:*:*)
1781cdf0e10cSrcweir-   echo mipseb-unknown-openbsd${UNAME_RELEASE}
1782cdf0e10cSrcweir-   exit 0 ;;
1783cdf0e10cSrcweir-    sun3:OpenBSD:*:*)
1784cdf0e10cSrcweir-   echo m68k-unknown-openbsd${UNAME_RELEASE}
1785cdf0e10cSrcweir-   exit 0 ;;
1786cdf0e10cSrcweir-    wgrisc:OpenBSD:*:*)
1787cdf0e10cSrcweir-   echo mipsel-unknown-openbsd${UNAME_RELEASE}
1788cdf0e10cSrcweir-   exit 0 ;;
1789cdf0e10cSrcweir+   exit ;;
1790cdf0e10cSrcweir     *:OpenBSD:*:*)
1791cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
1792cdf0e10cSrcweir-   exit 0 ;;
1793cdf0e10cSrcweir+   UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
1794cdf0e10cSrcweir+   echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
1795cdf0e10cSrcweir+   exit ;;
1796cdf0e10cSrcweir+    *:ekkoBSD:*:*)
1797cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
1798cdf0e10cSrcweir+   exit ;;
1799cdf0e10cSrcweir+    *:SolidBSD:*:*)
1800cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
1801cdf0e10cSrcweir+   exit ;;
1802cdf0e10cSrcweir+    macppc:MirBSD:*:*)
1803cdf0e10cSrcweir+   echo powerpc-unknown-mirbsd${UNAME_RELEASE}
1804cdf0e10cSrcweir+   exit ;;
1805cdf0e10cSrcweir+    *:MirBSD:*:*)
1806cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
1807cdf0e10cSrcweir+   exit ;;
1808cdf0e10cSrcweir     alpha:OSF1:*:*)
1809cdf0e10cSrcweir-   if test $UNAME_RELEASE = "V4.0"; then
1810cdf0e10cSrcweir+   case $UNAME_RELEASE in
1811cdf0e10cSrcweir+   *4.0)
1812cdf0e10cSrcweir        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
1813cdf0e10cSrcweir-   fi
1814cdf0e10cSrcweir+       ;;
1815cdf0e10cSrcweir+   *5.*)
1816cdf0e10cSrcweir+           UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
1817cdf0e10cSrcweir+       ;;
1818cdf0e10cSrcweir+   esac
1819cdf0e10cSrcweir+   # According to Compaq, /usr/sbin/psrinfo has been available on
1820cdf0e10cSrcweir+   # OSF/1 and Tru64 systems produced since 1995.  I hope that
1821cdf0e10cSrcweir+   # covers most systems running today.  This code pipes the CPU
1822cdf0e10cSrcweir+   # types through head -n 1, so we only detect the type of CPU 0.
1823cdf0e10cSrcweir+   ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
1824cdf0e10cSrcweir+   case "$ALPHA_CPU_TYPE" in
1825cdf0e10cSrcweir+       "EV4 (21064)")
1826cdf0e10cSrcweir+       UNAME_MACHINE="alpha" ;;
1827cdf0e10cSrcweir+       "EV4.5 (21064)")
1828cdf0e10cSrcweir+       UNAME_MACHINE="alpha" ;;
1829cdf0e10cSrcweir+       "LCA4 (21066/21068)")
1830cdf0e10cSrcweir+       UNAME_MACHINE="alpha" ;;
1831cdf0e10cSrcweir+       "EV5 (21164)")
1832cdf0e10cSrcweir+       UNAME_MACHINE="alphaev5" ;;
1833cdf0e10cSrcweir+       "EV5.6 (21164A)")
1834cdf0e10cSrcweir+       UNAME_MACHINE="alphaev56" ;;
1835cdf0e10cSrcweir+       "EV5.6 (21164PC)")
1836cdf0e10cSrcweir+       UNAME_MACHINE="alphapca56" ;;
1837cdf0e10cSrcweir+       "EV5.7 (21164PC)")
1838cdf0e10cSrcweir+       UNAME_MACHINE="alphapca57" ;;
1839cdf0e10cSrcweir+       "EV6 (21264)")
1840cdf0e10cSrcweir+       UNAME_MACHINE="alphaev6" ;;
1841cdf0e10cSrcweir+       "EV6.7 (21264A)")
1842cdf0e10cSrcweir+       UNAME_MACHINE="alphaev67" ;;
1843cdf0e10cSrcweir+       "EV6.8CB (21264C)")
1844cdf0e10cSrcweir+       UNAME_MACHINE="alphaev68" ;;
1845cdf0e10cSrcweir+       "EV6.8AL (21264B)")
1846cdf0e10cSrcweir+       UNAME_MACHINE="alphaev68" ;;
1847cdf0e10cSrcweir+       "EV6.8CX (21264D)")
1848cdf0e10cSrcweir+       UNAME_MACHINE="alphaev68" ;;
1849cdf0e10cSrcweir+       "EV6.9A (21264/EV69A)")
1850cdf0e10cSrcweir+       UNAME_MACHINE="alphaev69" ;;
1851cdf0e10cSrcweir+       "EV7 (21364)")
1852cdf0e10cSrcweir+       UNAME_MACHINE="alphaev7" ;;
1853cdf0e10cSrcweir+       "EV7.9 (21364A)")
1854cdf0e10cSrcweir+       UNAME_MACHINE="alphaev79" ;;
1855cdf0e10cSrcweir+   esac
1856cdf0e10cSrcweir+   # A Pn.n version is a patched version.
1857cdf0e10cSrcweir    # A Vn.n version is a released version.
1858cdf0e10cSrcweir    # A Tn.n version is a released field test version.
1859cdf0e10cSrcweir    # A Xn.n version is an unreleased experimental baselevel.
1860cdf0e10cSrcweir    # 1.2 uses "1.2" for uname -r.
1861cdf0e10cSrcweir-   eval $set_cc_for_build
1862cdf0e10cSrcweir-   cat <<EOF >$dummy.s
1863cdf0e10cSrcweir-   .data
1864cdf0e10cSrcweir-\$Lformat:
1865cdf0e10cSrcweir-   .byte 37,100,45,37,120,10,0 # "%d-%x\n"
1866cdf0e10cSrcweir-
1867cdf0e10cSrcweir-   .text
1868cdf0e10cSrcweir-   .globl main
1869cdf0e10cSrcweir-   .align 4
1870cdf0e10cSrcweir-   .ent main
1871cdf0e10cSrcweir-main:
1872cdf0e10cSrcweir-   .frame \$30,16,\$26,0
1873cdf0e10cSrcweir-   ldgp \$29,0(\$27)
1874cdf0e10cSrcweir-   .prologue 1
1875cdf0e10cSrcweir-   .long 0x47e03d80 # implver \$0
1876cdf0e10cSrcweir-   lda \$2,-1
1877cdf0e10cSrcweir-   .long 0x47e20c21 # amask \$2,\$1
1878cdf0e10cSrcweir-   lda \$16,\$Lformat
1879cdf0e10cSrcweir-   mov \$0,\$17
1880cdf0e10cSrcweir-   not \$1,\$18
1881cdf0e10cSrcweir-   jsr \$26,printf
1882cdf0e10cSrcweir-   ldgp \$29,0(\$26)
1883cdf0e10cSrcweir-   mov 0,\$16
1884cdf0e10cSrcweir-   jsr \$26,exit
1885cdf0e10cSrcweir-   .end main
1886cdf0e10cSrcweir-EOF
1887cdf0e10cSrcweir-   $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
1888cdf0e10cSrcweir-   if test "$?" = 0 ; then
1889cdf0e10cSrcweir-       case `$dummy` in
1890cdf0e10cSrcweir-           0-0)
1891cdf0e10cSrcweir-               UNAME_MACHINE="alpha"
1892cdf0e10cSrcweir-               ;;
1893cdf0e10cSrcweir-           1-0)
1894cdf0e10cSrcweir-               UNAME_MACHINE="alphaev5"
1895cdf0e10cSrcweir-               ;;
1896cdf0e10cSrcweir-           1-1)
1897cdf0e10cSrcweir-               UNAME_MACHINE="alphaev56"
1898cdf0e10cSrcweir-               ;;
1899cdf0e10cSrcweir-           1-101)
1900cdf0e10cSrcweir-               UNAME_MACHINE="alphapca56"
1901cdf0e10cSrcweir-               ;;
1902cdf0e10cSrcweir-           2-303)
1903cdf0e10cSrcweir-               UNAME_MACHINE="alphaev6"
1904cdf0e10cSrcweir-               ;;
1905cdf0e10cSrcweir-           2-307)
1906cdf0e10cSrcweir-               UNAME_MACHINE="alphaev67"
1907cdf0e10cSrcweir-               ;;
1908cdf0e10cSrcweir-           2-1307)
1909cdf0e10cSrcweir-               UNAME_MACHINE="alphaev68"
1910cdf0e10cSrcweir-               ;;
1911cdf0e10cSrcweir-           3-1307)
1912cdf0e10cSrcweir-               UNAME_MACHINE="alphaev7"
1913cdf0e10cSrcweir-               ;;
1914cdf0e10cSrcweir-       esac
1915cdf0e10cSrcweir-   fi
1916cdf0e10cSrcweir-   rm -f $dummy.s $dummy && rmdir $tmpdir
1917cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
1918cdf0e10cSrcweir-   exit 0 ;;
1919cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
1920cdf0e10cSrcweir+   exit ;;
1921cdf0e10cSrcweir     Alpha\ *:Windows_NT*:*)
1922cdf0e10cSrcweir    # How do we know it's Interix rather than the generic POSIX subsystem?
1923cdf0e10cSrcweir    # Should we change UNAME_MACHINE based on the output of uname instead
1924cdf0e10cSrcweir    # of the specific Alpha model?
1925cdf0e10cSrcweir    echo alpha-pc-interix
1926cdf0e10cSrcweir-   exit 0 ;;
1927cdf0e10cSrcweir+   exit ;;
1928cdf0e10cSrcweir     21064:Windows_NT:50:3)
1929cdf0e10cSrcweir    echo alpha-dec-winnt3.5
1930cdf0e10cSrcweir-   exit 0 ;;
1931cdf0e10cSrcweir+   exit ;;
1932cdf0e10cSrcweir     Amiga*:UNIX_System_V:4.0:*)
1933cdf0e10cSrcweir    echo m68k-unknown-sysv4
1934cdf0e10cSrcweir-   exit 0;;
1935cdf0e10cSrcweir+   exit ;;
1936cdf0e10cSrcweir     *:[Aa]miga[Oo][Ss]:*:*)
1937cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-amigaos
1938cdf0e10cSrcweir-   exit 0 ;;
1939cdf0e10cSrcweir+   exit ;;
1940cdf0e10cSrcweir     *:[Mm]orph[Oo][Ss]:*:*)
1941cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-morphos
1942cdf0e10cSrcweir-   exit 0 ;;
1943cdf0e10cSrcweir+   exit ;;
1944cdf0e10cSrcweir     *:OS/390:*:*)
1945cdf0e10cSrcweir    echo i370-ibm-openedition
1946cdf0e10cSrcweir-   exit 0 ;;
1947cdf0e10cSrcweir+   exit ;;
1948cdf0e10cSrcweir+    *:z/VM:*:*)
1949cdf0e10cSrcweir+   echo s390-ibm-zvmoe
1950cdf0e10cSrcweir+   exit ;;
1951cdf0e10cSrcweir+    *:OS400:*:*)
1952cdf0e10cSrcweir+        echo powerpc-ibm-os400
1953cdf0e10cSrcweir+   exit ;;
1954cdf0e10cSrcweir     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
1955cdf0e10cSrcweir    echo arm-acorn-riscix${UNAME_RELEASE}
1956cdf0e10cSrcweir-   exit 0;;
1957cdf0e10cSrcweir+   exit ;;
1958cdf0e10cSrcweir+    arm:riscos:*:*|arm:RISCOS:*:*)
1959cdf0e10cSrcweir+   echo arm-unknown-riscos
1960cdf0e10cSrcweir+   exit ;;
1961cdf0e10cSrcweir     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
1962cdf0e10cSrcweir    echo hppa1.1-hitachi-hiuxmpp
1963cdf0e10cSrcweir-   exit 0;;
1964cdf0e10cSrcweir+   exit ;;
1965cdf0e10cSrcweir     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
1966cdf0e10cSrcweir    # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
1967cdf0e10cSrcweir    if test "`(/bin/universe) 2>/dev/null`" = att ; then
1968cdf0e10cSrcweir@@ -323,29 +314,51 @@
1969cdf0e10cSrcweir    else
1970cdf0e10cSrcweir        echo pyramid-pyramid-bsd
1971cdf0e10cSrcweir    fi
1972cdf0e10cSrcweir-   exit 0 ;;
1973cdf0e10cSrcweir+   exit ;;
1974cdf0e10cSrcweir     NILE*:*:*:dcosx)
1975cdf0e10cSrcweir    echo pyramid-pyramid-svr4
1976cdf0e10cSrcweir-   exit 0 ;;
1977cdf0e10cSrcweir-    DRS?6000:UNIX_SV:4.2*:7*)
1978cdf0e10cSrcweir+   exit ;;
1979cdf0e10cSrcweir+    DRS?6000:unix:4.0:6*)
1980cdf0e10cSrcweir+   echo sparc-icl-nx6
1981cdf0e10cSrcweir+   exit ;;
1982cdf0e10cSrcweir+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
1983cdf0e10cSrcweir    case `/usr/bin/uname -p` in
1984cdf0e10cSrcweir-       sparc) echo sparc-icl-nx7 && exit 0 ;;
1985cdf0e10cSrcweir+       sparc) echo sparc-icl-nx7; exit ;;
1986cdf0e10cSrcweir    esac ;;
1987cdf0e10cSrcweir+    s390x:SunOS:*:*)
1988cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
1989cdf0e10cSrcweir+   exit ;;
1990cdf0e10cSrcweir     sun4H:SunOS:5.*:*)
1991cdf0e10cSrcweir    echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
1992cdf0e10cSrcweir-   exit 0 ;;
1993cdf0e10cSrcweir+   exit ;;
1994cdf0e10cSrcweir     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
1995cdf0e10cSrcweir    echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
1996cdf0e10cSrcweir-   exit 0 ;;
1997cdf0e10cSrcweir-    i86pc:SunOS:5.*:*)
1998cdf0e10cSrcweir-   echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
1999cdf0e10cSrcweir-   exit 0 ;;
2000cdf0e10cSrcweir+   exit ;;
2001cdf0e10cSrcweir+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
2002cdf0e10cSrcweir+   echo i386-pc-auroraux${UNAME_RELEASE}
2003cdf0e10cSrcweir+   exit ;;
2004cdf0e10cSrcweir+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
2005cdf0e10cSrcweir+   eval $set_cc_for_build
2006cdf0e10cSrcweir+   SUN_ARCH="i386"
2007cdf0e10cSrcweir+   # If there is a compiler, see if it is configured for 64-bit objects.
2008cdf0e10cSrcweir+   # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
2009cdf0e10cSrcweir+   # This test works for both compilers.
2010cdf0e10cSrcweir+   if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
2011cdf0e10cSrcweir+       if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
2012cdf0e10cSrcweir+       (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
2013cdf0e10cSrcweir+       grep IS_64BIT_ARCH >/dev/null
2014cdf0e10cSrcweir+       then
2015cdf0e10cSrcweir+       SUN_ARCH="x86_64"
2016cdf0e10cSrcweir+       fi
2017cdf0e10cSrcweir+   fi
2018cdf0e10cSrcweir+   echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2019cdf0e10cSrcweir+   exit ;;
2020cdf0e10cSrcweir     sun4*:SunOS:6*:*)
2021cdf0e10cSrcweir    # According to config.sub, this is the proper way to canonicalize
2022cdf0e10cSrcweir    # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
2023cdf0e10cSrcweir    # it's likely to be more like Solaris than SunOS4.
2024cdf0e10cSrcweir    echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2025cdf0e10cSrcweir-   exit 0 ;;
2026cdf0e10cSrcweir+   exit ;;
2027cdf0e10cSrcweir     sun4*:SunOS:*:*)
2028cdf0e10cSrcweir    case "`/usr/bin/arch -k`" in
2029cdf0e10cSrcweir        Series*|S4*)
2030cdf0e10cSrcweir@@ -354,10 +367,10 @@
2031cdf0e10cSrcweir    esac
2032cdf0e10cSrcweir    # Japanese Language versions have a version number like `4.1.3-JL'.
2033cdf0e10cSrcweir    echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
2034cdf0e10cSrcweir-   exit 0 ;;
2035cdf0e10cSrcweir+   exit ;;
2036cdf0e10cSrcweir     sun3*:SunOS:*:*)
2037cdf0e10cSrcweir    echo m68k-sun-sunos${UNAME_RELEASE}
2038cdf0e10cSrcweir-   exit 0 ;;
2039cdf0e10cSrcweir+   exit ;;
2040cdf0e10cSrcweir     sun*:*:4.2BSD:*)
2041cdf0e10cSrcweir    UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
2042cdf0e10cSrcweir    test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
2043cdf0e10cSrcweir@@ -369,10 +382,10 @@
2044cdf0e10cSrcweir        echo sparc-sun-sunos${UNAME_RELEASE}
2045cdf0e10cSrcweir        ;;
2046cdf0e10cSrcweir    esac
2047cdf0e10cSrcweir-   exit 0 ;;
2048cdf0e10cSrcweir+   exit ;;
2049cdf0e10cSrcweir     aushp:SunOS:*:*)
2050cdf0e10cSrcweir    echo sparc-auspex-sunos${UNAME_RELEASE}
2051cdf0e10cSrcweir-   exit 0 ;;
2052cdf0e10cSrcweir+   exit ;;
2053cdf0e10cSrcweir     # The situation for MiNT is a little confusing.  The machine name
2054cdf0e10cSrcweir     # can be virtually everything (everything which is not
2055cdf0e10cSrcweir     # "atarist" or "atariste" at least should have a processor
2056cdf0e10cSrcweir@@ -383,37 +396,40 @@
2057cdf0e10cSrcweir     # be no problem.
2058cdf0e10cSrcweir     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
2059cdf0e10cSrcweir         echo m68k-atari-mint${UNAME_RELEASE}
2060cdf0e10cSrcweir-   exit 0 ;;
2061cdf0e10cSrcweir+   exit ;;
2062cdf0e10cSrcweir     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
2063cdf0e10cSrcweir    echo m68k-atari-mint${UNAME_RELEASE}
2064cdf0e10cSrcweir-        exit 0 ;;
2065cdf0e10cSrcweir+        exit ;;
2066cdf0e10cSrcweir     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
2067cdf0e10cSrcweir         echo m68k-atari-mint${UNAME_RELEASE}
2068cdf0e10cSrcweir-   exit 0 ;;
2069cdf0e10cSrcweir+   exit ;;
2070cdf0e10cSrcweir     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
2071cdf0e10cSrcweir         echo m68k-milan-mint${UNAME_RELEASE}
2072cdf0e10cSrcweir-        exit 0 ;;
2073cdf0e10cSrcweir+        exit ;;
2074cdf0e10cSrcweir     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
2075cdf0e10cSrcweir         echo m68k-hades-mint${UNAME_RELEASE}
2076cdf0e10cSrcweir-        exit 0 ;;
2077cdf0e10cSrcweir+        exit ;;
2078cdf0e10cSrcweir     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
2079cdf0e10cSrcweir         echo m68k-unknown-mint${UNAME_RELEASE}
2080cdf0e10cSrcweir-        exit 0 ;;
2081cdf0e10cSrcweir+        exit ;;
2082cdf0e10cSrcweir+    m68k:machten:*:*)
2083cdf0e10cSrcweir+   echo m68k-apple-machten${UNAME_RELEASE}
2084cdf0e10cSrcweir+   exit ;;
2085cdf0e10cSrcweir     powerpc:machten:*:*)
2086cdf0e10cSrcweir    echo powerpc-apple-machten${UNAME_RELEASE}
2087cdf0e10cSrcweir-   exit 0 ;;
2088cdf0e10cSrcweir+   exit ;;
2089cdf0e10cSrcweir     RISC*:Mach:*:*)
2090cdf0e10cSrcweir    echo mips-dec-mach_bsd4.3
2091cdf0e10cSrcweir-   exit 0 ;;
2092cdf0e10cSrcweir+   exit ;;
2093cdf0e10cSrcweir     RISC*:ULTRIX:*:*)
2094cdf0e10cSrcweir    echo mips-dec-ultrix${UNAME_RELEASE}
2095cdf0e10cSrcweir-   exit 0 ;;
2096cdf0e10cSrcweir+   exit ;;
2097cdf0e10cSrcweir     VAX*:ULTRIX*:*:*)
2098cdf0e10cSrcweir    echo vax-dec-ultrix${UNAME_RELEASE}
2099cdf0e10cSrcweir-   exit 0 ;;
2100cdf0e10cSrcweir+   exit ;;
2101cdf0e10cSrcweir     2020:CLIX:*:* | 2430:CLIX:*:*)
2102cdf0e10cSrcweir    echo clipper-intergraph-clix${UNAME_RELEASE}
2103cdf0e10cSrcweir-   exit 0 ;;
2104cdf0e10cSrcweir+   exit ;;
2105cdf0e10cSrcweir     mips:*:*:UMIPS | mips:*:*:RISCos)
2106cdf0e10cSrcweir    eval $set_cc_for_build
2107cdf0e10cSrcweir    sed 's/^    //' << EOF >$dummy.c
2108cdf0e10cSrcweir@@ -437,33 +453,33 @@
2109cdf0e10cSrcweir      exit (-1);
2110cdf0e10cSrcweir    }
2111cdf0e10cSrcweir EOF
2112cdf0e10cSrcweir-   $CC_FOR_BUILD -o $dummy $dummy.c \
2113cdf0e10cSrcweir-     && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
2114cdf0e10cSrcweir-     && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
2115cdf0e10cSrcweir-   rm -f $dummy.c $dummy && rmdir $tmpdir
2116cdf0e10cSrcweir+   $CC_FOR_BUILD -o $dummy $dummy.c &&
2117cdf0e10cSrcweir+     dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
2118cdf0e10cSrcweir+     SYSTEM_NAME=`$dummy $dummyarg` &&
2119cdf0e10cSrcweir+       { echo "$SYSTEM_NAME"; exit; }
2120cdf0e10cSrcweir    echo mips-mips-riscos${UNAME_RELEASE}
2121cdf0e10cSrcweir-   exit 0 ;;
2122cdf0e10cSrcweir+   exit ;;
2123cdf0e10cSrcweir     Motorola:PowerMAX_OS:*:*)
2124cdf0e10cSrcweir    echo powerpc-motorola-powermax
2125cdf0e10cSrcweir-   exit 0 ;;
2126cdf0e10cSrcweir+   exit ;;
2127cdf0e10cSrcweir     Motorola:*:4.3:PL8-*)
2128cdf0e10cSrcweir    echo powerpc-harris-powermax
2129cdf0e10cSrcweir-   exit 0 ;;
2130cdf0e10cSrcweir-    Night_Hawk:*:*:PowerMAX_OS)
2131cdf0e10cSrcweir+   exit ;;
2132cdf0e10cSrcweir+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
2133cdf0e10cSrcweir    echo powerpc-harris-powermax
2134cdf0e10cSrcweir-   exit 0 ;;
2135cdf0e10cSrcweir+   exit ;;
2136cdf0e10cSrcweir     Night_Hawk:Power_UNIX:*:*)
2137cdf0e10cSrcweir    echo powerpc-harris-powerunix
2138cdf0e10cSrcweir-   exit 0 ;;
2139cdf0e10cSrcweir+   exit ;;
2140cdf0e10cSrcweir     m88k:CX/UX:7*:*)
2141cdf0e10cSrcweir    echo m88k-harris-cxux7
2142cdf0e10cSrcweir-   exit 0 ;;
2143cdf0e10cSrcweir+   exit ;;
2144cdf0e10cSrcweir     m88k:*:4*:R4*)
2145cdf0e10cSrcweir    echo m88k-motorola-sysv4
2146cdf0e10cSrcweir-   exit 0 ;;
2147cdf0e10cSrcweir+   exit ;;
2148cdf0e10cSrcweir     m88k:*:3*:R3*)
2149cdf0e10cSrcweir    echo m88k-motorola-sysv3
2150cdf0e10cSrcweir-   exit 0 ;;
2151cdf0e10cSrcweir+   exit ;;
2152cdf0e10cSrcweir     AViiON:dgux:*:*)
2153cdf0e10cSrcweir         # DG/UX returns AViiON for all architectures
2154cdf0e10cSrcweir         UNAME_PROCESSOR=`/usr/bin/uname -p`
2155cdf0e10cSrcweir@@ -479,29 +495,29 @@
2156cdf0e10cSrcweir    else
2157cdf0e10cSrcweir        echo i586-dg-dgux${UNAME_RELEASE}
2158cdf0e10cSrcweir    fi
2159cdf0e10cSrcweir-   exit 0 ;;
2160cdf0e10cSrcweir+   exit ;;
2161cdf0e10cSrcweir     M88*:DolphinOS:*:*)    # DolphinOS (SVR3)
2162cdf0e10cSrcweir    echo m88k-dolphin-sysv3
2163cdf0e10cSrcweir-   exit 0 ;;
2164cdf0e10cSrcweir+   exit ;;
2165cdf0e10cSrcweir     M88*:*:R3*:*)
2166cdf0e10cSrcweir    # Delta 88k system running SVR3
2167cdf0e10cSrcweir    echo m88k-motorola-sysv3
2168cdf0e10cSrcweir-   exit 0 ;;
2169cdf0e10cSrcweir+   exit ;;
2170cdf0e10cSrcweir     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
2171cdf0e10cSrcweir    echo m88k-tektronix-sysv3
2172cdf0e10cSrcweir-   exit 0 ;;
2173cdf0e10cSrcweir+   exit ;;
2174cdf0e10cSrcweir     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
2175cdf0e10cSrcweir    echo m68k-tektronix-bsd
2176cdf0e10cSrcweir-   exit 0 ;;
2177cdf0e10cSrcweir+   exit ;;
2178cdf0e10cSrcweir     *:IRIX*:*:*)
2179cdf0e10cSrcweir    echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
2180cdf0e10cSrcweir-   exit 0 ;;
2181cdf0e10cSrcweir+   exit ;;
2182cdf0e10cSrcweir     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
2183cdf0e10cSrcweir-   echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
2184cdf0e10cSrcweir-   exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
2185cdf0e10cSrcweir+   echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
2186cdf0e10cSrcweir+   exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
2187cdf0e10cSrcweir     i*86:AIX:*:*)
2188cdf0e10cSrcweir    echo i386-ibm-aix
2189cdf0e10cSrcweir-   exit 0 ;;
2190cdf0e10cSrcweir+   exit ;;
2191cdf0e10cSrcweir     ia64:AIX:*:*)
2192cdf0e10cSrcweir    if [ -x /usr/bin/oslevel ] ; then
2193cdf0e10cSrcweir        IBM_REV=`/usr/bin/oslevel`
2194cdf0e10cSrcweir@@ -509,7 +525,7 @@
2195cdf0e10cSrcweir        IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
2196cdf0e10cSrcweir    fi
2197cdf0e10cSrcweir    echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
2198cdf0e10cSrcweir-   exit 0 ;;
2199cdf0e10cSrcweir+   exit ;;
2200cdf0e10cSrcweir     *:AIX:2:3)
2201cdf0e10cSrcweir    if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
2202cdf0e10cSrcweir        eval $set_cc_for_build
2203cdf0e10cSrcweir@@ -524,16 +540,19 @@
2204cdf0e10cSrcweir            exit(0);
2205cdf0e10cSrcweir            }
2206cdf0e10cSrcweir EOF
2207cdf0e10cSrcweir-       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
2208cdf0e10cSrcweir-       rm -f $dummy.c $dummy && rmdir $tmpdir
2209cdf0e10cSrcweir-       echo rs6000-ibm-aix3.2.5
2210cdf0e10cSrcweir+       if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
2211cdf0e10cSrcweir+       then
2212cdf0e10cSrcweir+           echo "$SYSTEM_NAME"
2213cdf0e10cSrcweir+       else
2214cdf0e10cSrcweir+           echo rs6000-ibm-aix3.2.5
2215cdf0e10cSrcweir+       fi
2216cdf0e10cSrcweir    elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
2217cdf0e10cSrcweir        echo rs6000-ibm-aix3.2.4
2218cdf0e10cSrcweir    else
2219cdf0e10cSrcweir        echo rs6000-ibm-aix3.2
2220cdf0e10cSrcweir    fi
2221cdf0e10cSrcweir-   exit 0 ;;
2222cdf0e10cSrcweir-    *:AIX:*:[45])
2223cdf0e10cSrcweir+   exit ;;
2224cdf0e10cSrcweir+    *:AIX:*:[456])
2225cdf0e10cSrcweir    IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
2226cdf0e10cSrcweir    if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
2227cdf0e10cSrcweir        IBM_ARCH=rs6000
2228cdf0e10cSrcweir@@ -546,28 +565,28 @@
2229cdf0e10cSrcweir        IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
2230cdf0e10cSrcweir    fi
2231cdf0e10cSrcweir    echo ${IBM_ARCH}-ibm-aix${IBM_REV}
2232cdf0e10cSrcweir-   exit 0 ;;
2233cdf0e10cSrcweir+   exit ;;
2234cdf0e10cSrcweir     *:AIX:*:*)
2235cdf0e10cSrcweir    echo rs6000-ibm-aix
2236cdf0e10cSrcweir-   exit 0 ;;
2237cdf0e10cSrcweir+   exit ;;
2238cdf0e10cSrcweir     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
2239cdf0e10cSrcweir    echo romp-ibm-bsd4.4
2240cdf0e10cSrcweir-   exit 0 ;;
2241cdf0e10cSrcweir+   exit ;;
2242cdf0e10cSrcweir     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
2243cdf0e10cSrcweir    echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
2244cdf0e10cSrcweir-   exit 0 ;;                           # report: romp-ibm BSD 4.3
2245cdf0e10cSrcweir+   exit ;;                             # report: romp-ibm BSD 4.3
2246cdf0e10cSrcweir     *:BOSX:*:*)
2247cdf0e10cSrcweir    echo rs6000-bull-bosx
2248cdf0e10cSrcweir-   exit 0 ;;
2249cdf0e10cSrcweir+   exit ;;
2250cdf0e10cSrcweir     DPX/2?00:B.O.S.:*:*)
2251cdf0e10cSrcweir    echo m68k-bull-sysv3
2252cdf0e10cSrcweir-   exit 0 ;;
2253cdf0e10cSrcweir+   exit ;;
2254cdf0e10cSrcweir     9000/[34]??:4.3bsd:1.*:*)
2255cdf0e10cSrcweir    echo m68k-hp-bsd
2256cdf0e10cSrcweir-   exit 0 ;;
2257cdf0e10cSrcweir+   exit ;;
2258cdf0e10cSrcweir     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
2259cdf0e10cSrcweir    echo m68k-hp-bsd4.4
2260cdf0e10cSrcweir-   exit 0 ;;
2261cdf0e10cSrcweir+   exit ;;
2262cdf0e10cSrcweir     9000/[34678]??:HP-UX:*:*)
2263cdf0e10cSrcweir    HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
2264cdf0e10cSrcweir    case "${UNAME_MACHINE}" in
2265cdf0e10cSrcweir@@ -624,16 +643,36 @@
2266cdf0e10cSrcweir               }
2267cdf0e10cSrcweir EOF
2268cdf0e10cSrcweir            (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
2269cdf0e10cSrcweir-           if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
2270cdf0e10cSrcweir-           rm -f $dummy.c $dummy && rmdir $tmpdir
2271cdf0e10cSrcweir+           test -z "$HP_ARCH" && HP_ARCH=hppa
2272cdf0e10cSrcweir        fi ;;
2273cdf0e10cSrcweir    esac
2274cdf0e10cSrcweir+   if [ ${HP_ARCH} = "hppa2.0w" ]
2275cdf0e10cSrcweir+   then
2276cdf0e10cSrcweir+       eval $set_cc_for_build
2277cdf0e10cSrcweir+
2278cdf0e10cSrcweir+       # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
2279cdf0e10cSrcweir+       # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
2280cdf0e10cSrcweir+       # generating 64-bit code.  GNU and HP use different nomenclature:
2281cdf0e10cSrcweir+       #
2282cdf0e10cSrcweir+       # $ CC_FOR_BUILD=cc ./config.guess
2283cdf0e10cSrcweir+       # => hppa2.0w-hp-hpux11.23
2284cdf0e10cSrcweir+       # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
2285cdf0e10cSrcweir+       # => hppa64-hp-hpux11.23
2286cdf0e10cSrcweir+
2287cdf0e10cSrcweir+       if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
2288cdf0e10cSrcweir+       grep -q __LP64__
2289cdf0e10cSrcweir+       then
2290cdf0e10cSrcweir+       HP_ARCH="hppa2.0w"
2291cdf0e10cSrcweir+       else
2292cdf0e10cSrcweir+       HP_ARCH="hppa64"
2293cdf0e10cSrcweir+       fi
2294cdf0e10cSrcweir+   fi
2295cdf0e10cSrcweir    echo ${HP_ARCH}-hp-hpux${HPUX_REV}
2296cdf0e10cSrcweir-   exit 0 ;;
2297cdf0e10cSrcweir+   exit ;;
2298cdf0e10cSrcweir     ia64:HP-UX:*:*)
2299cdf0e10cSrcweir    HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
2300cdf0e10cSrcweir    echo ia64-hp-hpux${HPUX_REV}
2301cdf0e10cSrcweir-   exit 0 ;;
2302cdf0e10cSrcweir+   exit ;;
2303cdf0e10cSrcweir     3050*:HI-UX:*:*)
2304cdf0e10cSrcweir    eval $set_cc_for_build
2305cdf0e10cSrcweir    sed 's/^    //' << EOF >$dummy.c
2306cdf0e10cSrcweir@@ -661,186 +700,248 @@
2307cdf0e10cSrcweir      exit (0);
2308cdf0e10cSrcweir    }
2309cdf0e10cSrcweir EOF
2310cdf0e10cSrcweir-   $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
2311cdf0e10cSrcweir-   rm -f $dummy.c $dummy && rmdir $tmpdir
2312cdf0e10cSrcweir+   $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
2313cdf0e10cSrcweir+       { echo "$SYSTEM_NAME"; exit; }
2314cdf0e10cSrcweir    echo unknown-hitachi-hiuxwe2
2315cdf0e10cSrcweir-   exit 0 ;;
2316cdf0e10cSrcweir+   exit ;;
2317cdf0e10cSrcweir     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
2318cdf0e10cSrcweir    echo hppa1.1-hp-bsd
2319cdf0e10cSrcweir-   exit 0 ;;
2320cdf0e10cSrcweir+   exit ;;
2321cdf0e10cSrcweir     9000/8??:4.3bsd:*:*)
2322cdf0e10cSrcweir    echo hppa1.0-hp-bsd
2323cdf0e10cSrcweir-   exit 0 ;;
2324cdf0e10cSrcweir+   exit ;;
2325cdf0e10cSrcweir     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
2326cdf0e10cSrcweir    echo hppa1.0-hp-mpeix
2327cdf0e10cSrcweir-   exit 0 ;;
2328cdf0e10cSrcweir+   exit ;;
2329cdf0e10cSrcweir     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
2330cdf0e10cSrcweir    echo hppa1.1-hp-osf
2331cdf0e10cSrcweir-   exit 0 ;;
2332cdf0e10cSrcweir+   exit ;;
2333cdf0e10cSrcweir     hp8??:OSF1:*:*)
2334cdf0e10cSrcweir    echo hppa1.0-hp-osf
2335cdf0e10cSrcweir-   exit 0 ;;
2336cdf0e10cSrcweir+   exit ;;
2337cdf0e10cSrcweir     i*86:OSF1:*:*)
2338cdf0e10cSrcweir    if [ -x /usr/sbin/sysversion ] ; then
2339cdf0e10cSrcweir        echo ${UNAME_MACHINE}-unknown-osf1mk
2340cdf0e10cSrcweir    else
2341cdf0e10cSrcweir        echo ${UNAME_MACHINE}-unknown-osf1
2342cdf0e10cSrcweir    fi
2343cdf0e10cSrcweir-   exit 0 ;;
2344cdf0e10cSrcweir+   exit ;;
2345cdf0e10cSrcweir     parisc*:Lites*:*:*)
2346cdf0e10cSrcweir    echo hppa1.1-hp-lites
2347cdf0e10cSrcweir-   exit 0 ;;
2348cdf0e10cSrcweir+   exit ;;
2349cdf0e10cSrcweir     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
2350cdf0e10cSrcweir    echo c1-convex-bsd
2351cdf0e10cSrcweir-        exit 0 ;;
2352cdf0e10cSrcweir+        exit ;;
2353cdf0e10cSrcweir     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
2354cdf0e10cSrcweir    if getsysinfo -f scalar_acc
2355cdf0e10cSrcweir    then echo c32-convex-bsd
2356cdf0e10cSrcweir    else echo c2-convex-bsd
2357cdf0e10cSrcweir    fi
2358cdf0e10cSrcweir-        exit 0 ;;
2359cdf0e10cSrcweir+        exit ;;
2360cdf0e10cSrcweir     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
2361cdf0e10cSrcweir    echo c34-convex-bsd
2362cdf0e10cSrcweir-        exit 0 ;;
2363cdf0e10cSrcweir+        exit ;;
2364cdf0e10cSrcweir     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
2365cdf0e10cSrcweir    echo c38-convex-bsd
2366cdf0e10cSrcweir-        exit 0 ;;
2367cdf0e10cSrcweir+        exit ;;
2368cdf0e10cSrcweir     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
2369cdf0e10cSrcweir    echo c4-convex-bsd
2370cdf0e10cSrcweir-        exit 0 ;;
2371cdf0e10cSrcweir+        exit ;;
2372cdf0e10cSrcweir     CRAY*Y-MP:*:*:*)
2373cdf0e10cSrcweir    echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2374cdf0e10cSrcweir-   exit 0 ;;
2375cdf0e10cSrcweir+   exit ;;
2376cdf0e10cSrcweir     CRAY*[A-Z]90:*:*:*)
2377cdf0e10cSrcweir    echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
2378cdf0e10cSrcweir    | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
2379cdf0e10cSrcweir          -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
2380cdf0e10cSrcweir          -e 's/\.[^.]*$/.X/'
2381cdf0e10cSrcweir-   exit 0 ;;
2382cdf0e10cSrcweir+   exit ;;
2383cdf0e10cSrcweir     CRAY*TS:*:*:*)
2384cdf0e10cSrcweir    echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2385cdf0e10cSrcweir-   exit 0 ;;
2386cdf0e10cSrcweir-    CRAY*T3D:*:*:*)
2387cdf0e10cSrcweir-   echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2388cdf0e10cSrcweir-   exit 0 ;;
2389cdf0e10cSrcweir+   exit ;;
2390cdf0e10cSrcweir     CRAY*T3E:*:*:*)
2391cdf0e10cSrcweir    echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2392cdf0e10cSrcweir-   exit 0 ;;
2393cdf0e10cSrcweir+   exit ;;
2394cdf0e10cSrcweir     CRAY*SV1:*:*:*)
2395cdf0e10cSrcweir    echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2396cdf0e10cSrcweir-   exit 0 ;;
2397cdf0e10cSrcweir+   exit ;;
2398cdf0e10cSrcweir+    *:UNICOS/mp:*:*)
2399cdf0e10cSrcweir+   echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2400cdf0e10cSrcweir+   exit ;;
2401cdf0e10cSrcweir     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
2402cdf0e10cSrcweir    FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2403cdf0e10cSrcweir         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
2404cdf0e10cSrcweir         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
2405cdf0e10cSrcweir         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
2406cdf0e10cSrcweir-        exit 0 ;;
2407cdf0e10cSrcweir+        exit ;;
2408cdf0e10cSrcweir+    5000:UNIX_System_V:4.*:*)
2409cdf0e10cSrcweir+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
2410cdf0e10cSrcweir+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
2411cdf0e10cSrcweir+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
2412cdf0e10cSrcweir+   exit ;;
2413cdf0e10cSrcweir     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
2414cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
2415cdf0e10cSrcweir-   exit 0 ;;
2416cdf0e10cSrcweir+   exit ;;
2417cdf0e10cSrcweir     sparc*:BSD/OS:*:*)
2418cdf0e10cSrcweir    echo sparc-unknown-bsdi${UNAME_RELEASE}
2419cdf0e10cSrcweir-   exit 0 ;;
2420cdf0e10cSrcweir+   exit ;;
2421cdf0e10cSrcweir     *:BSD/OS:*:*)
2422cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
2423cdf0e10cSrcweir-   exit 0 ;;
2424cdf0e10cSrcweir+   exit ;;
2425cdf0e10cSrcweir     *:FreeBSD:*:*)
2426cdf0e10cSrcweir-   # Determine whether the default compiler uses glibc.
2427cdf0e10cSrcweir-   eval $set_cc_for_build
2428cdf0e10cSrcweir-   sed 's/^    //' << EOF >$dummy.c
2429cdf0e10cSrcweir-   #include <features.h>
2430cdf0e10cSrcweir-   #if __GLIBC__ >= 2
2431cdf0e10cSrcweir-   LIBC=gnu
2432cdf0e10cSrcweir-   #else
2433cdf0e10cSrcweir-   LIBC=
2434cdf0e10cSrcweir-   #endif
2435cdf0e10cSrcweir-EOF
2436cdf0e10cSrcweir-   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
2437cdf0e10cSrcweir-   rm -f $dummy.c && rmdir $tmpdir
2438cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
2439cdf0e10cSrcweir-   exit 0 ;;
2440cdf0e10cSrcweir+   case ${UNAME_MACHINE} in
2441cdf0e10cSrcweir+       pc98)
2442cdf0e10cSrcweir+       echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
2443cdf0e10cSrcweir+       amd64)
2444cdf0e10cSrcweir+       echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
2445cdf0e10cSrcweir+       *)
2446cdf0e10cSrcweir+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
2447cdf0e10cSrcweir+   esac
2448cdf0e10cSrcweir+   exit ;;
2449cdf0e10cSrcweir     i*:CYGWIN*:*)
2450cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-cygwin
2451cdf0e10cSrcweir-   exit 0 ;;
2452cdf0e10cSrcweir-    i*:MINGW*:*)
2453cdf0e10cSrcweir+   exit ;;
2454cdf0e10cSrcweir+    *:MINGW*:*)
2455cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-mingw32
2456cdf0e10cSrcweir-   exit 0 ;;
2457cdf0e10cSrcweir+   exit ;;
2458cdf0e10cSrcweir+    i*:windows32*:*)
2459cdf0e10cSrcweir+       # uname -m includes "-pc" on this system.
2460cdf0e10cSrcweir+       echo ${UNAME_MACHINE}-mingw32
2461cdf0e10cSrcweir+   exit ;;
2462cdf0e10cSrcweir     i*:PW*:*)
2463cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-pw32
2464cdf0e10cSrcweir-   exit 0 ;;
2465cdf0e10cSrcweir-    x86:Interix*:3*)
2466cdf0e10cSrcweir-   echo i386-pc-interix3
2467cdf0e10cSrcweir-   exit 0 ;;
2468cdf0e10cSrcweir+   exit ;;
2469cdf0e10cSrcweir+    *:Interix*:*)
2470cdf0e10cSrcweir+       case ${UNAME_MACHINE} in
2471cdf0e10cSrcweir+       x86)
2472cdf0e10cSrcweir+       echo i586-pc-interix${UNAME_RELEASE}
2473cdf0e10cSrcweir+       exit ;;
2474cdf0e10cSrcweir+       authenticamd | genuineintel | EM64T)
2475cdf0e10cSrcweir+       echo x86_64-unknown-interix${UNAME_RELEASE}
2476cdf0e10cSrcweir+       exit ;;
2477cdf0e10cSrcweir+       IA64)
2478cdf0e10cSrcweir+       echo ia64-unknown-interix${UNAME_RELEASE}
2479cdf0e10cSrcweir+       exit ;;
2480cdf0e10cSrcweir+   esac ;;
2481cdf0e10cSrcweir+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
2482cdf0e10cSrcweir+   echo i${UNAME_MACHINE}-pc-mks
2483cdf0e10cSrcweir+   exit ;;
2484cdf0e10cSrcweir+    8664:Windows_NT:*)
2485cdf0e10cSrcweir+   echo x86_64-pc-mks
2486cdf0e10cSrcweir+   exit ;;
2487cdf0e10cSrcweir     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
2488cdf0e10cSrcweir    # How do we know it's Interix rather than the generic POSIX subsystem?
2489cdf0e10cSrcweir    # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
2490cdf0e10cSrcweir    # UNAME_MACHINE based on the output of uname instead of i386?
2491cdf0e10cSrcweir-   echo i386-pc-interix
2492cdf0e10cSrcweir-   exit 0 ;;
2493cdf0e10cSrcweir+   echo i586-pc-interix
2494cdf0e10cSrcweir+   exit ;;
2495cdf0e10cSrcweir     i*:UWIN*:*)
2496cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-uwin
2497cdf0e10cSrcweir-   exit 0 ;;
2498cdf0e10cSrcweir+   exit ;;
2499cdf0e10cSrcweir+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
2500cdf0e10cSrcweir+   echo x86_64-unknown-cygwin
2501cdf0e10cSrcweir+   exit ;;
2502cdf0e10cSrcweir     p*:CYGWIN*:*)
2503cdf0e10cSrcweir    echo powerpcle-unknown-cygwin
2504cdf0e10cSrcweir-   exit 0 ;;
2505cdf0e10cSrcweir+   exit ;;
2506cdf0e10cSrcweir     prep*:SunOS:5.*:*)
2507cdf0e10cSrcweir    echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2508cdf0e10cSrcweir-   exit 0 ;;
2509cdf0e10cSrcweir+   exit ;;
2510cdf0e10cSrcweir     *:GNU:*:*)
2511cdf0e10cSrcweir+   # the GNU system
2512cdf0e10cSrcweir    echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
2513cdf0e10cSrcweir-   exit 0 ;;
2514cdf0e10cSrcweir+   exit ;;
2515cdf0e10cSrcweir+    *:GNU/*:*:*)
2516cdf0e10cSrcweir+   # other systems with GNU libc and userland
2517cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
2518cdf0e10cSrcweir+   exit ;;
2519cdf0e10cSrcweir     i*86:Minix:*:*)
2520cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-minix
2521cdf0e10cSrcweir-   exit 0 ;;
2522cdf0e10cSrcweir+   exit ;;
2523cdf0e10cSrcweir+    alpha:Linux:*:*)
2524cdf0e10cSrcweir+   case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
2525cdf0e10cSrcweir+     EV5)   UNAME_MACHINE=alphaev5 ;;
2526cdf0e10cSrcweir+     EV56)  UNAME_MACHINE=alphaev56 ;;
2527cdf0e10cSrcweir+     PCA56) UNAME_MACHINE=alphapca56 ;;
2528cdf0e10cSrcweir+     PCA57) UNAME_MACHINE=alphapca56 ;;
2529cdf0e10cSrcweir+     EV6)   UNAME_MACHINE=alphaev6 ;;
2530cdf0e10cSrcweir+     EV67)  UNAME_MACHINE=alphaev67 ;;
2531cdf0e10cSrcweir+     EV68*) UNAME_MACHINE=alphaev68 ;;
2532cdf0e10cSrcweir+        esac
2533cdf0e10cSrcweir+   objdump --private-headers /bin/sh | grep -q ld.so.1
2534cdf0e10cSrcweir+   if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
2535cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
2536cdf0e10cSrcweir+   exit ;;
2537cdf0e10cSrcweir     arm*:Linux:*:*)
2538cdf0e10cSrcweir+   eval $set_cc_for_build
2539cdf0e10cSrcweir+   if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
2540cdf0e10cSrcweir+       | grep -q __ARM_EABI__
2541cdf0e10cSrcweir+   then
2542cdf0e10cSrcweir+       echo ${UNAME_MACHINE}-unknown-linux-gnu
2543cdf0e10cSrcweir+   else
2544cdf0e10cSrcweir+       echo ${UNAME_MACHINE}-unknown-linux-gnueabi
2545cdf0e10cSrcweir+   fi
2546cdf0e10cSrcweir+   exit ;;
2547cdf0e10cSrcweir+    avr32*:Linux:*:*)
2548cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-linux-gnu
2549cdf0e10cSrcweir-   exit 0 ;;
2550cdf0e10cSrcweir+   exit ;;
2551cdf0e10cSrcweir+    cris:Linux:*:*)
2552cdf0e10cSrcweir+   echo cris-axis-linux-gnu
2553cdf0e10cSrcweir+   exit ;;
2554cdf0e10cSrcweir+    crisv32:Linux:*:*)
2555cdf0e10cSrcweir+   echo crisv32-axis-linux-gnu
2556cdf0e10cSrcweir+   exit ;;
2557cdf0e10cSrcweir+    frv:Linux:*:*)
2558cdf0e10cSrcweir+       echo frv-unknown-linux-gnu
2559cdf0e10cSrcweir+   exit ;;
2560cdf0e10cSrcweir+    i*86:Linux:*:*)
2561cdf0e10cSrcweir+   LIBC=gnu
2562cdf0e10cSrcweir+   eval $set_cc_for_build
2563cdf0e10cSrcweir+   sed 's/^    //' << EOF >$dummy.c
2564cdf0e10cSrcweir+   #ifdef __dietlibc__
2565cdf0e10cSrcweir+   LIBC=dietlibc
2566cdf0e10cSrcweir+   #endif
2567cdf0e10cSrcweir+EOF
2568cdf0e10cSrcweir+   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
2569cdf0e10cSrcweir+   echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
2570cdf0e10cSrcweir+   exit ;;
2571cdf0e10cSrcweir     ia64:Linux:*:*)
2572cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-linux-gnu
2573cdf0e10cSrcweir-   exit 0 ;;
2574cdf0e10cSrcweir+   exit ;;
2575cdf0e10cSrcweir+    m32r*:Linux:*:*)
2576cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-linux-gnu
2577cdf0e10cSrcweir+   exit ;;
2578cdf0e10cSrcweir     m68*:Linux:*:*)
2579cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-linux-gnu
2580cdf0e10cSrcweir-   exit 0 ;;
2581cdf0e10cSrcweir-    mips:Linux:*:*)
2582cdf0e10cSrcweir+   exit ;;
2583cdf0e10cSrcweir+    mips:Linux:*:* | mips64:Linux:*:*)
2584cdf0e10cSrcweir    eval $set_cc_for_build
2585cdf0e10cSrcweir    sed 's/^    //' << EOF >$dummy.c
2586cdf0e10cSrcweir    #undef CPU
2587cdf0e10cSrcweir-   #undef mips
2588cdf0e10cSrcweir-   #undef mipsel
2589cdf0e10cSrcweir+   #undef ${UNAME_MACHINE}
2590cdf0e10cSrcweir+   #undef ${UNAME_MACHINE}el
2591cdf0e10cSrcweir    #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
2592cdf0e10cSrcweir-   CPU=mipsel
2593cdf0e10cSrcweir+   CPU=${UNAME_MACHINE}el
2594cdf0e10cSrcweir    #else
2595cdf0e10cSrcweir    #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
2596cdf0e10cSrcweir-   CPU=mips
2597cdf0e10cSrcweir+   CPU=${UNAME_MACHINE}
2598cdf0e10cSrcweir    #else
2599cdf0e10cSrcweir    CPU=
2600cdf0e10cSrcweir    #endif
2601cdf0e10cSrcweir    #endif
2602cdf0e10cSrcweir EOF
2603cdf0e10cSrcweir-   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
2604cdf0e10cSrcweir-   rm -f $dummy.c && rmdir $tmpdir
2605cdf0e10cSrcweir-   test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
2606cdf0e10cSrcweir+   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
2607cdf0e10cSrcweir+   test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
2608cdf0e10cSrcweir    ;;
2609cdf0e10cSrcweir-    ppc:Linux:*:*)
2610cdf0e10cSrcweir-   echo powerpc-unknown-linux-gnu
2611cdf0e10cSrcweir-   exit 0 ;;
2612cdf0e10cSrcweir-    ppc64:Linux:*:*)
2613cdf0e10cSrcweir-   echo powerpc64-unknown-linux-gnu
2614cdf0e10cSrcweir-   exit 0 ;;
2615cdf0e10cSrcweir-    alpha:Linux:*:*)
2616cdf0e10cSrcweir-   case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
2617cdf0e10cSrcweir-     EV5)   UNAME_MACHINE=alphaev5 ;;
2618cdf0e10cSrcweir-     EV56)  UNAME_MACHINE=alphaev56 ;;
2619cdf0e10cSrcweir-     PCA56) UNAME_MACHINE=alphapca56 ;;
2620cdf0e10cSrcweir-     PCA57) UNAME_MACHINE=alphapca56 ;;
2621cdf0e10cSrcweir-     EV6)   UNAME_MACHINE=alphaev6 ;;
2622cdf0e10cSrcweir-     EV67)  UNAME_MACHINE=alphaev67 ;;
2623cdf0e10cSrcweir-     EV68*) UNAME_MACHINE=alphaev68 ;;
2624cdf0e10cSrcweir-        esac
2625cdf0e10cSrcweir-   objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
2626cdf0e10cSrcweir-   if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
2627cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
2628cdf0e10cSrcweir-   exit 0 ;;
2629cdf0e10cSrcweir+    or32:Linux:*:*)
2630cdf0e10cSrcweir+   echo or32-unknown-linux-gnu
2631cdf0e10cSrcweir+   exit ;;
2632cdf0e10cSrcweir+    padre:Linux:*:*)
2633cdf0e10cSrcweir+   echo sparc-unknown-linux-gnu
2634cdf0e10cSrcweir+   exit ;;
2635cdf0e10cSrcweir+    parisc64:Linux:*:* | hppa64:Linux:*:*)
2636cdf0e10cSrcweir+   echo hppa64-unknown-linux-gnu
2637cdf0e10cSrcweir+   exit ;;
2638cdf0e10cSrcweir     parisc:Linux:*:* | hppa:Linux:*:*)
2639cdf0e10cSrcweir    # Look for CPU level
2640cdf0e10cSrcweir    case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
2641cdf0e10cSrcweir@@ -848,82 +949,40 @@
2642cdf0e10cSrcweir      PA8*) echo hppa2.0-unknown-linux-gnu ;;
2643cdf0e10cSrcweir      *)    echo hppa-unknown-linux-gnu ;;
2644cdf0e10cSrcweir    esac
2645cdf0e10cSrcweir-   exit 0 ;;
2646cdf0e10cSrcweir-    parisc64:Linux:*:* | hppa64:Linux:*:*)
2647cdf0e10cSrcweir-   echo hppa64-unknown-linux-gnu
2648cdf0e10cSrcweir-   exit 0 ;;
2649cdf0e10cSrcweir+   exit ;;
2650cdf0e10cSrcweir+    ppc64:Linux:*:*)
2651cdf0e10cSrcweir+   echo powerpc64-unknown-linux-gnu
2652cdf0e10cSrcweir+   exit ;;
2653cdf0e10cSrcweir+    ppc:Linux:*:*)
2654cdf0e10cSrcweir+   echo powerpc-unknown-linux-gnu
2655cdf0e10cSrcweir+   exit ;;
2656cdf0e10cSrcweir     s390:Linux:*:* | s390x:Linux:*:*)
2657cdf0e10cSrcweir    echo ${UNAME_MACHINE}-ibm-linux
2658cdf0e10cSrcweir-   exit 0 ;;
2659cdf0e10cSrcweir+   exit ;;
2660cdf0e10cSrcweir+    sh64*:Linux:*:*)
2661cdf0e10cSrcweir+       echo ${UNAME_MACHINE}-unknown-linux-gnu
2662cdf0e10cSrcweir+   exit ;;
2663cdf0e10cSrcweir     sh*:Linux:*:*)
2664cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-linux-gnu
2665cdf0e10cSrcweir-   exit 0 ;;
2666cdf0e10cSrcweir+   exit ;;
2667cdf0e10cSrcweir     sparc:Linux:*:* | sparc64:Linux:*:*)
2668cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-linux-gnu
2669cdf0e10cSrcweir-   exit 0 ;;
2670cdf0e10cSrcweir+   exit ;;
2671cdf0e10cSrcweir+    vax:Linux:*:*)
2672cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-dec-linux-gnu
2673cdf0e10cSrcweir+   exit ;;
2674cdf0e10cSrcweir     x86_64:Linux:*:*)
2675cdf0e10cSrcweir    echo x86_64-unknown-linux-gnu
2676cdf0e10cSrcweir-   exit 0 ;;
2677cdf0e10cSrcweir-    i*86:Linux:*:*)
2678cdf0e10cSrcweir-   # The BFD linker knows what the default object file format is, so
2679cdf0e10cSrcweir-   # first see if it will tell us. cd to the root directory to prevent
2680cdf0e10cSrcweir-   # problems with other programs or directories called `ld' in the path.
2681cdf0e10cSrcweir-   # Set LC_ALL=C to ensure ld outputs messages in English.
2682cdf0e10cSrcweir-   ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
2683cdf0e10cSrcweir-            | sed -ne '/supported targets:/!d
2684cdf0e10cSrcweir-                   s/[     ][  ]*/ /g
2685cdf0e10cSrcweir-                   s/.*supported targets: *//
2686cdf0e10cSrcweir-                   s/ .*//
2687cdf0e10cSrcweir-                   p'`
2688cdf0e10cSrcweir-        case "$ld_supported_targets" in
2689cdf0e10cSrcweir-     elf32-i386)
2690cdf0e10cSrcweir-       TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
2691cdf0e10cSrcweir-       ;;
2692cdf0e10cSrcweir-     a.out-i386-linux)
2693cdf0e10cSrcweir-       echo "${UNAME_MACHINE}-pc-linux-gnuaout"
2694cdf0e10cSrcweir-       exit 0 ;;
2695cdf0e10cSrcweir-     coff-i386)
2696cdf0e10cSrcweir-       echo "${UNAME_MACHINE}-pc-linux-gnucoff"
2697cdf0e10cSrcweir-       exit 0 ;;
2698cdf0e10cSrcweir-     "")
2699cdf0e10cSrcweir-       # Either a pre-BFD a.out linker (linux-gnuoldld) or
2700cdf0e10cSrcweir-       # one that does not give us useful --help.
2701cdf0e10cSrcweir-       echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
2702cdf0e10cSrcweir-       exit 0 ;;
2703cdf0e10cSrcweir-   esac
2704cdf0e10cSrcweir-   # Determine whether the default compiler is a.out or elf
2705cdf0e10cSrcweir-   eval $set_cc_for_build
2706cdf0e10cSrcweir-   sed 's/^    //' << EOF >$dummy.c
2707cdf0e10cSrcweir-   #include <features.h>
2708cdf0e10cSrcweir-   #ifdef __ELF__
2709cdf0e10cSrcweir-   # ifdef __GLIBC__
2710cdf0e10cSrcweir-   #  if __GLIBC__ >= 2
2711cdf0e10cSrcweir-   LIBC=gnu
2712cdf0e10cSrcweir-   #  else
2713cdf0e10cSrcweir-   LIBC=gnulibc1
2714cdf0e10cSrcweir-   #  endif
2715cdf0e10cSrcweir-   # else
2716cdf0e10cSrcweir-   LIBC=gnulibc1
2717cdf0e10cSrcweir-   # endif
2718cdf0e10cSrcweir-   #else
2719cdf0e10cSrcweir-   #ifdef __INTEL_COMPILER
2720cdf0e10cSrcweir-   LIBC=gnu
2721cdf0e10cSrcweir-   #else
2722cdf0e10cSrcweir-   LIBC=gnuaout
2723cdf0e10cSrcweir-   #endif
2724cdf0e10cSrcweir-   #endif
2725cdf0e10cSrcweir-EOF
2726cdf0e10cSrcweir-   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
2727cdf0e10cSrcweir-   rm -f $dummy.c && rmdir $tmpdir
2728cdf0e10cSrcweir-   test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
2729cdf0e10cSrcweir-   test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
2730cdf0e10cSrcweir-   ;;
2731cdf0e10cSrcweir+   exit ;;
2732cdf0e10cSrcweir+    xtensa*:Linux:*:*)
2733cdf0e10cSrcweir+       echo ${UNAME_MACHINE}-unknown-linux-gnu
2734cdf0e10cSrcweir+   exit ;;
2735cdf0e10cSrcweir     i*86:DYNIX/ptx:4*:*)
2736cdf0e10cSrcweir    # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
2737cdf0e10cSrcweir    # earlier versions are messed up and put the nodename in both
2738cdf0e10cSrcweir    # sysname and nodename.
2739cdf0e10cSrcweir    echo i386-sequent-sysv4
2740cdf0e10cSrcweir-   exit 0 ;;
2741cdf0e10cSrcweir+   exit ;;
2742cdf0e10cSrcweir     i*86:UNIX_SV:4.2MP:2.*)
2743cdf0e10cSrcweir         # Unixware is an offshoot of SVR4, but it has its own version
2744cdf0e10cSrcweir         # number series starting with 2...
2745cdf0e10cSrcweir@@ -931,7 +990,27 @@
2746cdf0e10cSrcweir    # I just have to hope.  -- rms.
2747cdf0e10cSrcweir         # Use sysv4.2uw... so that sysv4* matches it.
2748cdf0e10cSrcweir    echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
2749cdf0e10cSrcweir-   exit 0 ;;
2750cdf0e10cSrcweir+   exit ;;
2751cdf0e10cSrcweir+    i*86:OS/2:*:*)
2752cdf0e10cSrcweir+   # If we were able to find `uname', then EMX Unix compatibility
2753cdf0e10cSrcweir+   # is probably installed.
2754cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-pc-os2-emx
2755cdf0e10cSrcweir+   exit ;;
2756cdf0e10cSrcweir+    i*86:XTS-300:*:STOP)
2757cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-stop
2758cdf0e10cSrcweir+   exit ;;
2759cdf0e10cSrcweir+    i*86:atheos:*:*)
2760cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-atheos
2761cdf0e10cSrcweir+   exit ;;
2762cdf0e10cSrcweir+    i*86:syllable:*:*)
2763cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-pc-syllable
2764cdf0e10cSrcweir+   exit ;;
2765cdf0e10cSrcweir+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
2766cdf0e10cSrcweir+   echo i386-unknown-lynxos${UNAME_RELEASE}
2767cdf0e10cSrcweir+   exit ;;
2768cdf0e10cSrcweir+    i*86:*DOS:*:*)
2769cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-pc-msdosdjgpp
2770cdf0e10cSrcweir+   exit ;;
2771cdf0e10cSrcweir     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
2772cdf0e10cSrcweir    UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
2773cdf0e10cSrcweir    if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
2774cdf0e10cSrcweir@@ -939,15 +1018,16 @@
2775cdf0e10cSrcweir    else
2776cdf0e10cSrcweir        echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
2777cdf0e10cSrcweir    fi
2778cdf0e10cSrcweir-   exit 0 ;;
2779cdf0e10cSrcweir-    i*86:*:5:[78]*)
2780cdf0e10cSrcweir+   exit ;;
2781cdf0e10cSrcweir+    i*86:*:5:[678]*)
2782cdf0e10cSrcweir+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
2783cdf0e10cSrcweir    case `/bin/uname -X | grep "^Machine"` in
2784cdf0e10cSrcweir        *486*)       UNAME_MACHINE=i486 ;;
2785cdf0e10cSrcweir        *Pentium)        UNAME_MACHINE=i586 ;;
2786cdf0e10cSrcweir        *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
2787cdf0e10cSrcweir    esac
2788cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
2789cdf0e10cSrcweir-   exit 0 ;;
2790cdf0e10cSrcweir+   exit ;;
2791cdf0e10cSrcweir     i*86:*:3.2:*)
2792cdf0e10cSrcweir    if test -f /usr/options/cb.name; then
2793cdf0e10cSrcweir        UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
2794cdf0e10cSrcweir@@ -965,76 +1045,86 @@
2795cdf0e10cSrcweir    else
2796cdf0e10cSrcweir        echo ${UNAME_MACHINE}-pc-sysv32
2797cdf0e10cSrcweir    fi
2798cdf0e10cSrcweir-   exit 0 ;;
2799cdf0e10cSrcweir-    i*86:*DOS:*:*)
2800cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-pc-msdosdjgpp
2801cdf0e10cSrcweir-   exit 0 ;;
2802cdf0e10cSrcweir+   exit ;;
2803cdf0e10cSrcweir     pc:*:*:*)
2804cdf0e10cSrcweir    # Left here for compatibility:
2805cdf0e10cSrcweir         # uname -m prints for DJGPP always 'pc', but it prints nothing about
2806cdf0e10cSrcweir-        # the processor, so we play safe by assuming i386.
2807cdf0e10cSrcweir-   echo i386-pc-msdosdjgpp
2808cdf0e10cSrcweir-        exit 0 ;;
2809cdf0e10cSrcweir+        # the processor, so we play safe by assuming i586.
2810cdf0e10cSrcweir+   # Note: whatever this is, it MUST be the same as what config.sub
2811cdf0e10cSrcweir+   # prints for the "djgpp" host, or else GDB configury will decide that
2812cdf0e10cSrcweir+   # this is a cross-build.
2813cdf0e10cSrcweir+   echo i586-pc-msdosdjgpp
2814cdf0e10cSrcweir+        exit ;;
2815cdf0e10cSrcweir     Intel:Mach:3*:*)
2816cdf0e10cSrcweir    echo i386-pc-mach3
2817cdf0e10cSrcweir-   exit 0 ;;
2818cdf0e10cSrcweir+   exit ;;
2819cdf0e10cSrcweir     paragon:*:*:*)
2820cdf0e10cSrcweir    echo i860-intel-osf1
2821cdf0e10cSrcweir-   exit 0 ;;
2822cdf0e10cSrcweir+   exit ;;
2823cdf0e10cSrcweir     i860:*:4.*:*) # i860-SVR4
2824cdf0e10cSrcweir    if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
2825cdf0e10cSrcweir      echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
2826cdf0e10cSrcweir    else # Add other i860-SVR4 vendors below as they are discovered.
2827cdf0e10cSrcweir      echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
2828cdf0e10cSrcweir    fi
2829cdf0e10cSrcweir-   exit 0 ;;
2830cdf0e10cSrcweir+   exit ;;
2831cdf0e10cSrcweir     mini*:CTIX:SYS*5:*)
2832cdf0e10cSrcweir    # "miniframe"
2833cdf0e10cSrcweir    echo m68010-convergent-sysv
2834cdf0e10cSrcweir-   exit 0 ;;
2835cdf0e10cSrcweir+   exit ;;
2836cdf0e10cSrcweir     mc68k:UNIX:SYSTEM5:3.51m)
2837cdf0e10cSrcweir    echo m68k-convergent-sysv
2838cdf0e10cSrcweir-   exit 0 ;;
2839cdf0e10cSrcweir-    M68*:*:R3V[567]*:*)
2840cdf0e10cSrcweir-   test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
2841cdf0e10cSrcweir-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
2842cdf0e10cSrcweir+   exit ;;
2843cdf0e10cSrcweir+    M680?0:D-NIX:5.3:*)
2844cdf0e10cSrcweir+   echo m68k-diab-dnix
2845cdf0e10cSrcweir+   exit ;;
2846cdf0e10cSrcweir+    M68*:*:R3V[5678]*:*)
2847cdf0e10cSrcweir+   test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
2848cdf0e10cSrcweir+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
2849cdf0e10cSrcweir    OS_REL=''
2850cdf0e10cSrcweir    test -r /etc/.relid \
2851cdf0e10cSrcweir    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
2852cdf0e10cSrcweir    /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
2853cdf0e10cSrcweir-     && echo i486-ncr-sysv4.3${OS_REL} && exit 0
2854cdf0e10cSrcweir+     && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
2855cdf0e10cSrcweir    /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
2856cdf0e10cSrcweir-     && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
2857cdf0e10cSrcweir+     && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
2858cdf0e10cSrcweir     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
2859cdf0e10cSrcweir         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
2860cdf0e10cSrcweir-          && echo i486-ncr-sysv4 && exit 0 ;;
2861cdf0e10cSrcweir+          && { echo i486-ncr-sysv4; exit; } ;;
2862cdf0e10cSrcweir+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
2863cdf0e10cSrcweir+   OS_REL='.3'
2864cdf0e10cSrcweir+   test -r /etc/.relid \
2865cdf0e10cSrcweir+       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
2866cdf0e10cSrcweir+   /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
2867cdf0e10cSrcweir+       && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
2868cdf0e10cSrcweir+   /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
2869cdf0e10cSrcweir+       && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
2870cdf0e10cSrcweir+   /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
2871cdf0e10cSrcweir+       && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
2872cdf0e10cSrcweir     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
2873cdf0e10cSrcweir    echo m68k-unknown-lynxos${UNAME_RELEASE}
2874cdf0e10cSrcweir-   exit 0 ;;
2875cdf0e10cSrcweir+   exit ;;
2876cdf0e10cSrcweir     mc68030:UNIX_System_V:4.*:*)
2877cdf0e10cSrcweir    echo m68k-atari-sysv4
2878cdf0e10cSrcweir-   exit 0 ;;
2879cdf0e10cSrcweir-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
2880cdf0e10cSrcweir-   echo i386-unknown-lynxos${UNAME_RELEASE}
2881cdf0e10cSrcweir-   exit 0 ;;
2882cdf0e10cSrcweir+   exit ;;
2883cdf0e10cSrcweir     TSUNAMI:LynxOS:2.*:*)
2884cdf0e10cSrcweir    echo sparc-unknown-lynxos${UNAME_RELEASE}
2885cdf0e10cSrcweir-   exit 0 ;;
2886cdf0e10cSrcweir+   exit ;;
2887cdf0e10cSrcweir     rs6000:LynxOS:2.*:*)
2888cdf0e10cSrcweir    echo rs6000-unknown-lynxos${UNAME_RELEASE}
2889cdf0e10cSrcweir-   exit 0 ;;
2890cdf0e10cSrcweir-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
2891cdf0e10cSrcweir+   exit ;;
2892cdf0e10cSrcweir+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
2893cdf0e10cSrcweir    echo powerpc-unknown-lynxos${UNAME_RELEASE}
2894cdf0e10cSrcweir-   exit 0 ;;
2895cdf0e10cSrcweir+   exit ;;
2896cdf0e10cSrcweir     SM[BE]S:UNIX_SV:*:*)
2897cdf0e10cSrcweir    echo mips-dde-sysv${UNAME_RELEASE}
2898cdf0e10cSrcweir-   exit 0 ;;
2899cdf0e10cSrcweir+   exit ;;
2900cdf0e10cSrcweir     RM*:ReliantUNIX-*:*:*)
2901cdf0e10cSrcweir    echo mips-sni-sysv4
2902cdf0e10cSrcweir-   exit 0 ;;
2903cdf0e10cSrcweir+   exit ;;
2904cdf0e10cSrcweir     RM*:SINIX-*:*:*)
2905cdf0e10cSrcweir    echo mips-sni-sysv4
2906cdf0e10cSrcweir-   exit 0 ;;
2907cdf0e10cSrcweir+   exit ;;
2908cdf0e10cSrcweir     *:SINIX-*:*:*)
2909cdf0e10cSrcweir    if uname -p 2>/dev/null >/dev/null ; then
2910cdf0e10cSrcweir        UNAME_MACHINE=`(uname -p) 2>/dev/null`
2911cdf0e10cSrcweir@@ -1042,64 +1132,94 @@
2912cdf0e10cSrcweir    else
2913cdf0e10cSrcweir        echo ns32k-sni-sysv
2914cdf0e10cSrcweir    fi
2915cdf0e10cSrcweir-   exit 0 ;;
2916cdf0e10cSrcweir+   exit ;;
2917cdf0e10cSrcweir     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
2918cdf0e10cSrcweir                       # says <Richard.M.Bartel@ccMail.Census.GOV>
2919cdf0e10cSrcweir         echo i586-unisys-sysv4
2920cdf0e10cSrcweir-        exit 0 ;;
2921cdf0e10cSrcweir+        exit ;;
2922cdf0e10cSrcweir     *:UNIX_System_V:4*:FTX*)
2923cdf0e10cSrcweir    # From Gerald Hewes <hewes@openmarket.com>.
2924cdf0e10cSrcweir    # How about differentiating between stratus architectures? -djm
2925cdf0e10cSrcweir    echo hppa1.1-stratus-sysv4
2926cdf0e10cSrcweir-   exit 0 ;;
2927cdf0e10cSrcweir+   exit ;;
2928cdf0e10cSrcweir     *:*:*:FTX*)
2929cdf0e10cSrcweir    # From seanf@swdc.stratus.com.
2930cdf0e10cSrcweir    echo i860-stratus-sysv4
2931cdf0e10cSrcweir-   exit 0 ;;
2932cdf0e10cSrcweir+   exit ;;
2933cdf0e10cSrcweir+    i*86:VOS:*:*)
2934cdf0e10cSrcweir+   # From Paul.Green@stratus.com.
2935cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-stratus-vos
2936cdf0e10cSrcweir+   exit ;;
2937cdf0e10cSrcweir     *:VOS:*:*)
2938cdf0e10cSrcweir    # From Paul.Green@stratus.com.
2939cdf0e10cSrcweir    echo hppa1.1-stratus-vos
2940cdf0e10cSrcweir-   exit 0 ;;
2941cdf0e10cSrcweir+   exit ;;
2942cdf0e10cSrcweir     mc68*:A/UX:*:*)
2943cdf0e10cSrcweir    echo m68k-apple-aux${UNAME_RELEASE}
2944cdf0e10cSrcweir-   exit 0 ;;
2945cdf0e10cSrcweir+   exit ;;
2946cdf0e10cSrcweir     news*:NEWS-OS:6*:*)
2947cdf0e10cSrcweir    echo mips-sony-newsos6
2948cdf0e10cSrcweir-   exit 0 ;;
2949cdf0e10cSrcweir+   exit ;;
2950cdf0e10cSrcweir     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
2951cdf0e10cSrcweir    if [ -d /usr/nec ]; then
2952cdf0e10cSrcweir            echo mips-nec-sysv${UNAME_RELEASE}
2953cdf0e10cSrcweir    else
2954cdf0e10cSrcweir            echo mips-unknown-sysv${UNAME_RELEASE}
2955cdf0e10cSrcweir    fi
2956cdf0e10cSrcweir-        exit 0 ;;
2957cdf0e10cSrcweir+        exit ;;
2958cdf0e10cSrcweir     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
2959cdf0e10cSrcweir    echo powerpc-be-beos
2960cdf0e10cSrcweir-   exit 0 ;;
2961cdf0e10cSrcweir+   exit ;;
2962cdf0e10cSrcweir     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
2963cdf0e10cSrcweir    echo powerpc-apple-beos
2964cdf0e10cSrcweir-   exit 0 ;;
2965cdf0e10cSrcweir+   exit ;;
2966cdf0e10cSrcweir     BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
2967cdf0e10cSrcweir    echo i586-pc-beos
2968cdf0e10cSrcweir-   exit 0 ;;
2969cdf0e10cSrcweir+   exit ;;
2970cdf0e10cSrcweir+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
2971cdf0e10cSrcweir+   echo i586-pc-haiku
2972cdf0e10cSrcweir+   exit ;;
2973cdf0e10cSrcweir     SX-4:SUPER-UX:*:*)
2974cdf0e10cSrcweir    echo sx4-nec-superux${UNAME_RELEASE}
2975cdf0e10cSrcweir-   exit 0 ;;
2976cdf0e10cSrcweir+   exit ;;
2977cdf0e10cSrcweir     SX-5:SUPER-UX:*:*)
2978cdf0e10cSrcweir    echo sx5-nec-superux${UNAME_RELEASE}
2979cdf0e10cSrcweir-   exit 0 ;;
2980cdf0e10cSrcweir+   exit ;;
2981cdf0e10cSrcweir     SX-6:SUPER-UX:*:*)
2982cdf0e10cSrcweir    echo sx6-nec-superux${UNAME_RELEASE}
2983cdf0e10cSrcweir-   exit 0 ;;
2984cdf0e10cSrcweir+   exit ;;
2985cdf0e10cSrcweir+    SX-7:SUPER-UX:*:*)
2986cdf0e10cSrcweir+   echo sx7-nec-superux${UNAME_RELEASE}
2987cdf0e10cSrcweir+   exit ;;
2988cdf0e10cSrcweir+    SX-8:SUPER-UX:*:*)
2989cdf0e10cSrcweir+   echo sx8-nec-superux${UNAME_RELEASE}
2990cdf0e10cSrcweir+   exit ;;
2991cdf0e10cSrcweir+    SX-8R:SUPER-UX:*:*)
2992cdf0e10cSrcweir+   echo sx8r-nec-superux${UNAME_RELEASE}
2993cdf0e10cSrcweir+   exit ;;
2994cdf0e10cSrcweir     Power*:Rhapsody:*:*)
2995cdf0e10cSrcweir    echo powerpc-apple-rhapsody${UNAME_RELEASE}
2996cdf0e10cSrcweir-   exit 0 ;;
2997cdf0e10cSrcweir+   exit ;;
2998cdf0e10cSrcweir     *:Rhapsody:*:*)
2999cdf0e10cSrcweir    echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
3000cdf0e10cSrcweir-   exit 0 ;;
3001cdf0e10cSrcweir+   exit ;;
3002cdf0e10cSrcweir     *:Darwin:*:*)
3003cdf0e10cSrcweir-   echo `uname -p`-apple-darwin${UNAME_RELEASE}
3004cdf0e10cSrcweir-   exit 0 ;;
3005cdf0e10cSrcweir+   UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
3006cdf0e10cSrcweir+   case $UNAME_PROCESSOR in
3007cdf0e10cSrcweir+       i386)
3008cdf0e10cSrcweir+       eval $set_cc_for_build
3009cdf0e10cSrcweir+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3010cdf0e10cSrcweir+         if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
3011cdf0e10cSrcweir+             (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3012cdf0e10cSrcweir+             grep IS_64BIT_ARCH >/dev/null
3013cdf0e10cSrcweir+         then
3014cdf0e10cSrcweir+             UNAME_PROCESSOR="x86_64"
3015cdf0e10cSrcweir+         fi
3016cdf0e10cSrcweir+       fi ;;
3017cdf0e10cSrcweir+       unknown) UNAME_PROCESSOR=powerpc ;;
3018cdf0e10cSrcweir+   esac
3019cdf0e10cSrcweir+   echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
3020cdf0e10cSrcweir+   exit ;;
3021cdf0e10cSrcweir     *:procnto*:*:* | *:QNX:[0123456789]*:*)
3022cdf0e10cSrcweir    UNAME_PROCESSOR=`uname -p`
3023cdf0e10cSrcweir    if test "$UNAME_PROCESSOR" = "x86"; then
3024cdf0e10cSrcweir@@ -1107,22 +1227,25 @@
3025cdf0e10cSrcweir        UNAME_MACHINE=pc
3026cdf0e10cSrcweir    fi
3027cdf0e10cSrcweir    echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
3028cdf0e10cSrcweir-   exit 0 ;;
3029cdf0e10cSrcweir+   exit ;;
3030cdf0e10cSrcweir     *:QNX:*:4*)
3031cdf0e10cSrcweir    echo i386-pc-qnx
3032cdf0e10cSrcweir-   exit 0 ;;
3033cdf0e10cSrcweir-    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
3034cdf0e10cSrcweir+   exit ;;
3035cdf0e10cSrcweir+    NSE-?:NONSTOP_KERNEL:*:*)
3036cdf0e10cSrcweir+   echo nse-tandem-nsk${UNAME_RELEASE}
3037cdf0e10cSrcweir+   exit ;;
3038cdf0e10cSrcweir+    NSR-?:NONSTOP_KERNEL:*:*)
3039cdf0e10cSrcweir    echo nsr-tandem-nsk${UNAME_RELEASE}
3040cdf0e10cSrcweir-   exit 0 ;;
3041cdf0e10cSrcweir+   exit ;;
3042cdf0e10cSrcweir     *:NonStop-UX:*:*)
3043cdf0e10cSrcweir    echo mips-compaq-nonstopux
3044cdf0e10cSrcweir-   exit 0 ;;
3045cdf0e10cSrcweir+   exit ;;
3046cdf0e10cSrcweir     BS2000:POSIX*:*:*)
3047cdf0e10cSrcweir    echo bs2000-siemens-sysv
3048cdf0e10cSrcweir-   exit 0 ;;
3049cdf0e10cSrcweir+   exit ;;
3050cdf0e10cSrcweir     DS/*:UNIX_System_V:*:*)
3051cdf0e10cSrcweir    echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
3052cdf0e10cSrcweir-   exit 0 ;;
3053cdf0e10cSrcweir+   exit ;;
3054cdf0e10cSrcweir     *:Plan9:*:*)
3055cdf0e10cSrcweir    # "uname -m" is not consistent, so use $cputype instead. 386
3056cdf0e10cSrcweir    # is converted to i386 for consistency with other x86
3057cdf0e10cSrcweir@@ -1133,36 +1256,50 @@
3058cdf0e10cSrcweir        UNAME_MACHINE="$cputype"
3059cdf0e10cSrcweir    fi
3060cdf0e10cSrcweir    echo ${UNAME_MACHINE}-unknown-plan9
3061cdf0e10cSrcweir-   exit 0 ;;
3062cdf0e10cSrcweir-    i*86:OS/2:*:*)
3063cdf0e10cSrcweir-   # If we were able to find `uname', then EMX Unix compatibility
3064cdf0e10cSrcweir-   # is probably installed.
3065cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-pc-os2-emx
3066cdf0e10cSrcweir-   exit 0 ;;
3067cdf0e10cSrcweir+   exit ;;
3068cdf0e10cSrcweir     *:TOPS-10:*:*)
3069cdf0e10cSrcweir    echo pdp10-unknown-tops10
3070cdf0e10cSrcweir-   exit 0 ;;
3071cdf0e10cSrcweir+   exit ;;
3072cdf0e10cSrcweir     *:TENEX:*:*)
3073cdf0e10cSrcweir    echo pdp10-unknown-tenex
3074cdf0e10cSrcweir-   exit 0 ;;
3075cdf0e10cSrcweir+   exit ;;
3076cdf0e10cSrcweir     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
3077cdf0e10cSrcweir    echo pdp10-dec-tops20
3078cdf0e10cSrcweir-   exit 0 ;;
3079cdf0e10cSrcweir+   exit ;;
3080cdf0e10cSrcweir     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
3081cdf0e10cSrcweir    echo pdp10-xkl-tops20
3082cdf0e10cSrcweir-   exit 0 ;;
3083cdf0e10cSrcweir+   exit ;;
3084cdf0e10cSrcweir     *:TOPS-20:*:*)
3085cdf0e10cSrcweir    echo pdp10-unknown-tops20
3086cdf0e10cSrcweir-   exit 0 ;;
3087cdf0e10cSrcweir+   exit ;;
3088cdf0e10cSrcweir     *:ITS:*:*)
3089cdf0e10cSrcweir    echo pdp10-unknown-its
3090cdf0e10cSrcweir-   exit 0 ;;
3091cdf0e10cSrcweir-    i*86:XTS-300:*:STOP)
3092cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-unknown-stop
3093cdf0e10cSrcweir-   exit 0 ;;
3094cdf0e10cSrcweir-    i*86:atheos:*:*)
3095cdf0e10cSrcweir-   echo ${UNAME_MACHINE}-unknown-atheos
3096cdf0e10cSrcweir-   exit 0 ;;
3097cdf0e10cSrcweir+   exit ;;
3098cdf0e10cSrcweir+    SEI:*:*:SEIUX)
3099cdf0e10cSrcweir+        echo mips-sei-seiux${UNAME_RELEASE}
3100cdf0e10cSrcweir+   exit ;;
3101cdf0e10cSrcweir+    *:DragonFly:*:*)
3102cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
3103cdf0e10cSrcweir+   exit ;;
3104cdf0e10cSrcweir+    *:*VMS:*:*)
3105cdf0e10cSrcweir+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
3106cdf0e10cSrcweir+   case "${UNAME_MACHINE}" in
3107cdf0e10cSrcweir+       A*) echo alpha-dec-vms ; exit ;;
3108cdf0e10cSrcweir+       I*) echo ia64-dec-vms ; exit ;;
3109cdf0e10cSrcweir+       V*) echo vax-dec-vms ; exit ;;
3110cdf0e10cSrcweir+   esac ;;
3111cdf0e10cSrcweir+    *:XENIX:*:SysV)
3112cdf0e10cSrcweir+   echo i386-pc-xenix
3113cdf0e10cSrcweir+   exit ;;
3114cdf0e10cSrcweir+    i*86:skyos:*:*)
3115cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
3116cdf0e10cSrcweir+   exit ;;
3117cdf0e10cSrcweir+    i*86:rdos:*:*)
3118cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-pc-rdos
3119cdf0e10cSrcweir+   exit ;;
3120cdf0e10cSrcweir+    i*86:AROS:*:*)
3121cdf0e10cSrcweir+   echo ${UNAME_MACHINE}-pc-aros
3122cdf0e10cSrcweir+   exit ;;
3123cdf0e10cSrcweir esac
3124cdf0e10cSrcweir
3125cdf0e10cSrcweir #echo '(No uname command or uname output not recognized.)' 1>&2
3126cdf0e10cSrcweir@@ -1194,7 +1331,7 @@
3127cdf0e10cSrcweir #endif
3128cdf0e10cSrcweir
3129cdf0e10cSrcweir #if defined (__arm) && defined (__acorn) && defined (__unix)
3130cdf0e10cSrcweir-  printf ("arm-acorn-riscix"); exit (0);
3131cdf0e10cSrcweir+  printf ("arm-acorn-riscix\n"); exit (0);
3132cdf0e10cSrcweir #endif
3133cdf0e10cSrcweir
3134cdf0e10cSrcweir #if defined (hp300) && !defined (hpux)
3135cdf0e10cSrcweir@@ -1283,12 +1420,12 @@
3136cdf0e10cSrcweir }
3137cdf0e10cSrcweir EOF
3138cdf0e10cSrcweir
3139cdf0e10cSrcweir-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
3140cdf0e10cSrcweir-rm -f $dummy.c $dummy && rmdir $tmpdir
3141cdf0e10cSrcweir+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
3142cdf0e10cSrcweir+   { echo "$SYSTEM_NAME"; exit; }
3143cdf0e10cSrcweir
3144cdf0e10cSrcweir # Apollos put the system type in the environment.
3145cdf0e10cSrcweir
3146cdf0e10cSrcweir-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
3147cdf0e10cSrcweir+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
3148cdf0e10cSrcweir
3149cdf0e10cSrcweir # Convex versions that predate uname can use getsysinfo(1)
3150cdf0e10cSrcweir
3151cdf0e10cSrcweir@@ -1297,22 +1434,22 @@
3152cdf0e10cSrcweir     case `getsysinfo -f cpu_type` in
3153cdf0e10cSrcweir     c1*)
3154cdf0e10cSrcweir    echo c1-convex-bsd
3155cdf0e10cSrcweir-   exit 0 ;;
3156cdf0e10cSrcweir+   exit ;;
3157cdf0e10cSrcweir     c2*)
3158cdf0e10cSrcweir    if getsysinfo -f scalar_acc
3159cdf0e10cSrcweir    then echo c32-convex-bsd
3160cdf0e10cSrcweir    else echo c2-convex-bsd
3161cdf0e10cSrcweir    fi
3162cdf0e10cSrcweir-   exit 0 ;;
3163cdf0e10cSrcweir+   exit ;;
3164cdf0e10cSrcweir     c34*)
3165cdf0e10cSrcweir    echo c34-convex-bsd
3166cdf0e10cSrcweir-   exit 0 ;;
3167cdf0e10cSrcweir+   exit ;;
3168cdf0e10cSrcweir     c38*)
3169cdf0e10cSrcweir    echo c38-convex-bsd
3170cdf0e10cSrcweir-   exit 0 ;;
3171cdf0e10cSrcweir+   exit ;;
3172cdf0e10cSrcweir     c4*)
3173cdf0e10cSrcweir    echo c4-convex-bsd
3174cdf0e10cSrcweir-   exit 0 ;;
3175cdf0e10cSrcweir+   exit ;;
3176cdf0e10cSrcweir     esac
3177cdf0e10cSrcweir fi
3178cdf0e10cSrcweir
3179cdf0e10cSrcweir@@ -1323,7 +1460,9 @@
3180cdf0e10cSrcweir the operating system you are using. It is advised that you
3181cdf0e10cSrcweir download the most up to date version of the config scripts from
3182cdf0e10cSrcweir
3183cdf0e10cSrcweir-    ftp://ftp.gnu.org/pub/gnu/config/
3184cdf0e10cSrcweir+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
3185cdf0e10cSrcweir+and
3186cdf0e10cSrcweir+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
3187cdf0e10cSrcweir
3188cdf0e10cSrcweir If the version you run ($0) is already up to date, please
3189cdf0e10cSrcweir send the following data and any information you think might be
3190cdf0e10cSrcweir--- misc/libtextcat-2.2/config.sub  2010-04-15 09:20:04.000000000 +0000
3191cdf0e10cSrcweir+++ misc/build/libtextcat-2.2/config.sub    2010-04-15 09:20:41.000000000 +0000
3192cdf0e10cSrcweir@@ -1,9 +1,10 @@
3193cdf0e10cSrcweir #! /bin/sh
3194cdf0e10cSrcweir # Configuration validation subroutine script.
3195cdf0e10cSrcweir #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3196cdf0e10cSrcweir-#   2000, 2001, 2002 Free Software Foundation, Inc.
3197cdf0e10cSrcweir+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3198cdf0e10cSrcweir+#   Free Software Foundation, Inc.
3199cdf0e10cSrcweir
3200cdf0e10cSrcweir-timestamp='2002-09-05'
3201cdf0e10cSrcweir+timestamp='2010-01-22'
3202cdf0e10cSrcweir
3203cdf0e10cSrcweir # This file is (in principle) common to ALL GNU software.
3204cdf0e10cSrcweir # The presence of a machine in this file suggests that SOME GNU software
3205cdf0e10cSrcweir@@ -21,22 +22,26 @@
3206cdf0e10cSrcweir #
3207cdf0e10cSrcweir # You should have received a copy of the GNU General Public License
3208cdf0e10cSrcweir # along with this program; if not, write to the Free Software
3209cdf0e10cSrcweir-# Foundation, Inc., 59 Temple Place - Suite 330,
3210cdf0e10cSrcweir-# Boston, MA 02111-1307, USA.
3211cdf0e10cSrcweir-
3212cdf0e10cSrcweir+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
3213cdf0e10cSrcweir+# 02110-1301, USA.
3214cdf0e10cSrcweir+#
3215cdf0e10cSrcweir # As a special exception to the GNU General Public License, if you
3216cdf0e10cSrcweir # distribute this file as part of a program that contains a
3217cdf0e10cSrcweir # configuration script generated by Autoconf, you may include it under
3218cdf0e10cSrcweir # the same distribution terms that you use for the rest of that program.
3219cdf0e10cSrcweir
3220cdf0e10cSrcweir+
3221cdf0e10cSrcweir # Please send patches to <config-patches@gnu.org>.  Submit a context
3222cdf0e10cSrcweir-# diff and a properly formatted ChangeLog entry.
3223cdf0e10cSrcweir+# diff and a properly formatted GNU ChangeLog entry.
3224cdf0e10cSrcweir #
3225cdf0e10cSrcweir # Configuration subroutine to validate and canonicalize a configuration type.
3226cdf0e10cSrcweir # Supply the specified configuration type as an argument.
3227cdf0e10cSrcweir # If it is invalid, we print an error message on stderr and exit with code 1.
3228cdf0e10cSrcweir # Otherwise, we print the canonical config type on stdout and succeed.
3229cdf0e10cSrcweir
3230cdf0e10cSrcweir+# You can get the latest version of this script from:
3231cdf0e10cSrcweir+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
3232cdf0e10cSrcweir+
3233cdf0e10cSrcweir # This file is supposed to be the same for all GNU packages
3234cdf0e10cSrcweir # and recognize all the CPU types, system types and aliases
3235cdf0e10cSrcweir # that are meaningful with *any* GNU software.
3236cdf0e10cSrcweir@@ -70,8 +75,9 @@
3237cdf0e10cSrcweir version="\
3238cdf0e10cSrcweir GNU config.sub ($timestamp)
3239cdf0e10cSrcweir
3240cdf0e10cSrcweir-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
3241cdf0e10cSrcweir-Free Software Foundation, Inc.
3242cdf0e10cSrcweir+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3243cdf0e10cSrcweir+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
3244cdf0e10cSrcweir+Software Foundation, Inc.
3245cdf0e10cSrcweir
3246cdf0e10cSrcweir This is free software; see the source for copying conditions.  There is NO
3247cdf0e10cSrcweir warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
3248cdf0e10cSrcweir@@ -83,11 +89,11 @@
3249cdf0e10cSrcweir while test $# -gt 0 ; do
3250cdf0e10cSrcweir   case $1 in
3251cdf0e10cSrcweir     --time-stamp | --time* | -t )
3252cdf0e10cSrcweir-       echo "$timestamp" ; exit 0 ;;
3253cdf0e10cSrcweir+       echo "$timestamp" ; exit ;;
3254cdf0e10cSrcweir     --version | -v )
3255cdf0e10cSrcweir-       echo "$version" ; exit 0 ;;
3256cdf0e10cSrcweir+       echo "$version" ; exit ;;
3257cdf0e10cSrcweir     --help | --h* | -h )
3258cdf0e10cSrcweir-       echo "$usage"; exit 0 ;;
3259cdf0e10cSrcweir+       echo "$usage"; exit ;;
3260cdf0e10cSrcweir     -- )     # Stop option processing
3261cdf0e10cSrcweir        shift; break ;;
3262cdf0e10cSrcweir     - )    # Use stdin as input.
3263cdf0e10cSrcweir@@ -99,7 +105,7 @@
3264cdf0e10cSrcweir     *local*)
3265cdf0e10cSrcweir        # First pass through any local machine types.
3266cdf0e10cSrcweir        echo $1
3267cdf0e10cSrcweir-       exit 0;;
3268cdf0e10cSrcweir+       exit ;;
3269cdf0e10cSrcweir
3270cdf0e10cSrcweir     * )
3271cdf0e10cSrcweir        break ;;
3272cdf0e10cSrcweir@@ -118,7 +124,10 @@
3273cdf0e10cSrcweir # Here we must recognize all the valid KERNEL-OS combinations.
3274cdf0e10cSrcweir maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
3275cdf0e10cSrcweir case $maybe_os in
3276cdf0e10cSrcweir-  nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
3277cdf0e10cSrcweir+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
3278cdf0e10cSrcweir+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
3279cdf0e10cSrcweir+  kopensolaris*-gnu* | \
3280cdf0e10cSrcweir+  storm-chaos* | os2-emx* | rtmk-nova*)
3281cdf0e10cSrcweir     os=-$maybe_os
3282cdf0e10cSrcweir     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
3283cdf0e10cSrcweir     ;;
3284cdf0e10cSrcweir@@ -144,10 +153,13 @@
3285cdf0e10cSrcweir    -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
3286cdf0e10cSrcweir    -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
3287cdf0e10cSrcweir    -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
3288cdf0e10cSrcweir-   -apple | -axis)
3289cdf0e10cSrcweir+   -apple | -axis | -knuth | -cray | -microblaze)
3290cdf0e10cSrcweir        os=
3291cdf0e10cSrcweir        basic_machine=$1
3292cdf0e10cSrcweir        ;;
3293cdf0e10cSrcweir+        -bluegene*)
3294cdf0e10cSrcweir+           os=-cnk
3295cdf0e10cSrcweir+       ;;
3296cdf0e10cSrcweir    -sim | -cisco | -oki | -wec | -winbond)
3297cdf0e10cSrcweir        os=
3298cdf0e10cSrcweir        basic_machine=$1
3299cdf0e10cSrcweir@@ -169,6 +181,10 @@
3300cdf0e10cSrcweir    -hiux*)
3301cdf0e10cSrcweir        os=-hiuxwe2
3302cdf0e10cSrcweir        ;;
3303cdf0e10cSrcweir+   -sco6)
3304cdf0e10cSrcweir+       os=-sco5v6
3305cdf0e10cSrcweir+       basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
3306cdf0e10cSrcweir+       ;;
3307cdf0e10cSrcweir    -sco5)
3308cdf0e10cSrcweir        os=-sco3.2v5
3309cdf0e10cSrcweir        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
3310cdf0e10cSrcweir@@ -185,6 +201,10 @@
3311cdf0e10cSrcweir        # Don't forget version if it is 3.2v4 or newer.
3312cdf0e10cSrcweir        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
3313cdf0e10cSrcweir        ;;
3314cdf0e10cSrcweir+   -sco5v6*)
3315cdf0e10cSrcweir+       # Don't forget version if it is 3.2v4 or newer.
3316cdf0e10cSrcweir+       basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
3317cdf0e10cSrcweir+       ;;
3318cdf0e10cSrcweir    -sco*)
3319cdf0e10cSrcweir        os=-sco3.2v2
3320cdf0e10cSrcweir        basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
3321cdf0e10cSrcweir@@ -228,51 +248,71 @@
3322cdf0e10cSrcweir    | a29k \
3323cdf0e10cSrcweir    | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
3324cdf0e10cSrcweir    | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
3325cdf0e10cSrcweir-   | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
3326cdf0e10cSrcweir-   | clipper \
3327cdf0e10cSrcweir+   | am33_2.0 \
3328cdf0e10cSrcweir+   | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
3329cdf0e10cSrcweir+   | bfin \
3330cdf0e10cSrcweir+   | c4x | clipper \
3331cdf0e10cSrcweir    | d10v | d30v | dlx | dsp16xx \
3332cdf0e10cSrcweir-   | fr30 | frv \
3333cdf0e10cSrcweir+   | fido | fr30 | frv \
3334cdf0e10cSrcweir    | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
3335cdf0e10cSrcweir    | i370 | i860 | i960 | ia64 \
3336cdf0e10cSrcweir-   | ip2k \
3337cdf0e10cSrcweir-   | m32r | m68000 | m68k | m88k | mcore \
3338cdf0e10cSrcweir+   | ip2k | iq2000 \
3339cdf0e10cSrcweir+   | lm32 \
3340cdf0e10cSrcweir+   | m32c | m32r | m32rle | m68000 | m68k | m88k \
3341cdf0e10cSrcweir+   | maxq | mb | microblaze | mcore | mep | metag \
3342cdf0e10cSrcweir    | mips | mipsbe | mipseb | mipsel | mipsle \
3343cdf0e10cSrcweir    | mips16 \
3344cdf0e10cSrcweir    | mips64 | mips64el \
3345cdf0e10cSrcweir-   | mips64vr | mips64vrel \
3346cdf0e10cSrcweir+   | mips64octeon | mips64octeonel \
3347cdf0e10cSrcweir    | mips64orion | mips64orionel \
3348cdf0e10cSrcweir+   | mips64r5900 | mips64r5900el \
3349cdf0e10cSrcweir+   | mips64vr | mips64vrel \
3350cdf0e10cSrcweir    | mips64vr4100 | mips64vr4100el \
3351cdf0e10cSrcweir    | mips64vr4300 | mips64vr4300el \
3352cdf0e10cSrcweir    | mips64vr5000 | mips64vr5000el \
3353cdf0e10cSrcweir+   | mips64vr5900 | mips64vr5900el \
3354cdf0e10cSrcweir    | mipsisa32 | mipsisa32el \
3355cdf0e10cSrcweir+   | mipsisa32r2 | mipsisa32r2el \
3356cdf0e10cSrcweir    | mipsisa64 | mipsisa64el \
3357cdf0e10cSrcweir+   | mipsisa64r2 | mipsisa64r2el \
3358cdf0e10cSrcweir    | mipsisa64sb1 | mipsisa64sb1el \
3359cdf0e10cSrcweir    | mipsisa64sr71k | mipsisa64sr71kel \
3360cdf0e10cSrcweir    | mipstx39 | mipstx39el \
3361cdf0e10cSrcweir    | mn10200 | mn10300 \
3362cdf0e10cSrcweir+   | moxie \
3363cdf0e10cSrcweir+   | mt \
3364cdf0e10cSrcweir+   | msp430 \
3365cdf0e10cSrcweir+   | nios | nios2 \
3366cdf0e10cSrcweir    | ns16k | ns32k \
3367cdf0e10cSrcweir-   | openrisc | or32 \
3368cdf0e10cSrcweir+   | or32 \
3369cdf0e10cSrcweir    | pdp10 | pdp11 | pj | pjl \
3370cdf0e10cSrcweir    | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
3371cdf0e10cSrcweir    | pyramid \
3372cdf0e10cSrcweir-   | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
3373cdf0e10cSrcweir+   | rx \
3374cdf0e10cSrcweir+   | score \
3375cdf0e10cSrcweir+   | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
3376cdf0e10cSrcweir    | sh64 | sh64le \
3377cdf0e10cSrcweir-   | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
3378cdf0e10cSrcweir-   | strongarm \
3379cdf0e10cSrcweir-   | tahoe | thumb | tic80 | tron \
3380cdf0e10cSrcweir+   | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
3381cdf0e10cSrcweir+   | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
3382cdf0e10cSrcweir+   | spu | strongarm \
3383cdf0e10cSrcweir+   | tahoe | thumb | tic4x | tic80 | tron \
3384cdf0e10cSrcweir+   | ubicom32 \
3385cdf0e10cSrcweir    | v850 | v850e \
3386cdf0e10cSrcweir    | we32k \
3387cdf0e10cSrcweir-   | x86 | xscale | xstormy16 | xtensa \
3388cdf0e10cSrcweir-   | z8k)
3389cdf0e10cSrcweir+   | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
3390cdf0e10cSrcweir+   | z8k | z80)
3391cdf0e10cSrcweir        basic_machine=$basic_machine-unknown
3392cdf0e10cSrcweir        ;;
3393cdf0e10cSrcweir-   m6811 | m68hc11 | m6812 | m68hc12)
3394cdf0e10cSrcweir+   m6811 | m68hc11 | m6812 | m68hc12 | picochip)
3395cdf0e10cSrcweir        # Motorola 68HC11/12.
3396cdf0e10cSrcweir        basic_machine=$basic_machine-unknown
3397cdf0e10cSrcweir        os=-none
3398cdf0e10cSrcweir        ;;
3399cdf0e10cSrcweir    m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3400cdf0e10cSrcweir        ;;
3401cdf0e10cSrcweir+   ms1)
3402cdf0e10cSrcweir+       basic_machine=mt-unknown
3403cdf0e10cSrcweir+       ;;
3404cdf0e10cSrcweir
3405cdf0e10cSrcweir    # We use `pc' rather than `unknown'
3406cdf0e10cSrcweir    # because (1) that's what they normally are, and
3407cdf0e10cSrcweir@@ -292,50 +332,69 @@
3408cdf0e10cSrcweir    | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3409cdf0e10cSrcweir    | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
3410cdf0e10cSrcweir    | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3411cdf0e10cSrcweir-   | avr-* \
3412cdf0e10cSrcweir-   | bs2000-* \
3413cdf0e10cSrcweir-   | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
3414cdf0e10cSrcweir-   | clipper-* | cydra-* \
3415cdf0e10cSrcweir+   | avr-* | avr32-* \
3416cdf0e10cSrcweir+   | bfin-* | bs2000-* \
3417cdf0e10cSrcweir+   | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
3418cdf0e10cSrcweir+   | clipper-* | craynv-* | cydra-* \
3419cdf0e10cSrcweir    | d10v-* | d30v-* | dlx-* \
3420cdf0e10cSrcweir    | elxsi-* \
3421cdf0e10cSrcweir-   | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
3422cdf0e10cSrcweir+   | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3423cdf0e10cSrcweir    | h8300-* | h8500-* \
3424cdf0e10cSrcweir    | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
3425cdf0e10cSrcweir    | i*86-* | i860-* | i960-* | ia64-* \
3426cdf0e10cSrcweir-   | ip2k-* \
3427cdf0e10cSrcweir-   | m32r-* \
3428cdf0e10cSrcweir+   | ip2k-* | iq2000-* \
3429cdf0e10cSrcweir+   | lm32-* \
3430cdf0e10cSrcweir+   | m32c-* | m32r-* | m32rle-* \
3431cdf0e10cSrcweir    | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
3432cdf0e10cSrcweir-   | m88110-* | m88k-* | mcore-* \
3433cdf0e10cSrcweir+   | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
3434cdf0e10cSrcweir    | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3435cdf0e10cSrcweir    | mips16-* \
3436cdf0e10cSrcweir    | mips64-* | mips64el-* \
3437cdf0e10cSrcweir-   | mips64vr-* | mips64vrel-* \
3438cdf0e10cSrcweir+   | mips64octeon-* | mips64octeonel-* \
3439cdf0e10cSrcweir    | mips64orion-* | mips64orionel-* \
3440cdf0e10cSrcweir+   | mips64r5900-* | mips64r5900el-* \
3441cdf0e10cSrcweir+   | mips64vr-* | mips64vrel-* \
3442cdf0e10cSrcweir    | mips64vr4100-* | mips64vr4100el-* \
3443cdf0e10cSrcweir    | mips64vr4300-* | mips64vr4300el-* \
3444cdf0e10cSrcweir    | mips64vr5000-* | mips64vr5000el-* \
3445cdf0e10cSrcweir+   | mips64vr5900-* | mips64vr5900el-* \
3446cdf0e10cSrcweir    | mipsisa32-* | mipsisa32el-* \
3447cdf0e10cSrcweir+   | mipsisa32r2-* | mipsisa32r2el-* \
3448cdf0e10cSrcweir    | mipsisa64-* | mipsisa64el-* \
3449cdf0e10cSrcweir+   | mipsisa64r2-* | mipsisa64r2el-* \
3450cdf0e10cSrcweir    | mipsisa64sb1-* | mipsisa64sb1el-* \
3451cdf0e10cSrcweir    | mipsisa64sr71k-* | mipsisa64sr71kel-* \
3452cdf0e10cSrcweir-   | mipstx39 | mipstx39el \
3453cdf0e10cSrcweir+   | mipstx39-* | mipstx39el-* \
3454cdf0e10cSrcweir+   | mmix-* \
3455cdf0e10cSrcweir+   | mt-* \
3456cdf0e10cSrcweir+   | msp430-* \
3457cdf0e10cSrcweir+   | nios-* | nios2-* \
3458cdf0e10cSrcweir    | none-* | np1-* | ns16k-* | ns32k-* \
3459cdf0e10cSrcweir    | orion-* \
3460cdf0e10cSrcweir    | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
3461cdf0e10cSrcweir    | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
3462cdf0e10cSrcweir    | pyramid-* \
3463cdf0e10cSrcweir-   | romp-* | rs6000-* \
3464cdf0e10cSrcweir-   | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
3465cdf0e10cSrcweir+   | romp-* | rs6000-* | rx-* \
3466cdf0e10cSrcweir+   | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
3467cdf0e10cSrcweir    | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
3468cdf0e10cSrcweir-   | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
3469cdf0e10cSrcweir-   | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
3470cdf0e10cSrcweir-   | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
3471cdf0e10cSrcweir+   | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
3472cdf0e10cSrcweir+   | sparclite-* \
3473cdf0e10cSrcweir+   | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
3474cdf0e10cSrcweir+   | tahoe-* | thumb-* \
3475cdf0e10cSrcweir+   | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
3476cdf0e10cSrcweir+   | tile-* | tilegx-* \
3477cdf0e10cSrcweir+   | tron-* \
3478cdf0e10cSrcweir+   | ubicom32-* \
3479cdf0e10cSrcweir    | v850-* | v850e-* | vax-* \
3480cdf0e10cSrcweir    | we32k-* \
3481cdf0e10cSrcweir-   | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
3482cdf0e10cSrcweir-   | xtensa-* \
3483cdf0e10cSrcweir+   | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
3484cdf0e10cSrcweir+   | xstormy16-* | xtensa*-* \
3485cdf0e10cSrcweir    | ymp-* \
3486cdf0e10cSrcweir-   | z8k-*)
3487cdf0e10cSrcweir+   | z8k-* | z80-*)
3488cdf0e10cSrcweir+       ;;
3489cdf0e10cSrcweir+   # Recognize the basic CPU types without company name, with glob match.
3490cdf0e10cSrcweir+   xtensa*)
3491cdf0e10cSrcweir+       basic_machine=$basic_machine-unknown
3492cdf0e10cSrcweir        ;;
3493cdf0e10cSrcweir    # Recognize the various machine names and aliases which stand
3494cdf0e10cSrcweir    # for a CPU type and a company and sometimes even an OS.
3495cdf0e10cSrcweir@@ -353,6 +412,9 @@
3496cdf0e10cSrcweir        basic_machine=a29k-amd
3497cdf0e10cSrcweir        os=-udi
3498cdf0e10cSrcweir        ;;
3499cdf0e10cSrcweir+       abacus)
3500cdf0e10cSrcweir+       basic_machine=abacus-unknown
3501cdf0e10cSrcweir+       ;;
3502cdf0e10cSrcweir    adobe68k)
3503cdf0e10cSrcweir        basic_machine=m68010-adobe
3504cdf0e10cSrcweir        os=-scout
3505cdf0e10cSrcweir@@ -367,6 +429,12 @@
3506cdf0e10cSrcweir        basic_machine=a29k-none
3507cdf0e10cSrcweir        os=-bsd
3508cdf0e10cSrcweir        ;;
3509cdf0e10cSrcweir+   amd64)
3510cdf0e10cSrcweir+       basic_machine=x86_64-pc
3511cdf0e10cSrcweir+       ;;
3512cdf0e10cSrcweir+   amd64-*)
3513cdf0e10cSrcweir+       basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
3514cdf0e10cSrcweir+       ;;
3515cdf0e10cSrcweir    amdahl)
3516cdf0e10cSrcweir        basic_machine=580-amdahl
3517cdf0e10cSrcweir        os=-sysv
3518cdf0e10cSrcweir@@ -390,6 +458,10 @@
3519cdf0e10cSrcweir        basic_machine=m68k-apollo
3520cdf0e10cSrcweir        os=-bsd
3521cdf0e10cSrcweir        ;;
3522cdf0e10cSrcweir+   aros)
3523cdf0e10cSrcweir+       basic_machine=i386-pc
3524cdf0e10cSrcweir+       os=-aros
3525cdf0e10cSrcweir+       ;;
3526cdf0e10cSrcweir    aux)
3527cdf0e10cSrcweir        basic_machine=m68k-apple
3528cdf0e10cSrcweir        os=-aux
3529cdf0e10cSrcweir@@ -398,10 +470,26 @@
3530cdf0e10cSrcweir        basic_machine=ns32k-sequent
3531cdf0e10cSrcweir        os=-dynix
3532cdf0e10cSrcweir        ;;
3533cdf0e10cSrcweir+   blackfin)
3534cdf0e10cSrcweir+       basic_machine=bfin-unknown
3535cdf0e10cSrcweir+       os=-linux
3536cdf0e10cSrcweir+       ;;
3537cdf0e10cSrcweir+   blackfin-*)
3538cdf0e10cSrcweir+       basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
3539cdf0e10cSrcweir+       os=-linux
3540cdf0e10cSrcweir+       ;;
3541cdf0e10cSrcweir+   bluegene*)
3542cdf0e10cSrcweir+       basic_machine=powerpc-ibm
3543cdf0e10cSrcweir+       os=-cnk
3544cdf0e10cSrcweir+       ;;
3545cdf0e10cSrcweir    c90)
3546cdf0e10cSrcweir        basic_machine=c90-cray
3547cdf0e10cSrcweir        os=-unicos
3548cdf0e10cSrcweir        ;;
3549cdf0e10cSrcweir+        cegcc)
3550cdf0e10cSrcweir+       basic_machine=arm-unknown
3551cdf0e10cSrcweir+       os=-cegcc
3552cdf0e10cSrcweir+       ;;
3553cdf0e10cSrcweir    convex-c1)
3554cdf0e10cSrcweir        basic_machine=c1-convex
3555cdf0e10cSrcweir        os=-bsd
3556cdf0e10cSrcweir@@ -426,12 +514,27 @@
3557cdf0e10cSrcweir        basic_machine=j90-cray
3558cdf0e10cSrcweir        os=-unicos
3559cdf0e10cSrcweir        ;;
3560cdf0e10cSrcweir+   craynv)
3561cdf0e10cSrcweir+       basic_machine=craynv-cray
3562cdf0e10cSrcweir+       os=-unicosmp
3563cdf0e10cSrcweir+       ;;
3564cdf0e10cSrcweir+   cr16)
3565cdf0e10cSrcweir+       basic_machine=cr16-unknown
3566cdf0e10cSrcweir+       os=-elf
3567cdf0e10cSrcweir+       ;;
3568cdf0e10cSrcweir    crds | unos)
3569cdf0e10cSrcweir        basic_machine=m68k-crds
3570cdf0e10cSrcweir        ;;
3571cdf0e10cSrcweir+   crisv32 | crisv32-* | etraxfs*)
3572cdf0e10cSrcweir+       basic_machine=crisv32-axis
3573cdf0e10cSrcweir+       ;;
3574cdf0e10cSrcweir    cris | cris-* | etrax*)
3575cdf0e10cSrcweir        basic_machine=cris-axis
3576cdf0e10cSrcweir        ;;
3577cdf0e10cSrcweir+   crx)
3578cdf0e10cSrcweir+       basic_machine=crx-unknown
3579cdf0e10cSrcweir+       os=-elf
3580cdf0e10cSrcweir+       ;;
3581cdf0e10cSrcweir    da30 | da30-*)
3582cdf0e10cSrcweir        basic_machine=m68k-da30
3583cdf0e10cSrcweir        ;;
3584cdf0e10cSrcweir@@ -454,6 +557,14 @@
3585cdf0e10cSrcweir        basic_machine=m88k-motorola
3586cdf0e10cSrcweir        os=-sysv3
3587cdf0e10cSrcweir        ;;
3588cdf0e10cSrcweir+   dicos)
3589cdf0e10cSrcweir+       basic_machine=i686-pc
3590cdf0e10cSrcweir+       os=-dicos
3591cdf0e10cSrcweir+       ;;
3592cdf0e10cSrcweir+   djgpp)
3593cdf0e10cSrcweir+       basic_machine=i586-pc
3594cdf0e10cSrcweir+       os=-msdosdjgpp
3595cdf0e10cSrcweir+       ;;
3596cdf0e10cSrcweir    dpx20 | dpx20-*)
3597cdf0e10cSrcweir        basic_machine=rs6000-bull
3598cdf0e10cSrcweir        os=-bosx
3599cdf0e10cSrcweir@@ -604,6 +715,14 @@
3600cdf0e10cSrcweir        basic_machine=m68k-isi
3601cdf0e10cSrcweir        os=-sysv
3602cdf0e10cSrcweir        ;;
3603cdf0e10cSrcweir+   m68knommu)
3604cdf0e10cSrcweir+       basic_machine=m68k-unknown
3605cdf0e10cSrcweir+       os=-linux
3606cdf0e10cSrcweir+       ;;
3607cdf0e10cSrcweir+   m68knommu-*)
3608cdf0e10cSrcweir+       basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
3609cdf0e10cSrcweir+       os=-linux
3610cdf0e10cSrcweir+       ;;
3611cdf0e10cSrcweir    m88k-omron*)
3612cdf0e10cSrcweir        basic_machine=m88k-omron
3613cdf0e10cSrcweir        ;;
3614cdf0e10cSrcweir@@ -615,10 +734,17 @@
3615cdf0e10cSrcweir        basic_machine=ns32k-utek
3616cdf0e10cSrcweir        os=-sysv
3617cdf0e10cSrcweir        ;;
3618cdf0e10cSrcweir+        microblaze)
3619cdf0e10cSrcweir+       basic_machine=microblaze-xilinx
3620cdf0e10cSrcweir+       ;;
3621cdf0e10cSrcweir    mingw32)
3622cdf0e10cSrcweir        basic_machine=i386-pc
3623cdf0e10cSrcweir        os=-mingw32
3624cdf0e10cSrcweir        ;;
3625cdf0e10cSrcweir+   mingw32ce)
3626cdf0e10cSrcweir+       basic_machine=arm-unknown
3627cdf0e10cSrcweir+       os=-mingw32ce
3628cdf0e10cSrcweir+       ;;
3629cdf0e10cSrcweir    miniframe)
3630cdf0e10cSrcweir        basic_machine=m68000-convergent
3631cdf0e10cSrcweir        ;;
3632cdf0e10cSrcweir@@ -632,10 +758,6 @@
3633cdf0e10cSrcweir    mips3*)
3634cdf0e10cSrcweir        basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
3635cdf0e10cSrcweir        ;;
3636cdf0e10cSrcweir-   mmix*)
3637cdf0e10cSrcweir-       basic_machine=mmix-knuth
3638cdf0e10cSrcweir-       os=-mmixware
3639cdf0e10cSrcweir-       ;;
3640cdf0e10cSrcweir    monitor)
3641cdf0e10cSrcweir        basic_machine=m68k-rom68k
3642cdf0e10cSrcweir        os=-coff
3643cdf0e10cSrcweir@@ -648,6 +770,9 @@
3644cdf0e10cSrcweir        basic_machine=i386-pc
3645cdf0e10cSrcweir        os=-msdos
3646cdf0e10cSrcweir        ;;
3647cdf0e10cSrcweir+   ms1-*)
3648cdf0e10cSrcweir+       basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
3649cdf0e10cSrcweir+       ;;
3650cdf0e10cSrcweir    mvs)
3651cdf0e10cSrcweir        basic_machine=i370-ibm
3652cdf0e10cSrcweir        os=-mvs
3653cdf0e10cSrcweir@@ -723,9 +848,12 @@
3654cdf0e10cSrcweir        basic_machine=hppa1.1-oki
3655cdf0e10cSrcweir        os=-proelf
3656cdf0e10cSrcweir        ;;
3657cdf0e10cSrcweir-   or32 | or32-*)
3658cdf0e10cSrcweir+   openrisc | openrisc-*)
3659cdf0e10cSrcweir        basic_machine=or32-unknown
3660cdf0e10cSrcweir-       os=-coff
3661cdf0e10cSrcweir+       ;;
3662cdf0e10cSrcweir+   os400)
3663cdf0e10cSrcweir+       basic_machine=powerpc-ibm
3664cdf0e10cSrcweir+       os=-os400
3665cdf0e10cSrcweir        ;;
3666cdf0e10cSrcweir    OSE68000 | ose68000)
3667cdf0e10cSrcweir        basic_machine=m68000-ericsson
3668cdf0e10cSrcweir@@ -743,6 +871,14 @@
3669cdf0e10cSrcweir        basic_machine=i860-intel
3670cdf0e10cSrcweir        os=-osf
3671cdf0e10cSrcweir        ;;
3672cdf0e10cSrcweir+   parisc)
3673cdf0e10cSrcweir+       basic_machine=hppa-unknown
3674cdf0e10cSrcweir+       os=-linux
3675cdf0e10cSrcweir+       ;;
3676cdf0e10cSrcweir+   parisc-*)
3677cdf0e10cSrcweir+       basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
3678cdf0e10cSrcweir+       os=-linux
3679cdf0e10cSrcweir+       ;;
3680cdf0e10cSrcweir    pbd)
3681cdf0e10cSrcweir        basic_machine=sparc-tti
3682cdf0e10cSrcweir        ;;
3683cdf0e10cSrcweir@@ -752,24 +888,36 @@
3684cdf0e10cSrcweir    pc532 | pc532-*)
3685cdf0e10cSrcweir        basic_machine=ns32k-pc532
3686cdf0e10cSrcweir        ;;
3687cdf0e10cSrcweir+   pc98)
3688cdf0e10cSrcweir+       basic_machine=i386-pc
3689cdf0e10cSrcweir+       ;;
3690cdf0e10cSrcweir+   pc98-*)
3691cdf0e10cSrcweir+       basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
3692cdf0e10cSrcweir+       ;;
3693cdf0e10cSrcweir    pentium | p5 | k5 | k6 | nexgen | viac3)
3694cdf0e10cSrcweir        basic_machine=i586-pc
3695cdf0e10cSrcweir        ;;
3696cdf0e10cSrcweir    pentiumpro | p6 | 6x86 | athlon | athlon_*)
3697cdf0e10cSrcweir        basic_machine=i686-pc
3698cdf0e10cSrcweir        ;;
3699cdf0e10cSrcweir-   pentiumii | pentium2)
3700cdf0e10cSrcweir+   pentiumii | pentium2 | pentiumiii | pentium3)
3701cdf0e10cSrcweir        basic_machine=i686-pc
3702cdf0e10cSrcweir        ;;
3703cdf0e10cSrcweir+   pentium4)
3704cdf0e10cSrcweir+       basic_machine=i786-pc
3705cdf0e10cSrcweir+       ;;
3706cdf0e10cSrcweir    pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
3707cdf0e10cSrcweir        basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
3708cdf0e10cSrcweir        ;;
3709cdf0e10cSrcweir    pentiumpro-* | p6-* | 6x86-* | athlon-*)
3710cdf0e10cSrcweir        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
3711cdf0e10cSrcweir        ;;
3712cdf0e10cSrcweir-   pentiumii-* | pentium2-*)
3713cdf0e10cSrcweir+   pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
3714cdf0e10cSrcweir        basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
3715cdf0e10cSrcweir        ;;
3716cdf0e10cSrcweir+   pentium4-*)
3717cdf0e10cSrcweir+       basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
3718cdf0e10cSrcweir+       ;;
3719cdf0e10cSrcweir    pn)
3720cdf0e10cSrcweir        basic_machine=pn-gould
3721cdf0e10cSrcweir        ;;
3722cdf0e10cSrcweir@@ -802,6 +950,10 @@
3723cdf0e10cSrcweir        basic_machine=i586-unknown
3724cdf0e10cSrcweir        os=-pw32
3725cdf0e10cSrcweir        ;;
3726cdf0e10cSrcweir+   rdos)
3727cdf0e10cSrcweir+       basic_machine=i386-pc
3728cdf0e10cSrcweir+       os=-rdos
3729cdf0e10cSrcweir+       ;;
3730cdf0e10cSrcweir    rom68k)
3731cdf0e10cSrcweir        basic_machine=m68k-rom68k
3732cdf0e10cSrcweir        os=-coff
3733cdf0e10cSrcweir@@ -828,6 +980,14 @@
3734cdf0e10cSrcweir    sb1el)
3735cdf0e10cSrcweir        basic_machine=mipsisa64sb1el-unknown
3736cdf0e10cSrcweir        ;;
3737cdf0e10cSrcweir+   sde)
3738cdf0e10cSrcweir+       basic_machine=mipsisa32-sde
3739cdf0e10cSrcweir+       os=-elf
3740cdf0e10cSrcweir+       ;;
3741cdf0e10cSrcweir+   sei)
3742cdf0e10cSrcweir+       basic_machine=mips-sei
3743cdf0e10cSrcweir+       os=-seiux
3744cdf0e10cSrcweir+       ;;
3745cdf0e10cSrcweir    sequent)
3746cdf0e10cSrcweir        basic_machine=i386-sequent
3747cdf0e10cSrcweir        ;;
3748cdf0e10cSrcweir@@ -835,6 +995,12 @@
3749cdf0e10cSrcweir        basic_machine=sh-hitachi
3750cdf0e10cSrcweir        os=-hms
3751cdf0e10cSrcweir        ;;
3752cdf0e10cSrcweir+   sh5el)
3753cdf0e10cSrcweir+       basic_machine=sh5le-unknown
3754cdf0e10cSrcweir+       ;;
3755cdf0e10cSrcweir+   sh64)
3756cdf0e10cSrcweir+       basic_machine=sh64-unknown
3757cdf0e10cSrcweir+       ;;
3758cdf0e10cSrcweir    sparclite-wrs | simso-wrs)
3759cdf0e10cSrcweir        basic_machine=sparclite-wrs
3760cdf0e10cSrcweir        os=-vxworks
3761cdf0e10cSrcweir@@ -901,10 +1067,6 @@
3762cdf0e10cSrcweir        basic_machine=i386-sequent
3763cdf0e10cSrcweir        os=-dynix
3764cdf0e10cSrcweir        ;;
3765cdf0e10cSrcweir-   t3d)
3766cdf0e10cSrcweir-       basic_machine=alpha-cray
3767cdf0e10cSrcweir-       os=-unicos
3768cdf0e10cSrcweir-       ;;
3769cdf0e10cSrcweir    t3e)
3770cdf0e10cSrcweir        basic_machine=alphaev5-cray
3771cdf0e10cSrcweir        os=-unicos
3772cdf0e10cSrcweir@@ -913,14 +1075,27 @@
3773cdf0e10cSrcweir        basic_machine=t90-cray
3774cdf0e10cSrcweir        os=-unicos
3775cdf0e10cSrcweir        ;;
3776cdf0e10cSrcweir-        tic4x | c4x*)
3777cdf0e10cSrcweir-       basic_machine=tic4x-unknown
3778cdf0e10cSrcweir-       os=-coff
3779cdf0e10cSrcweir-       ;;
3780cdf0e10cSrcweir    tic54x | c54x*)
3781cdf0e10cSrcweir        basic_machine=tic54x-unknown
3782cdf0e10cSrcweir        os=-coff
3783cdf0e10cSrcweir        ;;
3784cdf0e10cSrcweir+   tic55x | c55x*)
3785cdf0e10cSrcweir+       basic_machine=tic55x-unknown
3786cdf0e10cSrcweir+       os=-coff
3787cdf0e10cSrcweir+       ;;
3788cdf0e10cSrcweir+   tic6x | c6x*)
3789cdf0e10cSrcweir+       basic_machine=tic6x-unknown
3790cdf0e10cSrcweir+       os=-coff
3791cdf0e10cSrcweir+       ;;
3792cdf0e10cSrcweir+        # This must be matched before tile*.
3793cdf0e10cSrcweir+        tilegx*)
3794cdf0e10cSrcweir+       basic_machine=tilegx-unknown
3795cdf0e10cSrcweir+       os=-linux-gnu
3796cdf0e10cSrcweir+       ;;
3797cdf0e10cSrcweir+   tile*)
3798cdf0e10cSrcweir+       basic_machine=tile-unknown
3799cdf0e10cSrcweir+       os=-linux-gnu
3800cdf0e10cSrcweir+       ;;
3801cdf0e10cSrcweir    tx39)
3802cdf0e10cSrcweir        basic_machine=mipstx39-unknown
3803cdf0e10cSrcweir        ;;
3804cdf0e10cSrcweir@@ -934,6 +1109,10 @@
3805cdf0e10cSrcweir    tower | tower-32)
3806cdf0e10cSrcweir        basic_machine=m68k-ncr
3807cdf0e10cSrcweir        ;;
3808cdf0e10cSrcweir+   tpf)
3809cdf0e10cSrcweir+       basic_machine=s390x-ibm
3810cdf0e10cSrcweir+       os=-tpf
3811cdf0e10cSrcweir+       ;;
3812cdf0e10cSrcweir    udi29k)
3813cdf0e10cSrcweir        basic_machine=a29k-amd
3814cdf0e10cSrcweir        os=-udi
3815cdf0e10cSrcweir@@ -977,9 +1156,9 @@
3816cdf0e10cSrcweir        basic_machine=hppa1.1-winbond
3817cdf0e10cSrcweir        os=-proelf
3818cdf0e10cSrcweir        ;;
3819cdf0e10cSrcweir-   windows32)
3820cdf0e10cSrcweir-       basic_machine=i386-pc
3821cdf0e10cSrcweir-       os=-windows32-msvcrt
3822cdf0e10cSrcweir+   xbox)
3823cdf0e10cSrcweir+       basic_machine=i686-pc
3824cdf0e10cSrcweir+       os=-mingw32
3825cdf0e10cSrcweir        ;;
3826cdf0e10cSrcweir    xps | xps100)
3827cdf0e10cSrcweir        basic_machine=xps100-honeywell
3828cdf0e10cSrcweir@@ -992,6 +1171,10 @@
3829cdf0e10cSrcweir        basic_machine=z8k-unknown
3830cdf0e10cSrcweir        os=-sim
3831cdf0e10cSrcweir        ;;
3832cdf0e10cSrcweir+   z80-*-coff)
3833cdf0e10cSrcweir+       basic_machine=z80-unknown
3834cdf0e10cSrcweir+       os=-sim
3835cdf0e10cSrcweir+       ;;
3836cdf0e10cSrcweir    none)
3837cdf0e10cSrcweir        basic_machine=none-none
3838cdf0e10cSrcweir        os=-none
3839cdf0e10cSrcweir@@ -1011,6 +1194,9 @@
3840cdf0e10cSrcweir    romp)
3841cdf0e10cSrcweir        basic_machine=romp-ibm
3842cdf0e10cSrcweir        ;;
3843cdf0e10cSrcweir+   mmix)
3844cdf0e10cSrcweir+       basic_machine=mmix-knuth
3845cdf0e10cSrcweir+       ;;
3846cdf0e10cSrcweir    rs6000)
3847cdf0e10cSrcweir        basic_machine=rs6000-ibm
3848cdf0e10cSrcweir        ;;
3849cdf0e10cSrcweir@@ -1027,13 +1213,10 @@
3850cdf0e10cSrcweir    we32k)
3851cdf0e10cSrcweir        basic_machine=we32k-att
3852cdf0e10cSrcweir        ;;
3853cdf0e10cSrcweir-   sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
3854cdf0e10cSrcweir+   sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
3855cdf0e10cSrcweir        basic_machine=sh-unknown
3856cdf0e10cSrcweir        ;;
3857cdf0e10cSrcweir-   sh64)
3858cdf0e10cSrcweir-       basic_machine=sh64-unknown
3859cdf0e10cSrcweir-       ;;
3860cdf0e10cSrcweir-   sparc | sparcv9 | sparcv9b)
3861cdf0e10cSrcweir+   sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
3862cdf0e10cSrcweir        basic_machine=sparc-sun
3863cdf0e10cSrcweir        ;;
3864cdf0e10cSrcweir    cydra)
3865cdf0e10cSrcweir@@ -1080,6 +1263,9 @@
3866cdf0e10cSrcweir         # First match some system type aliases
3867cdf0e10cSrcweir         # that might get confused with valid system types.
3868cdf0e10cSrcweir    # -solaris* is a basic system type, with this one exception.
3869cdf0e10cSrcweir+        -auroraux)
3870cdf0e10cSrcweir+           os=-auroraux
3871cdf0e10cSrcweir+       ;;
3872cdf0e10cSrcweir    -solaris1 | -solaris1.*)
3873cdf0e10cSrcweir        os=`echo $os | sed -e 's|solaris1|sunos4|'`
3874cdf0e10cSrcweir        ;;
3875cdf0e10cSrcweir@@ -1100,24 +1286,30 @@
3876cdf0e10cSrcweir    # Each alternative MUST END IN A *, to match a version number.
3877cdf0e10cSrcweir    # -sysv* is not here because it comes later, after sysvr4.
3878cdf0e10cSrcweir    -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
3879cdf0e10cSrcweir-         | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
3880cdf0e10cSrcweir-         | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
3881cdf0e10cSrcweir+         | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
3882cdf0e10cSrcweir+         | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
3883cdf0e10cSrcweir+         | -sym* | -kopensolaris* \
3884cdf0e10cSrcweir          | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
3885cdf0e10cSrcweir-         | -aos* \
3886cdf0e10cSrcweir+         | -aos* | -aros* \
3887cdf0e10cSrcweir          | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
3888cdf0e10cSrcweir          | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
3889cdf0e10cSrcweir-         | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
3890cdf0e10cSrcweir-         | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
3891cdf0e10cSrcweir+         | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
3892cdf0e10cSrcweir+         | -openbsd* | -solidbsd* \
3893cdf0e10cSrcweir+         | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
3894cdf0e10cSrcweir+         | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
3895cdf0e10cSrcweir          | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
3896cdf0e10cSrcweir          | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
3897cdf0e10cSrcweir-         | -chorusos* | -chorusrdb* \
3898cdf0e10cSrcweir+         | -chorusos* | -chorusrdb* | -cegcc* \
3899cdf0e10cSrcweir          | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
3900cdf0e10cSrcweir-         | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
3901cdf0e10cSrcweir-         | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
3902cdf0e10cSrcweir+         | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
3903cdf0e10cSrcweir+         | -uxpv* | -beos* | -mpeix* | -udk* \
3904cdf0e10cSrcweir+         | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
3905cdf0e10cSrcweir          | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
3906cdf0e10cSrcweir          | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
3907cdf0e10cSrcweir          | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
3908cdf0e10cSrcweir-         | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
3909cdf0e10cSrcweir+         | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
3910cdf0e10cSrcweir+         | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
3911cdf0e10cSrcweir+         | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
3912cdf0e10cSrcweir    # Remember, each alternative MUST END IN *, to match a version number.
3913cdf0e10cSrcweir        ;;
3914cdf0e10cSrcweir    -qnx*)
3915cdf0e10cSrcweir@@ -1129,16 +1321,21 @@
3916cdf0e10cSrcweir            ;;
3917cdf0e10cSrcweir        esac
3918cdf0e10cSrcweir        ;;
3919cdf0e10cSrcweir+   -nto-qnx*)
3920cdf0e10cSrcweir+       ;;
3921cdf0e10cSrcweir    -nto*)
3922cdf0e10cSrcweir-       os=-nto-qnx
3923cdf0e10cSrcweir+       os=`echo $os | sed -e 's|nto|nto-qnx|'`
3924cdf0e10cSrcweir        ;;
3925cdf0e10cSrcweir    -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
3926cdf0e10cSrcweir-         | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
3927cdf0e10cSrcweir+         | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
3928cdf0e10cSrcweir          | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
3929cdf0e10cSrcweir        ;;
3930cdf0e10cSrcweir    -mac*)
3931cdf0e10cSrcweir        os=`echo $os | sed -e 's|mac|macos|'`
3932cdf0e10cSrcweir        ;;
3933cdf0e10cSrcweir+   -linux-dietlibc)
3934cdf0e10cSrcweir+       os=-linux-dietlibc
3935cdf0e10cSrcweir+       ;;
3936cdf0e10cSrcweir    -linux*)
3937cdf0e10cSrcweir        os=`echo $os | sed -e 's|linux|linux-gnu|'`
3938cdf0e10cSrcweir        ;;
3939cdf0e10cSrcweir@@ -1151,6 +1348,9 @@
3940cdf0e10cSrcweir    -opened*)
3941cdf0e10cSrcweir        os=-openedition
3942cdf0e10cSrcweir        ;;
3943cdf0e10cSrcweir+        -os400*)
3944cdf0e10cSrcweir+       os=-os400
3945cdf0e10cSrcweir+       ;;
3946cdf0e10cSrcweir    -wince*)
3947cdf0e10cSrcweir        os=-wince
3948cdf0e10cSrcweir        ;;
3949cdf0e10cSrcweir@@ -1172,6 +1372,9 @@
3950cdf0e10cSrcweir    -atheos*)
3951cdf0e10cSrcweir        os=-atheos
3952cdf0e10cSrcweir        ;;
3953cdf0e10cSrcweir+   -syllable*)
3954cdf0e10cSrcweir+       os=-syllable
3955cdf0e10cSrcweir+       ;;
3956cdf0e10cSrcweir    -386bsd)
3957cdf0e10cSrcweir        os=-bsd
3958cdf0e10cSrcweir        ;;
3959cdf0e10cSrcweir@@ -1194,6 +1397,9 @@
3960cdf0e10cSrcweir    -sinix*)
3961cdf0e10cSrcweir        os=-sysv4
3962cdf0e10cSrcweir        ;;
3963cdf0e10cSrcweir+        -tpf*)
3964cdf0e10cSrcweir+       os=-tpf
3965cdf0e10cSrcweir+       ;;
3966cdf0e10cSrcweir    -triton*)
3967cdf0e10cSrcweir        os=-sysv3
3968cdf0e10cSrcweir        ;;
3969cdf0e10cSrcweir@@ -1224,6 +1430,20 @@
3970cdf0e10cSrcweir    -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
3971cdf0e10cSrcweir        os=-mint
3972cdf0e10cSrcweir        ;;
3973cdf0e10cSrcweir+   -aros*)
3974cdf0e10cSrcweir+       os=-aros
3975cdf0e10cSrcweir+       ;;
3976cdf0e10cSrcweir+   -kaos*)
3977cdf0e10cSrcweir+       os=-kaos
3978cdf0e10cSrcweir+       ;;
3979cdf0e10cSrcweir+   -zvmoe)
3980cdf0e10cSrcweir+       os=-zvmoe
3981cdf0e10cSrcweir+       ;;
3982cdf0e10cSrcweir+   -dicos*)
3983cdf0e10cSrcweir+       os=-dicos
3984cdf0e10cSrcweir+       ;;
3985cdf0e10cSrcweir+        -nacl*)
3986cdf0e10cSrcweir+           ;;
3987cdf0e10cSrcweir    -none)
3988cdf0e10cSrcweir        ;;
3989cdf0e10cSrcweir    *)
3990cdf0e10cSrcweir@@ -1246,6 +1466,12 @@
3991cdf0e10cSrcweir # system, and we'll never get to this point.
3992cdf0e10cSrcweir
3993cdf0e10cSrcweir case $basic_machine in
3994cdf0e10cSrcweir+        score-*)
3995cdf0e10cSrcweir+       os=-elf
3996cdf0e10cSrcweir+       ;;
3997cdf0e10cSrcweir+        spu-*)
3998cdf0e10cSrcweir+       os=-elf
3999cdf0e10cSrcweir+       ;;
4000cdf0e10cSrcweir    *-acorn)
4001cdf0e10cSrcweir        os=-riscix1.2
4002cdf0e10cSrcweir        ;;
4003cdf0e10cSrcweir@@ -1255,6 +1481,9 @@
4004cdf0e10cSrcweir    arm*-semi)
4005cdf0e10cSrcweir        os=-aout
4006cdf0e10cSrcweir        ;;
4007cdf0e10cSrcweir+        c4x-* | tic4x-*)
4008cdf0e10cSrcweir+           os=-coff
4009cdf0e10cSrcweir+       ;;
4010cdf0e10cSrcweir    # This must come before the *-dec entry.
4011cdf0e10cSrcweir    pdp10-*)
4012cdf0e10cSrcweir        os=-tops20
4013cdf0e10cSrcweir@@ -1280,6 +1509,9 @@
4014cdf0e10cSrcweir    m68*-cisco)
4015cdf0e10cSrcweir        os=-aout
4016cdf0e10cSrcweir        ;;
4017cdf0e10cSrcweir+        mep-*)
4018cdf0e10cSrcweir+       os=-elf
4019cdf0e10cSrcweir+       ;;
4020cdf0e10cSrcweir    mips*-cisco)
4021cdf0e10cSrcweir        os=-elf
4022cdf0e10cSrcweir        ;;
4023cdf0e10cSrcweir@@ -1298,9 +1530,15 @@
4024cdf0e10cSrcweir    *-be)
4025cdf0e10cSrcweir        os=-beos
4026cdf0e10cSrcweir        ;;
4027cdf0e10cSrcweir+   *-haiku)
4028cdf0e10cSrcweir+       os=-haiku
4029cdf0e10cSrcweir+       ;;
4030cdf0e10cSrcweir    *-ibm)
4031cdf0e10cSrcweir        os=-aix
4032cdf0e10cSrcweir        ;;
4033cdf0e10cSrcweir+       *-knuth)
4034cdf0e10cSrcweir+       os=-mmixware
4035cdf0e10cSrcweir+       ;;
4036cdf0e10cSrcweir    *-wec)
4037cdf0e10cSrcweir        os=-proelf
4038cdf0e10cSrcweir        ;;
4039cdf0e10cSrcweir@@ -1403,7 +1641,7 @@
4040cdf0e10cSrcweir            -sunos*)
4041cdf0e10cSrcweir                vendor=sun
4042cdf0e10cSrcweir                ;;
4043cdf0e10cSrcweir-           -aix*)
4044cdf0e10cSrcweir+           -cnk*|-aix*)
4045cdf0e10cSrcweir                vendor=ibm
4046cdf0e10cSrcweir                ;;
4047cdf0e10cSrcweir            -beos*)
4048cdf0e10cSrcweir@@ -1433,9 +1671,15 @@
4049cdf0e10cSrcweir            -mvs* | -opened*)
4050cdf0e10cSrcweir                vendor=ibm
4051cdf0e10cSrcweir                ;;
4052cdf0e10cSrcweir+           -os400*)
4053cdf0e10cSrcweir+               vendor=ibm
4054cdf0e10cSrcweir+               ;;
4055cdf0e10cSrcweir            -ptx*)
4056cdf0e10cSrcweir                vendor=sequent
4057cdf0e10cSrcweir                ;;
4058cdf0e10cSrcweir+           -tpf*)
4059cdf0e10cSrcweir+               vendor=ibm
4060cdf0e10cSrcweir+               ;;
4061cdf0e10cSrcweir            -vxsim* | -vxworks* | -windiss*)
4062cdf0e10cSrcweir                vendor=wrs
4063cdf0e10cSrcweir                ;;
4064cdf0e10cSrcweir@@ -1460,7 +1704,7 @@
4065cdf0e10cSrcweir esac
4066cdf0e10cSrcweir
4067cdf0e10cSrcweir echo $basic_machine$os
4068cdf0e10cSrcweir-exit 0
4069cdf0e10cSrcweir+exit
4070cdf0e10cSrcweir
4071cdf0e10cSrcweir # Local variables:
4072cdf0e10cSrcweir # eval: (add-hook 'write-file-hooks 'time-stamp)
4073