OSDN Git Service

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