OSDN Git Service

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