OSDN Git Service

* Makefile.in (TARGET_TOOLPREFIX): No longer define.
[pf3gnuchains/gcc-fork.git] / gcc / configure.in
1 # configure.in for GNU CC
2 # Process this file with autoconf to generate a configuration script.
3
4 # Copyright (C) 1997, 1998 Free Software Foundation, Inc.
5
6 #This file is part of GNU CC.
7
8 #GNU CC is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
11 #any later version.
12
13 #GNU CC is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #GNU General Public License for more details.
17
18 #You should have received a copy of the GNU General Public License
19 #along with GNU CC; see the file COPYING.  If not, write to
20 #the Free Software Foundation, 59 Temple Place - Suite 330,
21 #Boston, MA 02111-1307, USA.
22
23 # Initialization and defaults
24 AC_INIT(tree.c)
25 AC_CONFIG_HEADER(auto-host.h:config.in)
26
27 remove=rm
28 hard_link=ln
29 symbolic_link='ln -s'
30 copy=cp
31
32 # Check for additional parameters
33
34 # With GNU ld
35 AC_ARG_WITH(gnu-ld,
36 [  --with-gnu-ld           arrange to work with GNU ld.],
37 gnu_ld_flag="$with_gnu_ld",
38 gnu_ld_flag=no)
39
40 # With GNU as
41 AC_ARG_WITH(gnu-as,
42 [  --with-gnu-as           arrange to work with GNU as.],
43 gas_flag="$with_gnu_as",
44 gas_flag=no)
45
46 # With stabs
47 AC_ARG_WITH(stabs,
48 [  --with-stabs            arrange to use stabs instead of host debug format.],
49 stabs="$with_stabs",
50 stabs=no)
51
52 # With ELF
53 AC_ARG_WITH(elf,
54 [  --with-elf              arrange to use ELF instead of host debug format.],
55 elf="$with_elf",
56 elf=no)
57
58 # Specify the local prefix
59 AC_ARG_WITH(local-prefix,
60 [  --with-local-prefix=DIR specifies directory to put local include.],
61 local_prefix=$with_local_prefix,
62 local_prefix=/usr/local)
63
64 # Default local prefix if it is empty
65 if [[ x$local_prefix = x ]]; then
66         local_prefix=/usr/local
67 fi
68
69 # Specify the g++ header file directory
70 AC_ARG_WITH(gxx-include-dir,
71 [  --with-gxx-include-dir=DIR
72                           specifies directory to put g++ header files.],
73 gxx_include_dir=$with_gxx_include_dir,
74 gxx_include_dir='${prefix}/include/g++')
75
76 # Default g++ header file directory if it is empty
77 if [[ x$gxx_include_dir = x ]]; then
78         gxx_include_dir='${prefix}/include/g++'
79 fi
80
81 # Enable expensive internal checks
82 AC_ARG_ENABLE(checking,
83 [  --enable-checking       enable expensive run-time checks.],
84 AC_DEFINE(ENABLE_CHECKING)  
85 )
86
87 # Enable use of cpplib for C.
88 AC_ARG_ENABLE(c-cpplib,
89 [  --enable-c-cpplib       Use cpplib for C.],
90 if [[[ x$enable_c_cpplib != xno ]]]; then
91   extra_c_objs="${extra_c_objs} cpplib.o cppexp.o cpphash.o cpperror.o"
92   extra_c_flags=-DUSE_CPPLIB=1
93 fi)
94   
95 # Enable Haifa scheduler.
96 AC_ARG_ENABLE(haifa,
97 [  --enable-haifa          Use the experimental scheduler.
98   --disable-haifa         Don't use the experimental scheduler for the
99                           targets which normally enable it.])
100 # Fast fixincludes
101 #
102 # This is a work in progress...
103 AC_ARG_WITH(fast-fixincludes,
104 [  --with-fast-fixincludes    Use a faster fixinclude program.  Experimental],
105 fast_fixinc="$with_fast_fixincludes",
106 fast_fixinc=no)
107
108 # Enable threads
109 # Pass with no value to take the default
110 # Pass with a value to specify a thread package
111 AC_ARG_ENABLE(threads,
112 [  --enable-threads        enable thread usage for target GCC.
113   --enable-threads=LIB    use LIB thread package for target GCC.],
114 if [[[ x$enable_threads = xno ]]]; then
115         enable_threads=''
116 fi,
117 enable_threads='')
118
119 enable_threads_flag=$enable_threads
120 # Check if a valid thread package
121 case x${enable_threads_flag} in
122         x | xno)
123                 # No threads
124                 target_thread_file='single'
125                 ;;
126         xyes)
127                 # default
128                 target_thread_file=''
129                 ;;
130         xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
131         xsolaris | xwin32 | xdce | xvxworks)
132                 target_thread_file=$enable_threads_flag
133                 ;;
134         *)
135                 echo "$enable_threads is an unknown thread package" 1>&2
136                 exit 1
137                 ;;
138 esac
139
140 # Determine the host, build, and target systems
141 AC_CANONICAL_SYSTEM
142
143 # Find the native compiler
144 AC_PROG_CC
145 AC_PROG_MAKE_SET
146
147 # Find some useful tools
148 AC_PROG_AWK
149 AC_PROG_LEX
150 GCC_PROG_LN
151 GCC_PROG_LN_S
152 GCC_C_VOLATILE
153 AC_PROG_RANLIB
154 AC_PROG_YACC
155 EGCS_PROG_INSTALL
156
157 AC_HEADER_STDC
158 AC_HEADER_TIME
159 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h wait.h sys/wait.h)
160
161 # Check for thread headers.
162 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
163 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
164
165 # See if the system preprocessor understands the ANSI C preprocessor
166 # stringification operator.
167 AC_MSG_CHECKING(whether cpp understands the stringify operator)
168 AC_CACHE_VAL(gcc_cv_c_have_stringify,
169 [AC_TRY_COMPILE(,
170 [#define S(x)   #x
171 char *test = S(foo);],
172 gcc_cv_c_have_stringify=yes, gcc_cv_c_have_stringify=no)])
173 AC_MSG_RESULT($gcc_cv_c_have_stringify)
174 if test $gcc_cv_c_have_stringify = yes; then
175   AC_DEFINE(HAVE_CPP_STRINGIFY)
176 fi
177
178 # Use <inttypes.h> only if it exists,
179 # doesn't clash with <sys/types.h>, and declares intmax_t.
180 AC_MSG_CHECKING(for inttypes.h)
181 AC_CACHE_VAL(gcc_cv_header_inttypes_h,
182 [AC_TRY_COMPILE(
183   [#include <sys/types.h>
184 #include <inttypes.h>],
185   [intmax_t i = -1;],
186   [AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H)
187    gcc_cv_header_inttypes_h=yes],
188   gcc_cv_header_inttypes_h=no)])
189 AC_MSG_RESULT($gcc_cv_header_inttypes_h)
190
191 AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \
192         index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \
193         sysconf isascii)
194
195 GCC_FUNC_VFPRINTF_DOPRNT
196 GCC_FUNC_PRINTF_PTR
197
198 GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
199         index rindex getenv atol sbrk abort atof)
200
201 AC_DECL_SYS_SIGLIST
202
203 # File extensions
204 manext='.1'
205 objext='.o'
206 AC_SUBST(manext)
207 AC_SUBST(objext)
208
209 build_xm_file=
210 build_xm_defines=
211 build_install_headers_dir=install-headers-tar
212 build_exeext=
213 host_xm_file=
214 host_xm_defines=
215 host_xmake_file=
216 host_truncate_target=
217 host_exeext=
218
219 # Decode the host machine, then the target machine.
220 # For the host machine, we save the xm_file variable as host_xm_file;
221 # then we decode the target machine and forget everything else
222 # that came from the host machine.
223 for machine in $build $host $target; do
224
225         out_file=
226         xmake_file=
227         tmake_file=
228         extra_headers=
229         extra_passes=
230         extra_parts=
231         extra_programs=
232         extra_objs=
233         extra_host_objs=
234         extra_gcc_objs=
235         xm_defines=
236         float_format=
237         # Set this to force installation and use of collect2.
238         use_collect2=
239         # Set this to override the default target model.
240         target_cpu_default=
241         # Set this to control which fixincludes program to use.
242         if [[ x$fast_fixinc != xyes ]] ; then
243                 fixincludes=fixincludes
244         else fixincludes=fixinc.sh ; fi
245         # Set this to control how the header file directory is installed.
246         install_headers_dir=install-headers-tar
247         # Set this to a non-empty list of args to pass to cpp if the target
248         # wants its .md file passed through cpp.
249         md_cppflags=
250         # Set this if directory names should be truncated to 14 characters.
251         truncate_target=
252         # Set this if gdb needs a dir command with `dirname $out_file`
253         gdb_needs_out_file_path=
254         # Set this if the build machine requires executables to have a
255         # file name suffix.
256         exeext=
257         # Set this to control which thread package will be used.
258         thread_file=
259         # Reinitialize these from the flag values every loop pass, since some
260         # configure entries modify them.
261         gas="$gas_flag"
262         gnu_ld="$gnu_ld_flag"
263         enable_threads=$enable_threads_flag
264
265         # Set default cpu_type, tm_file and xm_file so it can be updated in
266         # each machine entry.
267         cpu_type=`echo $machine | sed 's/-.*$//'`
268         case $machine in
269         alpha*-*-*)
270                 cpu_type=alpha
271                 ;;
272         arm*-*-*)
273                 cpu_type=arm
274                 ;;
275         c*-convex-*)
276                 cpu_type=convex
277                 ;;
278         i[[34567]]86-*-*)
279                 cpu_type=i386
280                 ;;
281         hppa*-*-*)
282                 cpu_type=pa
283                 ;;
284         m68000-*-*)
285                 cpu_type=m68k
286                 ;;
287         mips*-*-*)
288                 cpu_type=mips
289                 ;;
290         powerpc*-*-*)
291                 cpu_type=rs6000
292                 ;;
293         pyramid-*-*)
294                 cpu_type=pyr
295                 ;;
296         sparc*-*-*)
297                 cpu_type=sparc
298                 ;;
299         esac
300
301         tm_file=${cpu_type}/${cpu_type}.h
302         xm_file=${cpu_type}/xm-${cpu_type}.h
303         
304         # Set the default macros to define for GNU/Linux systems.
305         case $machine in
306         *-*-linux-gnu*)
307                 xm_defines="HAVE_ATEXIT POSIX NO_STAB_H BSTRING"
308                 ;;
309         esac
310
311         case $machine in
312         # Support site-specific machine types.
313         *local*)
314                 cpu_type=`echo $machine | sed -e 's/-.*//'`
315                 rest=`echo $machine | sed -e "s/$cpu_type-//"`
316                 xm_file=${cpu_type}/xm-$rest.h
317                 tm_file=${cpu_type}/$rest.h
318                 if [[ -f $srcdir/config/${cpu_type}/x-$rest ]] ; \
319                 then xmake_file=${cpu_type}/x-$rest; \
320                 else true; \
321                 fi
322                 if [[ -f $srcdir/config/${cpu_type}/t-$rest ]] ; \
323                 then tmake_file=${cpu_type}/t-$rest; \
324                 else true; \
325                 fi
326                 ;;
327         1750a-*-*)
328                 ;;
329         a29k-*-bsd* | a29k-*-sym1*)
330                 tm_file="${tm_file} a29k/unix.h"
331                 xm_defines=USG
332                 xmake_file=a29k/x-unix
333                 use_collect2=yes
334                 ;;
335         a29k-*-udi | a29k-*-coff)
336                 tm_file="${tm_file} dbxcoff.h a29k/udi.h"
337                 tmake_file=a29k/t-a29kbare
338                 ;;
339         a29k-wrs-vxworks*)
340                 tm_file="${tm_file} dbxcoff.h a29k/udi.h a29k/vx29k.h"
341                 tmake_file=a29k/t-vx29k
342                 extra_parts="crtbegin.o crtend.o"
343                 thread_file='vxworks'
344                 ;;
345         a29k-*-*)                       # Default a29k environment.
346                 use_collect2=yes
347                 ;;
348         alpha*-*-linux-gnuecoff*)
349                 tm_file="${tm_file} alpha/linux-ecoff.h alpha/linux.h"
350                 target_cpu_default="MASK_GAS"
351                 gas=no
352                 xmake_file=none
353                 gas=yes gnu_ld=yes
354                 ;;
355         alpha*-*-linux-gnulibc1*)
356                 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
357                 target_cpu_default="MASK_GAS"
358                 tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe"
359                 extra_parts="crtbegin.o crtend.o"
360                 fixincludes=fixinc.wrap
361                 xmake_file=none
362                 gas=yes gnu_ld=yes
363                 if [[ x$enable_threads = xyes ]]; then
364                         thread_file='posix'
365                 fi
366                 ;;
367         alpha*-*-linux-gnu*)
368                 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
369                 target_cpu_default="MASK_GAS"
370                 tmake_file="t-linux alpha/t-linux alpha/t-crtbe"
371                 extra_parts="crtbegin.o crtend.o"
372                 xmake_file=none
373                 fixincludes=Makefile.in
374                 gas=yes gnu_ld=yes
375                 if [[ x$enable_threads = xyes ]]; then
376                         thread_file='posix'
377                 fi
378                 ;;
379         alpha*-*-netbsd*)
380                 tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsdl-elf.h"
381                 target_cpu_default="MASK_GAS"
382                 tmake_file="alpha/t-crtbe"
383                 extra_parts="crtbegin.o crtend.o"
384                 xmake_file=none
385                 fixincludes=fixinc.wrap
386                 gas=yes gnu_ld=yes
387                 ;;
388                 
389         alpha*-dec-osf*)
390                 if [[ x$stabs = xyes ]]
391                 then
392                         tm_file="${tm_file} dbx.h"
393                 fi
394                 if [[ x$gas != xyes ]]
395                 then
396                         extra_passes="mips-tfile mips-tdump"
397                 fi
398                 use_collect2=yes
399                 case $machine in
400                   *-*-osf1*)
401                     tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h"
402                     ;;
403                   *-*-osf[[23]]*)
404                     tm_file="${tm_file} alpha/osf.h alpha/osf2or3.h"
405                     ;;
406                   *-*-osf4*)
407                     tm_file="${tm_file} alpha/osf.h"
408                     # Some versions of OSF4 (specifically X4.0-9 296.7) have
409                     # a broken tar, so we use cpio instead.
410                     install_headers_dir=install-headers-cpio
411                     ;;
412                 esac
413                 case $machine in
414                   *-*-osf4.0[[b-z]] | *-*-osf4.[[1-9]]*)
415                     target_cpu_default=MASK_SUPPORT_ARCH
416                     ;;
417                 esac
418                 ;;
419         alpha*-*-winnt*)
420                 tm_file="${tm_file} alpha/win-nt.h"
421                 xm_file="${xm_file} config/winnt/xm-winnt.h alpha/xm-winnt.h"
422                 tmake_file=t-libc-ok
423                 xmake_file=winnt/x-winnt
424                 extra_host_objs=oldnames.o
425                 extra_gcc_objs="spawnv.o oldnames.o"
426                 fixincludes=fixinc.winnt
427                 if [[ x$gnu_ld != xyes ]]
428                 then
429                         extra_programs=ld.exe
430                 fi
431                 if [[ x$enable_threads = xyes ]]; then
432                         thread_file='win32'
433                 fi
434                 ;;
435         alpha*-dec-vms*)
436                 tm_file=alpha/vms.h
437                 xm_file="${xm_file} alpha/xm-vms.h"
438                 tmake_file=alpha/t-vms
439                 fixincludes=Makefile.in
440                 ;;
441         arc-*-elf*)
442                 extra_parts="crtinit.o crtfini.o"
443                 ;;
444         arm-*-coff* | armel-*-coff*)
445                 tm_file=arm/coff.h
446                 tmake_file=arm/t-bare
447                 ;;
448         arm-*-riscix1.[[01]]*)          # Acorn RISC machine (early versions)
449                 tm_file=arm/riscix1-1.h
450                 use_collect2=yes
451                 ;;
452         arm-*-riscix*)                  # Acorn RISC machine
453                 if [[ x$gas = xyes ]]
454                 then
455                     tm_file=arm/rix-gas.h
456                 else
457                     tm_file=arm/riscix.h
458                 fi
459                 xmake_file=arm/x-riscix
460                 tmake_file=arm/t-riscix
461                 use_collect2=yes
462                 ;;
463         arm-semi-aout | armel-semi-aout)
464                 tm_file=arm/semi.h
465                 tmake_file=arm/t-semi
466                 fixincludes=Makefile.in # There is nothing to fix
467                 ;;
468         arm-semi-aof | armel-semi-aof)
469                 tm_file=arm/semiaof.h
470                 tmake_file=arm/t-semiaof
471                 fixincludes=Makefile.in # There is nothing to fix
472                 ;;
473         arm-*-netbsd*)
474                 tm_file=arm/netbsd.h
475                 xm_file="xm-siglist.h ${xm_file}"
476                 tmake_file="t-netbsd arm/t-netbsd"
477                 # On NetBSD, the headers are already okay, except for math.h.
478                 fixincludes=fixinc.wrap
479                 ;;
480         arm-*-linux-gnuaout*)           # ARM GNU/Linux
481                 cpu_type=arm
482                 xmake_file=x-linux
483                 tm_file=arm/linux-gas.h
484                 tmake_file=arm/t-linux
485                 fixincludes=Makefile.in
486                 gnu_ld=yes
487                 ;;
488         arm-*-aout)
489                 tm_file=arm/aout.h
490                 tmake_file=arm/t-bare
491                 ;;
492         c1-convex-*)                    # Convex C1
493                 target_cpu_default=1
494                 use_collect2=yes
495                 fixincludes=Makefile.in
496                 ;;
497         c2-convex-*)                    # Convex C2
498                 target_cpu_default=2
499                 use_collect2=yes
500                 fixincludes=Makefile.in
501                 ;;
502         c32-convex-*)
503                 target_cpu_default=4
504                 use_collect2=yes
505                 fixincludes=Makefile.in
506                 ;;
507         c34-convex-*)
508                 target_cpu_default=8
509                 use_collect2=yes
510                 fixincludes=Makefile.in
511                 ;;
512         c38-convex-*)
513                 target_cpu_default=16           
514                 use_collect2=yes
515                 fixincludes=Makefile.in
516                 ;;
517         clipper-intergraph-clix*)
518                 tm_file="${tm_file} svr3.h clipper/clix.h"
519                 xm_file=clipper/xm-clix.h
520                 xmake_file=clipper/x-clix
521                 extra_headers=va-clipper.h
522                 extra_parts="crtbegin.o crtend.o"
523                 install_headers_dir=install-headers-cpio
524                 ;;
525         dsp16xx-*)
526                 ;;
527         elxsi-elxsi-*)
528                 use_collect2=yes
529                 ;;
530 # This hasn't been upgraded to GCC 2.
531 #       fx80-alliant-*)                 # Alliant FX/80
532 #               ;;
533         h8300-*-*)
534                 float_format=i32
535                 ;;
536         hppa1.1-*-pro*)
537                 tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h"
538                 xm_file=pa/xm-papro.h
539                 tmake_file=pa/t-pro
540                 ;;
541         hppa1.1-*-osf*)
542                 target_cpu_default=1
543                 tm_file="${tm_file} pa/pa-osf.h"
544                 use_collect2=yes
545                 fixincludes=Makefile.in
546                 ;;
547         hppa1.1-*-rtems*)
548                 tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h pa/rtems.h"
549                 xm_file=pa/xm-papro.h
550                 tmake_file=pa/t-pro
551                 ;;
552         hppa1.0-*-osf*)
553                 tm_file="${tm_file} pa/pa-osf.h"
554                 use_collect2=yes
555                 fixincludes=Makefile.in
556                 ;;
557         hppa1.1-*-bsd*)
558                 target_cpu_default=1
559                 use_collect2=yes
560                 fixincludes=Makefile.in
561                 ;;
562         hppa1.0-*-bsd*)
563                 use_collect2=yes
564                 fixincludes=Makefile.in
565                 ;;
566         hppa1.0-*-hpux7*)
567                 tm_file="pa/pa-oldas.h ${tm_file} pa/pa-hpux7.h"
568                 xm_file=pa/xm-pahpux.h
569                 xmake_file=pa/x-pa-hpux
570                 if [[ x$gas = xyes ]]
571                 then
572                         tm_file="${tm_file} pa/gas.h"
573                 fi
574                 install_headers_dir=install-headers-cpio
575                 use_collect2=yes
576                 ;;
577         hppa1.0-*-hpux8.0[[0-2]]*)
578                 tm_file="${tm_file} pa/pa-hpux.h"
579                 xm_file=pa/xm-pahpux.h
580                 xmake_file=pa/x-pa-hpux
581                 if [[ x$gas = xyes ]]
582                 then
583                         tm_file="${tm_file} pa/pa-gas.h"
584                 else
585                         tm_file="pa/pa-oldas.h ${tm_file}"
586                 fi
587                 install_headers_dir=install-headers-cpio
588                 use_collect2=yes
589                 ;;
590         hppa1.1-*-hpux8.0[[0-2]]*)
591                 target_cpu_default=1
592                 tm_file="${tm_file} pa/pa-hpux.h"
593                 xm_file=pa/xm-pahpux.h
594                 xmake_file=pa/x-pa-hpux
595                 if [[ x$gas = xyes ]]
596                 then
597                         tm_file="${tm_file} pa/pa-gas.h"
598                 else
599                         tm_file="pa/pa-oldas.h ${tm_file}"
600                 fi
601                 install_headers_dir=install-headers-cpio
602                 use_collect2=yes
603                 ;;
604         hppa1.1-*-hpux8*)
605                 target_cpu_default=1
606                 tm_file="${tm_file} pa/pa-hpux.h"
607                 xm_file=pa/xm-pahpux.h
608                 xmake_file=pa/x-pa-hpux
609                 if [[ x$gas = xyes ]]
610                 then
611                         tm_file="${tm_file} pa/pa-gas.h"
612                 fi
613                 install_headers_dir=install-headers-cpio
614                 use_collect2=yes
615                 ;;
616         hppa1.0-*-hpux8*)
617                 tm_file="${tm_file} pa/pa-hpux.h"
618                 xm_file=pa/xm-pahpux.h
619                 xmake_file=pa/x-pa-hpux
620                 if [[ x$gas = xyes ]]
621                 then
622                         tm_file="${tm_file} pa/pa-gas.h"
623                 fi
624                 install_headers_dir=install-headers-cpio
625                 use_collect2=yes
626                 ;;
627         hppa1.1-*-hpux10*)
628                 target_cpu_default=1
629                 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h"
630                 xm_file=pa/xm-pahpux.h
631                 xmake_file=pa/x-pa-hpux
632                 tmake_file=pa/t-pa
633                 if [[ x$gas = xyes ]]
634                 then
635                         tm_file="${tm_file} pa/pa-gas.h"
636                 fi
637                 if [[ x$enable_threads = x ]]; then
638                     enable_threads=$have_pthread_h
639                 fi
640                 if [[ x$enable_threads = xyes ]]; then
641                         thread_file='dce'
642                         tmake_file="${tmake_file} pa/t-dce-thr"
643                 fi
644                 install_headers_dir=install-headers-cpio
645                 use_collect2=yes
646                 ;;
647         hppa1.0-*-hpux10*)
648                 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h"
649                 xm_file=pa/xm-pahpux.h
650                 xmake_file=pa/x-pa-hpux
651                 if [[ x$gas = xyes ]]
652                 then
653                         tm_file="${tm_file} pa/pa-gas.h"
654                 fi
655                 if [[ x$enable_threads = x ]]; then
656                     enable_threads=$have_pthread_h
657                 fi
658                 if [[ x$enable_threads = xyes ]]; then
659                         thread_file='dce'
660                         tmake_file="${tmake_file} pa/t-dce-thr"
661                 fi
662                 install_headers_dir=install-headers-cpio
663                 use_collect2=yes
664                 ;;
665         hppa1.1-*-hpux*)
666                 target_cpu_default=1
667                 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
668                 xm_file=pa/xm-pahpux.h
669                 xmake_file=pa/x-pa-hpux
670                 if [[ x$gas = xyes ]]
671                 then
672                         tm_file="${tm_file} pa/pa-gas.h"
673                 fi
674                 install_headers_dir=install-headers-cpio
675                 use_collect2=yes
676                 ;;
677         hppa1.0-*-hpux*)
678                 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
679                 xm_file=pa/xm-pahpux.h
680                 xmake_file=pa/x-pa-hpux
681                 if [[ x$gas = xyes ]]
682                 then
683                         tm_file="${tm_file} pa/pa-gas.h"
684                 fi
685                 install_headers_dir=install-headers-cpio
686                 use_collect2=yes
687                 ;;
688         hppa1.1-*-hiux*)
689                 target_cpu_default=1
690                 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
691                 xm_file=pa/xm-pahpux.h
692                 xmake_file=pa/x-pa-hpux
693                 if [[ x$gas = xyes ]]
694                 then
695                         tm_file="${tm_file} pa/pa-gas.h"
696                 fi
697                 install_headers_dir=install-headers-cpio
698                 use_collect2=yes
699                 ;;
700         hppa1.0-*-hiux*)
701                 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
702                 xm_file=pa/xm-pahpux.h
703                 xmake_file=pa/x-pa-hpux
704                 if [[ x$gas = xyes ]]
705                 then
706                         tm_file="${tm_file} pa/pa-gas.h"
707                 fi
708                 install_headers_dir=install-headers-cpio
709                 use_collect2=yes
710                 ;;
711         hppa*-*-lites*)
712                 target_cpu_default=1
713                 use_collect2=yes
714                 fixincludes=Makefile.in
715                 ;;
716         i370-*-mvs*)
717                 ;;
718         i[[34567]]86-ibm-aix*)          # IBM PS/2 running AIX
719                 if [[ x$gas = xyes ]]
720                 then
721                         tm_file=i386/aix386.h
722                         extra_parts="crtbegin.o crtend.o"
723                         tmake_file=i386/t-crtstuff
724                 else
725                         tm_file=i386/aix386ng.h
726                         use_collect2=yes
727                 fi
728                 xm_file="xm-alloca.h i386/xm-aix.h ${xm_file}"
729                 xm_defines=USG
730                 xmake_file=i386/x-aix
731                 ;;
732         i[[34567]]86-ncr-sysv4*)        # NCR 3000 - ix86 running system V.4
733                 xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
734                 xm_defines="USG POSIX SMALL_ARG_MAX"
735                 xmake_file=i386/x-ncr3000
736                 if [[ x$stabs = xyes -a x$gas = xyes ]]
737                 then
738                         tm_file=i386/sysv4gdb.h
739                 else
740                         tm_file=i386/sysv4.h
741                 fi
742                 extra_parts="crtbegin.o crtend.o"
743                 tmake_file=i386/t-crtpic
744                 ;;
745         i[[34567]]86-next-*)
746                 tm_file=i386/next.h
747                 xm_file=i386/xm-next.h
748                 tmake_file=i386/t-next
749                 xmake_file=i386/x-next
750                 extra_objs=nextstep.o
751                 if [[ x$enable_threads = xyes ]]; then
752                         thread_file='mach'
753                 fi
754                 ;;
755         i[[34567]]86-sequent-bsd*)              # 80386 from Sequent
756                 use_collect2=yes
757                 if [[ x$gas = xyes ]]
758                 then
759                         tm_file=i386/seq-gas.h
760                 else
761                         tm_file=i386/sequent.h
762                 fi
763                 ;;
764         i[[34567]]86-sequent-ptx1*)
765                 xm_defines="USG SVR3"
766                 xmake_file=i386/x-sysv3
767                 tm_file=i386/seq-sysv3.h
768                 tmake_file=i386/t-crtstuff
769                 fixincludes=fixinc.ptx
770                 extra_parts="crtbegin.o crtend.o"
771                 install_headers_dir=install-headers-cpio
772                 ;;
773         i[[34567]]86-sequent-ptx2* | i[[34567]]86-sequent-sysv3*)
774                 xm_defines="USG SVR3"
775                 xmake_file=i386/x-sysv3
776                 tm_file=i386/seq2-sysv3.h
777                 tmake_file=i386/t-crtstuff
778                 extra_parts="crtbegin.o crtend.o"
779                 fixincludes=fixinc.ptx
780                 install_headers_dir=install-headers-cpio
781                 ;;
782         i[[34567]]86-sequent-ptx4* | i[[34567]]86-sequent-sysv4*)
783                 xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
784                 xm_defines="USG POSIX SMALL_ARG_MAX"
785                 xmake_file=x-svr4
786                 tm_file=i386/ptx4-i.h
787                 tmake_file=t-svr4
788                 extra_parts="crtbegin.o crtend.o"
789                 fixincludes=fixinc.ptx
790                 install_headers_dir=install-headers-cpio
791                 ;;
792         i386-sun-sunos*)                # Sun i386 roadrunner
793                 xm_defines=USG
794                 tm_file=i386/sun.h
795                 use_collect2=yes
796                 ;;
797         i[[34567]]86-wrs-vxworks*)
798                 tm_file=i386/vxi386.h
799                 tmake_file=i386/t-i386bare
800                 ;;
801         i[[34567]]86-*-aout*)
802                 tm_file=i386/i386-aout.h
803                 tmake_file=i386/t-i386bare
804                 ;;
805         i[[34567]]86-*-bsdi* | i[[34567]]86-*-bsd386*)
806                 tm_file=i386/bsd386.h
807 #               tmake_file=t-libc-ok
808                 ;;
809         i[[34567]]86-*-bsd*)
810                 tm_file=i386/386bsd.h
811 #               tmake_file=t-libc-ok
812 # Next line turned off because both 386BSD and BSD/386 use GNU ld.
813 #               use_collect2=yes
814                 ;;
815         i[[34567]]86-*-freebsdelf*)
816                 tm_file="i386/i386.h i386/att.h linux.h i386/freebsd-elf.h i386/perform.h"
817                 # On FreeBSD, the headers are already ok, except for math.h.
818                 fixincludes=fixinc.wrap
819                 tmake_file=i386/t-freebsd
820                 gas=yes
821                 gnu_ld=yes
822                 stabs=yes
823                 ;;
824         i[[34567]]86-*-freebsd*)
825                 tm_file=i386/freebsd.h
826                 # On FreeBSD, the headers are already ok, except for math.h.
827                 fixincludes=fixinc.wrap
828                 tmake_file=i386/t-freebsd
829                 ;;
830         i[[34567]]86-*-netbsd*)
831                 tm_file=i386/netbsd.h
832                 # On NetBSD, the headers are already okay, except for math.h.
833                 fixincludes=fixinc.wrap
834                 tmake_file=t-netbsd
835                 ;;
836         i[[34567]]86-*-coff*)
837                 tm_file=i386/i386-coff.h
838                 tmake_file=i386/t-i386bare
839                 ;;
840         i[[34567]]86-*-isc*)            # 80386 running ISC system
841                 xm_file="${xm_file} i386/xm-isc.h"
842                 xm_defines="USG SVR3"
843                 case $machine in
844                   i[[34567]]86-*-isc[[34]]*)
845                     xmake_file=i386/x-isc3
846                     ;;
847                   *)
848                     xmake_file=i386/x-isc
849                     ;;
850                 esac
851                 if [[ x$gas = xyes -a x$stabs = xyes ]]
852                 then
853                         tm_file=i386/iscdbx.h
854                         tmake_file=i386/t-svr3dbx
855                         extra_parts="svr3.ifile svr3z.ifile"
856                 else
857                         tm_file=i386/isccoff.h
858                         tmake_file=i386/t-crtstuff
859                         extra_parts="crtbegin.o crtend.o"
860                 fi
861                 install_headers_dir=install-headers-cpio
862                 ;;
863         i[[34567]]86-*-linux-gnuoldld*) # Intel 80386's running GNU/Linux
864                                         # with a.out format using
865                                         # pre BFD linkers
866                 xmake_file=x-linux-aout
867                 tmake_file="t-linux-aout i386/t-crtstuff"
868                 tm_file=i386/linux-oldld.h
869                 fixincludes=Makefile.in #On Linux, the headers are ok already.
870                 gnu_ld=yes
871                 ;;
872         i[[34567]]86-*-linux-gnuaout*)  # Intel 80386's running GNU/Linux
873                                         # with a.out format
874                 xmake_file=x-linux-aout
875                 tmake_file="t-linux-aout i386/t-crtstuff"
876                 tm_file=i386/linux-aout.h
877                 fixincludes=Makefile.in #On Linux, the headers are ok already.
878                 gnu_ld=yes
879                 ;;
880         i[[34567]]86-*-linux-gnulibc1)  # Intel 80386's running GNU/Linux
881                                         # with ELF format using the
882                                         # GNU/Linux C library 5
883                 xmake_file=x-linux      
884                 tm_file=i386/linux.h    
885                 tmake_file="t-linux t-linux-gnulibc1 i386/t-crtstuff"
886                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
887                 fixincludes=Makefile.in #On Linux, the headers are ok already.
888                 gnu_ld=yes
889                 if [[ x$enable_threads = xyes ]]; then
890                         thread_file='single'
891                 fi
892                 ;;
893         i[[34567]]86-*-linux-gnu*)      # Intel 80386's running GNU/Linux
894                                         # with ELF format using glibc 2
895                                         # aka GNU/Linux C library 6
896                 xmake_file=x-linux
897                 tm_file=i386/linux.h
898                 tmake_file="t-linux i386/t-crtstuff"
899                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
900                 fixincludes=Makefile.in #On Linux, the headers are ok already.
901                 gnu_ld=yes
902                 if [[ x$enable_threads = xyes ]]; then
903                         thread_file='posix'
904                 fi
905                 ;;
906         i[[34567]]86-*-gnu*)
907                 ;;
908         i[[34567]]86-go32-msdos | i[[34567]]86-*-go32*)
909                 xm_file=i386/xm-go32.h
910                 tm_file=i386/go32.h
911                 tmake_file=i386/t-go32
912                 ;;
913         i[[34567]]86-pc-msdosdjgpp*)
914                 xm_file=i386/xm-go32.h
915                 tm_file=i386/go32.h
916                 tmake_file=i386/t-go32
917                 gnu_ld=yes
918                 gas=yes
919                 ;;
920         i[[34567]]86-moss-msdos* | i[[34567]]86-*-moss*)
921                 tm_file=i386/moss.h
922                 tmake_file=t-libc-ok
923                 fixincludes=Makefile.in
924                 gnu_ld=yes
925                 gas=yes
926                 ;;
927         i[[34567]]86-*-lynxos*)
928                 if [[ x$gas = xyes ]]
929                 then
930                         tm_file=i386/lynx.h
931                 else
932                         tm_file=i386/lynx-ng.h
933                 fi
934                 xm_file=i386/xm-lynx.h
935                 tmake_file=i386/t-i386bare
936                 xmake_file=x-lynx
937                 ;;
938         i[[34567]]86-*-mach*)
939                 tm_file=i386/mach.h
940 #               tmake_file=t-libc-ok
941                 use_collect2=yes
942                 ;;
943         i[[34567]]86-*-osfrose*)                # 386 using OSF/rose
944                 if [[ x$elf = xyes ]]
945                 then
946                         tm_file=i386/osfelf.h
947                         use_collect2=
948                 else
949                         tm_file=i386/osfrose.h
950                         use_collect2=yes
951                 fi
952                 xm_file="i386/xm-osf.h ${xm_file}"
953                 xmake_file=i386/x-osfrose
954                 tmake_file=i386/t-osf
955                 extra_objs=halfpic.o
956                 ;;
957         i[[34567]]86-go32-rtems*)
958                 cpu_type=i386
959                 xm_file=i386/xm-go32.h
960                 tm_file=i386/go32-rtems.h
961                 tmake_file="i386/t-go32 t-rtems"
962                 ;;
963         i[[34567]]86-*-rtemself*)
964                 cpu_type=i386
965                 tm_file=i386/rtemself.h
966                 tmake_file="i386/t-i386bare t-rtems"
967                 ;;
968         i[[34567]]86-*-rtems*)
969                 cpu_type=i386
970                 tm_file=i386/rtems.h
971                 tmake_file="i386/t-i386bare t-rtems"
972                 ;;
973         i[[34567]]86-*-sco3.2v5*)       # 80386 running SCO Open Server 5
974                 xm_file="xm-siglist.h xm-alloca.h ${xm_file} i386/xm-sco5.h"
975                 xm_defines="USG SVR3"
976                 xmake_file=i386/x-sco5
977                 fixincludes=fixinc.sco
978                 install_headers_dir=install-headers-cpio
979                 tm_file=i386/sco5.h
980                 tmake_file=i386/t-sco5
981                 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
982                 ;;
983         i[[34567]]86-*-sco3.2v4*)       # 80386 running SCO 3.2v4 system
984                 xm_file="${xm_file} i386/xm-sco.h"
985                 xm_defines="USG SVR3 BROKEN_LDEXP SMALL_ARG_MAX NO_SYS_SIGLIST"
986                 xmake_file=i386/x-sco4
987                 fixincludes=fixinc.sco
988                 install_headers_dir=install-headers-cpio
989                 if [[ x$stabs = xyes ]]
990                 then
991                         tm_file=i386/sco4dbx.h
992                         tmake_file=i386/t-svr3dbx
993                         extra_parts="svr3.ifile svr3z.rfile"
994                 else
995                         tm_file=i386/sco4.h
996                         tmake_file=i386/t-crtstuff
997                         extra_parts="crtbegin.o crtend.o"
998                 fi
999                 truncate_target=yes
1000                 ;;
1001         i[[34567]]86-*-sco*)            # 80386 running SCO system
1002                 xm_file=i386/xm-sco.h
1003                 xmake_file=i386/x-sco
1004                 install_headers_dir=install-headers-cpio
1005                 if [[ x$stabs = xyes ]]
1006                 then
1007                         tm_file=i386/scodbx.h
1008                         tmake_file=i386/t-svr3dbx
1009                         extra_parts="svr3.ifile svr3z.rfile"
1010                 else
1011                         tm_file=i386/sco.h
1012                         extra_parts="crtbegin.o crtend.o"
1013                         tmake_file=i386/t-crtstuff
1014                 fi
1015                 truncate_target=yes
1016                 ;;
1017         i[[34567]]86-*-solaris2*)
1018                 xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
1019                 xm_defines="USG POSIX SMALL_ARG_MAX"
1020                 if [[ x$stabs = xyes ]]
1021                 then
1022                         tm_file=i386/sol2dbg.h
1023                 else
1024                         tm_file=i386/sol2.h
1025                 fi
1026                 tmake_file=i386/t-sol2
1027                 extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
1028                 xmake_file=x-svr4
1029                 case $machine in
1030                 *-*-solaris2.[[0-4]])
1031                         fixincludes=fixinc.svr4;;
1032                 *)
1033                         fixincludes=fixinc.wrap;;
1034                 esac
1035                 if [[ x$enable_threads = xyes ]]; then
1036                         thread_file='solaris'
1037                 fi
1038                 ;;
1039        i[[34567]]86-*-sysv5*)           # Intel x86 on System V Release 5
1040                xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
1041                xm_defines="USG POSIX"
1042                tm_file=i386/sysv4.h
1043                if [[ x$stabs = xyes ]]
1044                then
1045                        tm_file="${tm_file} dbx.h"
1046                fi
1047                tmake_file=i386/t-crtpic
1048                xmake_file=x-svr4
1049                extra_parts="crtbegin.o crtend.o"
1050                fixincludes=Makefile.in # The headers are just fine, thank you.
1051                ;;
1052         i[[34567]]86-*-sysv4*)          # Intel 80386's running system V.4
1053                 xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
1054                 xm_defines="USG POSIX SMALL_ARG_MAX"
1055                 tm_file=i386/sysv4.h
1056                 if [[ x$stabs = xyes ]]
1057                 then
1058                         tm_file="${tm_file} dbx.h"
1059                 fi
1060                 tmake_file=i386/t-crtpic
1061                 xmake_file=x-svr4
1062                 extra_parts="crtbegin.o crtend.o"
1063                 ;;
1064         i[[34567]]86-*-osf1*)           # Intel 80386's running OSF/1 1.3+
1065                 cpu_type=i386
1066                 xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h i386/xm-osf1elf.h"
1067                 xm_defines="USE_C_ALLOCA SMALL_ARG_MAX"
1068                 fixincludes=Makefile.in #Don't do it on OSF/1
1069                 if [[ x$stabs = xyes ]]
1070                 then
1071                         tm_file=i386/osf1elfgdb.h
1072                 else
1073                         tm_file=i386/osf1elf.h
1074                 fi
1075                 tmake_file=i386/t-osf1elf
1076                 xmake_file=i386/x-osf1elf
1077                 extra_parts="crti.o crtn.o crtbegin.o crtend.o"
1078                 ;;
1079         i[[34567]]86-*-sysv*)           # Intel 80386's running system V
1080                 xm_defines="USG SVR3"
1081                 xmake_file=i386/x-sysv3
1082                 if [[ x$gas = xyes ]]
1083                 then
1084                         if [[ x$stabs = xyes ]]
1085                         then
1086                                 tm_file=i386/svr3dbx.h
1087                                 tmake_file=i386/t-svr3dbx
1088                                 extra_parts="svr3.ifile svr3z.rfile"
1089                         else
1090                                 tm_file=i386/svr3gas.h
1091                                 extra_parts="crtbegin.o crtend.o"
1092                                 tmake_file=i386/t-crtstuff
1093                         fi
1094                 else
1095                         tm_file=i386/sysv3.h
1096                         extra_parts="crtbegin.o crtend.o"
1097                         tmake_file=i386/t-crtstuff
1098                 fi
1099                 ;;
1100         i386-*-vsta)                    # Intel 80386's running VSTa kernel
1101                 xm_file="${xm_file} i386/xm-vsta.h"
1102                 tm_file=i386/vsta.h
1103                 tmake_file=i386/t-vsta
1104                 xmake_file=i386/x-vsta
1105                 ;;
1106         i[[34567]]86-*-pe | i[[34567]]86-*-cygwin32)
1107                 xm_file="${xm_file} i386/xm-cygwin32.h"
1108                 tmake_file=i386/t-cygwin32
1109                 tm_file=i386/cygwin32.h
1110                 xmake_file=i386/x-cygwin32
1111                 extra_objs=winnt.o
1112                 fixincludes=Makefile.in
1113                 if [[ x$enable_threads = xyes ]]; then
1114                         thread_file='win32'
1115                 fi
1116                 exeext=.exe
1117                 ;;
1118         i[[34567]]86-*-mingw32*)
1119                 tm_file=i386/mingw32.h
1120                 xm_file="${xm_file} i386/xm-mingw32.h"
1121                 tmake_file=i386/t-cygwin32
1122                 extra_objs=winnt.o
1123                 xmake_file=i386/x-cygwin32
1124                 fixincludes=Makefile.in
1125                 if [[ x$enable_threads = xyes ]]; then
1126                         thread_file='win32'
1127                 fi
1128                 exeext=.exe
1129                 case $machine in
1130                         *mingw32msv*)
1131                                 ;;
1132                         *minwg32crt* | *mingw32*)
1133                                 tm_file="${tm_file} i386/crtdll.h"
1134                                 ;;
1135                 esac
1136                 ;;
1137         i[[34567]]86-*-winnt3*)
1138                 tm_file=i386/win-nt.h
1139                 out_file=i386/i386.c
1140                 xm_file="xm-winnt.h ${xm_file}"
1141                 xmake_file=winnt/x-winnt
1142                 tmake_file=i386/t-winnt
1143                 extra_host_objs="winnt.o oldnames.o"
1144                 extra_gcc_objs="spawnv.o oldnames.o"
1145                 fixincludes=fixinc.winnt
1146                 if [[ x$gnu_ld != xyes ]]
1147                 then
1148                         extra_programs=ld.exe
1149                 fi
1150                 if [[ x$enable_threads = xyes ]]; then
1151                         thread_file='win32'
1152                 fi
1153                 ;;
1154         i[[34567]]86-dg-dgux*)
1155                 xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
1156                 xm_defines="USG POSIX"
1157                 out_file=i386/dgux.c
1158                 tm_file=i386/dgux.h
1159                 tmake_file=i386/t-dgux
1160                 xmake_file=i386/x-dgux
1161                 fixincludes=fixinc.dgux
1162                 install_headers_dir=install-headers-cpio
1163               ;;
1164         i860-alliant-*)         # Alliant FX/2800
1165                 tm_file="${tm_file} svr4.h i860/sysv4.h i860/fx2800.h"
1166                 xm_file="${xm_file}"
1167                 xmake_file=i860/x-fx2800
1168                 tmake_file=i860/t-fx2800
1169                 extra_parts="crtbegin.o crtend.o"
1170                 ;;
1171         i860-*-bsd*)
1172                 tm_file="${tm_file} i860/bsd.h"
1173                 if [[ x$gas = xyes ]]
1174                 then
1175                         tm_file="${tm_file} i860/bsd-gas.h"
1176                 fi
1177                 use_collect2=yes
1178                 ;;
1179         i860-*-mach*)
1180                 tm_file="${tm_file} i860/mach.h"
1181                 tmake_file=t-libc-ok
1182                 ;;
1183         i860-*-osf*)                    # Intel Paragon XP/S, OSF/1AD
1184                 tm_file="${tm_file} svr3.h i860/paragon.h"
1185                 xm_defines="USG SVR3"
1186                 tmake_file=t-osf
1187                 ;;
1188         i860-*-sysv3*)
1189                 tm_file="${tm_file} svr3.h i860/sysv3.h"
1190                 xm_defines="USG SVR3"
1191                 xmake_file=i860/x-sysv3
1192                 extra_parts="crtbegin.o crtend.o"
1193                 ;;
1194         i860-*-sysv4*)
1195                 tm_file="${tm_file} svr4.h i860/sysv4.h"
1196                 xm_defines="USG SVR3"
1197                 xmake_file=i860/x-sysv4
1198                 tmake_file=t-svr4
1199                 extra_parts="crtbegin.o crtend.o"
1200                 ;;
1201         i960-wrs-vxworks5 | i960-wrs-vxworks5.0*)
1202                 tm_file="${tm_file} i960/vx960.h"
1203                 tmake_file=i960/t-vxworks960
1204                 use_collect2=yes
1205                 thread_file='vxworks'
1206                 ;;
1207         i960-wrs-vxworks5* | i960-wrs-vxworks)
1208                 tm_file="${tm_file} dbxcoff.h i960/i960-coff.h i960/vx960-coff.h"
1209                 tmake_file=i960/t-vxworks960
1210                 use_collect2=yes
1211                 thread_file='vxworks'
1212                 ;;
1213         i960-wrs-vxworks*)
1214                 tm_file="${tm_file} i960/vx960.h"
1215                 tmake_file=i960/t-vxworks960
1216                 use_collect2=yes
1217                 thread_file='vxworks'
1218                 ;;
1219         i960-*-coff*)
1220                 tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h"
1221                 tmake_file=i960/t-960bare
1222                 use_collect2=yes
1223                 ;;
1224         i960-*-rtems)
1225                 tmake_file="i960/t-960bare t-rtems"
1226                 tm_file="${tm_file} dbxcoff.h i960/rtems.h"
1227                 use_collect2=yes
1228                 ;;
1229         i960-*-*)                       # Default i960 environment.
1230                 use_collect2=yes
1231                 ;;
1232         m32r-*-elf*)
1233                 extra_parts="crtinit.o crtfini.o"
1234                 ;;
1235         m68000-convergent-sysv*)
1236                 tm_file=m68k/ctix.h
1237                 xm_file="m68k/xm-3b1.h ${xm_file}"
1238                 xm_defines=USG
1239                 use_collect2=yes
1240                 extra_headers=math-68881.h
1241                 ;;
1242         m68000-hp-bsd*)                 # HP 9000/200 running BSD
1243                 tm_file=m68k/hp2bsd.h
1244                 xmake_file=m68k/x-hp2bsd
1245                 use_collect2=yes
1246                 extra_headers=math-68881.h
1247                 ;;
1248         m68000-hp-hpux*)                # HP 9000 series 300
1249                 xm_file="xm_alloca.h ${xm_file}"
1250                 xm_defines="USG NO_SYS_SIGLIST"
1251                 if [[ x$gas = xyes ]]
1252                 then
1253                         xmake_file=m68k/x-hp320g
1254                         tm_file=m68k/hp310g.h
1255                 else
1256                         xmake_file=m68k/x-hp320
1257                         tm_file=m68k/hp310.h
1258                 fi
1259                 install_headers_dir=install-headers-cpio
1260                 use_collect2=yes
1261                 extra_headers=math-68881.h
1262                 ;;
1263         m68000-sun-sunos3*)
1264                 tm_file=m68k/sun2.h
1265                 use_collect2=yes
1266                 extra_headers=math-68881.h
1267                 ;;
1268         m68000-sun-sunos4*)
1269                 tm_file=m68k/sun2o4.h
1270                 use_collect2=yes
1271                 extra_headers=math-68881.h
1272                 ;;
1273         m68000-att-sysv*)
1274                 xm_file="m68k/xm-3b1.h ${xm_file}"
1275                 xm_defines=USG
1276                 if [[ x$gas = xyes ]]
1277                 then
1278                         tm_file=m68k/3b1g.h
1279                 else
1280                         tm_file=m68k/3b1.h
1281                 fi
1282                 use_collect2=yes
1283                 extra_headers=math-68881.h
1284                 ;;
1285         m68k-apple-aux*)                # Apple Macintosh running A/UX
1286                 xm_defines="USG AUX"
1287                 tmake_file=m68k/t-aux
1288                 install_headers_dir=install-headers-cpio
1289                 extra_headers=math-68881.h
1290                 extra_parts="crt1.o mcrt1.o maccrt1.o crt2.o crtn.o"
1291                 tm_file=
1292                 if [[ "$gnu_ld" = yes ]]
1293                 then
1294                         tm_file="${tm_file} m68k/auxgld.h"
1295                 else
1296                         tm_file="${tm_file} m68k/auxld.h"
1297                 fi
1298                 if [[ "$gas" = yes ]]
1299                 then
1300                         tm_file="${tm_file} m68k/auxgas.h"
1301                 else
1302                         tm_file="${tm_file} m68k/auxas.h"
1303                 fi
1304                 tm_file="${tm_file} m68k/a-ux.h"
1305                 ;;
1306         m68k-apollo-*)
1307                 tm_file=m68k/apollo68.h
1308                 xmake_file=m68k/x-apollo68
1309                 use_collect2=yes
1310                 extra_headers=math-68881.h
1311                 ;;
1312         m68k-altos-sysv*)                  # Altos 3068
1313                 if [[ x$gas = xyes ]]
1314                 then
1315                         tm_file=m68k/altos3068.h
1316                         xm_defines=USG
1317                 else
1318                         echo "The Altos is supported only with the GNU assembler" 1>&2
1319                         exit 1
1320                 fi
1321                 extra_headers=math-68881.h
1322                 ;;
1323         m68k-bull-sysv*)                # Bull DPX/2
1324                 if [[ x$gas = xyes ]]
1325                 then
1326                         if [[ x$stabs = xyes ]]
1327                         then
1328                                 tm_file=m68k/dpx2cdbx.h
1329                         else
1330                                 tm_file=m68k/dpx2g.h
1331                         fi
1332                 else
1333                         tm_file=m68k/dpx2.h
1334                 fi
1335                 xm_file="xm-alloca.h ${xm_file}"
1336                 xm_defines=USG
1337                 xmake_file=m68k/x-dpx2
1338                 use_collect2=yes
1339                 extra_headers=math-68881.h
1340                 ;;
1341         m68k-atari-sysv4*)              # Atari variant of V.4.
1342                 tm_file=m68k/atari.h
1343                 xm_file="xm-alloca.h ${xm_file}"
1344                 xm_defines="USG FULL_PROTOTYPES"
1345                 tmake_file=t-svr4
1346                 extra_parts="crtbegin.o crtend.o"
1347                 extra_headers=math-68881.h
1348                 ;;
1349         m68k-motorola-sysv*)
1350                 tm_file=m68k/mot3300.h
1351                 xm_file="xm-alloca.h m68k/xm-mot3300.h ${xm_file}"
1352                 xm_defines=NO_SYS_SIGLIST
1353                 if [[ x$gas = xyes ]]
1354                 then
1355                         xmake_file=m68k/x-mot3300-gas
1356                         if [[ x$gnu_ld = xyes ]]
1357                         then
1358                                 tmake_file=m68k/t-mot3300-gald
1359                         else
1360                                 tmake_file=m68k/t-mot3300-gas
1361                                 use_collect2=yes
1362                         fi
1363                 else
1364                         xmake_file=m68k/x-mot3300
1365                         if [[ x$gnu_ld = xyes ]]
1366                         then
1367                                 tmake_file=m68k/t-mot3300-gld
1368                         else
1369                                 tmake_file=m68k/t-mot3300
1370                                 use_collect2=yes
1371                         fi
1372                 fi
1373                 gdb_needs_out_file_path=yes
1374                 extra_parts="crt0.o mcrt0.o"
1375                 extra_headers=math-68881.h
1376                 ;;
1377         m68k-ncr-sysv*)                 # NCR Tower 32 SVR3
1378                 tm_file=m68k/tower-as.h
1379                 xm_defines="USG SVR3"
1380                 xmake_file=m68k/x-tower
1381                 extra_parts="crtbegin.o crtend.o"
1382                 extra_headers=math-68881.h
1383                 ;;
1384         m68k-plexus-sysv*)
1385                 tm_file=m68k/plexus.h
1386                 xm_file="xm-alloca.h m68k/xm-plexus.h ${xm_file}"
1387                 xm_defines=USG
1388                 use_collect2=yes
1389                 extra_headers=math-68881.h
1390                 ;;
1391         m68k-tti-*)
1392                 tm_file=m68k/pbb.h
1393                 xm_file="xm-alloca.h ${xm_file}"
1394                 xm_defines=USG
1395                 extra_headers=math-68881.h
1396                 ;;
1397         m68k-crds-unos*)
1398                 xm_file="xm-alloca.h m68k/xm-crds.h ${xm_file}"
1399                 xm_defines="USG unos"
1400                 xmake_file=m68k/x-crds
1401                 tm_file=m68k/crds.h
1402                 use_collect2=yes
1403                 extra_headers=math-68881.h
1404                 ;;
1405         m68k-cbm-sysv4*)                # Commodore variant of V.4.
1406                 tm_file=m68k/amix.h
1407                 xm_file="xm-alloca.h ${xm_file}"
1408                 xm_defines="USG FULL_PROTOTYPES"
1409                 xmake_file=m68k/x-amix
1410                 tmake_file=t-svr4
1411                 extra_parts="crtbegin.o crtend.o"
1412                 extra_headers=math-68881.h
1413                 ;;
1414         m68k-ccur-rtu)
1415                 tm_file=m68k/ccur-GAS.h
1416                 xmake_file=m68k/x-ccur
1417                 extra_headers=math-68881.h
1418                 use_collect2=yes
1419                 ;;
1420         m68k-hp-bsd4.4*)                # HP 9000/3xx running 4.4bsd
1421                 tm_file=m68k/hp3bsd44.h
1422                 xmake_file=m68k/x-hp3bsd44
1423                 use_collect2=yes
1424                 extra_headers=math-68881.h
1425                 ;;
1426         m68k-hp-bsd*)                   # HP 9000/3xx running Berkeley Unix
1427                 tm_file=m68k/hp3bsd.h
1428                 use_collect2=yes
1429                 extra_headers=math-68881.h
1430                 ;;
1431         m68k-isi-bsd*)
1432                 if [[ x$with_fp = xno ]]
1433                 then
1434                         tm_file=m68k/isi-nfp.h
1435                 else
1436                         tm_file=m68k/isi.h
1437                 fi
1438                 use_collect2=yes
1439                 extra_headers=math-68881.h
1440                 ;;
1441         m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
1442                 xm_file="xm_alloca.h ${xm_file}"
1443                 xm_defines="USG NO_SYS_SIGLIST"
1444                 if [[ x$gas = xyes ]]
1445                 then
1446                         xmake_file=m68k/x-hp320g
1447                         tm_file=m68k/hp320g.h
1448                 else
1449                         xmake_file=m68k/x-hp320
1450                         tm_file=m68k/hpux7.h
1451                 fi
1452                 install_headers_dir=install-headers-cpio
1453                 use_collect2=yes
1454                 extra_headers=math-68881.h
1455                 ;;
1456         m68k-hp-hpux*)  # HP 9000 series 300
1457                 xm_file="xm_alloca.h ${xm_file}"
1458                 xm_defines="USG NO_SYS_SIGLIST"
1459                 if [[ x$gas = xyes ]]
1460                 then
1461                         xmake_file=m68k/x-hp320g
1462                         tm_file=m68k/hp320g.h
1463                 else
1464                         xmake_file=m68k/x-hp320
1465                         tm_file=m68k/hp320.h
1466                 fi
1467                 install_headers_dir=install-headers-cpio
1468                 use_collect2=yes
1469                 extra_headers=math-68881.h
1470                 ;;
1471         m68k-sun-mach*)
1472                 tm_file=m68k/sun3mach.h
1473                 use_collect2=yes
1474                 extra_headers=math-68881.h
1475                 ;;
1476         m68k-sony-newsos3*)
1477                 if [[ x$gas = xyes ]]
1478                 then
1479                         tm_file=m68k/news3gas.h
1480                 else
1481                         tm_file=m68k/news3.h
1482                 fi
1483                 use_collect2=yes
1484                 extra_headers=math-68881.h
1485                 ;;
1486         m68k-sony-bsd* | m68k-sony-newsos*)
1487                 if [[ x$gas = xyes ]]
1488                 then
1489                         tm_file=m68k/newsgas.h
1490                 else
1491                         tm_file=m68k/news.h
1492                 fi
1493                 use_collect2=yes
1494                 extra_headers=math-68881.h
1495                 ;;
1496         m68k-next-nextstep2*)
1497                 tm_file=m68k/next21.h
1498                 xm_file="m68k/xm-next.h ${xm_file}"
1499                 tmake_file=m68k/t-next
1500                 xmake_file=m68k/x-next
1501                 extra_objs=nextstep.o
1502                 extra_headers=math-68881.h
1503                 use_collect2=yes
1504                 ;;
1505         m68k-next-nextstep3*)
1506                 tm_file=m68k/next.h
1507                 xm_file="m68k/xm-next.h ${xm_file}"
1508                 tmake_file=m68k/t-next
1509                 xmake_file=m68k/x-next
1510                 extra_objs=nextstep.o
1511                 extra_headers=math-68881.h
1512                 if [[ x$enable_threads = xyes ]]; then
1513                         thread_file='mach'
1514                 fi
1515                 ;;
1516         m68k-sun-sunos3*)
1517                 if [[ x$with_fp = xno ]]
1518                 then
1519                         tm_file=m68k/sun3n3.h
1520                 else
1521                         tm_file=m68k/sun3o3.h
1522                 fi
1523                 use_collect2=yes
1524                 extra_headers=math-68881.h
1525                 ;;
1526         m68k-sun-sunos*)                        # For SunOS 4 (the default).
1527                 if [[ x$with_fp = xno ]]
1528                 then
1529                         tm_file=m68k/sun3n.h
1530                 else
1531                         tm_file=m68k/sun3.h
1532                 fi
1533                 use_collect2=yes
1534                 extra_headers=math-68881.h
1535                 ;;
1536         m68k-wrs-vxworks*)
1537                 tm_file=m68k/vxm68k.h
1538                 tmake_file=m68k/t-vxworks68
1539                 extra_headers=math-68881.h
1540                 thread_file='vxworks'
1541                 ;;
1542         m68k-*-aout*)
1543                 tmake_file=m68k/t-m68kbare
1544                 tm_file="m68k/m68k-aout.h libgloss.h"
1545                 extra_headers=math-68881.h
1546                 ;;
1547         m68k-*-coff*)
1548                 tmake_file=m68k/t-m68kbare
1549                 tm_file="m68k/m68k-coff.h dbx.h libgloss.h"
1550                 extra_headers=math-68881.h
1551                 ;;
1552         m68k-*-lynxos*)
1553                 if [[ x$gas = xyes ]]
1554                 then
1555                         tm_file=m68k/lynx.h
1556                 else
1557                         tm_file=m68k/lynx-ng.h
1558                 fi
1559                 xm_file=m68k/xm-lynx.h
1560                 xmake_file=x-lynx
1561                 tmake_file=m68k/t-lynx
1562                 extra_headers=math-68881.h
1563                 ;;
1564         m68k-*-netbsd*)
1565                 tm_file=m68k/netbsd.h
1566                 # On NetBSD, the headers are already okay, except for math.h.
1567                 fixincludes=fixinc.wrap
1568                 tmake_file=t-netbsd
1569                 ;;
1570         m68k-*-sysv3*)                  # Motorola m68k's running system V.3
1571                 xm_file="xm-alloca.h ${xm_file}"
1572                 xm_defines=USG
1573                 xmake_file=m68k/x-m68kv
1574                 extra_parts="crtbegin.o crtend.o"
1575                 extra_headers=math-68881.h
1576                 ;;
1577         m68k-*-sysv4*)                  # Motorola m68k's running system V.4
1578                 tm_file=m68k/m68kv4.h
1579                 xm_file="xm-alloca.h ${xm_file}"
1580                 xm_defines=USG
1581                 tmake_file=t-svr4
1582                 extra_parts="crtbegin.o crtend.o"
1583                 extra_headers=math-68881.h
1584                 ;;
1585         m68k-*-linux-gnuaout*)          # Motorola m68k's running GNU/Linux
1586                                         # with a.out format
1587                 xmake_file=x-linux
1588                 tm_file=m68k/linux-aout.h
1589                 tmake_file="t-linux-aout m68k/t-linux-aout"
1590                 fixincludes=Makefile.in # The headers are ok already.
1591                 extra_headers=math-68881.h
1592                 gnu_ld=yes
1593                 ;;
1594         m68k-*-linux-gnulibc1)          # Motorola m68k's running GNU/Linux
1595                                         # with ELF format using the
1596                                         # GNU/Linux C library 5
1597                 xmake_file=x-linux
1598                 tm_file=m68k/linux.h
1599                 tmake_file="t-linux t-linux-gnulibc1 m68k/t-linux"
1600                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
1601                 fixincludes=Makefile.in # The headers are ok already.
1602                 extra_headers=math-68881.h
1603                 gnu_ld=yes
1604                 ;;
1605         m68k-*-linux-gnu*)              # Motorola m68k's running GNU/Linux
1606                                         # with ELF format using glibc 2
1607                                         # aka the GNU/Linux C library 6.
1608                 xmake_file=x-linux
1609                 tm_file=m68k/linux.h
1610                 tmake_file="t-linux m68k/t-linux"
1611                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
1612                 fixincludes=Makefile.in # The headers are ok already.
1613                 extra_headers=math-68881.h
1614                 gnu_ld=yes
1615                 if [[ x$enable_threads = xyes ]]; then
1616                         thread_file='posix'
1617                 fi
1618                 ;;
1619         m68k-*-psos*)
1620                 tmake_file=m68k/t-m68kbare
1621                 tm_file=m68k/m68k-psos.h
1622                 extra_headers=math-68881.h
1623                 ;;
1624         m68k-*-rtems*)
1625                 tmake_file="m68k/t-m68kbare t-rtems"
1626                 tm_file=m68k/rtems.h
1627                 extra_headers=math-68881.h
1628                 ;;
1629
1630         m88k-dg-dgux*)
1631                 case $machine in
1632                   m88k-dg-dguxbcs*)
1633                     tm_file=m88k/dguxbcs.h
1634                     tmake_file=m88k/t-dguxbcs
1635                     ;;
1636                   *)
1637                     tm_file=m88k/dgux.h
1638                     tmake_file=m88k/t-dgux
1639                     ;;
1640                 esac
1641                 extra_parts="crtbegin.o bcscrtbegin.o crtend.o m88kdgux.ld"
1642                 xmake_file=m88k/x-dgux
1643                 if [[ x$gas = xyes ]]
1644                 then
1645                         tmake_file=m88k/t-dgux-gas
1646                 fi
1647                 fixincludes=fixinc.dgux
1648                 ;;
1649         m88k-dolphin-sysv3*)
1650                 tm_file=m88k/dolph.h
1651                 extra_parts="crtbegin.o crtend.o"
1652                 xm_file="m88k/xm-sysv3.h ${xm_file}"
1653                 xmake_file=m88k/x-dolph
1654                 if [[ x$gas = xyes ]]
1655                 then
1656                         tmake_file=m88k/t-m88k-gas
1657                 fi
1658                 ;;
1659         m88k-tektronix-sysv3)
1660                 tm_file=m88k/tekXD88.h
1661                 extra_parts="crtbegin.o crtend.o"
1662                 xm_file="m88k/xm-sysv3.h ${xm_file}"
1663                 xmake_file=m88k/x-tekXD88
1664                 if [[ x$gas = xyes ]]
1665                 then
1666                         tmake_file=m88k/t-m88k-gas
1667                 fi
1668                 ;;
1669         m88k-*-aout*)
1670                 tm_file=m88k/m88k-aout.h
1671                 ;;
1672         m88k-*-coff*)
1673                 tm_file=m88k/m88k-coff.h
1674                 tmake_file=m88k/t-bug
1675                 ;;
1676         m88k-*-luna*)
1677                 tm_file=m88k/luna.h
1678                 extra_parts="crtbegin.o crtend.o"
1679                 if [[ x$gas = xyes ]]
1680                 then
1681                         tmake_file=m88k/t-luna-gas
1682                 else
1683                         tmake_file=m88k/t-luna
1684                 fi
1685                 ;;
1686         m88k-*-sysv3*)
1687                 tm_file=m88k/sysv3.h
1688                 extra_parts="crtbegin.o crtend.o"
1689                 xm_file="m88k/xm-sysv3.h ${xm_file}"
1690                 xmake_file=m88k/x-sysv3
1691                 if [[ x$gas = xyes ]]
1692                 then
1693                         tmake_file=m88k/t-m88k-gas
1694                 fi
1695                 ;;
1696         m88k-*-sysv4*)
1697                 tm_file=m88k/sysv4.h
1698                 extra_parts="crtbegin.o crtend.o"
1699                 xmake_file=m88k/x-sysv4
1700                 tmake_file=m88k/t-sysv4
1701                 ;;
1702         mips-sgi-irix6*)                # SGI System V.4., IRIX 6
1703                 tm_file=mips/iris6.h
1704                 xm_file=mips/xm-iris6.h
1705                 fixincludes=fixinc.irix
1706                 xmake_file=mips/x-iris6
1707                 tmake_file=mips/t-iris6
1708                 if [[ x$enable_threads = xyes ]]; then
1709                         thread_file='irix'
1710                 fi
1711                 ;;
1712         mips-wrs-vxworks)
1713                 tm_file="mips/elf.h libgloss.h"
1714                 tmake_file=mips/t-ecoff
1715                 gas=yes
1716                 gnu_ld=yes
1717                 extra_parts="crtbegin.o crtend.o"
1718 #               thread_file='vxworks'
1719                 ;;
1720         mips-sgi-irix5cross64)          # Irix5 host, Irix 6 target, cross64
1721                 tm_file="mips/iris6.h mips/cross64.h"
1722                 xm_defines="USG HAVE_INTTYPES_H"
1723                 fixincludes=Makefile.in
1724                 xmake_file=mips/x-iris
1725                 tmake_file=mips/t-cross64
1726                 # See comment in mips/iris[56].h files.
1727                 use_collect2=yes
1728                 if [[ x$enable_threads = xyes ]]; then
1729                         thread_file='irix'
1730                 fi
1731                 ;;
1732         mips-sni-sysv4)
1733                 if [[ x$gas = xyes ]]
1734                 then
1735                         if [[ x$stabs = xyes ]]
1736                         then
1737                                 tm_file=mips/iris5gdb.h
1738                         else
1739                                 tm_file="mips/sni-svr4.h mips/sni-gas.h"
1740                         fi
1741                 else
1742                         tm_file=mips/sni-svr4.h
1743                 fi
1744                 xm_defines=USG
1745                 xmake_file=mips/x-sni-svr4
1746                 tmake_file=mips/t-mips-gas
1747                 if [[ x$gnu_ld != xyes ]]
1748                 then
1749                         use_collect2=yes
1750                 fi
1751                 ;;
1752         mips-sgi-irix5*)                # SGI System V.4., IRIX 5
1753                 if [[ x$gas = xyes ]]
1754                 then
1755                         tm_file="mips/iris5.h mips/iris5gas.h"
1756                         if [[ x$stabs = xyes ]]
1757                         then
1758                                 tm_file="${tm_file} dbx.h"
1759                         fi
1760                 else
1761                         tm_file=mips/iris5.h
1762                 fi
1763                 xm_defines="USG HAVE_INTTYPES_H"
1764                 fixincludes=fixinc.irix
1765                 xmake_file=mips/x-iris
1766                 # mips-tfile doesn't work yet
1767                 tmake_file=mips/t-mips-gas
1768                 # See comment in mips/iris5.h file.
1769                 use_collect2=yes
1770                 if [[ x$enable_threads = xyes ]]; then
1771                         thread_file='irix'
1772                 fi
1773                 ;;
1774         mips-sgi-irix4loser*)           # Mostly like a MIPS.
1775                 tm_file="mips/iris4loser.h mips/iris3.h ${tm_file} mips/iris4.h"
1776                 if [[ x$stabs = xyes ]]; then
1777                         tm_file="${tm_file} dbx.h"
1778                 fi
1779                 xm_defines=USG
1780                 xmake_file=mips/x-iris
1781                 if [[ x$gas = xyes ]]
1782                 then
1783                         tmake_file=mips/t-mips-gas
1784                 else
1785                         extra_passes="mips-tfile mips-tdump"
1786                 fi
1787                 if [[ x$gnu_ld != xyes ]]
1788                 then
1789                         use_collect2=yes
1790                 fi
1791                 if [[ x$enable_threads = xyes ]]; then
1792                         thread_file='irix'
1793                 fi
1794                 ;;
1795         mips-sgi-irix4*)                # Mostly like a MIPS.
1796                 tm_file="mips/iris3.h ${tm_file} mips/iris4.h"
1797                 if [[ x$stabs = xyes ]]; then
1798                         tm_file="${tm_file} dbx.h"
1799                 fi
1800                 xm_defines=USG
1801                 xmake_file=mips/x-iris
1802                 if [[ x$gas = xyes ]]
1803                 then
1804                         tmake_file=mips/t-mips-gas
1805                 else
1806                         extra_passes="mips-tfile mips-tdump"
1807                 fi
1808                 if [[ x$gnu_ld != xyes ]]
1809                 then
1810                         use_collect2=yes
1811                 fi
1812                 if [[ x$enable_threads = xyes ]]; then
1813                         thread_file='irix'
1814                 fi
1815                 ;;
1816         mips-sgi-*)                     # Mostly like a MIPS.
1817                 tm_file="mips/iris3.h ${tm_file}"
1818                 if [[ x$stabs = xyes ]]; then
1819                         tm_file="${tm_file} dbx.h"
1820                 fi
1821                 xm_defines=USG
1822                 xmake_file=mips/x-iris3
1823                 if [[ x$gas = xyes ]]
1824                 then
1825                         tmake_file=mips/t-mips-gas
1826                 else
1827                         extra_passes="mips-tfile mips-tdump"
1828                 fi
1829                 if [[ x$gnu_ld != xyes ]]
1830                 then
1831                         use_collect2=yes
1832                 fi
1833                 ;;
1834         mips-dec-osfrose*)              # Decstation running OSF/1 reference port with OSF/rose.
1835                 tm_file="mips/osfrose.h ${tm_file}"
1836                 xmake_file=mips/x-osfrose
1837                 tmake_file=mips/t-osfrose
1838                 extra_objs=halfpic.o
1839                 use_collect2=yes
1840                 ;;
1841         mips-dec-osf*)                  # Decstation running OSF/1 as shipped by DIGITAL
1842                 tm_file=mips/dec-osf1.h
1843                 if [[ x$stabs = xyes ]]; then
1844                         tm_file="${tm_file} dbx.h"
1845                 fi
1846                 xmake_file=mips/x-dec-osf1
1847                 if [[ x$gas = xyes ]]
1848                 then
1849                         tmake_file=mips/t-mips-gas
1850                 else
1851                         tmake_file=mips/t-ultrix
1852                         extra_passes="mips-tfile mips-tdump"
1853                 fi
1854                 if [[ x$gnu_ld != xyes ]]
1855                 then
1856                         use_collect2=yes
1857                 fi
1858                 ;;
1859         mips-dec-bsd*)                  # Decstation running 4.4 BSD
1860               tm_file=mips/dec-bsd.h
1861               fixincludes=
1862               if [[ x$gas = xyes ]]
1863               then
1864                         tmake_file=mips/t-mips-gas
1865               else
1866                         tmake_file=mips/t-ultrix
1867                         extra_passes="mips-tfile mips-tdump"
1868               fi
1869               if [[ x$gnu_ld != xyes ]]
1870               then
1871                         use_collect2=yes
1872               fi
1873               ;;
1874         mips-dec-netbsd*)                  # Decstation running NetBSD
1875                 tm_file=mips/netbsd.h
1876                 # On NetBSD, the headers are already okay, except for math.h.
1877                 fixincludes=fixinc.wrap
1878                 tmake_file=t-netbsd
1879                 ;;
1880         mips-sony-bsd* | mips-sony-newsos*)     # Sony NEWS 3600 or risc/news.
1881                 tm_file="mips/news4.h ${tm_file}"
1882                 if [[ x$stabs = xyes ]]; then
1883                         tm_file="${tm_file} dbx.h"
1884                 fi
1885                 if [[ x$gas = xyes ]]
1886                 then
1887                         tmake_file=mips/t-mips-gas
1888                 else
1889                         extra_passes="mips-tfile mips-tdump"
1890                 fi
1891                 if [[ x$gnu_ld != xyes ]]
1892                 then
1893                         use_collect2=yes
1894                 fi
1895                 xmake_file=mips/x-sony
1896                 ;;
1897         mips-sony-sysv*)                # Sony NEWS 3800 with NEWSOS5.0.
1898                                         # That is based on svr4.
1899                 # t-svr4 is not right because this system doesn't use ELF.
1900                 tm_file="mips/news5.h ${tm_file}"
1901                 if [[ x$stabs = xyes ]]; then
1902                         tm_file="${tm_file} dbx.h"
1903                 fi
1904                 xm_file="xm-siglist.h ${xm_file}"
1905                 xm_defines=USG
1906                 if [[ x$gas = xyes ]]
1907                 then
1908                         tmake_file=mips/t-mips-gas
1909                 else
1910                         extra_passes="mips-tfile mips-tdump"
1911                 fi
1912                 if [[ x$gnu_ld != xyes ]]
1913                 then
1914                         use_collect2=yes
1915                 fi
1916                 ;;
1917         mips-tandem-sysv4*)             # Tandem S2 running NonStop UX
1918                 tm_file="mips/svr4-5.h mips/svr4-t.h"
1919                 if [[ x$stabs = xyes ]]; then
1920                         tm_file="${tm_file} dbx.h"
1921                 fi
1922                 xm_file="xm-siglist.h ${xm_file}"
1923                 xm_defines=USG
1924                 xmake_file=mips/x-sysv
1925                 if [[ x$gas = xyes ]]
1926                 then
1927                         tmake_file=mips/t-mips-gas
1928                         extra_parts="crtbegin.o crtend.o"
1929                 else
1930                         tmake_file=mips/t-mips
1931                         extra_passes="mips-tfile mips-tdump"
1932                 fi
1933                 if [[ x$gnu_ld != xyes ]]
1934                 then
1935                         use_collect2=yes
1936                 fi
1937                 ;;
1938         mips-*-ultrix* | mips-dec-mach3)        # Decstation.
1939                 tm_file="mips/ultrix.h ${tm_file}"
1940                 if [[ x$stabs = xyes ]]; then
1941                         tm_file="${tm_file} dbx.h"
1942                 fi
1943                 xmake_file=mips/x-ultrix
1944                 if [[ x$gas = xyes ]]
1945                 then
1946                         tmake_file=mips/t-mips-gas
1947                 else
1948                         tmake_file=mips/t-ultrix
1949                         extra_passes="mips-tfile mips-tdump"
1950                 fi
1951                 if [[ x$gnu_ld != xyes ]]
1952                 then
1953                         use_collect2=yes
1954                 fi
1955                 ;;
1956         mips-*-riscos[[56789]]bsd*)
1957                 tm_file=mips/bsd-5.h    # MIPS BSD 4.3, RISC-OS 5.0
1958                 if [[ x$stabs = xyes ]]; then
1959                         tm_file="${tm_file} dbx.h"
1960                 fi
1961                 if [[ x$gas = xyes ]]
1962                 then
1963                         tmake_file=mips/t-bsd-gas
1964                 else
1965                         tmake_file=mips/t-bsd
1966                         extra_passes="mips-tfile mips-tdump"
1967                 fi
1968                 if [[ x$gnu_ld != xyes ]]
1969                 then
1970                         use_collect2=yes
1971                 fi
1972                 ;;
1973         mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[[1234]]bsd*)
1974                 tm_file="mips/bsd-4.h ${tm_file}" # MIPS BSD 4.3, RISC-OS 4.0
1975                 if [[ x$stabs = xyes ]]; then
1976                         tm_file="${tm_file} dbx.h"
1977                 fi
1978                 if [[ x$gas = xyes ]]
1979                 then
1980                         tmake_file=mips/t-bsd-gas
1981                 else
1982                         tmake_file=mips/t-bsd
1983                         extra_passes="mips-tfile mips-tdump"
1984                 fi
1985                 if [[ x$gnu_ld != xyes ]]
1986                 then
1987                         use_collect2=yes
1988                 fi
1989                 ;;
1990         mips-*-riscos[[56789]]sysv4*)
1991                 tm_file=mips/svr4-5.h   # MIPS System V.4., RISC-OS 5.0
1992                 if [[ x$stabs = xyes ]]; then
1993                         tm_file="${tm_file} dbx.h"
1994                 fi
1995                 xm_file="xm-siglist.h ${xm_file}"
1996                 xmake_file=mips/x-sysv
1997                 if [[ x$gas = xyes ]]
1998                 then
1999                         tmake_file=mips/t-svr4-gas
2000                 else
2001                         tmake_file=mips/t-svr4
2002                         extra_passes="mips-tfile mips-tdump"
2003                 fi
2004                 if [[ x$gnu_ld != xyes ]]
2005                 then
2006                         use_collect2=yes
2007                 fi
2008                 ;;
2009         mips-*-sysv4* | mips-*-riscos[[1234]]sysv4* | mips-*-riscossysv4*)
2010                 tm_file="mips/svr4-4.h ${tm_file}"
2011                 if [[ x$stabs = xyes ]]; then
2012                         tm_file="${tm_file} dbx.h"
2013                 fi
2014                 xm_defines=USG
2015                 xmake_file=mips/x-sysv
2016                 if [[ x$gas = xyes ]]
2017                 then
2018                         tmake_file=mips/t-svr4-gas
2019                 else
2020                         tmake_file=mips/t-svr4
2021                         extra_passes="mips-tfile mips-tdump"
2022                 fi
2023                 if [[ x$gnu_ld != xyes ]]
2024                 then
2025                         use_collect2=yes
2026                 fi
2027                 ;;
2028         mips-*-riscos[[56789]]sysv*)
2029                 tm_file=mips/svr3-5.h   # MIPS System V.3, RISC-OS 5.0
2030                 if [[ x$stabs = xyes ]]; then
2031                         tm_file="${tm_file} dbx.h"
2032                 fi
2033                 xm_defines=USG
2034                 xmake_file=mips/x-sysv
2035                 if [[ x$gas = xyes ]]
2036                 then
2037                         tmake_file=mips/t-svr3-gas
2038                 else
2039                         tmake_file=mips/t-svr3
2040                         extra_passes="mips-tfile mips-tdump"
2041                 fi
2042                 if [[ x$gnu_ld != xyes ]]
2043                 then
2044                         use_collect2=yes
2045                 fi
2046                 ;;
2047         mips-*-sysv* | mips-*-riscos*sysv*)
2048                 tm_file="mips/svr3-4.h ${tm_file}"
2049                 if [[ x$stabs = xyes ]]; then
2050                         tm_file="${tm_file} dbx.h"
2051                 fi
2052                 xm_defines=USG
2053                 xmake_file=mips/x-sysv
2054                 if [[ x$gas = xyes ]]
2055                 then
2056                         tmake_file=mips/t-svr3-gas
2057                 else
2058                         tmake_file=mips/t-svr3
2059                         extra_passes="mips-tfile mips-tdump"
2060                 fi
2061                 if [[ x$gnu_ld != xyes ]]
2062                 then
2063                         use_collect2=yes
2064                 fi
2065                 ;;
2066         mips-*-riscos[[56789]]*)                # Default MIPS RISC-OS 5.0.
2067                 tm_file=mips/mips-5.h
2068                 if [[ x$stabs = xyes ]]; then
2069                         tm_file="${tm_file} dbx.h"
2070                 fi
2071                 if [[ x$gas = xyes ]]
2072                 then
2073                         tmake_file=mips/t-mips-gas
2074                 else
2075                         extra_passes="mips-tfile mips-tdump"
2076                 fi
2077                 if [[ x$gnu_ld != xyes ]]
2078                 then
2079                         use_collect2=yes
2080                 fi
2081                 ;;
2082         mips-*-gnu*)
2083                 ;;
2084         mipsel-*-ecoff*)
2085                 tm_file=mips/ecoffl.h
2086                 if [[ x$stabs = xyes ]]; then
2087                         tm_file="${tm_file} dbx.h"
2088                 fi
2089                 tmake_file=mips/t-ecoff
2090                 ;;
2091         mips-*-ecoff*)
2092                 tm_file="gofast.h mips/ecoff.h"
2093                 if [[ x$stabs = xyes ]]; then
2094                         tm_file="${tm_file} dbx.h"
2095                 fi
2096                 tmake_file=mips/t-ecoff
2097                 ;;
2098         mipsel-*-elf*)
2099                 tm_file="mips/elfl.h libgloss.h"
2100                 tmake_file=mips/t-ecoff
2101                 ;;
2102         mips-*-elf*)
2103                 tm_file="mips/elf.h libgloss.h"
2104                 tmake_file=mips/t-ecoff
2105                 ;;
2106         mips64el-*-elf*)
2107                 tm_file="mips/elfl64.h libgloss.h"
2108                 tmake_file=mips/t-ecoff
2109                 ;;
2110         mips64orionel-*-elf*)
2111                 tm_file="mips/elforion.h mips/elfl64.h libgloss.h"
2112                 tmake_file=mips/t-ecoff
2113                 ;;
2114         mips64-*-elf*)
2115                 tm_file="mips/elf64.h libgloss.h"
2116                 tmake_file=mips/t-ecoff
2117                 ;;
2118         mips64orion-*-elf*)
2119                 tm_file="mips/elforion.h mips/elf64.h libgloss.h"
2120                 tmake_file=mips/t-ecoff
2121                 ;;
2122         mips64orion-*-rtems*)
2123                 tm_file="mips/elforion.h mips/elfl64.h mips/rtems64.h"
2124                 tmake_file="mips/t-ecoff t-rtems"
2125                 ;;
2126         mipstx39el-*-elf*)
2127                 tm_file="mips/r3900.h mips/elfl.h mips/abi64.h libgloss.h"
2128                 tmake_file=mips/t-r3900
2129                 ;;
2130         mipstx39-*-elf*)
2131                 tm_file="mips/r3900.h mips/elf.h mips/abi64.h libgloss.h"
2132                 tmake_file=mips/t-r3900
2133                 ;;
2134         mips-*-*)                               # Default MIPS RISC-OS 4.0.
2135                 if [[ x$stabs = xyes ]]; then
2136                         tm_file="${tm_file} dbx.h"
2137                 fi
2138                 if [[ x$gas = xyes ]]
2139                 then
2140                         tmake_file=mips/t-mips-gas
2141                 else
2142                         extra_passes="mips-tfile mips-tdump"
2143                 fi
2144                 if [[ x$gnu_ld != xyes ]]
2145                 then
2146                         use_collect2=yes
2147                 fi
2148                 ;;
2149         mn10200-*-*)
2150                 cpu_type=mn10200
2151                 tm_file="mn10200/mn10200.h"
2152                 if [[ x$stabs = xyes ]]
2153                 then
2154                         tm_file="${tm_file} dbx.h"
2155                 fi
2156                 use_collect2=no
2157                 ;;
2158         mn10300-*-*)
2159                 cpu_type=mn10300
2160                 tm_file="mn10300/mn10300.h"
2161                 if [[ x$stabs = xyes ]]
2162                 then
2163                         tm_file="${tm_file} dbx.h"
2164                 fi
2165                 use_collect2=no
2166                 ;;
2167         ns32k-encore-bsd*)
2168                 tm_file=ns32k/encore.h
2169                 use_collect2=yes
2170                 ;;
2171         ns32k-sequent-bsd*)
2172                 tm_file=ns32k/sequent.h
2173                 use_collect2=yes
2174                 ;;
2175         ns32k-tek6100-bsd*)
2176                 tm_file=ns32k/tek6100.h
2177                 use_collect2=yes
2178                 ;;
2179         ns32k-tek6200-bsd*)
2180                 tm_file=ns32k/tek6200.h
2181                 use_collect2=yes
2182                 ;;
2183 # This has not been updated to GCC 2.
2184 #       ns32k-ns-genix*)
2185 #               xm_defines=USG
2186 #               xmake_file=ns32k/x-genix
2187 #               tm_file=ns32k/genix.h
2188 #               use_collect2=yes
2189 #               ;;
2190         ns32k-merlin-*)
2191                 tm_file=ns32k/merlin.h
2192                 use_collect2=yes
2193                 ;;
2194         ns32k-pc532-mach*)
2195                 tm_file=ns32k/pc532-mach.h
2196                 use_collect2=yes
2197                 ;;
2198         ns32k-pc532-minix*)
2199                 tm_file=ns32k/pc532-min.h
2200                 xm_file="ns32k/xm-pc532-min.h ${xm-file}"
2201                 xm_defines=USG
2202                 use_collect2=yes
2203                 ;;
2204         ns32k-pc532-netbsd*)
2205                 tm_file=ns32k/netbsd.h
2206                 # On NetBSD, the headers are already okay, except for math.h.
2207                 fixincludes=fixinc.wrap
2208                 tmake_file=t-netbsd
2209                 ;;
2210         pdp11-*-bsd)
2211                 tm_file="${tm_file} pdp11/2bsd.h"
2212                 ;;
2213         pdp11-*-*)
2214                 ;;
2215         pyramid-*-*)
2216                 cpu_type=pyr
2217                 xmake_file=pyr/x-pyr
2218                 use_collect2=yes
2219                 ;;
2220         romp-*-aos*)
2221                 use_collect2=yes
2222                 ;;
2223         romp-*-mach*)
2224                 xmake_file=romp/x-mach
2225                 use_collect2=yes
2226                 ;;
2227         powerpc-*-beos*)
2228                 cpu_type=rs6000
2229                 tm_file=rs6000/beos.h
2230                 xm_file=rs6000/xm-beos.h
2231                 tmake_file=rs6000/t-beos
2232                 xmake_file=rs6000/x-beos
2233                 ;;
2234         powerpc-*-sysv* | powerpc-*-elf*)
2235                 tm_file=rs6000/sysv4.h
2236                 xm_file="xm-siglist.h rs6000/xm-sysv4.h"
2237                 xm_defines="USG POSIX"
2238                 extra_headers=ppc-asm.h
2239                 if [[ x$gas = xyes ]]
2240                 then
2241                         tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
2242                 else
2243                         tmake_file="rs6000/t-ppc rs6000/t-ppccomm"
2244                 fi
2245                 xmake_file=rs6000/x-sysv4
2246                 ;;
2247         powerpc-*-eabiaix*)
2248                 tm_file=rs6000/eabiaix.h
2249                 tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
2250                 fixincludes=Makefile.in
2251                 extra_headers=ppc-asm.h
2252                 ;;
2253         powerpc-*-eabisim*)
2254                 tm_file=rs6000/eabisim.h
2255                 tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
2256                 fixincludes=Makefile.in
2257                 extra_headers=ppc-asm.h
2258                 ;;
2259         powerpc-*-eabi*)
2260                 tm_file=rs6000/eabi.h
2261                 if [[ x$gas = xyes ]]
2262                 then
2263                         tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
2264                 else
2265                         tmake_file="rs6000/t-ppc rs6000/t-ppccomm"
2266                 fi
2267                 fixincludes=Makefile.in
2268                 extra_headers=ppc-asm.h
2269                 ;;
2270         powerpc-*-rtems*)
2271                 tm_file=rs6000/rtems.h
2272                 if [[ x$gas = xyes ]]
2273                 then
2274                      tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm"
2275                 else
2276                      tmake_file="rs6000/t-ppc t-rtems rs6000/t-ppccomm"
2277                 fi
2278                 fixincludes=Makefile.in
2279                 extra_headers=ppc-asm.h
2280                 ;;
2281         powerpc-*-linux-gnulibc1)
2282                 tm_file=rs6000/linux.h
2283                 xm_file=rs6000/xm-sysv4.h
2284                 out_file=rs6000/rs6000.c
2285                 if [[ x$gas = xyes ]]
2286                 then
2287                         tmake_file="rs6000/t-ppcos t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
2288                 else
2289                         tmake_file="rs6000/t-ppc t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
2290                 fi
2291                 xmake_file=x-linux
2292                 fixincludes=Makefile.in
2293                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
2294                 extra_headers=ppc-asm.h
2295                 if [[ x$enable_threads = xyes ]]; then
2296                         thread_file='posix'
2297                 fi
2298                 ;;
2299         powerpc-*-linux-gnu*)
2300                 tm_file=rs6000/linux.h
2301                 xm_file="xm-siglist.h rs6000/xm-sysv4.h"
2302                 xm_defines="USG ${xm_defines}"
2303                 out_file=rs6000/rs6000.c
2304                 if [[ x$gas = xyes ]]
2305                 then
2306                         tmake_file="rs6000/t-ppcos t-linux rs6000/t-ppccomm"
2307                 else
2308                         tmake_file="rs6000/t-ppc t-linux rs6000/t-ppccomm"
2309                 fi
2310                 xmake_file=x-linux
2311                 fixincludes=Makefile.in
2312                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
2313                 extra_headers=ppc-asm.h
2314                 if [[ x$enable_threads = xyes ]]; then
2315                         thread_file='posix'
2316                 fi
2317                 ;;
2318         powerpc-wrs-vxworks*)
2319                 cpu_type=rs6000
2320                 xm_file="xm-siglist.h rs6000/xm-sysv4.h"
2321                 xm_defines="USG POSIX"
2322                 tm_file=rs6000/vxppc.h
2323                 tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
2324                 extra_headers=ppc-asm.h
2325                 thread_file='vxworks'
2326                 ;;
2327         powerpcle-*-sysv* | powerpcle-*-elf*)
2328                 tm_file=rs6000/sysv4le.h
2329                 xm_file="xm-siglist.h rs6000/xm-sysv4.h"
2330                 xm_defines="USG POSIX"
2331                 if [[ x$gas = xyes ]]
2332                 then
2333                         tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
2334                 else
2335                         tmake_file="rs6000/t-ppc rs6000/t-ppccomm"
2336                 fi
2337                 xmake_file=rs6000/x-sysv4
2338                 extra_headers=ppc-asm.h
2339                 ;;
2340         powerpcle-*-eabisim*)
2341                 tm_file=rs6000/eabilesim.h
2342                 tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
2343                 fixincludes=Makefile.in
2344                 extra_headers=ppc-asm.h
2345                 ;;
2346         powerpcle-*-eabi*)
2347                 tm_file=rs6000/eabile.h
2348                 if [[ x$gas = xyes ]]
2349                 then
2350                         tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
2351                 else
2352                         tmake_file="rs6000/t-ppc rs6000/t-ppccomm"
2353                 fi
2354                 fixincludes=Makefile.in
2355                 extra_headers=ppc-asm.h
2356                 ;;
2357         powerpcle-*-winnt* )
2358                 tm_file=rs6000/win-nt.h
2359                 tmake_file=rs6000/t-winnt
2360 #               extra_objs=pe.o
2361                 fixincludes=Makefile.in
2362                 if [[ x$enable_threads = xyes ]]; then
2363                         thread_file='win32'
2364                 fi
2365                 extra_headers=ppc-asm.h
2366                 ;;
2367         powerpcle-*-pe | powerpcle-*-cygwin32)
2368                 tm_file=rs6000/cygwin32.h
2369                 xm_file="rs6000/xm-cygwin32.h ${xm_file}"
2370                 xm_defines=NO_STAB_H
2371                 tmake_file=rs6000/t-winnt
2372                 xmake_file=rs6000/x-cygwin32
2373 #               extra_objs=pe.o
2374                 fixincludes=Makefile.in
2375                 if [[ x$enable_threads = xyes ]]; then
2376                         thread_file='win32'
2377                 fi
2378                 exeext=.exe
2379                 extra_headers=ppc-asm.h
2380                 ;;
2381         powerpcle-*-solaris2*)
2382                 tm_file=rs6000/sol2.h
2383                 xm_file="xm-siglist.h rs6000/xm-sysv4.h"
2384                 xm_defines="USG POSIX"
2385                 if [[ x$gas = xyes ]]
2386                 then
2387                         tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
2388                 else
2389                         tmake_file="rs6000/t-ppc rs6000/t-ppccomm"
2390                 fi
2391                 xmake_file=rs6000/x-sysv4
2392                 case $machine in
2393                 *-*-solaris2.[[0-4]])
2394                         fixincludes=fixinc.svr4;;
2395                 *)
2396                         fixincludes=fixinc.wrap;;
2397                 esac
2398                 extra_headers=ppc-asm.h
2399                 ;;
2400         rs6000-ibm-aix3.[[01]]*)
2401                 tm_file=rs6000/aix31.h
2402                 xmake_file=rs6000/x-aix31
2403                 use_collect2=yes
2404                 ;;
2405         rs6000-ibm-aix3.2.[[456789]]* | powerpc-ibm-aix3.2.[[456789]]*)
2406                 tm_file=rs6000/aix3newas.h
2407                 if [[ x$host != x$target ]]
2408                 then
2409                         tmake_file=rs6000/t-xnewas
2410                 else
2411                         tmake_file=rs6000/t-newas
2412                 fi
2413                 use_collect2=yes
2414                 ;;
2415         rs6000-ibm-aix[[456789]].* | powerpc-ibm-aix[[456789]].*)
2416                 tm_file=rs6000/aix41.h
2417                 if [[ x$host != x$target ]]
2418                 then
2419                         tmake_file=rs6000/t-xnewas
2420                 else
2421                         tmake_file=rs6000/t-newas
2422                 fi
2423                 xmake_file=rs6000/x-aix31
2424                 use_collect2=yes
2425                 ;;
2426         rs6000-ibm-aix*)
2427                 use_collect2=yes
2428                 ;;
2429         rs6000-bull-bosx)
2430                 use_collect2=yes
2431                 ;;
2432         rs6000-*-mach*)
2433                 tm_file=rs6000/mach.h
2434                 xm_file="${xm_file} rs6000/xm-mach.h"
2435                 xmake_file=rs6000/x-mach
2436                 use_collect2=yes
2437                 ;;
2438         rs6000-*-lynxos*)
2439                 tm_file=rs6000/lynx.h
2440                 xm_file=rs6000/xm-lynx.h
2441                 tmake_file=rs6000/t-rs6000
2442                 xmake_file=rs6000/x-lynx
2443                 use_collect2=yes
2444                 ;;
2445         sh-*-elf*)
2446                 tm_file=sh/elf.h
2447                 float_format=sh
2448                 ;;
2449         sh-*-rtems*)
2450                 tmake_file="sh/t-sh t-rtems"
2451                 tm_file=sh/rtems.h
2452                 float_format=sh
2453                 ;;
2454         sh-*-*)
2455                 float_format=sh
2456                 ;;
2457         sparc-tti-*)
2458                 tm_file=sparc/pbd.h
2459                 xm_file="xm-alloca.h ${xm_file}"
2460                 xm_defines=USG
2461                 ;;
2462         sparc-wrs-vxworks* | sparclite-wrs-vxworks*)
2463                 tm_file=sparc/vxsparc.h
2464                 tmake_file=sparc/t-vxsparc
2465                 use_collect2=yes
2466                 thread_file='vxworks'
2467                 ;;
2468         sparc-*-aout*)
2469                 tmake_file=sparc/t-sparcbare
2470                 tm_file="sparc/aout.h libgloss.h"
2471                 ;;
2472         sparc-*-netbsd*)
2473                 tm_file=sparc/netbsd.h
2474                 # On NetBSD, the headers are already okay, except for math.h.
2475                 fixincludes=fixinc.wrap
2476                 tmake_file=t-netbsd
2477                 ;;
2478         sparc-*-bsd*)
2479                 tm_file=sparc/bsd.h
2480                 ;;
2481         sparc-*-elf*)
2482                 tm_file=sparc/elf.h
2483                 tmake_file=sparc/t-elf
2484                 extra_parts="crti.o crtn.o crtbegin.o crtend.o"
2485                 #float_format=i128
2486                 float_format=i64
2487                 ;;
2488         sparc-*-linux-gnuaout*)         # Sparc's running GNU/Linux, a.out
2489                 xm_file="${xm_file} sparc/xm-linux.h"
2490                 tm_file=sparc/linux-aout.h
2491                 xmake_file=x-linux
2492                 fixincludes=Makefile.in #On Linux, the headers are ok already.
2493                 gnu_ld=yes
2494                 ;;
2495         sparc-*-linux-gnulibc1*)        # Sparc's running GNU/Linux, libc5
2496                 xm_file="${xm_file} sparc/xm-linux.h"
2497                 xmake_file=x-linux
2498                 tm_file=sparc/linux.h
2499                 tmake_file="t-linux t-linux-gnulibc1"
2500                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
2501                 fixincludes=Makefile.in #On Linux, the headers are ok already.
2502                 gnu_ld=yes
2503                 ;;
2504         sparc-*-linux-gnu*)             # Sparc's running GNU/Linux, libc6
2505                 xm_file="${xm_file} sparc/xm-linux.h"
2506                 xmake_file=x-linux
2507                 tm_file=sparc/linux.h
2508                 tmake_file="t-linux"
2509                 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
2510                 fixincludes=Makefile.in #On Linux, the headers are ok already.
2511                 gnu_ld=yes
2512                 if [[ x$enable_threads = xyes ]]; then
2513                         thread_file='posix'
2514                 fi
2515                 ;;
2516         sparc-*-lynxos*)
2517                 if [[ x$gas = xyes ]]
2518                 then
2519                         tm_file=sparc/lynx.h
2520                 else
2521                         tm_file=sparc/lynx-ng.h
2522                 fi
2523                 xm_file=sparc/xm-lynx.h
2524                 tmake_file=sparc/t-sunos41
2525                 xmake_file=x-lynx
2526                 ;;
2527         sparc-*-rtems*)
2528                 tmake_file="sparc/t-sparcbare t-rtems"
2529                 tm_file=sparc/rtems.h
2530                 ;;
2531         sparc-*-solaris2*)
2532                 if [[ x$gnu_ld = xyes ]]
2533                 then
2534                         tm_file=sparc/sol2.h
2535                 else
2536                         tm_file=sparc/sol2-sld.h
2537                 fi
2538                 xm_file="xm-siglist.h sparc/xm-sysv4.h sparc/xm-sol2.h"
2539                 xm_defines="USG POSIX"
2540                 tmake_file=sparc/t-sol2
2541                 xmake_file=sparc/x-sysv4
2542                 extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
2543                 case $machine in
2544                 *-*-solaris2.[[0-4]])
2545                         fixincludes=fixinc.svr4;;
2546                 *)
2547                         fixincludes=fixinc.wrap;;
2548                 esac
2549                 float_format=i128
2550                 if [[ x${enable_threads} = x ]]; then
2551                     enable_threads=$have_pthread_h
2552                     if [[ x${enable_threads} = x ]]; then
2553                         enable_threads=$have_thread_h
2554                     fi
2555                 fi
2556                 if [[ x${enable_threads} = xyes ]]; then
2557                     if [[ x${have_pthread_h} = xyes ]]; then
2558                         thread_file='posix'
2559                     else
2560                         thread_file='solaris'
2561                     fi
2562                 fi
2563                 ;;
2564         sparc-*-sunos4.0*)
2565                 tm_file=sparc/sunos4.h
2566                 tmake_file=sparc/t-sunos40
2567                 use_collect2=yes
2568                 ;;
2569         sparc-*-sunos4*)
2570                 tm_file=sparc/sunos4.h
2571                 tmake_file=sparc/t-sunos41
2572                 use_collect2=yes
2573                 if [[ x$gas = xyes ]]; then
2574                         tm_file="${tm_file} sparc/sun4gas.h"
2575                 fi
2576                 ;;
2577         sparc-*-sunos3*)
2578                 tm_file=sparc/sun4o3.h
2579                 use_collect2=yes
2580                 ;;
2581         sparc-*-sysv4*)
2582                 tm_file=sparc/sysv4.h
2583                 xm_file="xm-siglist.h sparc/xm-sysv4.h"
2584                 xm_defines="USG POSIX"
2585                 tmake_file=t-svr4
2586                 xmake_file=sparc/x-sysv4
2587                 extra_parts="crtbegin.o crtend.o"
2588                 ;;
2589         sparc-*-vxsim*)
2590                 xm_file="xm-siglist.h sparc/xm-sysv4.h sparc/xm-sol2.h"
2591                 xm_defines="USG POSIX"
2592                 tm_file=sparc/vxsim.h
2593                 tmake_file=sparc/t-vxsparc
2594                 xmake_file=sparc/x-sysv4
2595                 ;;
2596         sparclet-*-aout*)
2597                 tm_file="sparc/splet.h libgloss.h"
2598                 tmake_file=sparc/t-splet
2599                 ;;
2600         sparclite-*-coff*)
2601                 tm_file="sparc/litecoff.h libgloss.h"
2602                 tmake_file=sparc/t-sparclite
2603                 ;;
2604         sparclite-*-aout*)
2605                 tm_file="sparc/lite.h aoutos.h libgloss.h"
2606                 tmake_file=sparc/t-sparclite
2607                 ;;
2608         sparc64-*-aout*)
2609                 tmake_file=sparc/t-sp64
2610                 tm_file=sparc/sp64-aout.h
2611                 ;;
2612         sparc64-*-elf*)
2613                 tmake_file=sparc/t-sp64
2614                 tm_file=sparc/sp64-elf.h
2615                 extra_parts="crtbegin.o crtend.o"
2616                 ;;
2617         sparc64-*-linux*)               # 64-bit Sparc's running GNU/Linux
2618                 tmake_file=sparc/t-sp64
2619                 xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
2620                 tm_file=sparc/linux64.h
2621                 xmake_file=x-linux
2622                 fixincludes=Makefile.in # The headers are ok already.
2623                 gnu_ld=yes
2624                 ;;
2625 # This hasn't been upgraded to GCC 2.
2626 #       tahoe-harris-*)                 # Harris tahoe, using COFF.
2627 #               tm_file=tahoe/harris.h
2628 #               ;;
2629 #       tahoe-*-bsd*)                   # tahoe running BSD
2630 #               ;;
2631         thumb-*-coff* | thumbel-*-coff*)
2632                 tm_file=arm/tcoff.h
2633                 out_file=arm/thumb.c
2634                 xm_file=arm/xm-thumb.h
2635                 md_file=arm/thumb.md
2636                 tmake_file=arm/t-thumb
2637                 ;;
2638 # This hasn't been upgraded to GCC 2.
2639 #       tron-*-*)
2640 #               cpu_type=gmicro
2641 #               use_collect2=yes
2642 #               ;;
2643         v850-*-*)
2644                 cpu_type=v850
2645                 tm_file="v850/v850.h"
2646                 xm_file="v850/xm-v850.h"
2647                 tmake_file=v850/t-v850
2648                 if [[ x$stabs = xyes ]]
2649                 then
2650                         tm_file="${tm_file} dbx.h"
2651                 fi
2652                 use_collect2=no
2653                 ;;
2654         vax-*-bsd*)                     # vaxen running BSD
2655                 use_collect2=yes
2656                 float_format=vax
2657                 ;;
2658         vax-*-sysv*)                    # vaxen running system V
2659                 tm_file="${tm_file} vax/vaxv.h"
2660                 xm_defines=USG
2661                 float_format=vax
2662                 ;;
2663         vax-*-netbsd*)
2664                 tm_file="${tm_file} netbsd.h vax/netbsd.h"
2665                 # On NetBSD, the headers are already okay, except for math.h.
2666                 fixincludes=fixinc.wrap
2667                 tmake_file=t-netbsd
2668                 float_format=vax
2669                 ;;
2670         vax-*-ultrix*)                  # vaxen running ultrix
2671                 tm_file="${tm_file} vax/ultrix.h"
2672                 use_collect2=yes
2673                 float_format=vax
2674                 ;;
2675         vax-*-vms*)                     # vaxen running VMS
2676                 xm_file=vax/xm-vms.h
2677                 tm_file=vax/vms.h
2678                 float_format=vax
2679                 ;;
2680         vax-*-*)                        # vax default entry
2681                 float_format=vax
2682                 ;;
2683         we32k-att-sysv*)
2684                 xm_file="${xm_file} xm-svr3"
2685                 use_collect2=yes
2686                 ;;
2687         *)
2688                 echo "Configuration $machine not supported" 1>&2
2689                 exit 1
2690                 ;;
2691         esac
2692
2693         case $machine in
2694         *-*-linux-gnu*)
2695                 ;; # Existing GNU/Linux systems do not use the GNU setup.
2696         *-*-gnu*)
2697                 # On the GNU system, the setup is just about the same on
2698                 # each different CPU.  The specific machines that GNU
2699                 # supports are matched above and just set $cpu_type.
2700                 xm_file="xm-gnu.h ${xm_file}"
2701                 tm_file=${cpu_type}/gnu.h
2702                 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
2703                 # GNU always uses ELF.
2704                 elf=yes
2705                 # GNU tools are the only tools.
2706                 gnu_ld=yes
2707                 gas=yes
2708                 # On GNU, the headers are already okay.
2709                 fixincludes=Makefile.in
2710                 xmake_file=x-linux      # These details are the same as Linux.
2711                 tmake_file=t-gnu        # These are not.
2712                 ;;
2713         *-*-sysv4*)
2714                 fixincludes=fixinc.svr4
2715                 xmake_try_sysv=x-sysv
2716                 install_headers_dir=install-headers-cpio
2717                 ;;
2718         *-*-sysv*)
2719                 install_headers_dir=install-headers-cpio
2720                 ;;
2721         esac
2722
2723         # Distinguish i[34567]86
2724         # Also, do not run mips-tfile on MIPS if using gas.
2725         # Process --with-cpu= for PowerPC/rs6000
2726         target_cpu_default2=
2727         case $machine in
2728         i486-*-*)
2729                 target_cpu_default2=1
2730                 ;;
2731         i586-*-*)
2732                 target_cpu_default2=2
2733                 ;;
2734         i686-*-* | i786-*-*)
2735                 target_cpu_default2=3
2736                 ;;
2737         alpha*-*-*)
2738                 case $machine in
2739                         alphaev6*)
2740                                 target_cpu_default2="MASK_CPU_EV6|MASK_BXW|MASK_CIX|MASK_MAX"
2741                                 ;;
2742                         alphapca56*)
2743                                 target_cpu_default2="MASK_CPU_EV5|MASK_BWX|MASK_MAX"
2744                                 ;;
2745                         alphaev56*)
2746                                 target_cpu_default2="MASK_CPU_EV5|MASK_BWX"
2747                                 ;;
2748                         alphaev5*)
2749                                 target_cpu_default2="MASK_CPU_EV5"
2750                                 ;;
2751                 esac
2752                                 
2753                 if [[ x$gas = xyes ]]
2754                 then
2755                         if [[ "$target_cpu_default2" = "" ]]
2756                         then
2757                                 target_cpu_default2="MASK_GAS"
2758                         else
2759                                 target_cpu_default2="${target_cpu_default2}|MASK_GAS"
2760                         fi
2761                 fi
2762                 ;;
2763         arm*-*-*)
2764                 case "x$with_cpu" in
2765                         x)
2766                                 # The most generic
2767                                 target_cpu_default2="TARGET_CPU_generic"
2768                                 ;;
2769
2770                         # Distinguish cores, and major variants
2771                         # arm7m doesn't exist, but D & I don't affect code
2772                         xarm[23678] | xarm250 | xarm[67][01]0 \
2773                         | xarm7m | xarm7dm | xarm7dmi | xarm7tdmi \
2774                         | xarm7100 | xarm7500 | xarm7500fe | xarm810 \
2775                         | xstrongarm | xstrongarm110)
2776                                 target_cpu_default2="TARGET_CPU_$with_cpu"
2777                                 ;;
2778
2779                         xyes | xno)
2780                                 echo "--with-cpu must be passed a value" 1>&2
2781                                 exit 1
2782                                 ;;
2783
2784                         *)
2785                                 if [[ x$pass2done = xyes ]]
2786                                 then
2787                                         echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
2788                                         exit 1
2789                                 fi
2790                                 ;;
2791                 esac
2792                 ;;
2793
2794         mips*-*-ecoff* | mips*-*-elf*)
2795                 if [[ x$gas = xyes ]]
2796                 then
2797                         if [[ x$gnu_ld = xyes ]]
2798                         then
2799                                 target_cpu_default2=20
2800                         else
2801                                 target_cpu_default2=16
2802                         fi
2803                 fi
2804                 ;;
2805         mips*-*-*)
2806                 if [[ x$gas = xyes ]]
2807                 then
2808                         target_cpu_default2=16
2809                 fi
2810                 ;;
2811         powerpc*-*-* | rs6000-*-*)
2812                 case "x$with_cpu" in
2813                         x)
2814                                 ;;
2815
2816                         xcommon | xpower | xpower2 | xpowerpc | xrios \
2817                           | xrios1 | xrios2 | xrsc | xrsc1 \
2818                           | x601 | x602 | x603 | x603e | x604 | x604e | x620 \
2819                           | x403 | x505 | x801 | x821 | x823 | x860)
2820                                 target_cpu_default2="\"$with_cpu\""
2821                                 ;;
2822
2823                         xyes | xno)
2824                                 echo "--with-cpu must be passed a value" 1>&2
2825                                 exit 1
2826                                 ;;
2827
2828                         *)
2829                                 if [[ x$pass2done = xyes ]]
2830                                 then
2831                                         echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
2832                                         exit 1
2833                                 fi
2834                                 ;;
2835                 esac
2836                 ;;
2837         sparc*-*-*)
2838                 case ".$with_cpu" in
2839                         .)
2840                                 target_cpu_default2=TARGET_CPU_"`echo $machine | sed 's/-.*$//'`"
2841                                 ;;
2842                         .supersparc | .ultrasparc | .v7 | .v8 | .v9)
2843                                 target_cpu_default2="TARGET_CPU_$with_cpu"
2844                                 ;;
2845                         *)
2846                                 if [[ x$pass2done = xyes ]]
2847                                 then
2848                                         echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
2849                                         exit 1
2850                                 fi
2851                                 ;;
2852                 esac
2853                 ;;
2854         esac
2855
2856         if [[ "$target_cpu_default2" != "" ]]
2857         then
2858                 if [[ "$target_cpu_default" != "" ]]
2859                 then
2860                         target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
2861                 else
2862                         target_cpu_default=$target_cpu_default2
2863                 fi
2864         fi
2865
2866         # No need for collect2 if we have the GNU linker.
2867         case x$gnu_ld in
2868         xyes)
2869                 use_collect2=
2870                 ;;
2871         esac
2872
2873 # Save data on machine being used to compile GCC in build_xm_file.
2874 # Save data on host machine in vars host_xm_file and host_xmake_file.
2875         if [[ x$pass1done = x ]]
2876         then
2877                 if [[ x"$xm_file" = x ]]
2878                 then build_xm_file=$cpu_type/xm-$cpu_type.h
2879                 else build_xm_file=$xm_file
2880                 fi
2881                 build_xm_defines=$xm_defines
2882                 build_install_headers_dir=$install_headers_dir
2883                 build_exeext=$exeext
2884                 pass1done=yes
2885         else
2886                 if [[ x$pass2done = x ]]
2887                 then
2888                         if [[ x"$xm_file" = x ]]
2889                         then host_xm_file=$cpu_type/xm-$cpu_type.h
2890                         else host_xm_file=$xm_file
2891                         fi
2892                         host_xm_defines=$xm_defines
2893                         if [[ x"$xmake_file" = x ]]
2894                         then xmake_file=$cpu_type/x-$cpu_type
2895                         fi
2896                         host_xmake_file="$xmake_file"
2897                         host_truncate_target=$truncate_target
2898                         host_extra_gcc_objs=$extra_gcc_objs
2899                         host_extra_objs=$extra_host_objs
2900                         host_exeext=$exeext
2901                         pass2done=yes
2902                 fi
2903         fi
2904 done
2905
2906 extra_objs="${host_extra_objs} ${extra_objs}"
2907
2908 # Default the target-machine variables that were not explicitly set.
2909 if [[ x"$tm_file" = x ]]
2910 then tm_file=$cpu_type/$cpu_type.h; fi
2911
2912 if [[ x$extra_headers = x ]]
2913 then extra_headers=; fi
2914
2915 if [[ x"$xm_file" = x ]]
2916 then xm_file=$cpu_type/xm-$cpu_type.h; fi
2917
2918 if [[ x$md_file = x ]]
2919 then md_file=$cpu_type/$cpu_type.md; fi
2920
2921 if [[ x$out_file = x ]]
2922 then out_file=$cpu_type/$cpu_type.c; fi
2923
2924 if [[ x"$tmake_file" = x ]]
2925 then tmake_file=$cpu_type/t-$cpu_type
2926 fi
2927
2928 if [[ x$float_format = x ]]
2929 then float_format=i64
2930 fi
2931
2932 if [[ x$enable_haifa = x ]]
2933 then
2934   case $target in
2935     alpha*-* | hppa1.?-* | powerpc*-* | rs6000-* | *sparc-* | m32r*-*)
2936       enable_haifa=yes;;
2937   esac
2938 fi
2939
2940 # Say what files are being used for the output code and MD file.
2941 echo "Using \`$srcdir/config/$out_file' to output insns."
2942 echo "Using \`$srcdir/config/$md_file' as machine description file."
2943
2944 count=a
2945 for f in $tm_file; do
2946         count=${count}x
2947 done
2948 if [[ $count = ax ]]; then
2949         echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
2950 else
2951         echo "Using the following target machine macro files:"
2952         for f in $tm_file; do
2953                 echo "  $srcdir/config/$f"
2954         done
2955 fi
2956
2957 count=a
2958 for f in $host_xm_file; do
2959         count=${count}x
2960 done
2961 if [[ $count = ax ]]; then
2962         echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
2963 else
2964         echo "Using the following host machine macro files:"
2965         for f in $host_xm_file; do
2966                 echo "  $srcdir/config/$f"
2967         done
2968 fi
2969
2970 if [[ "$host_xm_file" != "$build_xm_file" ]]; then
2971         count=a
2972         for f in $build_xm_file; do
2973                 count=${count}x
2974         done
2975         if [[ $count = ax ]]; then
2976                 echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
2977         else
2978                 echo "Using the following build machine macro files:"
2979                 for f in $build_xm_file; do
2980                         echo "  $srcdir/config/$f"
2981                 done
2982         fi
2983 fi
2984
2985 if [[ x$thread_file = x ]]; then
2986         if [[ x$target_thread_file != x ]]; then
2987                 thread_file=$target_thread_file
2988         else
2989                 thread_file='single'
2990         fi
2991 fi
2992
2993 # Set up the header files.
2994 # $links is the list of header files to create.
2995 # $vars is the list of shell variables with file names to include.
2996 # auto-host.h is the file containing items generated by autoconf and is
2997 # the first file included by config.h.
2998 null_defines=
2999 host_xm_file="auto-host.h ${host_xm_file}"
3000
3001 # If host=build, it is correct to have hconfig include auto-host.h
3002 # as well.  If host!=build, we are in error and need to do more 
3003 # work to find out the build config parameters.
3004 if [[ x$host = x$build ]]
3005 then
3006         build_xm_file="auto-host.h ${build_xm_file}"
3007 else
3008         # We create a subdir, then run autoconf in the subdir.
3009         # To prevent recursion we set host and build for the new
3010         # invocation of configure to the build for this invocation
3011         # of configure. 
3012         tempdir=build.$$
3013         rm -rf $tempdir
3014         mkdir $tempdir
3015         cd $tempdir
3016         case ${srcdir} in
3017         /*) realsrcdir=${srcdir};;
3018         *) realsrcdir=../${srcdir};;
3019         esac
3020         CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
3021                 --target=$target --host=$build --build=$build
3022
3023         # We just finished tests for the build machine, so rename
3024         # the file auto-build.h in the gcc directory.
3025         mv auto-host.h ../auto-build.h
3026         cd ..
3027         rm -rf $tempdir
3028         build_xm_file="auto-build.h ${build_xm_file}"
3029 fi
3030
3031 vars="host_xm_file tm_file xm_file build_xm_file"
3032 links="config.h tm.h tconfig.h hconfig.h"
3033 defines="host_xm_defines null_defines xm_defines build_xm_defines"
3034
3035 rm -f config.bak
3036 if [[ -f config.status ]]; then mv -f config.status config.bak; fi
3037
3038 # Make the links.
3039 while [[ -n "$vars" ]]
3040 do
3041         set $vars; var=$1; shift; vars=$*
3042         set $links; link=$1; shift; links=$*
3043         set $defines; define=$1; shift; defines=$*
3044
3045         rm -f $link
3046
3047         # Define TARGET_CPU_DEFAULT if the system wants one.
3048         # This substitutes for lots of *.h files.
3049         if [[ "$target_cpu_default" != "" -a $link = tm.h ]]
3050         then
3051                 echo "#define TARGET_CPU_DEFAULT ($target_cpu_default)" >>$link
3052         fi
3053
3054         for file in `eval echo '$'$var`; do
3055                 echo "#include \"$file\"" >>$link
3056         done
3057
3058         for def in `eval echo '$'$define`; do
3059                 echo "#ifndef $def" >>$link
3060                 echo "#define $def" >>$link
3061                 echo "#endif" >>$link
3062         done
3063 done
3064
3065 # Truncate the target if necessary
3066 if [[ x$host_truncate_target != x ]]; then
3067         target=`echo $target | sed -e 's/\(..............\).*/\1/'`
3068 fi
3069
3070 # Get the version number from the toplevel
3071 version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${srcdir}/version.c`
3072
3073 # Get an absolute path to the GCC top-level source directory
3074 holddir=`pwd`
3075 cd $srcdir
3076 topdir=`pwd`
3077 cd $holddir
3078
3079 # Conditionalize the makefile for this host machine.
3080 # Make-host contains the concatenation of all host makefile fragments
3081 # [there can be more than one].  This file is built by configure.frag.
3082 host_overrides=Make-host
3083 dep_host_xmake_file=
3084 for f in .. ${host_xmake_file}
3085 do
3086         if [[ -f ${srcdir}/config/$f ]]
3087         then
3088                 dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
3089         fi
3090 done
3091
3092 # Conditionalize the makefile for this target machine.
3093 # Make-target contains the concatenation of all host makefile fragments
3094 # [there can be more than one].  This file is built by configure.frag.
3095 target_overrides=Make-target
3096 dep_tmake_file=
3097 for f in .. ${tmake_file}
3098 do
3099         if [[ -f ${srcdir}/config/$f ]]
3100         then
3101                 dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
3102         fi
3103 done
3104
3105 # If the host doesn't support symlinks, modify CC in
3106 # FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
3107 # Otherwise, we can use "CC=$(CC)".
3108 rm -f symtest.tem
3109 if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
3110 then
3111         cc_set_by_configure="\$(CC)"
3112         stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
3113 else
3114         rm -f symtest.tem
3115         if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
3116         then
3117                 symbolic_link="cp -p"
3118         else
3119                 symbolic_link="cp"
3120         fi
3121         cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
3122         stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
3123 fi
3124 rm -f symtest.tem
3125
3126 out_object_file=`basename $out_file .c`.o
3127
3128 tm_file_list=
3129 for f in $tm_file; do
3130         tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
3131 done
3132
3133 host_xm_file_list=
3134 for f in $host_xm_file; do
3135         if test $f != "auto-host.h"; then
3136                 host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
3137         else
3138                 host_xm_file_list="${host_xm_file_list} auto-host.h"
3139         fi
3140 done
3141
3142 build_xm_file_list=
3143 for f in $build_xm_file; do
3144         if test $f != "auto-build.h"; then
3145                 if test $f != "auto-host.h"; then
3146                         build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
3147                 else
3148                         build_xm_file_list="${build_xm_file_list} auto-host.h"
3149                 fi
3150         else
3151                 build_xm_file_list="${build_xm_file_list} auto-build.h"
3152         fi
3153 done
3154
3155 # Define macro CROSS_COMPILE in compilation
3156 # if this is a cross-compiler.
3157 # Also use all.cross instead of all.internal
3158 # and add cross-make to Makefile.
3159 cross_overrides="/dev/null"
3160 if [[ x$host != x$target ]]
3161 then
3162         cross_defines="CROSS=-DCROSS_COMPILE"
3163         cross_overrides="${topdir}/cross-make"
3164 fi
3165
3166 # When building gcc with a cross-compiler, we need to fix a few things.
3167 # This must come after cross-make as we want all.build to override
3168 # all.cross.
3169 build_overrides="/dev/null"
3170 if [[ x$build != x$host ]]
3171 then
3172         build_overrides="${topdir}/build-make"
3173 fi
3174
3175 # Expand extra_headers to include complete path.
3176 # This substitutes for lots of t-* files.
3177 extra_headers_list=
3178 if [[ "x$extra_headers" = x ]]
3179 then true
3180 else
3181         # Prepend ${srcdir}/ginclude/ to every entry in extra_headers.
3182         for file in $extra_headers;
3183         do
3184                 extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/${file}"
3185         done
3186 fi
3187
3188 # Add a definition of USE_COLLECT2 if system wants one.
3189 # Also tell toplev.c what to do.
3190 # This substitutes for lots of t-* files.
3191 if [[ x$use_collect2 = x ]]
3192 then
3193         will_use_collect2=
3194         maybe_use_collect2=
3195 else
3196         will_use_collect2="collect2"
3197         maybe_use_collect2="-DUSE_COLLECT2"
3198 fi
3199
3200 # NEED TO CONVERT
3201 # Set MD_DEPS if the real md file is in md.pre-cpp.
3202 # Set MD_CPP to the cpp to pass the md file through.  Md files use ';'
3203 # for line oriented comments, so we must always use a GNU cpp.  If
3204 # building gcc with a cross compiler, use the cross compiler just
3205 # built.  Otherwise, we can use the cpp just built.
3206 md_file_sub=
3207 if [[ "x$md_cppflags" = x ]]
3208 then
3209         md_file_sub=$srcdir/config/$md_file
3210 else
3211         md_file=md
3212 fi
3213
3214 # If we have gas in the build tree, make a link to it.
3215 if [[ -f ../gas/Makefile ]]; then
3216         rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
3217 fi
3218
3219 # If we have ld in the build tree, make a link to it.
3220 if [[ -f ../ld/Makefile ]]; then
3221 #       if [[ x$use_collect2 = x ]]; then
3222 #               rm -f ld; $symbolic_link ../ld/ld-new$host_exeext ld$host_exeext 2>/dev/null
3223 #       else
3224                 rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
3225 #       fi
3226 fi
3227
3228 # Figure out what language subdirectories are present.
3229 subdirs=
3230 for lang in ${srcdir}/*/config-lang.in ..
3231 do
3232         case $lang in
3233         ..) ;;
3234         # The odd quoting in the next line works around
3235         # an apparent bug in bash 1.12 on linux.
3236         ${srcdir}/[[*]]/config-lang.in) ;;
3237         *) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`" ;;
3238         esac
3239 done
3240
3241 # Make gthr-default.h if we have a thread file.
3242 gthread_flags=
3243 if [[ $thread_file != single ]]; then
3244     rm -f gthr-default.h
3245     echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
3246     gthread_flags=-DHAVE_GTHR_DEFAULT
3247 fi
3248 AC_SUBST(gthread_flags)
3249
3250 # Make empty files to contain the specs and options for each language.
3251 # Then add #include lines to for a compiler that has specs and/or options.
3252
3253 lang_specs_files=
3254 lang_options_files=
3255 rm -f specs.h options.h
3256 touch specs.h options.h
3257 for subdir in . $subdirs
3258 do
3259         if [[ -f $srcdir/$subdir/lang-specs.h ]]; then
3260                 echo "#include \"$subdir/lang-specs.h\"" >>specs.h
3261                 lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
3262         fi
3263         if [[ -f $srcdir/$subdir/lang-options.h ]]; then
3264                 echo "#include \"$subdir/lang-options.h\"" >>options.h
3265                 lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
3266         fi
3267 done
3268
3269 # These (without "all_") are set in each config-lang.in.
3270 # `language' must be a single word so is spelled singularly.
3271 all_languages=
3272 all_boot_languages=
3273 all_compilers=
3274 all_stagestuff=
3275 all_diff_excludes=
3276 all_outputs=Makefile
3277 # List of language makefile fragments.
3278 all_lang_makefiles=
3279 all_headers=
3280 all_lib2funcs=
3281
3282 # Add the language fragments.
3283 # Languages are added via two mechanisms.  Some information must be
3284 # recorded in makefile variables, these are defined in config-lang.in.
3285 # We accumulate them and plug them into the main Makefile.
3286 # The other mechanism is a set of hooks for each of the main targets
3287 # like `clean', `install', etc.
3288
3289 language_fragments="Make-lang"
3290 language_hooks="Make-hooks"
3291 oldstyle_subdirs=
3292
3293 for s in .. $subdirs
3294 do
3295         if [[ $s != ".." ]]
3296         then
3297                 language=
3298                 boot_language=
3299                 compilers=
3300                 stagestuff=
3301                 diff_excludes=
3302                 headers=
3303                 outputs=
3304                 lib2funcs=
3305                 . ${srcdir}/$s/config-lang.in
3306                 if [[ "x$language" = x ]]
3307                 then
3308                         echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
3309                         exit 1
3310                 fi
3311                 all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in ${srcdir}/$s/Makefile.in"
3312                 all_languages="$all_languages $language"
3313                 if [[ "x$boot_language" = xyes ]]
3314                 then
3315                         all_boot_languages="$all_boot_languages $language"
3316                 fi
3317                 all_compilers="$all_compilers $compilers"
3318                 all_stagestuff="$all_stagestuff $stagestuff"
3319                 all_diff_excludes="$all_diff_excludes $diff_excludes"
3320                 all_headers="$all_headers $headers"
3321                 all_outputs="$all_outputs $outputs"
3322                 if [[ x$outputs = x ]]
3323                 then
3324                         oldstyle_subdirs="$oldstyle_subdirs $s"
3325                 fi
3326                 all_lib2funcs="$all_lib2funcs $lib2funcs"
3327         fi
3328 done
3329
3330 # Since we can't use `::' targets, we link each language in
3331 # with a set of hooks, reached indirectly via lang.${target}.
3332
3333 rm -f Make-hooks
3334 touch Make-hooks
3335 target_list="all.build all.cross start.encap rest.encap \
3336         info dvi \
3337         install-normal install-common install-info install-man \
3338         uninstall distdir \
3339         mostlyclean clean distclean extraclean maintainer-clean \
3340         stage1 stage2 stage3 stage4"
3341 for t in $target_list
3342 do
3343         x=
3344         for l in .. $all_languages
3345         do
3346                 if [[ $l != ".." ]]; then
3347                         x="$x $l.$t"
3348                 fi
3349         done
3350         echo "lang.$t: $x" >> Make-hooks
3351 done
3352
3353 # If we're not building in srcdir, create .gdbinit.
3354
3355 if [[ ! -f Makefile.in ]]; then
3356         echo "dir ." > .gdbinit
3357         echo "dir ${srcdir}" >> .gdbinit
3358         if [[ x$gdb_needs_out_file_path = xyes ]]
3359         then
3360                 echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
3361         fi
3362         if [[ "x$subdirs" != x ]]; then
3363                 for s in $subdirs
3364                 do
3365                         echo "dir ${srcdir}/$s" >> .gdbinit
3366                 done
3367         fi
3368         echo "source ${srcdir}/.gdbinit" >> .gdbinit
3369 fi
3370
3371 # Define variables host_canonical and build_canonical
3372 # because some Cygnus local changes in the Makefile depend on them.
3373 build_canonical=${build}
3374 host_canonical=${host}
3375 target_subdir=
3376 if [[ "${host}" != "${target}" ]] ; then
3377     target_subdir=${target}/
3378 fi
3379 AC_SUBST(build_canonical)
3380 AC_SUBST(host_canonical)
3381 AC_SUBST(target_subdir)
3382         
3383 # If this is using newlib, then define inhibit_libc in
3384 # LIBGCC2_CFLAGS.  This will cause __eprintf to be left out of
3385 # libgcc.a, but that's OK because newib should have its own version of
3386 # assert.h.
3387 inhibit_libc=
3388 if [[ x$with_newlib = xyes ]]; then
3389         inhibit_libc=-Dinhibit_libc
3390 fi
3391 AC_SUBST(inhibit_libc)
3392
3393 # Override SCHED_OBJ and SCHED_CFLAGS to enable the Haifa scheduler.
3394 sched_prefix=
3395 sched_cflags=
3396 if [[ x$enable_haifa = xyes ]]; then
3397     echo "Using the Haifa scheduler."
3398     sched_prefix=haifa-
3399     sched_cflags=-DHAIFA
3400 fi
3401 AC_SUBST(sched_prefix)
3402 AC_SUBST(sched_cflags)
3403 if [[ x$enable_haifa != x ]]; then
3404     # Explicitly remove files that need to be recompiled for the Haifa scheduler.
3405     for x in genattrtab.o toplev.o loop.o unroll.o *sched.o; do
3406         if [[ -f $x ]]; then
3407             echo "Removing $x"
3408             rm -f $x
3409         fi
3410     done
3411 fi
3412
3413 # Nothing to do for FLOAT_H, float_format already handled.
3414 objdir=`pwd`
3415 AC_SUBST(objdir)
3416
3417 # Process the language and host/target makefile fragments.
3418 ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
3419
3420 # Substitute configuration variables
3421 AC_SUBST(subdirs)
3422 AC_SUBST(all_languages)
3423 AC_SUBST(all_boot_languages)
3424 AC_SUBST(all_compilers)
3425 AC_SUBST(all_lang_makefiles)
3426 AC_SUBST(all_stagestuff)
3427 AC_SUBST(all_diff_excludes)
3428 AC_SUBST(all_lib2funcs)
3429 AC_SUBST(all_headers)
3430 AC_SUBST(extra_passes)
3431 AC_SUBST(extra_programs)
3432 AC_SUBST(extra_parts)
3433 AC_SUBST(extra_c_objs)
3434 AC_SUBST(extra_c_flags)
3435 AC_SUBST(extra_objs)
3436 AC_SUBST(host_extra_gcc_objs)
3437 AC_SUBST(extra_headers_list)
3438 AC_SUBST(dep_host_xmake_file)
3439 AC_SUBST(dep_tmake_file)
3440 AC_SUBST(out_file)
3441 AC_SUBST(out_object_file)
3442 AC_SUBST(md_file)
3443 AC_SUBST(tm_file_list)
3444 AC_SUBST(build_xm_file_list)
3445 AC_SUBST(host_xm_file_list)
3446 AC_SUBST(lang_specs_files)
3447 AC_SUBST(lang_options_files)
3448 AC_SUBST(thread_file)
3449 AC_SUBST(version)
3450 AC_SUBST(local_prefix)
3451 AC_SUBST(gxx_include_dir)
3452 AC_SUBST(fixincludes)
3453 AC_SUBST(build_install_headers_dir)
3454 AC_SUBST(build_exeext)
3455 AC_SUBST(host_exeext)
3456 AC_SUBST(float_format)
3457 AC_SUBST(will_use_collect2)
3458 AC_SUBST(maybe_use_collect2)
3459 AC_SUBST(cc_set_by_configure)
3460 AC_SUBST(stage_prefix_set_by_configure)
3461 AC_SUBST(install)
3462 AC_SUBST(symbolic_link)
3463
3464 AC_SUBST_FILE(target_overrides)
3465 AC_SUBST_FILE(host_overrides)
3466 AC_SUBST(cross_defines)
3467 AC_SUBST_FILE(cross_overrides)
3468 AC_SUBST_FILE(build_overrides)
3469 AC_SUBST_FILE(language_fragments)
3470 AC_SUBST_FILE(language_hooks)
3471
3472 # Echo that links are built
3473 if [[ x$host = x$target ]]
3474 then
3475         str1="native "
3476 else
3477         str1="cross-"
3478         str2=" from $host"
3479 fi
3480
3481 if [[ x$host != x$build ]]
3482 then
3483         str3=" on a $build system"
3484 fi
3485
3486 if [[ "x$str2" != x ]] || [[ "x$str3" != x ]]
3487 then
3488         str4=
3489 fi
3490
3491 echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
3492
3493 if [[ "x$str2" != x ]] || [[ "x$str3" != x ]]
3494 then
3495         echo " ${str2}${str3}." 1>&2
3496 fi
3497
3498 # Truncate the target if necessary
3499 if [[ x$host_truncate_target != x ]]; then
3500         target=`echo $target | sed -e 's/\(..............\).*/\1/'`
3501 fi
3502
3503 # Configure the subdirectories
3504 # AC_CONFIG_SUBDIRS($subdirs)
3505
3506 # Create the Makefile
3507 # and configure language subdirectories
3508 AC_OUTPUT($all_outputs,
3509 [
3510 . $srcdir/configure.lang
3511 case x$CONFIG_HEADERS in
3512 xauto-host.h:config.in)
3513 echo > cstamp-h ;;
3514 esac
3515 # If the host supports symlinks, point stage[1234] at ../stage[1234] so
3516 # bootstrapping and the installation procedure can still use
3517 # CC="stage1/xgcc -Bstage1/".  If the host doesn't support symlinks,
3518 # FLAGS_TO_PASS has been modified to solve the problem there.
3519 # This is virtually a duplicate of what happens in configure.lang; we do
3520 # an extra check to make sure this only happens if ln -s can be used.
3521 if [[ "$symbolic_link" = "ln -s" ]]; then
3522  for d in .. ${subdirs} ; do
3523    if [[ $d != .. ]]; then
3524         STARTDIR=`pwd`
3525         cd $d
3526         for t in stage1 stage2 stage3 stage4 include
3527         do
3528                 rm -f $t
3529                 $symbolic_link ../$t $t 2>/dev/null
3530         done
3531         cd $STARTDIR
3532    fi
3533  done
3534 else true ; fi
3535 ],
3536 [
3537 host='${host}'
3538 build='${build}'
3539 target='${target}'
3540 target_alias='${target_alias}'
3541 srcdir='${srcdir}'
3542 subdirs='${subdirs}'
3543 oldstyle_subdirs='${oldstyle_subdirs}'
3544 symbolic_link='${symbolic_link}'
3545 program_transform_set='${program_transform_set}'
3546 program_transform_name='${program_transform_name}'
3547 dep_host_xmake_file='${dep_host_xmake_file}'
3548 host_xmake_file='${host_xmake_file}'
3549 dep_tmake_file='${dep_tmake_file}'
3550 tmake_file='${tmake_file}'
3551 thread_file='${thread_file}'
3552 version='${version}'
3553 local_prefix='${local_prefix}'
3554 build_install_headers_dir='${build_install_headers_dir}'
3555 build_exeext='${build_exeext}'
3556 host_exeext='${host_exeext}'
3557 out_file='${out_file}'
3558 gdb_needs_out_file_path='${gdb_needs_out_file_path}'
3559 SET_MAKE='${SET_MAKE}'
3560 target_list='${target_list}'
3561 target_overrides='${target_overrides}'
3562 host_overrides='${host_overrides}'
3563 cross_defines='${cross_defines}'
3564 cross_overrides='${cross_overrides}'
3565 build_overrides='${build_overrides}'
3566 ])