configure revision 18335
1#!/bin/sh
2# Configuration script for GNU CC
3#   Copyright (C) 1988, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
4
5#This file is part of GNU CC.
6
7#GNU CC is free software; you can redistribute it and/or modify
8#it under the terms of the GNU General Public License as published by
9#the Free Software Foundation; either version 2, or (at your option)
10#any later version.
11
12#GNU CC is distributed in the hope that it will be useful,
13#but WITHOUT ANY WARRANTY; without even the implied warranty of
14#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15#GNU General Public License for more details.
16
17#You should have received a copy of the GNU General Public License
18#along with GNU CC; see the file COPYING.  If not, write to
19#the Free Software Foundation, 59 Temple Place - Suite 330,
20#Boston, MA 02111-1307, USA.
21
22#
23# Shell script to create proper links to machine-dependent files in
24# preparation for compiling gcc.
25#
26# Options: --srcdir=DIR		specifies directory where sources are.
27# 	   --host=HOST		specifies host configuration.
28#	   --target=TARGET	specifies target configuration.
29#	   --build=TARGET	specifies configuration of machine you are
30#				using to compile GCC.
31#	   --prefix=DIR		specifies directory to install in.
32#	   --local-prefix=DIR	specifies directory to put local ./include in.
33#	   --gxx-include-dir=DIR specifies directory to put g++ header files in.
34#	   --exec-prefix=DIR	specifies directory to install executables in.
35#	   --with-gnu-ld	arrange to work with GNU ld.
36#	   --with-gnu-as	arrange to work with GAS.
37#	   --with-stabs		arrange to use stabs instead of host debug format.
38#	   --with-elf		arrange to use elf instead of host debug format.
39#	   --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)
40#	   --disable-FOO	do not include feature FOO
41#	   --nfp		assume system has no FPU.
42#	   --program-prefix=PREFIX specifies prefix for executable names.
43#	   --program-suffix=SUFFIX specifies suffix for executable names.
44#	   --program-transform-name=SED-EXPR specifies `sed' expression to
45#				apply to executable names.
46#
47# If configure succeeds, it leaves its status in config.status.
48# If configure fails after disturbing the status quo, 
49# 	config.status is removed.
50#
51
52progname=$0
53
54# Default --srcdir to the directory where the script is found, 
55# if a directory was specified.
56# The second sed call is to convert `.//configure' to `./configure'.
57srcdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
58if [ x$srcdir = x$0 ]
59then
60srcdir=
61fi
62
63host=
64
65# Default prefix to /usr/local.
66prefix=/usr/local
67
68# On systems where GCC is the native compiler, $prefix should be
69# /usr. But the user can change it with configure --prefix=/foo/bar
70native_prefix=/usr
71 
72# local_prefix specifies where to find the directory /usr/local/include
73# We don't use $(prefix) for this
74# because we always want GCC to search /usr/local/include
75# even if GCC is installed somewhere other than /usr/local.
76# Think THREE TIMES before specifying any other value for this!
77# DO NOT make this use $prefix!
78local_prefix=/usr/local
79# Default is to let the Makefile set exec_prefix from $(prefix)
80exec_prefix='$(prefix)'
81#
82# The default g++ include directory is $(libdir)/g++-include.
83gxx_include_dir='$(libdir)/g++-include'
84
85# Default --program-transform-name to nothing.
86program_transform_name=
87program_transform_set=
88
89remove=rm
90hard_link=ln
91symbolic_link='ln -s'
92copy=cp
93
94# Record all the arguments, to write them in config.status.
95arguments=$*
96
97#for Test
98#remove="echo rm"
99#hard_link="echo ln"
100#symbolic_link="echo ln -s"
101
102target=
103host=
104build=
105name1=
106name2=
107
108for arg in $*;
109do
110  case $next_arg in
111  --srcdir)
112    srcdir=$arg
113    next_arg=
114    ;;
115  --host)
116    host=$arg
117    next_arg=
118    ;;
119  --target)
120    target=$arg
121    next_arg=
122    ;;
123  --build)
124    build=$arg
125    next_arg=
126    ;;
127  --prefix)
128    prefix=$arg
129    native_prefix=$prefix
130    next_arg=
131    ;;
132  --local-prefix)
133    local_prefix=$arg
134    next_arg=
135    ;;
136  --gxx-include-dir)
137    gxx_include_dir=$arg
138    next_arg=
139    ;;
140  --exec-prefix)
141    exec_prefix=$arg
142    next_arg=
143    ;;
144  --program-transform-name)
145    # Double any backslashes or dollar signs in the argument.
146    if [ -n "${arg}" ] ; then
147      program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
148    fi
149    program_transform_set=yes
150    next_arg=
151    ;;    
152  --program-prefix)
153    if [ -n "${arg}" ]; then
154      program_transform_name="${program_transform_name} -e s,^,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
155    fi
156    program_transform_set=yes
157    next_arg=
158    ;;
159  --program-suffix)
160    if [ -n "${arg}" ]; then
161      program_transform_name="${program_transform_name} -e s,\$\$,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
162    fi
163    program_transform_set=yes
164    next_arg=
165    ;;
166  --x-*)
167    next_arg=
168    ;;
169  *)
170    case $arg in
171      -*)
172	if [ x$name1 != x ]
173	then
174		echo "Positional arguments must be last." 1>&2
175		exit 1
176	fi
177	;;
178    esac
179
180    case $arg in
181     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
182	next_arg=--srcdir
183	;;
184     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
185	srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
186	;;
187     -host | --host | --hos | --ho)
188	next_arg=--host
189	;;
190     -host=* | --host=* | --hos=* | --ho=*)
191	host=`echo $arg | sed 's/-*h[a-z]*=//'`
192	;; 
193     -target | --target | --targe | --targ | --tar | --ta | --t)
194	next_arg=--target
195	;;
196     -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
197	target=`echo $arg | sed 's/-*t[a-z]*=//'`
198	;; 
199     -build | --build | --buil | --bui | --bu | --b)
200	next_arg=--build
201	;;
202     -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
203	build=`echo $arg | sed 's/-*b[a-z]*=//'`
204	;; 
205     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
206	next_arg=--prefix
207	;;
208     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
209	prefix=`echo $arg | sed 's/-*p[a-z]*=//'`
210	native_prefix=$prefix
211	;;
212     -local-prefix | --local-prefix | --local-prefi | --local-pref | --local-pre \
213	| --local-pr | --local-p | --local- | --local | --loc | --lo | --l)
214	next_arg=--local-prefix
215	;;
216     -local-prefix=* | --local-prefix=* | --local-prefi=* | --local-pref=* \
217	| --local-pre=* | --local-pr=* | --local-p=* | --local-=* | --local=* \
218	| --loc=* | --lo=* | --l=*)
219	local_prefix=`echo $arg | sed 's/-*l[-a-z]*=//'`
220	;;
221     -gxx-include-dir | --gxx-include-dir | --gxx-include \
222	| --gxx-incl | --gxx-inc | --gxx-in | --gxx-i | --gxx- \
223	| --gxx | --gxx | --gx | --g)
224	next_arg=--gxx-include-dir
225	;;
226     -gxx-include-dir=* | --gxx-include-dir=* | --gxx-include=* \
227	| --gxx-incl=* | --gxx-inc=* | --gxx-in=* | --gxx-i=* \
228	| --gxx-=* | --gxx=* | --gxx=* | --gxx=* | --g=*)
229	gxx_include_dir=`echo $arg | sed 's/-*g[-a-z]*=//'`
230	;;
231     -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \
232	| --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
233	next_arg=--exec-prefix
234	;;
235     -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* \
236	| --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \
237	| --exe=* | --ex=* | --e=*)
238	exec_prefix=`echo $arg | sed 's/-*e[-a-z]*=//'`
239	;;
240     -program-transform-name | --program-transform-name \
241	| --program-transform-nam | --program-transform-na \
242	| --program-transform-n | --program-transform- | --program-transform \
243	| --program-transfor | --program-transfo | --program-transf \
244	| --program-trans | --program-tran | --program-tra \
245	| --program-tr | --program-t)
246	next_arg=--program-transform-name
247	;;
248     -program-transform-name=* | --program-transform-name=* \
249	| --program-transform-nam=* | --program-transform-na=* \
250	| --program-transform-n=* | --program-transform-=* \
251	| --program-transform=* | --program-transfor=* | --program-transfo=* \
252	| --program-transf=* | --program-trans=* | --program-tran=* \
253	| --program-tra=* | --program-tr=* | --program-t=*)
254	arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
255	# Double any \ or $ in the argument.
256	if [ -n "${arg}" ] ; then
257	  program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
258	fi
259	program_transform_set=yes
260	;;
261     -program-prefix | --program-prefix | --program-prefi \
262	| --program-pref | --program-pre | --program-pr \
263	| --program-p)
264	next_arg=--program-prefix
265	;;
266     -program-prefix=* | --program-prefix=* | --program-prefi=* \
267	| --program-pref=* | --program-pre=* | --program-pr=* \
268	| --program-p=*)
269	arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
270	if [ -n "${arg}" ]; then
271	  program_transform_name="${program_transform_name} -e s,^,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
272	fi
273	program_transform_set=yes
274	;;
275     -program-suffix | --program-suffix | --program-suffi \
276	| --program-suff | --program-suf | --program-su \
277	| --program-s)
278	next_arg=--program-suffix
279	;;
280     -program-suffix=* | --program-suffix=* | --program-suffi=* \
281	| --program-suff=* | --program-suf=* | --program-su=* \
282	| --program-s=*)
283	arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
284	if [ -n "${arg}" ]; then
285	  program_transform_name="${program_transform_name} -e s,\$\$,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
286	fi
287	program_transform_set=yes
288	;;
289     -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
290	gnu_ld=yes
291	;;
292     -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
293        gas=yes
294	;;
295     -nfp | --nfp | --nf | --n)
296	nfp=yes
297	;;
298     -with-stabs | -with-stab | -with-sta | -with-st | -with-s \
299	| --with-stabs | --with-stab | --with-sta | --with-st | --with-s \
300	| -stabs | -stab | -sta | -st  \
301	| --stabs | --stab | --sta | --st)
302	stabs=yes
303	;;
304     -with-elf | -with-el | -with-se \
305	| --with-elf | --with-el | --with-e \
306	| -elf | -el | -e \
307	|--elf | --el | --e)
308	elf=yes
309	;;
310     -with-* | --with-*) ;; #ignored
311     -without-* | --without-*) ;; #ignored
312     -disable-* | --disable-*)
313	enableopt=`echo ${arg} | sed 's:^-*disable-:enable_:;s:-:_:g'`
314	eval $enableopt=no
315	;;
316     -enable-* | --enable-*)
317	case "$arg" in
318	*=*)	optarg=`echo $arg | sed 's:^[^=]*=::;s:-:_:g'` ;;
319	*)	optarg=yes ;;
320	esac
321	enableopt=`echo ${arg} | sed 's:^-*::;s:=.*$::;s:-:_:g'`
322	eval $enableopt="$optarg"
323	;;
324     -x | --x) ;; # ignored
325     -x-*=* | --x-*=*) ;; # ignored
326     -x-* | --x-*)
327	next_arg=--x-ignored # ignored
328	;;
329     --he*) ;; # ignored for now (--help)
330     --vers*) ;; # ignored for now (--version)
331     -v | -verb* | --verb*) ;; # ignored for now (--verbose)
332     --program-*) ;; #ignored (--program-prefix, --program-suffix)
333     --c*) ;; #ignored (--cache-file)
334     --q*) ;; #ignored (--quiet)
335     --si*) ;; #ignored (--silent)
336     -*)
337	echo "Invalid option \`$arg'" 1>&2
338	exit 1
339	;;
340     *)
341# Allow configure HOST TARGET.  If just one name is given, it is used
342# as both unless a host was previously given, in which case it is
343# just the target.
344	if [ x$name1 != x ]
345	then
346		if [ x$name2 != x ]
347		then
348			echo "More than two configuration names." 1>&2
349			exit 1
350		fi
351		name2=$arg
352	elif [ x$host != x ]
353	then
354		name1=$host
355		name2=$arg
356		host=
357	else
358		name1=$arg
359	fi
360	;;
361    esac
362  esac
363done
364
365if [ x$name1 != x ]
366then
367	if [ x$name2 = x ]
368	then
369		name2=$name1
370	fi
371
372	if [ x$host != x ]
373	then
374		echo "Duplicate specification of host." 1>&2
375		exit 1
376	fi
377
378	if [ x$target != x ]
379	then
380		echo "Duplicate specification of target." 1>&2
381		exit 1
382	fi
383
384	host=$name1
385	build=$name1
386	target=$name2
387fi
388
389# Find the source files, if location was not specified.
390if [ x$srcdir = x ]
391then
392	srcdirdefaulted=1
393	srcdir=.
394	if [ ! -r tree.c ]
395	then
396		srcdir=..
397	fi
398fi
399
400if [ ! -r ${srcdir}/tree.c ]
401then
402	if [ x$srcdirdefaulted = x ]
403	then
404	  echo "$progname: Can't find compiler sources in \`${srcdir}'" 1>&2
405	else
406	  echo "$progname: Can't find compiler sources in \`.' or \`..'" 1>&2
407	fi
408	exit 1
409fi
410
411if [ -r ${srcdir}/config.status ] && [ x$srcdir != x. ]
412then
413	echo "$progname: \`configure' has been run in \`${srcdir}'" 1>&2
414	exit 1
415fi
416
417# Complain if an arg is missing
418if [ x$build = x ]
419then
420	# If host was specified, always use it for build also to avoid
421	# confusion.  If someone wants a cross compiler where build != host,
422	# then they must specify build explicitly.  Since this case is
423	# extremely rare, it does not matter that it is slightly inconvenient.
424	if [ x$host != x ]
425	then
426		build=$host
427	
428	# This way of testing the result of a command substitution is
429	# defined by Posix.2 (section 3.9.1) as well as traditional shells.
430	elif build=`${srcdir}/config.guess`
431	then
432		echo "This appears to be a ${build} system." 1>&2
433
434	elif [ x$target != x ]
435	then
436		echo 'Config.guess failed to determine the host type.  Defaulting to target.'
437		build=$target
438	else
439		echo 'Config.guess failed to determine the host type.  You need to specify one.' 1>&2
440		echo "\
441Usage: `basename $progname` [--host=HOST] [--build=BUILD]
442       [--prefix=DIR] [--gxx-include-dir=DIR] [--local-pref=DIR] [--exec-pref=DIR]
443       [--with-gnu-as] [--with-gnu-ld] [--with-stabs] [--with-elf] [--nfp] TARGET" 1>&2
444	echo "Where HOST, TARGET and BUILD are three-part configuration names " 1>&2
445		if [ -r config.status ]
446		then
447			tail +2 config.status 1>&2
448		fi
449		exit 1
450	fi
451fi
452
453# If $host was not specified, use $build.
454if [ x$host = x ]
455then
456	host=$build
457fi
458
459# If $target was not specified, use $host.
460if [ x$target = x ]
461then
462	target=$host
463fi
464
465build_xm_file=
466host_xm_file=
467host_xmake_file=
468host_broken_install=
469host_install_headers_dir=install-headers-tar
470host_truncate_target=
471
472# Validate the specs, and canonicalize them.
473canon_build=`/bin/sh $srcdir/config.sub $build` || exit 1
474canon_host=`/bin/sh $srcdir/config.sub $host` || exit 1
475canon_target=`/bin/sh $srcdir/config.sub $target` || exit 1
476
477# Decode the host machine, then the target machine.
478# For the host machine, we save the xm_file variable as host_xm_file;
479# then we decode the target machine and forget everything else
480# that came from the host machine.
481for machine in $canon_build $canon_host $canon_target; do
482
483	cpu_type=
484	xm_file=
485	tm_file=
486	out_file=
487	xmake_file=
488	tmake_file=
489	extra_headers=
490	extra_passes=
491	extra_parts=
492	extra_programs=
493	extra_objs=
494	extra_gcc_objs=
495	# Set this to force installation and use of collect2.
496	use_collect2=
497	# Set this to override the default target model.
498	target_cpu_default=
499	# Set this to force use of install.sh.
500	broken_install=
501	# Set this to control which fixincludes program to use.
502	fixincludes=fixincludes
503	# Set this to control how the header file directory is installed.
504	install_headers_dir=install-headers-tar
505	# Set this to a non-empty list of args to pass to cpp if the target
506	# wants its .md file passed through cpp.
507	md_cppflags=
508	# Set this if directory names should be truncated to 14 characters.
509	truncate_target=
510	# Set this if gdb needs a dir command with `dirname $out_file`
511	gdb_needs_out_file_path=
512
513	case $machine in
514	# Support site-specific machine types.
515	*local*)
516		cpu_type=`echo $machine | sed -e 's/-.*//'`
517		rest=`echo $machine | sed -e "s/$cpu_type-//"`
518		xm_file=${cpu_type}/xm-$rest.h
519		tm_file=${cpu_type}/$rest.h
520		if [ -f $srcdir/config/${cpu_type}/x-$rest ] ; \
521		then xmake_file=${cpu_type}/x-$rest; \
522		else true; \
523		fi
524		if [ -f $srcdir/config/${cpu_type}/t-$rest ] ; \
525		then tmake_file=${cpu_type}/t-$rest; \
526		else true; \
527		fi
528		;;
529	1750a-*-*)
530		;;
531	a29k-*-bsd* | a29k-*-sym1*)
532		tm_file=a29k/unix.h
533		xm_file=a29k/xm-unix.h
534		xmake_file=a29k/x-unix
535		tmake_file=a29k/t-a29k
536		use_collect2=yes
537		;;
538	a29k-*-udi | a29k-*-coff)
539		tmake_file=a29k/t-a29kbare
540		tm_file=a29k/a29k-udi.h
541		;;
542	a29k-*-vxworks*)
543		tmake_file=a29k/t-vx29k
544		tm_file=a29k/vx29k.h
545		extra_parts="crtbegin.o crtend.o"
546		;;
547	a29k-*-*)			# Default a29k environment.
548		use_collect2=yes
549		;;
550	alpha-dec-osf[23456789]*)
551		tm_file=alpha/osf2.h
552		if [ x$stabs = xyes ]
553		then
554			tm_file=alpha/gdb-osf2.h
555		fi
556		if [ x$gas != xyes ]
557		then
558			extra_passes="mips-tfile mips-tdump"
559		fi
560		broken_install=yes
561		use_collect2=yes
562		;;
563	alpha-dec-osf1.2)
564		tm_file=alpha/osf12.h
565		if [ x$stabs = xyes ]
566		then
567			tm_file=alpha/gdb-osf12.h
568		fi
569		if [ x$gas != xyes ]
570		then
571			extra_passes="mips-tfile mips-tdump"
572		fi
573		broken_install=yes
574		use_collect2=yes
575		;;
576	alpha-*-osf*)
577		if [ x$stabs = xyes ]
578		then
579			tm_file=alpha/gdb.h
580		fi
581		if [ x$gas != xyes ]
582		then
583			extra_passes="mips-tfile mips-tdump"
584		fi
585		broken_install=yes
586		use_collect2=yes
587		;;
588	alpha-*-winnt3*)
589		tm_file=alpha/win-nt.h
590		xm_file=alpha/xm-winnt.h
591		tmake_file=t-libc-ok
592		xmake_file=winnt/x-winnt
593		extra_objs=oldnames.o
594		extra_gcc_objs="spawnv.o oldnames.o"
595		fixincludes=fixinc.winnt
596		if [ x$gnu_ld != xyes ]
597		then
598			extra_programs=ld.exe
599		fi
600		;;
601	arm-*-riscix1.[01]*)		# Acorn RISC machine (early versions)
602		tm_file=arm/riscix1-1.h
603		use_collect2=yes
604		;;
605	arm-*-riscix*)			# Acorn RISC machine
606		if [ x$gas = xyes ]
607		then
608		    tm_file=arm/rix-gas.h
609		else
610		    tm_file=arm/riscix.h
611		fi
612		xmake_file=arm/x-riscix
613		tmake_file=arm/t-riscix
614		use_collect2=yes
615		;;
616	arm-semi-aout | armel-semi-aout)
617		cpu_type=arm
618		tm_file=arm/semi.h
619		tmake_file=arm/t-semi
620		fixincludes=Makefile.in # There is nothing to fix
621		;;
622	arm-*-*)			# generic version
623		;;
624	c1-convex-*)			# Convex C1
625		cpu_type=convex
626		tm_file=convex/convex1.h
627		use_collect2=yes
628		fixincludes=Makefile.in
629		;;
630	c2-convex-*)			# Convex C2
631		cpu_type=convex
632		tm_file=convex/convex2.h
633		use_collect2=yes
634		fixincludes=Makefile.in
635		;;
636	c32-convex-*)
637		cpu_type=convex
638		tm_file=convex/convex32.h	# Convex C32xx
639		use_collect2=yes
640		fixincludes=Makefile.in
641		;;
642	c34-convex-*)
643		cpu_type=convex
644		tm_file=convex/convex34.h	# Convex C34xx
645		use_collect2=yes
646		fixincludes=Makefile.in
647		;;
648	c38-convex-*)
649		cpu_type=convex
650		tm_file=convex/convex38.h	# Convex C38xx
651		use_collect2=yes
652		fixincludes=Makefile.in
653		;;
654	clipper-intergraph-clix*)
655		broken_install=yes
656		cpu_type=clipper
657		xm_file=clipper/xm-clix.h
658		tm_file=clipper/clix.h
659		extra_headers=va-clipper.h
660		extra_parts="crtbegin.o crtend.o"
661		xmake_file=clipper/x-clix
662		install_headers_dir=install-headers-cpio
663		;;
664	dsp16xx-*)
665		;;
666	elxsi-elxsi-*)
667		use_collect2=yes
668		;;
669# This hasn't been upgraded to GCC 2.
670#	fx80-alliant-*)			# Alliant FX/80
671#		;;
672	h8300-*-*)
673		cpu_type=h8300
674		;;
675	hppa1.1-*-osf*)
676		cpu_type=pa
677		tm_file=pa/pa1-osf.h
678		use_collect2=yes
679		fixincludes=Makefile.in
680		;;
681	hppa1.0-*-osf*)
682		cpu_type=pa
683		tm_file=pa/pa-osf.h
684		use_collect2=yes
685		fixincludes=Makefile.in
686		;;
687	hppa1.1-*-bsd*)
688		cpu_type=pa
689		tm_file=pa/pa1.h
690		use_collect2=yes
691		fixincludes=Makefile.in
692		;;
693	hppa1.0-*-bsd*)
694		cpu_type=pa
695		use_collect2=yes
696		fixincludes=Makefile.in
697		;;
698	hppa1.0-*-hpux7*)
699		cpu_type=pa
700		xm_file=pa/xm-pahpux.h
701		xmake_file=pa/x-pa-hpux
702		tmake_file=pa/t-pa
703		if [ x$gas = xyes ]
704		then
705			tm_file=pa/pa-gux7.h
706		else
707			tm_file=pa/pa-hpux7.h
708		fi
709		broken_install=yes
710		install_headers_dir=install-headers-cpio
711		use_collect2=yes
712		;;
713	hppa1.0-*-hpux8.0[0-2]*)
714		cpu_type=pa
715		xm_file=pa/xm-pahpux.h
716		xmake_file=pa/x-pa-hpux
717		tmake_file=pa/t-pa
718		if [ x$gas = xyes ]
719		then
720			tm_file=pa/pa-ghpux.h
721		else
722			tm_file=pa/pa-oldas.h
723		fi
724		broken_install=yes
725		install_headers_dir=install-headers-cpio
726		use_collect2=yes
727		;;
728	hppa1.1-*-hpux8.0[0-2]*)
729		cpu_type=pa
730		xm_file=pa/xm-pahpux.h
731		xmake_file=pa/x-pa-hpux
732		tmake_file=pa/t-pa
733		if [ x$gas = xyes ]
734		then
735			tm_file=pa/pa1-ghpux.h
736		else
737			tm_file=pa/pa1-oldas.h
738		fi
739		broken_install=yes
740		install_headers_dir=install-headers-cpio
741		use_collect2=yes
742		;;
743	hppa1.1-*-hpux9* | \
744	hppa1.1-*-hpux10*)
745		cpu_type=pa
746		xm_file=pa/xm-pahpux.h
747		xmake_file=pa/x-pa-hpux
748		tmake_file=pa/t-pa
749		if [ x$gas = xyes ]
750		then
751			tm_file=pa/pa1-ghpux9.h
752		else
753			tm_file=pa/pa1-hpux9.h
754		fi
755		broken_install=yes
756		install_headers_dir=install-headers-cpio
757		use_collect2=yes
758		;;
759	hppa1.0-*-hpux9* | \
760	hppa1.0-*-hpux10*)
761		cpu_type=pa
762		xm_file=pa/xm-pahpux.h
763		xmake_file=pa/x-pa-hpux
764		tmake_file=pa/t-pa
765		if [ x$gas = xyes ]
766		then
767			tm_file=pa/pa-ghpux9.h
768		else
769			tm_file=pa/pa-hpux9.h
770		fi
771		broken_install=yes
772		install_headers_dir=install-headers-cpio
773		use_collect2=yes
774		;;
775	hppa1.1-*-hpux*)
776		cpu_type=pa
777		xm_file=pa/xm-pahpux.h
778		xmake_file=pa/x-pa-hpux
779		tmake_file=pa/t-pa
780		if [ x$gas = xyes ]
781		then
782			tm_file=pa/pa1-ghpux.h
783		else
784			tm_file=pa/pa1-hpux.h
785		fi
786		broken_install=yes
787		install_headers_dir=install-headers-cpio
788		use_collect2=yes
789		;;
790	hppa1.0-*-hpux*)
791		cpu_type=pa
792		xm_file=pa/xm-pahpux.h
793		xmake_file=pa/x-pa-hpux
794		tmake_file=pa/t-pa
795		if [ x$gas = xyes ]
796		then
797			tm_file=pa/pa-ghpux.h
798		else
799			tm_file=pa/pa-hpux.h
800		fi
801		broken_install=yes
802		install_headers_dir=install-headers-cpio
803		use_collect2=yes
804		;;
805	hppa1.1-*-hiux*)
806		cpu_type=pa
807		xm_file=pa/xm-pahpux.h
808		xmake_file=pa/x-pa-hpux
809		tmake_file=pa/t-pa
810		if [ x$gas = xyes ]
811		then
812			tm_file=pa/pa1-ghiux.h
813		else
814			tm_file=pa/pa1-hiux.h
815		fi
816		broken_install=yes
817		install_headers_dir=install-headers-cpio
818		use_collect2=yes
819		;;
820	hppa1.0-*-hiux*)
821		cpu_type=pa
822		xm_file=pa/xm-pahpux.h
823		xmake_file=pa/x-pa-hpux
824		tmake_file=pa/t-pa
825		if [ x$gas = xyes ]
826		then
827			tm_file=pa/pa-ghiux.h
828		else
829			tm_file=pa/pa-hiux.h
830		fi
831		broken_install=yes
832		install_headers_dir=install-headers-cpio
833		use_collect2=yes
834		;;
835	hppa*-*-lites*)
836		cpu_type=pa
837		tm_file=pa/pa1.h
838		use_collect2=yes
839		fixincludes=Makefile.in
840		;;
841	i370-*-mvs*)
842		cpu_type=i370
843		tm_file=i370/mvs.h
844		xm_file=i370/xm-mvs.h
845		out_file=i370/mvs370.c
846		;;
847	i[345]86-ibm-aix*)		# IBM PS/2 running AIX
848		cpu_type=i386
849                if [ x$gas = xyes ]
850		then
851			tm_file=i386/aix386.h
852			extra_parts="crtbegin.o crtend.o"
853			tmake_file=i386/t-crtstuff
854		else
855			tm_file=i386/aix386ng.h
856			use_collect2=yes
857		fi
858		xm_file=i386/xm-aix.h
859		xmake_file=i386/x-aix
860		broken_install=yes
861		;;
862	i486-ncr-sysv4*)		# NCR 3000 - i486 running system V.4
863		cpu_type=i386
864		xm_file=i386/xm-sysv4.h
865		xmake_file=i386/x-ncr3000
866		tm_file=i386/sysv4.h
867		extra_parts="crtbegin.o crtend.o"
868		tmake_file=i386/t-crtpic
869		;;
870	i[345]86-next-*)
871		cpu_type=i386
872		tm_file=i386/next.h
873		out_file=i386/next.c
874		xm_file=i386/xm-next.h
875		tmake_file=i386/t-next
876		xmake_file=i386/x-next
877		;;
878	i[345]86-sequent-bsd*) 		# 80386 from Sequent
879		cpu_type=i386
880		use_collect2=yes
881		if [ x$gas = xyes ]
882		then
883			tm_file=i386/seq-gas.h
884		else
885			tm_file=i386/sequent.h
886		fi
887		;;
888	i[345]86-sequent-ptx1*)
889		cpu_type=i386
890		xm_file=i386/xm-sysv3.h
891		xmake_file=i386/x-sysv3
892		tm_file=i386/seq-sysv3.h
893		tmake_file=i386/t-crtstuff
894		fixincludes=fixinc.ptx
895		extra_parts="crtbegin.o crtend.o"
896		install_headers_dir=install-headers-cpio
897		broken_install=yes
898		;;
899	i[345]86-sequent-ptx2* | i[345]86-sequent-sysv*)
900		cpu_type=i386
901		xm_file=i386/xm-sysv3.h
902		xmake_file=i386/x-sysv3
903		tm_file=i386/seq2-sysv3.h
904		tmake_file=i386/t-crtstuff
905		extra_parts="crtbegin.o crtend.o"
906		fixincludes=fixinc.ptx
907		install_headers_dir=install-headers-cpio
908		broken_install=yes
909		;;
910	i386-sun-sunos*)		# Sun i386 roadrunner
911		xm_file=i386/xm-sun.h
912		tm_file=i386/sun.h
913		use_collect2=yes
914		;;
915	i[345]86-*-aout*)
916		cpu_type=i386
917		tm_file=i386/i386-aout.h
918		tmake_file=i386/t-i386bare
919		;;
920	i[345]86-*-bsdi* | i[345]86-*-bsd386*)
921		cpu_type=i386
922		tm_file=i386/bsd386.h
923		xm_file=i386/xm-bsd386.h
924#		tmake_file=t-libc-ok
925		;;
926	i[345]86-*-bsd*)
927		cpu_type=i386
928		tm_file=i386/386bsd.h
929		xm_file=i386/xm-bsd386.h
930#		tmake_file=t-libc-ok
931# Next line turned off because both 386BSD and BSD/386 use GNU ld.
932#		use_collect2=yes
933		;;
934	i[345]86-*-freebsd*)
935		cpu_type=i386
936		tm_file=i386/freebsd.h
937		xm_file=i386/xm-freebsd.h
938		# On FreeBSD, the headers are already ok.
939		fixincludes=Makefile.in
940		xmake_file=i386/x-freebsd
941		;;
942	i[345]86-*-netbsd*)
943		cpu_type=i386
944		tm_file=i386/netbsd.h
945		xm_file=i386/xm-netbsd.h
946		# On NetBSD, the headers are already okay.
947		fixincludes=Makefile.in
948		tmake_file=t-libc-ok
949		xmake_file=x-netbsd
950		;;
951	i[345]86-*-coff*)
952		cpu_type=i386
953		tm_file=i386/i386-coff.h
954		tmake_file=i386/t-i386bare
955		;;
956	i[345]86-*-gnu*)
957		cpu_type=i386	# GNU supports this CPU; rest done below.
958		;;
959	i[345]86-*-isc*)		# 80386 running ISC system
960		cpu_type=i386
961		xm_file=i386/xm-isc.h
962		case $machine in
963		  i[345]86-*-isc[34]*)
964		    xmake_file=i386/x-isc3
965		    ;;
966		  *)
967		    xmake_file=i386/x-isc
968		    ;;
969		esac
970		echo $xmake_file
971                if [ x$gas = xyes -a x$stabs = xyes ]
972		then
973			tm_file=i386/iscdbx.h
974			tmake_file=i386/t-svr3dbx
975			extra_parts="crtbegin.o crtend.o svr3.ifile svr3z.ifile"
976		else
977			tm_file=i386/isccoff.h
978			tmake_file=i386/t-crtstuff
979			extra_parts="crtbegin.o crtend.o"
980		fi
981		install_headers_dir=install-headers-cpio
982		broken_install=yes
983		;;
984	i[345]86-*-linux*oldld*)	# Intel 80386's running Linux
985		cpu_type=i386		# with a.out format using pre BFD linkers
986		xm_file=i386/xm-linux.h
987		xmake_file=x-linux
988		tm_file=i386/linux-oldld.h
989		fixincludes=Makefile.in #On Linux, the headers are ok already.
990		broken_install=yes
991		gnu_ld=yes
992		;;
993	i[345]86-*-linux*aout*)		# Intel 80386's running Linux
994		cpu_type=i386		# with a.out format
995		xm_file=i386/xm-linux.h
996		xmake_file=x-linux
997		tm_file=i386/linux-aout.h
998		fixincludes=Makefile.in #On Linux, the headers are ok already.
999		broken_install=yes
1000		gnu_ld=yes
1001		;;
1002	i[345]86-*-linux*)		# Intel 80386's running Linux
1003		cpu_type=i386		# with ELF format
1004		xm_file=i386/xm-linux.h
1005		xmake_file=x-linux
1006		tm_file=i386/linux.h
1007		fixincludes=Makefile.in #On Linux, the headers are ok already.
1008		broken_install=yes
1009		gnu_ld=yes
1010		# Don't use it. Linux uses a slightly different one.
1011		# The real one comes with the Linux C library.
1012		#extra_parts="crtbegin.o crtend.o"
1013		;;
1014      i[345]86-go32-msdos | i[345]86-*-go32)
1015              cpu_type=i386
1016              tm_file=i386/go32.h
1017              ;;
1018	i[345]86-*-lynxos*)
1019		cpu_type=i386
1020		if [ x$gas = xyes ]
1021		then
1022			tm_file=i386/lynx.h
1023		else
1024			tm_file=i386/lynx-ng.h
1025		fi
1026		xm_file=i386/xm-lynx.h
1027		tmake_file=i386/t-i386bare
1028		xmake_file=x-lynx
1029		;;
1030	i[345]86-*-mach*)
1031		cpu_type=i386
1032		tm_file=i386/mach.h
1033#		tmake_file=t-libc-ok
1034		use_collect2=yes
1035		;;
1036	i[345]86-*-osfrose*)		# 386 using OSF/rose
1037		cpu_type=i386
1038                if [ x$elf = xyes ]
1039		then
1040			tm_file=i386/osfelf.h
1041			use_collect2=
1042		else
1043			tm_file=i386/osfrose.h
1044			use_collect2=yes
1045		fi
1046		xm_file=i386/xm-osf.h
1047		xmake_file=i386/x-osfrose
1048		extra_objs=halfpic.o
1049		;;
1050	i[345]86-*-sco3.2v4*)	 	# 80386 running SCO 3.2v4 system
1051		cpu_type=i386
1052		xm_file=i386/xm-sco.h
1053		xmake_file=i386/x-sco4
1054		fixincludes=fixinc.sco
1055		broken_install=yes
1056		install_headers_dir=install-headers-cpio
1057                if [ x$stabs = xyes ]
1058		then
1059			tm_file=i386/sco4dbx.h
1060			tmake_file=i386/t-svr3dbx
1061			extra_parts="svr3.ifile svr3z.rfile"
1062		else
1063			tm_file=i386/sco4.h
1064			tmake_file=i386/t-crtstuff
1065			extra_parts="crtbegin.o crtend.o"
1066		fi
1067		;;
1068	i[345]86-*-sco*)	 	# 80386 running SCO system
1069		cpu_type=i386
1070		xm_file=i386/xm-sco.h
1071		xmake_file=i386/x-sco
1072		broken_install=yes
1073		install_headers_dir=install-headers-cpio
1074                if [ x$stabs = xyes ]
1075		then
1076			tm_file=i386/scodbx.h
1077			tmake_file=i386/t-svr3dbx
1078			extra_parts="svr3.ifile svr3z.rfile"
1079		else
1080			tm_file=i386/sco.h
1081			extra_parts="crtbegin.o crtend.o"
1082			tmake_file=i386/t-crtstuff
1083		fi
1084		truncate_target=yes
1085		;;
1086	i[345]86-*-solaris2* | i[345]86-*-sunos5*)
1087		cpu_type=i386
1088		xm_file=i386/xm-sysv4.h
1089		tm_file=i386/sol2.h
1090		tmake_file=i386/t-sol2
1091		extra_parts="crt1.o crti.o crtn.o crtbegin.o crtend.o"
1092		xmake_file=x-svr4
1093		fixincludes=fixinc.svr4
1094		broken_install=yes
1095		;;
1096	i[345]86-*-sysv4*)		# Intel 80386's running system V.4
1097		cpu_type=i386
1098		xm_file=i386/xm-sysv4.h
1099		if [ x$stabs = xyes ]
1100		then
1101			tm_file=i386/sysv4gdb.h
1102		else
1103			tm_file=i386/sysv4.h
1104		fi
1105		tmake_file=i386/t-crtpic
1106		xmake_file=x-svr4
1107		extra_parts="crtbegin.o crtend.o"
1108		;;
1109	i[345]86-*-sysv*)		# Intel 80386's running system V
1110		cpu_type=i386
1111		xm_file=i386/xm-sysv3.h
1112		xmake_file=i386/x-sysv3
1113		if [ x$gas = xyes ]
1114		then
1115			if [ x$stabs = xyes ]
1116			then
1117				tm_file=i386/svr3dbx.h
1118				tmake_file=i386/t-svr3dbx
1119				extra_parts="svr3.ifile svr3z.rfile"
1120			else
1121				tm_file=i386/svr3gas.h
1122				extra_parts="crtbegin.o crtend.o"
1123				tmake_file=i386/t-crtstuff
1124			fi
1125		else
1126			tm_file=i386/sysv3.h
1127			extra_parts="crtbegin.o crtend.o"
1128			tmake_file=i386/t-crtstuff
1129		fi
1130		;;
1131	i386-*-vsta)			# Intel 80386's running VSTa kernel
1132		xm_file=i386/xm-vsta.h
1133		tm_file=i386/vsta.h
1134		tmake_file=i386/t-vsta
1135		xmake_file=i386/x-vsta
1136		;;
1137	i[345]86-*-winnt3*)
1138		cpu_type=i386
1139		tm_file=i386/win-nt.h
1140		out_file=i386/i386.c
1141		xm_file=i386/xm-winnt.h
1142		xmake_file=winnt/x-winnt
1143		tmake_file=i386/t-winnt
1144		extra_objs="winnt.o oldnames.o"
1145		extra_gcc_objs="spawnv.o oldnames.o"
1146		fixincludes=fixinc.winnt
1147		if [ x$gnu_ld != xyes ]
1148		then
1149			extra_programs=ld.exe
1150		fi
1151		;;
1152	i860-alliant-*)		# Alliant FX/2800
1153		xm_file=i860/xm-fx2800.h
1154		xmake_file=i860/x-fx2800
1155		tm_file=i860/fx2800.h
1156		tmake_file=i860/t-fx2800
1157		extra_parts="crtbegin.o crtend.o"
1158		;;
1159	i860-*-bsd*)
1160		if [ x$gas = xyes ]
1161		then
1162			tm_file=i860/bsd-gas.h
1163		else
1164			tm_file=i860/bsd.h
1165		fi
1166		use_collect2=yes
1167		;;
1168	i860-*-mach*)
1169		xm_file=i860/xm-i860.h
1170		tm_file=i860/mach.h
1171		tmake_file=t-libc-ok
1172		;;
1173	i860-*-osf*)			# Intel Paragon XP/S, OSF/1AD
1174		xm_file=i860/xm-paragon.h
1175		tm_file=i860/paragon.h
1176		tmake_file=t-osf
1177		broken_install=yes
1178		;;
1179	i860-*-sysv3*)
1180		xm_file=i860/xm-sysv3.h
1181		xmake_file=i860/x-sysv3
1182		tm_file=i860/sysv3.h
1183		extra_parts="crtbegin.o crtend.o"
1184		;;
1185	i860-*-sysv4*)
1186		xm_file=i860/xm-sysv4.h
1187		xmake_file=i860/x-sysv4
1188		tm_file=i860/sysv4.h
1189		tmake_file=t-svr4
1190		extra_parts="crtbegin.o crtend.o"
1191		;;
1192	i960-wrs-vxworks5 | i960-wrs-vxworks5.0*)
1193		tmake_file=i960/t-vxworks960
1194		tm_file=i960/vx960.h
1195		use_collect2=yes
1196		;;
1197	i960-wrs-vxworks5*)
1198		tmake_file=i960/t-vxworks960
1199		tm_file=i960/vx960-coff.h
1200		use_collect2=yes
1201		;;
1202	i960-wrs-vxworks*)
1203		tmake_file=i960/t-vxworks960
1204		tm_file=i960/vx960.h
1205		use_collect2=yes
1206		;;
1207	i960-*-coff*)
1208		tmake_file=i960/t-960bare
1209		tm_file=i960/i960-coff.h
1210		use_collect2=yes
1211		;;
1212	i960-*-*)			# Default i960 environment.
1213		use_collect2=yes
1214		;;
1215	m68000-convergent-sysv*)
1216		cpu_type=m68k
1217		xm_file=m68k/xm-3b1.h
1218		tm_file=m68k/ctix.h
1219		use_collect2=yes
1220		extra_headers=math-68881.h
1221		;;
1222	m68000-hp-bsd*)			# HP 9000/200 running BSD
1223		cpu_type=m68k
1224		tm_file=m68k/hp2bsd.h
1225		xmake_file=m68k/x-hp2bsd
1226		use_collect2=yes
1227		extra_headers=math-68881.h
1228		;;
1229	m68000-hp-hpux*)		# HP 9000 series 300
1230		cpu_type=m68k
1231		xm_file=m68k/xm-hp320.h
1232		if [ x$gas = xyes ]
1233		then
1234			xmake_file=m68k/x-hp320g
1235			tm_file=m68k/hp310g.h
1236		else
1237			xmake_file=m68k/x-hp320
1238			tm_file=m68k/hp310.h
1239		fi
1240		broken_install=yes
1241		install_headers_dir=install-headers-cpio
1242		use_collect2=yes
1243		extra_headers=math-68881.h
1244		;;
1245	m68000-sun-sunos3*)
1246		cpu_type=m68k
1247		tm_file=m68k/sun2.h
1248		use_collect2=yes
1249		extra_headers=math-68881.h
1250		;;
1251	m68000-sun-sunos4*)
1252		cpu_type=m68k
1253		tm_file=m68k/sun2o4.h
1254		use_collect2=yes
1255		extra_headers=math-68881.h
1256		;;
1257	m68000-att-sysv*)
1258		cpu_type=m68k
1259		xm_file=m68k/xm-3b1.h
1260		if [ x$gas = xyes ]
1261		then
1262			tm_file=m68k/3b1g.h
1263		else
1264			tm_file=m68k/3b1.h
1265		fi
1266		use_collect2=yes
1267		extra_headers=math-68881.h
1268		;;
1269	m68k-apollo-*)
1270		xmake_file=m68k/x-apollo68
1271		tm_file=m68k/apollo68.h
1272		use_collect2=yes
1273		extra_headers=math-68881.h
1274		;;
1275	m68k-altos-sysv*)		   # Altos 3068
1276		if [ x$gas = xyes ]
1277		then
1278		        xm_file=m68k/xm-altos3068.h
1279		        tm_file=m68k/altos3068.h
1280		else
1281			echo "The Altos is supported only with the GNU assembler" 1>&2
1282			exit 1
1283		fi
1284		extra_headers=math-68881.h
1285	        ;;
1286	m68k-bull-sysv*)		# Bull DPX/2
1287		if [ x$gas = xyes ]
1288		then
1289			if [ x$stabs = xyes ]
1290			then
1291				tm_file=m68k/dpx2cdbx.h
1292			else
1293				tm_file=m68k/dpx2g.h
1294			fi
1295		else
1296			tm_file=m68k/dpx2.h
1297		fi
1298		xm_file=m68k/xm-m68kv.h
1299		xmake_file=m68k/x-dpx2
1300		use_collect2=yes
1301		extra_headers=math-68881.h
1302		;;
1303	m68k-atari-sysv4*)              # Atari variant of V.4.
1304		tm_file=m68k/atari.h
1305		xm_file=m68k/xm-atari.h
1306		tmake_file=t-svr4
1307		extra_parts="crtbegin.o crtend.o"
1308		extra_headers=math-68881.h
1309		;;
1310	m68k-motorola-sysv*)
1311		xm_file=m68k/xm-mot3300.h
1312		xmake_file=m68k/x-mot3300
1313		if [ x$gas = xyes ]
1314		then
1315			tm_file=m68k/mot3300g.h
1316		else
1317			tm_file=m68k/mot3300.h
1318			gdb_needs_out_file_path=yes
1319		fi
1320		use_collect2=yes
1321		extra_headers=math-68881.h
1322		;;
1323	m68k-ncr-sysv*)			# NCR Tower 32 SVR3
1324		tm_file=m68k/tower-as.h
1325		xm_file=m68k/xm-tower.h
1326		xmake_file=m68k/x-tower
1327		extra_parts="crtbegin.o crtend.o"
1328		extra_headers=math-68881.h
1329		;;
1330        m68k-plexus-sysv*)
1331		tm_file=m68k/plexus.h
1332		xm_file=m68k/xm-plexus.h
1333		use_collect2=yes
1334		extra_headers=math-68881.h
1335		;;
1336	m68k-tti-*)
1337		tm_file=m68k/pbb.h
1338		xm_file=m68k/xm-m68kv.h
1339		extra_headers=math-68881.h
1340		;;
1341	m68k-crds-unos*)
1342		xm_file=m68k/xm-crds.h
1343		xmake_file=m68k/x-crds
1344		tm_file=m68k/crds.h
1345		broken_install=yes
1346		use_collect2=yes
1347		extra_headers=math-68881.h
1348		;;
1349	m68k-cbm-sysv4*)		# Commodore variant of V.4.
1350		tm_file=m68k/amix.h
1351		xm_file=m68k/xm-amix.h
1352		xmake_file=m68k/x-amix
1353		tmake_file=t-svr4
1354		extra_parts="crtbegin.o crtend.o"
1355		extra_headers=math-68881.h
1356		;;
1357	m68k-ccur-rtu)
1358		tm_file=m68k/ccur-GAS.h
1359		xmake_file=m68k/x-ccur
1360		extra_headers=math-68881.h
1361		use_collect2=yes
1362		broken_install=yes
1363		;;
1364	m68k-hp-bsd4.4*)		# HP 9000/3xx running 4.4bsd
1365		tm_file=m68k/hp3bsd44.h
1366		xmake_file=m68k/x-hp3bsd44
1367		use_collect2=yes
1368		extra_headers=math-68881.h
1369		;;
1370	m68k-hp-bsd*)			# HP 9000/3xx running Berkeley Unix
1371		tm_file=m68k/hp3bsd.h
1372		use_collect2=yes
1373		extra_headers=math-68881.h
1374		;;
1375	m68k-isi-bsd*)
1376		if [ x$nfp = xyes ]
1377		then
1378			tm_file=m68k/isi-nfp.h
1379		else
1380			tm_file=m68k/isi.h
1381		fi
1382		use_collect2=yes
1383		extra_headers=math-68881.h
1384		;;
1385	m68k-hp-hpux7*)	# HP 9000 series 300 running HPUX version 7.
1386		xm_file=m68k/xm-hp320.h
1387		if [ x$gas = xyes ]
1388		then
1389			xmake_file=m68k/x-hp320g
1390			tm_file=m68k/hp320g.h
1391		else
1392			xmake_file=m68k/x-hp320
1393			tm_file=m68k/hpux7.h
1394		fi
1395		broken_install=yes
1396		install_headers_dir=install-headers-cpio
1397		use_collect2=yes
1398		extra_headers=math-68881.h
1399		;;
1400	m68k-hp-hpux*)	# HP 9000 series 300
1401		xm_file=m68k/xm-hp320.h
1402		if [ x$gas = xyes ]
1403		then
1404			xmake_file=m68k/x-hp320g
1405			tm_file=m68k/hp320g.h
1406		else
1407			xmake_file=m68k/x-hp320
1408			tm_file=m68k/hp320.h
1409		fi
1410		broken_install=yes
1411		install_headers_dir=install-headers-cpio
1412		use_collect2=yes
1413		extra_headers=math-68881.h
1414		;;
1415	m68k-sun-mach*)
1416		tm_file=m68k/sun3mach.h
1417		use_collect2=yes
1418		extra_headers=math-68881.h
1419		;;
1420	m68k-sony-newsos3*)
1421		if [ x$gas = xyes ]
1422		then
1423			tm_file=m68k/news3gas.h
1424		else
1425			tm_file=m68k/news3.h
1426		fi
1427		use_collect2=yes
1428		extra_headers=math-68881.h
1429		;;
1430	m68k-sony-bsd* | m68k-sony-newsos*)
1431		if [ x$gas = xyes ]
1432		then
1433			tm_file=m68k/newsgas.h
1434		else
1435			tm_file=m68k/news.h
1436		fi
1437		use_collect2=yes
1438		extra_headers=math-68881.h
1439		;;
1440	m68k-next-nextstep2*)
1441		tm_file=m68k/next21.h
1442		out_file=m68k/next.c
1443		xm_file=m68k/xm-next.h
1444		tmake_file=m68k/t-next
1445		xmake_file=m68k/x-next
1446		extra_headers=math-68881.h
1447		use_collect2=yes
1448                ;;
1449	m68k-next-nextstep3*)
1450		tm_file=m68k/next.h
1451		out_file=m68k/next.c
1452		xm_file=m68k/xm-next.h
1453		tmake_file=m68k/t-next
1454		xmake_file=m68k/x-next
1455		extra_headers=math-68881.h
1456		;;
1457	m68k-sun-sunos3*)
1458		if [ x$nfp = xyes ]
1459		then
1460			tm_file=m68k/sun3n3.h
1461		else
1462			tm_file=m68k/sun3o3.h
1463		fi
1464		use_collect2=yes
1465		extra_headers=math-68881.h
1466		;;
1467	m68k-sun-sunos*)			# For SunOS 4 (the default).
1468		if [ x$nfp = xyes ]
1469		then
1470			tm_file=m68k/sun3n.h
1471		else
1472			tm_file=m68k/sun3.h
1473		fi
1474		use_collect2=yes
1475		extra_headers=math-68881.h
1476		;;
1477	m68k-wrs-vxworks*)
1478		tm_file=m68k/vxm68k.h
1479		tmake_file=m68k/t-vxworks68
1480		extra_headers=math-68881.h
1481		;;
1482	m68k-*-aout*)
1483		tmake_file=m68k/t-m68kbare
1484		tm_file=m68k/m68k-aout.h
1485		extra_headers=math-68881.h
1486		;;
1487	m68k-*-coff*)
1488		tmake_file=m68k/t-m68kbare
1489		tm_file=m68k/m68k-coff.h
1490		extra_headers=math-68881.h
1491		;;
1492	m68k-*-lynxos*)
1493		if [ x$gas = xyes ]
1494		then
1495			tm_file=m68k/lynx.h
1496		else
1497			tm_file=m68k/lynx-ng.h
1498		fi
1499		xm_file=m68k/xm-lynx.h
1500		xmake_file=x-lynx
1501		tmake_file=m68k/t-lynx
1502		extra_headers=math-68881.h
1503		;;
1504	m68k-*-netbsd*)
1505		cpu_type=m68k
1506		tm_file=m68k/netbsd.h
1507		xm_file=m68k/xm-netbsd.h
1508		# On NetBSD, the headers are already okay.
1509		fixincludes=Makefile.in
1510		tmake_file=t-libc-ok
1511		xmake_file=x-netbsd
1512		;;
1513	m68k-*-sysv3*)			# Motorola m68k's running system V.3
1514		xm_file=m68k/xm-m68kv.h
1515		xmake_file=m68k/x-m68kv
1516		extra_parts="crtbegin.o crtend.o"
1517		extra_headers=math-68881.h
1518		;;
1519	m68k-*-sysv4*)			# Motorola m68k's running system V.4
1520		tm_file=m68k/m68kv4.h
1521		xm_file=m68k/xm-m68kv.h
1522		tmake_file=t-svr4
1523		extra_parts="crtbegin.o crtend.o"
1524		extra_headers=math-68881.h
1525		;;
1526	m68k-*-linux*aout*)		# Motorola m68k's running Linux
1527		xm_file=m68k/xm-linux.h	# with a.out format
1528		xmake_file=x-linux
1529		tm_file=m68k/linux-aout.h
1530		tmake_file=m68k/t-linux
1531		fixincludes=Makefile.in #On Linux, the headers are ok already.
1532		extra_headers=math-68881.h
1533		gnu_ld=yes
1534		;;
1535	m68k-*-linux*)			# Motorola m68k's running Linux
1536		xm_file=m68k/xm-linux.h	# with ELF format
1537		xmake_file=x-linux
1538		tm_file=m68k/linux.h
1539		tmake_file=m68k/t-linux
1540		fixincludes=Makefile.in #On Linux, the headers are ok already.
1541		extra_headers=math-68881.h
1542		gnu_ld=yes
1543		# Don't use it. Linux uses a slightly different one.
1544		# The real one comes with the Linux C library.
1545		#extra_parts="crtbegin.o crtend.o"
1546		;;
1547	m88k-dg-dgux*)
1548		case $machine in
1549		  m88k-dg-dguxbcs*)
1550		    tm_file=m88k/dguxbcs.h
1551		    xmake_file=m88k/x-dguxbcs
1552		    ;;
1553		  *)
1554		    tm_file=m88k/dgux.h
1555		    xmake_file=m88k/x-dgux
1556		    ;;
1557		esac
1558		extra_parts="crtbegin.o bcscrtbegin.o crtend.o m88kdgux.ld"
1559		broken_install=yes
1560		if [ x$gas = xyes ]
1561		then
1562			tmake_file=m88k/t-dgux-gas
1563		else
1564			tmake_file=m88k/t-dgux
1565		fi
1566		fixincludes=fixinc.dgux
1567		;;
1568	m88k-dolphin-sysv3*)
1569		tm_file=m88k/dolph.h
1570		extra_parts="crtbegin.o crtend.o"
1571		xm_file=m88k/xm-sysv3.h
1572		xmake_file=m88k/x-dolph
1573		if [ x$gas = xyes ]
1574		then
1575			tmake_file=m88k/t-m88k-gas
1576		fi
1577		;;
1578	m88k-tektronix-sysv3)
1579		tm_file=m88k/tekXD88.h
1580		extra_parts="crtbegin.o crtend.o"
1581		xm_file=m88k/xm-sysv3.h
1582		xmake_file=m88k/x-tekXD88
1583		if [ x$gas = xyes ]
1584		then
1585			tmake_file=m88k/t-m88k-gas
1586		fi
1587		;;
1588	m88k-*-aout*)
1589		cpu_type=m88k
1590		tm_file=m88k/m88k-aout.h
1591		;;
1592	m88k-*-coff*)
1593		cpu_type=m88k
1594		tm_file=m88k/m88k-coff.h
1595		tmake_file=m88k/t-bug
1596		;;
1597	m88k-*-luna*)
1598		tm_file=m88k/luna.h
1599		extra_parts="crtbegin.o crtend.o"
1600		if [ x$gas = xyes ]
1601		then
1602			tmake_file=m88k/t-luna-gas
1603		else
1604			tmake_file=m88k/t-luna
1605		fi
1606		;;
1607	m88k-*-sysv3*)
1608		tm_file=m88k/sysv3.h
1609		extra_parts="crtbegin.o crtend.o"
1610		xm_file=m88k/xm-sysv3.h
1611		xmake_file=m88k/x-sysv3
1612		if [ x$gas = xyes ]
1613		then
1614			tmake_file=m88k/t-m88k-gas
1615		fi
1616		;;
1617	m88k-*-sysv4*)
1618		tm_file=m88k/sysv4.h
1619		extra_parts="crtbegin.o crtend.o"
1620		xmake_file=m88k/x-sysv4
1621		tmake_file=m88k/t-sysv4
1622		;;
1623	mips-sgi-irix6*)		# SGI System V.4., IRIX 6
1624		tm_file=mips/iris6.h
1625		xm_file=mips/xm-iris6.h
1626		broken_install=yes
1627		fixincludes=Makefile.in
1628		xmake_file=mips/x-iris6
1629		tmake_file=mips/t-iris6
1630		# See comment in mips/iris[56].h files.
1631		use_collect2=yes
1632		;;
1633	mips-sgi-irix5cross64)		# Irix5 host, Irix 6 target, cross64
1634		tm_file=mips/cross64.h
1635		xm_file=mips/xm-iris5.h
1636		broken_install=yes
1637		fixincludes=Makefile.in
1638		xmake_file=mips/x-iris
1639		tmake_file=mips/t-cross64
1640		# See comment in mips/iris[56].h files.
1641		use_collect2=yes
1642		;;
1643	mips-sgi-irix5*)		# SGI System V.4., IRIX 5
1644		if [ x$gas = xyes ]
1645		then
1646			if [ x$stabs = xyes ]
1647			then
1648				tm_file=mips/iris5gdb.h
1649			else
1650				tm_file=mips/iris5gas.h
1651			fi
1652		else
1653			tm_file=mips/iris5.h
1654		fi
1655		xm_file=mips/xm-iris5.h
1656		broken_install=yes
1657		fixincludes=Makefile.in
1658		xmake_file=mips/x-iris
1659		# mips-tfile doesn't work yet
1660		tmake_file=mips/t-mips-gas
1661		# See comment in mips/iris5.h file.
1662		use_collect2=yes
1663		;;
1664	mips-sgi-irix4loser*)		# Mostly like a MIPS.
1665		if [ x$stabs = xyes ]; then
1666			tm_file=mips/iris4gl.h
1667		else
1668			tm_file=mips/iris4loser.h
1669		fi
1670		xm_file=mips/xm-iris4.h
1671		broken_install=yes
1672		xmake_file=mips/x-iris
1673		if [ x$gas = xyes ]
1674		then
1675			tmake_file=mips/t-mips-gas
1676		else
1677			extra_passes="mips-tfile mips-tdump"
1678		fi
1679		if [ x$gnu_ld != xyes ]
1680		then
1681			use_collect2=yes
1682		fi
1683		;;
1684	mips-sgi-irix4*)		# Mostly like a MIPS.
1685		if [ x$stabs = xyes ]; then
1686			tm_file=mips/iris4-gdb.h
1687		else
1688			tm_file=mips/iris4.h
1689		fi
1690		xm_file=mips/xm-iris4.h
1691		broken_install=yes
1692		xmake_file=mips/x-iris
1693		if [ x$gas = xyes ]
1694		then
1695			tmake_file=mips/t-mips-gas
1696		else
1697			extra_passes="mips-tfile mips-tdump"
1698		fi
1699		if [ x$gnu_ld != xyes ]
1700		then
1701			use_collect2=yes
1702		fi
1703		;;
1704	mips-sgi-*)			# Mostly like a MIPS.
1705		if [ x$stabs = xyes ]; then
1706			tm_file=mips/iris3-gdb.h
1707		else
1708			tm_file=mips/iris3.h
1709		fi
1710		xm_file=mips/xm-iris3.h
1711		broken_install=yes
1712		xmake_file=mips/x-iris3
1713		if [ x$gas = xyes ]
1714		then
1715			tmake_file=mips/t-mips-gas
1716		else
1717			extra_passes="mips-tfile mips-tdump"
1718		fi
1719		if [ x$gnu_ld != xyes ]
1720		then
1721			use_collect2=yes
1722		fi
1723		;;
1724	mips-dec-osfrose*)		# Decstation running OSF/1 reference port with OSF/rose.
1725		tm_file=mips/osfrose.h
1726		xmake_file=mips/x-osfrose
1727		tmake_file=mips/t-osfrose
1728		extra_objs=halfpic.o
1729		use_collect2=yes
1730		;;
1731	mips-dec-osf*)			# Decstation running OSF/1 as shipped by DIGITAL
1732		if [ x$stabs = xyes ]; then
1733			tm_file=mips/dec-gosf1.h
1734		else
1735			tm_file=mips/dec-osf1.h
1736		fi
1737		xmake_file=mips/x-dec-osf1
1738		if [ x$gas = xyes ]
1739		then
1740			tmake_file=mips/t-mips-gas
1741		else
1742			tmake_file=mips/t-ultrix
1743			extra_passes="mips-tfile mips-tdump"
1744		fi
1745		if [ x$gnu_ld != xyes ]
1746		then
1747			use_collect2=yes
1748		fi
1749		;;
1750	mips-dec-bsd*)                  # Decstation running 4.4 BSD
1751              tm_file=mips/dec-bsd.h
1752              xmake_file=
1753              tmake_file=
1754              fixincludes=
1755	      if [ x$gas = xyes ]
1756	      then
1757		   	tmake_file=mips/t-mips-gas
1758	      else
1759			tmake_file=mips/t-ultrix
1760			extra_passes="mips-tfile mips-tdump"
1761	      fi
1762	      if [ x$gnu_ld != xyes ]
1763	      then
1764			use_collect2=yes
1765	      fi
1766	      ;;
1767	mips-dec-netbsd*)                  # Decstation running NetBSD
1768		tm_file=mips/netbsd.h
1769		xm_file=mips/xm-netbsd.h
1770		xmake_file=x-netbsd
1771		tmake_file=t-libc-ok
1772		fixincludes=Makefile.in
1773		prefix=$native_prefix
1774		;;
1775	mips-sony-bsd* | mips-sony-newsos*)	# Sony NEWS 3600 or risc/news.
1776		if [ x$stabs = xyes ]; then
1777			tm_file=mips/news4-gdb.h
1778		else
1779			tm_file=mips/news4.h
1780		fi
1781		if [ x$gas = xyes ]
1782		then
1783			tmake_file=mips/t-mips-gas
1784		else
1785			extra_passes="mips-tfile mips-tdump"
1786		fi
1787		if [ x$gnu_ld != xyes ]
1788		then
1789			use_collect2=yes
1790		fi
1791		xmake_file=mips/x-sony
1792		;;
1793	mips-sony-sysv*)		# Sony NEWS 3800 with NEWSOS5.0.
1794					# That is based on svr4.
1795		# t-svr4 is not right because this system doesn't use ELF.
1796		if [ x$stabs = xyes ]; then
1797			tm_file=mips/news5-gdb.h
1798		else
1799			tm_file=mips/news5.h
1800		fi
1801		xm_file=mips/xm-news.h
1802		if [ x$gas = xyes ]
1803		then
1804			tmake_file=mips/t-mips-gas
1805		else
1806			extra_passes="mips-tfile mips-tdump"
1807		fi
1808		if [ x$gnu_ld != xyes ]
1809		then
1810			use_collect2=yes
1811		fi
1812		;;
1813	mips-tandem-sysv4*)		# Tandem S2 running NonStop UX
1814		if [ x$stabs = xyes ]; then
1815			tm_file=mips/svr4-t-gdb.h
1816		else
1817			tm_file=mips/svr4-t.h
1818		fi
1819		xm_file=mips/xm-sysv4.h
1820		xmake_file=mips/x-sysv
1821		if [ x$gas = xyes ]
1822		then
1823			tmake_file=mips/t-mips-gas
1824			extra_parts="crtbegin.o crtend.o"
1825		else
1826			tmake_file=mips/t-mips
1827			extra_passes="mips-tfile mips-tdump"
1828		fi
1829		if [ x$gnu_ld != xyes ]
1830		then
1831			use_collect2=yes
1832		fi
1833		broken_install=yes
1834		;;
1835	mips-*-ultrix* | mips-dec-mach3)	# Decstation.
1836		if [ x$stabs = xyes ]; then
1837			tm_file=mips/ultrix-gdb.h
1838		else
1839			tm_file=mips/ultrix.h
1840		fi
1841		xmake_file=mips/x-ultrix
1842		if [ x$gas = xyes ]
1843		then
1844			tmake_file=mips/t-mips-gas
1845		else
1846			tmake_file=mips/t-ultrix
1847			extra_passes="mips-tfile mips-tdump"
1848		fi
1849		if [ x$gnu_ld != xyes ]
1850		then
1851			use_collect2=yes
1852		fi
1853	        ;;
1854	mips-*-riscos[56789]bsd*)
1855		if [ x$stabs = xyes ]; then	# MIPS BSD 4.3, RISC-OS 5.0
1856			tm_file=mips/bsd-5-gdb.h
1857		else
1858			tm_file=mips/bsd-5.h
1859		fi
1860		if [ x$gas = xyes ]
1861		then
1862			tmake_file=mips/t-bsd-gas
1863		else
1864			tmake_file=mips/t-bsd
1865			extra_passes="mips-tfile mips-tdump"
1866		fi
1867		if [ x$gnu_ld != xyes ]
1868		then
1869			use_collect2=yes
1870		fi
1871		broken_install=yes
1872	        ;;
1873	mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[1234]bsd*)
1874		if [ x$stabs = xyes ]; then	# MIPS BSD 4.3, RISC-OS 4.0
1875			tm_file=mips/bsd-4-gdb.h
1876		else
1877			tm_file=mips/bsd-4.h
1878		fi
1879		if [ x$gas = xyes ]
1880		then
1881			tmake_file=mips/t-bsd-gas
1882		else
1883			tmake_file=mips/t-bsd
1884			extra_passes="mips-tfile mips-tdump"
1885		fi
1886		if [ x$gnu_ld != xyes ]
1887		then
1888			use_collect2=yes
1889		fi
1890		broken_install=yes
1891	        ;;
1892	mips-*-riscos[56789]sysv4*)
1893		if [ x$stabs = xyes ]; then	# MIPS System V.4., RISC-OS 5.0
1894			tm_file=mips/svr4-5-gdb.h
1895		else
1896			tm_file=mips/svr4-5.h
1897		fi
1898		xm_file=mips/xm-sysv4.h
1899		xmake_file=mips/x-sysv
1900		if [ x$gas = xyes ]
1901		then
1902			tmake_file=mips/t-svr4-gas
1903		else
1904			tmake_file=mips/t-svr4
1905			extra_passes="mips-tfile mips-tdump"
1906		fi
1907		if [ x$gnu_ld != xyes ]
1908		then
1909			use_collect2=yes
1910		fi
1911		broken_install=yes
1912		;;
1913	mips-*-sysv4* | mips-*-riscos[1234]sysv4* | mips-*-riscossysv4*)
1914		if [ x$stabs = xyes ]; then	# MIPS System V.4. RISC-OS 4.0
1915			tm_file=mips/svr4-4-gdb.h
1916		else
1917			tm_file=mips/svr4-4.h
1918		fi
1919		xm_file=mips/xm-sysv.h
1920		xmake_file=mips/x-sysv
1921		if [ x$gas = xyes ]
1922		then
1923			tmake_file=mips/t-svr4-gas
1924		else
1925			tmake_file=mips/t-svr4
1926			extra_passes="mips-tfile mips-tdump"
1927		fi
1928		if [ x$gnu_ld != xyes ]
1929		then
1930			use_collect2=yes
1931		fi
1932		broken_install=yes
1933		;;
1934	mips-*-riscos[56789]sysv*)
1935		if [ x$stabs = xyes ]; then	# MIPS System V.3, RISC-OS 5.0
1936			tm_file=mips/svr3-5-gdb.h
1937		else
1938			tm_file=mips/svr3-5.h
1939		fi
1940		xm_file=mips/xm-sysv.h
1941		xmake_file=mips/x-sysv
1942		if [ x$gas = xyes ]
1943		then
1944			tmake_file=mips/t-svr3-gas
1945		else
1946			tmake_file=mips/t-svr3
1947			extra_passes="mips-tfile mips-tdump"
1948		fi
1949		if [ x$gnu_ld != xyes ]
1950		then
1951			use_collect2=yes
1952		fi
1953		broken_install=yes
1954		;;
1955	mips-*-sysv* | mips-*-riscos*sysv*)
1956		if [ x$stabs = xyes ]; then	# MIPS System V.3, RISC-OS 4.0
1957			tm_file=mips/svr3-4-gdb.h
1958		else
1959			tm_file=mips/svr3-4.h
1960		fi
1961		xm_file=mips/xm-sysv.h
1962		xmake_file=mips/x-sysv
1963		if [ x$gas = xyes ]
1964		then
1965			tmake_file=mips/t-svr3-gas
1966		else
1967			tmake_file=mips/t-svr3
1968			extra_passes="mips-tfile mips-tdump"
1969		fi
1970		if [ x$gnu_ld != xyes ]
1971		then
1972			use_collect2=yes
1973		fi
1974		broken_install=yes
1975		;;
1976	mips-*-riscos[56789]*)			# Default MIPS RISC-OS 5.0.
1977		if [ x$stabs = xyes ]; then
1978			tm_file=mips/mips-5-gdb.h
1979		else
1980			tm_file=mips/mips-5.h
1981		fi
1982		if [ x$gas = xyes ]
1983		then
1984			tmake_file=mips/t-mips-gas
1985		else
1986			extra_passes="mips-tfile mips-tdump"
1987		fi
1988		if [ x$gnu_ld != xyes ]
1989		then
1990			use_collect2=yes
1991		fi
1992		broken_install=yes
1993		;;
1994	mips-*-gnu*)
1995		cpu_type=mips	# GNU supports this CPU; rest done below.
1996		;;
1997	mipsel-*-ecoff*)
1998		cpu_type=mips
1999		if [ x$stabs = xyes ]; then
2000		    tm_file=mips/ecoffl-gdb.h
2001		else
2002		    tm_file=mips/ecoffl.h
2003		fi
2004		tmake_file=mips/t-ecoff
2005		;;
2006	mips-*-ecoff*)
2007		if [ x$stabs = xyes ]; then
2008		    tm_file=mips/ecoff-gdb.h
2009		else
2010		    tm_file=mips/ecoff.h
2011		fi
2012		tmake_file=mips/t-ecoff
2013		broken_install=yes
2014		;;
2015	mipsel-*-elf*)
2016		cpu_type=mips
2017		tm_file=mips/elfl.h
2018		tmake_file=mips/t-ecoff
2019		;;
2020	mips-*-elf*)
2021		cpu_type=mips
2022		tm_file=mips/elf.h
2023		tmake_file=mips/t-ecoff
2024		;;
2025	mips64el-*-elf*)
2026		cpu_type=mips
2027		tm_file=mips/elfl64.h
2028		tmake_file=mips/t-ecoff
2029		;;
2030	mips64orionel-*-elf*)
2031		cpu_type=mips
2032		tm_file=mips/elflorion.h
2033		tmake_file=mips/t-ecoff
2034		;;
2035	mips64-*-elf*)
2036		cpu_type=mips
2037		tm_file=mips/elf64.h
2038		tmake_file=mips/t-ecoff
2039		;;
2040	mips64orion-*-elf*)
2041		cpu_type=mips
2042		tm_file=mips/elforion.h
2043		tmake_file=mips/t-ecoff
2044		;;
2045	mips-*-*)				# Default MIPS RISC-OS 4.0.
2046		if [ x$stabs = xyes ]; then
2047			tm_file=mips/mips-4-gdb.h
2048		else
2049			tm_file=mips/mips.h
2050		fi
2051		if [ x$gas = xyes ]
2052		then
2053			tmake_file=mips/t-mips-gas
2054		else
2055			extra_passes="mips-tfile mips-tdump"
2056		fi
2057		if [ x$gnu_ld != xyes ]
2058		then
2059			use_collect2=yes
2060		fi
2061		;;
2062	ns32k-encore-bsd*)
2063		tm_file=ns32k/encore.h
2064		use_collect2=yes
2065		;;
2066	ns32k-sequent-bsd*)
2067		tm_file=ns32k/sequent.h
2068		use_collect2=yes
2069		;;
2070	ns32k-tek6100-bsd*)
2071		tm_file=ns32k/tek6100.h
2072		broken_install=yes
2073		use_collect2=yes
2074		;;
2075	ns32k-tek6200-bsd*)
2076		tm_file=ns32k/tek6200.h
2077		broken_install=yes
2078		use_collect2=yes
2079		;;
2080# This has not been updated to GCC 2.
2081#	ns32k-ns-genix*)
2082#		xm_file=ns32k/xm-genix.h
2083#		xmake_file=ns32k/x-genix
2084#		tm_file=ns32k/genix.h
2085#		broken_install=yes
2086#		use_collect2=yes
2087#		;;
2088	ns32k-merlin-*)
2089		tm_file=ns32k/merlin.h
2090		use_collect2=yes
2091		;;
2092	ns32k-pc532-mach*)
2093		tm_file=ns32k/pc532-mach.h
2094		use_collect2=yes
2095		;;
2096	ns32k-pc532-minix*)
2097		tm_file=ns32k/pc532-min.h
2098		xm_file=ns32k/xm-pc532-min.h
2099		use_collect2=yes
2100		;;
2101	ns32k-pc532-netbsd*)
2102		tm_file=ns32k/netbsd.h
2103		xm_file=ns32k/xm-netbsd.h
2104		tmake_file=t-libc-ok
2105		# On NetBSD, the headers are already okay.
2106		fixincludes=Makefile.in
2107		xmake_file=x-netbsd
2108		;;
2109	pyramid-*-*)
2110		cpu_type=pyr
2111		xmake_file=pyr/x-pyr
2112		use_collect2=yes
2113		;;
2114	romp-*-aos*)
2115		use_collect2=yes
2116		;;
2117	romp-*-mach*)
2118		xmake_file=romp/x-mach
2119		use_collect2=yes
2120		;;
2121	powerpc-ibm-aix[456789].*)
2122		cpu_type=rs6000
2123		tm_file=rs6000/aix41ppc.h
2124		tmake_file=rs6000/t-newas
2125		use_collect2=yes
2126		;;
2127	powerpc-ibm-aix*)
2128		cpu_type=rs6000
2129		tm_file=rs6000/powerpc.h
2130		tmake_file=rs6000/t-rs6000
2131		use_collect2=yes
2132		;;
2133	powerpc-*-sysv4* | powerpc-*-elf*)
2134		cpu_type=rs6000
2135		xm_file=rs6000/xm-sysv4.h
2136		tm_file=rs6000/sysv4.h
2137		if [ x$gas = xyes ]
2138		then
2139		     tmake_file=rs6000/t-ppcgas
2140		else
2141		     tmake_file=rs6000/t-ppc
2142		fi
2143		xmake_file=rs6000/x-sysv4
2144		;;
2145	powerpc-*-eabiaix*)
2146		cpu_type=rs6000
2147		tm_file=rs6000/eabiaix.h
2148		tmake_file=rs6000/t-eabiaix
2149		fixincludes=Makefile.in
2150		;;
2151	powerpc-*-eabisim*)
2152		cpu_type=rs6000
2153		tm_file=rs6000/eabisim.h
2154		tmake_file=rs6000/t-eabisim
2155		fixincludes=Makefile.in
2156		;;
2157	powerpc-*-eabi*)
2158		cpu_type=rs6000
2159		tm_file=rs6000/eabi.h
2160		if [ x$gas = xyes ]
2161		then
2162		     tmake_file=rs6000/t-eabigas
2163		else
2164		     tmake_file=rs6000/t-eabi
2165		fi
2166		fixincludes=Makefile.in
2167		;;
2168	powerpcle-*-sysv4* | powerpcle-*-elf*)
2169		cpu_type=rs6000
2170		xm_file=rs6000/xm-sysv4.h
2171		tm_file=rs6000/sysv4le.h
2172		if [ x$gas = xyes ]
2173		then
2174		     tmake_file=rs6000/t-ppclegas
2175		else
2176		     tmake_file=rs6000/t-ppc
2177		fi
2178		xmake_file=rs6000/x-sysv4
2179		;;
2180	powerpcle-*-eabisim*)
2181		cpu_type=rs6000
2182		tm_file=rs6000/eabilesim.h
2183		tmake_file=rs6000/t-eabisim
2184		fixincludes=Makefile.in
2185		;;
2186	powerpcle-*-eabi*)
2187		cpu_type=rs6000
2188		tm_file=rs6000/eabile.h
2189		if [ x$gas = xyes ]
2190		then
2191		     tmake_file=rs6000/t-eabilegas
2192		else
2193		     tmake_file=rs6000/t-eabi
2194		fi
2195		fixincludes=Makefile.in
2196		;;
2197	rs6000-ibm-aix3.[01]*)
2198		tm_file=rs6000/aix31.h
2199		tmake_file=rs6000/t-rs6000
2200		xmake_file=rs6000/x-aix31
2201		use_collect2=yes
2202		;;
2203	rs6000-ibm-aix3.2.[456789]*)
2204		tm_file=rs6000/aix3newas.h
2205		tmake_file=rs6000/t-newas
2206		use_collect2=yes
2207		;;
2208	rs6000-ibm-aix[456789].*)
2209		tm_file=rs6000/aix41.h
2210		tmake_file=rs6000/t-newas
2211		xmake_file=rs6000/x-aix31
2212		use_collect2=yes
2213		;;
2214	rs6000-ibm-aix*)
2215		use_collect2=yes
2216		tmake_file=rs6000/t-rs6000
2217		;;
2218	rs6000-bull-bosx)
2219		tmake_file=rs6000/t-rs6000
2220		use_collect2=yes
2221		;;
2222	rs6000-*-mach*)
2223		xm_file=rs6000/xm-mach.h
2224		tm_file=rs6000/mach.h
2225		tmake_file=rs6000/t-rs6000
2226		xmake_file=rs6000/x-mach
2227		use_collect2=yes
2228		;;
2229	rs6000-*-lynxos*)
2230		xmake_file=rs6000/x-lynx
2231		xm_file=rs6000/xm-lynx.h
2232		tm_file=rs6000/lynx.h
2233		tmake_file=rs6000/t-rs6000
2234		use_collect2=yes
2235		;;
2236	sh-*-*)
2237		cpu_type=sh
2238		;;
2239	sparc-tti-*)
2240		tm_file=sparc/pbd.h
2241		xm_file=sparc/xm-pbd.h
2242		;;
2243	sparc-wrs-vxworks* | sparclite-wrs-vxworks*)
2244		cpu_type=sparc
2245		tm_file=sparc/vxsparc.h
2246		tmake_file=sparc/t-vxsparc
2247		use_collect2=yes
2248		;;
2249	sparc-*-aout*)
2250		tmake_file=sparc/t-sparcbare
2251		tm_file=sparc/sparc-aout.h
2252		;;
2253	sparc-*-netbsd*)
2254		tm_file=sparc/netbsd.h
2255		xm_file=sparc/xm-netbsd.h
2256		# On NetBSD, the headers are already okay.
2257		fixincludes=Makefile.in
2258		tmake_file=t-libc-ok
2259		xmake_file=x-netbsd
2260		;;
2261	sparc-*-bsd*)
2262		tm_file=sparc/bsd.h
2263		;;
2264	sparc-*-lynxos*)
2265		if [ x$gas = xyes ]
2266		then
2267			tm_file=sparc/lynx.h
2268		else
2269			tm_file=sparc/lynx-ng.h
2270		fi
2271		xm_file=sparc/xm-lynx.h
2272		tmake_file=sparc/t-sunos41
2273		xmake_file=x-lynx
2274		;;
2275	sparc-*-solaris2* | sparc-*-sunos5*)
2276		xm_file=sparc/xm-sol2.h
2277		tm_file=sparc/sol2.h
2278		tmake_file=sparc/t-sol2
2279		xmake_file=sparc/x-sysv4
2280		extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
2281		fixincludes=fixinc.svr4
2282		broken_install=yes
2283		;;
2284	sparc-*-sunos4.0*)
2285		tm_file=sparc/sunos4.h
2286		tmake_file=sparc/t-sunos40
2287		use_collect2=yes
2288		;;
2289	sparc-*-sunos4*)
2290		tm_file=sparc/sunos4.h
2291		tmake_file=sparc/t-sunos41
2292		use_collect2=yes
2293		;;
2294	sparc-*-sunos3*)
2295		tm_file=sparc/sun4o3.h
2296		use_collect2=yes
2297		;;
2298	sparc-*-sysv4*)
2299		xm_file=sparc/xm-sysv4.h
2300		tm_file=sparc/sysv4.h
2301		tmake_file=t-svr4
2302		xmake_file=sparc/x-sysv4
2303		extra_parts="crtbegin.o crtend.o"
2304		;;
2305	sparclite-*-coff*)
2306		cpu_type=sparc
2307		tm_file=sparc/litecoff.h
2308		tmake_file=sparc/t-sparclite
2309		;;
2310	sparclite-*-*)
2311		cpu_type=sparc
2312		tm_file=sparc/lite.h
2313		tmake_file=sparc/t-sparclite
2314		use_collect2=yes
2315		;;
2316	sparc64-*-aout*)
2317		cpu_type=sparc
2318		tmake_file=sparc/t-sp64
2319		tm_file=sparc/sp64-aout.h
2320		;;
2321	sparc64-*-elf*)
2322		cpu_type=sparc
2323		tmake_file=sparc/t-sp64
2324		tm_file=sparc/sp64-elf.h
2325		extra_parts="crtbegin.o crtend.o"
2326		;;
2327# This hasn't been upgraded to GCC 2.
2328#	tahoe-harris-*)			# Harris tahoe, using COFF.
2329#		tm_file=tahoe/harris.h
2330#		;;
2331#	tahoe-*-bsd*)			# tahoe running BSD
2332#		;;
2333# This hasn't been upgraded to GCC 2.
2334#	tron-*-*)
2335#		cpu_type=gmicro
2336#		use_collect2=yes
2337#		;;
2338	vax-*-bsd*)			# vaxen running BSD
2339		use_collect2=yes
2340		;;
2341	vax-*-sysv*)			# vaxen running system V
2342		xm_file=vax/xm-vaxv.h
2343		tm_file=vax/vaxv.h
2344		;;
2345	vax-*-netbsd*)
2346		tm_file=vax/netbsd.h
2347		xm_file=vax/xm-netbsd.h
2348		tmake_file=t-libc-ok
2349		# On NetBSD, the headers are already okay.
2350		fixincludes=Makefile.in
2351		xmake_file=x-netbsd
2352		;;
2353	vax-*-ultrix*)			# vaxen running ultrix
2354		tm_file=vax/ultrix.h
2355		use_collect2=yes
2356		;;
2357	vax-*-vms*)			# vaxen running VMS
2358		xm_file=vax/xm-vms.h
2359		tm_file=vax/vms.h
2360		;;
2361        pdp11-*-bsd)
2362		xm_file=pdp11/xm-pdp11.h
2363		tm_file=pdp11/2bsd.h
2364		tmake_file=pdp11/t-pdp11
2365                ;;
2366        pdp11-*-*)
2367		xm_file=pdp11/xm-pdp11.h
2368		tm_file=pdp11/pdp11.h
2369		tmake_file=pdp11/t-pdp11
2370		;;
2371	we32k-att-sysv*)
2372		cpu_type=we32k
2373		use_collect2=yes
2374		;;
2375	*)
2376		echo "Configuration $machine not supported" 1>&2
2377		exit 1
2378		;;
2379	esac
2380
2381	case $machine in
2382	*-*-gnu*)
2383		# On the GNU system, the setup is just about the same on
2384		# each different CPU.  The specific machines that GNU
2385		# supports are matched above and just set $cpu_type.
2386		xm_file=${cpu_type}/xm-gnu.h
2387		tm_file=${cpu_type}/gnu.h
2388		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
2389		# GNU always uses ELF.
2390		elf=yes
2391		# GNU tools are the only tools.
2392		gnu_ld=yes
2393		gas=yes
2394		# On GNU, the headers are already okay.
2395		fixincludes=Makefile.in
2396		# Don't build libgcc1.c, because there is no non-GNU
2397		# compiler to build it with.  The GNU system C library will
2398		# include assembly versions of any needed functions.
2399		tmake_file=t-libc-ok
2400		;;
2401	*-*-sysv4*)
2402		fixincludes=fixinc.svr4
2403		xmake_try_sysv=x-sysv
2404		broken_install=yes
2405		install_headers_dir=install-headers-cpio
2406		;;
2407	*-*-sysv*)
2408		broken_install=yes
2409		install_headers_dir=install-headers-cpio
2410		;;
2411	esac
2412
2413	# Distinguish i386 from i486/i586.
2414	# ??? For the moment we treat i586 as an i486.
2415	# Also, do not run mips-tfile on MIPS if using gas.
2416	case $machine in
2417	i[45]86-*-*)
2418		target_cpu_default=2
2419		;;
2420	mips*-*-*)
2421		if [ x$gas = xyes ]
2422		then
2423			target_cpu_default=16
2424		fi
2425		;;
2426	alpha-*-*)
2427		if [ x$gas = xyes ]
2428		then
2429			target_cpu_default=4
2430		fi
2431		;;
2432	esac
2433
2434	# No need for collect2 if we have the GNU linker.
2435	case x$gnu_ld in 
2436	xyes)
2437		use_collect2=
2438		;;
2439	esac
2440
2441# Default certain vars that apply to both host and target in turn.
2442	if [ x$cpu_type = x ]
2443	then cpu_type=`echo $machine | sed 's/-.*$//'`
2444	fi
2445
2446# Save data on machine being used to compile GCC in build_xm_file.
2447# Save data on host machine in vars host_xm_file and host_xmake_file.
2448	if [ x$pass1done = x ]
2449	then
2450		if [ x$xm_file = x ]
2451		then build_xm_file=$cpu_type/xm-$cpu_type.h
2452		else build_xm_file=$xm_file
2453		fi
2454		pass1done=yes
2455	else
2456		if [ x$pass2done = x ]
2457		then
2458			if [ x$xm_file = x ]
2459			then host_xm_file=$cpu_type/xm-$cpu_type.h
2460			else host_xm_file=$xm_file
2461			fi
2462			if [ x$xmake_file = x ]
2463			then xmake_file=$cpu_type/x-$cpu_type
2464			fi
2465			host_xmake_file=$xmake_file
2466			host_broken_install=$broken_install
2467			host_install_headers_dir=$install_headers_dir
2468			host_truncate_target=$truncate_target
2469			pass2done=yes
2470		fi
2471	fi
2472done
2473
2474# Default the target-machine variables that were not explicitly set.
2475if [ x$tm_file = x ]
2476then tm_file=$cpu_type/$cpu_type.h; fi
2477
2478if [ x$extra_headers = x ]
2479then extra_headers=; fi
2480
2481if [ x$xm_file = x ]
2482then xm_file=$cpu_type/xm-$cpu_type.h; fi
2483
2484md_file=$cpu_type/$cpu_type.md
2485
2486if [ x$out_file = x ]
2487then out_file=$cpu_type/$cpu_type.c; fi
2488
2489if [ x$tmake_file = x ]
2490then tmake_file=$cpu_type/t-$cpu_type
2491fi
2492
2493# Say what files are being used for the output code and MD file.
2494echo "Using \`$srcdir/config/$out_file' to output insns."
2495echo "Using \`$srcdir/config/$md_file' as machine description file."
2496echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
2497echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
2498if [ $host_xm_file != $build_xm_file ]; then
2499	echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
2500fi
2501
2502# Set up the list of links to be made.
2503# $links is the list of link names, and $files is the list of names to link to.
2504files="$host_xm_file $tm_file $xm_file $build_xm_file"
2505links="config.h tm.h tconfig.h hconfig.h"
2506
2507rm -f config.bak
2508if [ -f config.status ]; then mv -f config.status config.bak; fi
2509
2510# Make the links.
2511while [ -n "$files" ]
2512do
2513	# set file to car of files, files to cdr of files
2514	set $files; file=$1; shift; files=$*
2515	set $links; link=$1; shift; links=$*
2516
2517	rm -f $link
2518	echo "#include \"$file\"" >$link
2519done
2520
2521# Truncate the target if necessary
2522if [ x$host_truncate_target != x ]; then
2523	target=`echo $target | sed -e 's/\(..............\).*/\1/'`
2524fi
2525
2526# Get the version number from the toplevel
2527version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${srcdir}/version.c`
2528
2529# For the current directory and all of the language subdirectories,
2530# do the rest of the script ...
2531
2532subdirs=
2533for lang in ${srcdir}/*/config-lang.in ..
2534do
2535	case $lang in
2536	..) ;;
2537	# The odd quoting in the next line works around
2538	# an apparent bug in bash 1.12 on linux.
2539	${srcdir}/[*]/config-lang.in) ;;
2540	*) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" ;;
2541	esac
2542done
2543
2544# Are we using gcc as the native compiler?
2545case $canon_host in
2546*linux*)	# All Linux's use gcc as the native compiler.
2547	prefix=$native_prefix
2548	;;
2549esac
2550
2551# Make empty files to contain the specs and options for each language.
2552# Then add #include lines to for a compiler that has specs and/or options.
2553
2554lang_specs_files=
2555lang_options_files=
2556rm -f specs.h options.h
2557touch specs.h options.h
2558for subdir in . $subdirs
2559do
2560	if [ -f $srcdir/$subdir/lang-specs.h ]; then
2561		echo "#include \"$subdir/lang-specs.h\"" >>specs.h
2562		lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
2563	fi
2564	if [ -f $srcdir/$subdir/lang-options.h ]; then
2565		echo "#include \"$subdir/lang-options.h\"" >>options.h
2566		lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
2567	fi
2568done
2569
2570# Define SET_MAKE if this old version of `make' doesn't define $(MAKE).
2571rm -f Makefile.xx
2572(echo 'all:'; echo '	@echo maketemp=$(MAKE)') >Makefile.xx
2573case `${MAKE-make} -f Makefile.xx 2>/dev/null | grep maketemp=` in
2574'maketemp=')
2575	SET_MAKE="MAKE = ${MAKE-make}"
2576	;;
2577*)
2578	SET_MAKE=
2579	;;
2580esac
2581rm -f Makefile.xx
2582
2583savesrcdir=$srcdir
2584for subdir in . $subdirs
2585do
2586	oldsrcdir=$savesrcdir
2587
2588	# Re-adjust the path
2589	case $oldsrcdir in
2590	/*)
2591		srcdir=$oldsrcdir/$subdir
2592		;;
2593	*)
2594		case $subdir in
2595		.)
2596			;;
2597		*)
2598			oldsrcdir=../${oldsrcdir}
2599			srcdir=$oldsrcdir/$subdir
2600			;;
2601		esac
2602		;;
2603	esac
2604	mainsrcdir=$oldsrcdir
2605	STARTDIR=`pwd`
2606	test -d $subdir || mkdir $subdir
2607	cd $subdir
2608
2609	# Create Makefile.tem from Makefile.in.
2610	# Make it set VPATH if necessary so that the sources are found.
2611	# Also change its value of srcdir.
2612	# Also create a .gdbinit file which runs the one in srcdir
2613	# and tells GDB to look there for source files.
2614	case $srcdir in
2615	. | ./$subdir | .././$subdir)
2616		rm -f Makefile.tem
2617		cp Makefile.in Makefile.tem
2618		chmod +w Makefile.tem
2619		;;
2620	*)
2621		rm -f Makefile.tem
2622		echo "VPATH = ${srcdir}" \
2623		  | cat - ${srcdir}/Makefile.in \
2624		  | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem
2625		rm -f .gdbinit
2626		echo "dir ." > .gdbinit
2627		echo "dir ${srcdir}" >> .gdbinit
2628		if [ x$gdb_needs_out_file_path = xyes ]
2629		then
2630			echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
2631		fi
2632		if [ "x$subdirs" != x ]; then
2633			for s in $subdirs
2634			do
2635				echo "dir ${srcdir}/$s" >> .gdbinit
2636			done
2637		fi
2638		echo "source ${srcdir}/.gdbinit" >> .gdbinit
2639		;;
2640	esac
2641	
2642	# Conditionalize the makefile for this host machine.
2643	if [ -f ${mainsrcdir}/config/${host_xmake_file} ]
2644	then
2645		rm -f Makefile.xx
2646		sed -e "/####host/  r ${mainsrcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx
2647		echo "Merged ${host_xmake_file}."
2648		rm -f Makefile.tem
2649		mv Makefile.xx Makefile.tem
2650		dep_host_xmake_file=${host_xmake_file}
2651	else
2652	# Say in the makefile that there is no host_xmake_file,
2653	# by using a name which (when interpreted relative to $srcdir/config)
2654	# will duplicate another dependency: $srcdir/Makefile.in.
2655		dep_host_xmake_file=../Makefile.in
2656	fi
2657
2658	# Add a definition for MAKE if system wants one.
2659	case "$SET_MAKE" in
2660	?*)
2661		rm -f Makefile.xx
2662		(echo "$SET_MAKE"; cat Makefile.tem) >Makefile.xx
2663		rm -f Makefile.tem
2664		mv Makefile.xx Makefile.tem
2665	esac
2666
2667	# Add a definition for INSTALL if system wants one.
2668	# This substitutes for lots of x-* files.
2669	if [ x$host_broken_install = x ]
2670	then true
2671	else
2672		rm -f Makefile.xx
2673		abssrcdir=`cd ${srcdir}; pwd`
2674		sed "s|^INSTALL = .*|INSTALL = ${abssrcdir}/install.sh -c|" Makefile.tem > Makefile.xx
2675		rm -f Makefile.tem
2676		mv Makefile.xx Makefile.tem
2677	fi
2678
2679	# Some of the following don't make sense in the language makefiles,
2680	# but rather than introduce another level of nesting, we leave them
2681	# as is.
2682
2683	# Set EXTRA_HEADERS according to extra_headers.
2684	# This substitutes for lots of t-* files.
2685	if [ "x$extra_headers" = x ]
2686	then true
2687	else
2688		# Prepend ${srcdir}/ginclude/ to every entry in extra_headers.
2689		list=
2690		for file in $extra_headers;
2691		do
2692			list="${list} ${srcdir}/ginclude/${file}"
2693		done
2694		rm -f Makefile.xx
2695		sed "s|^EXTRA_HEADERS =|EXTRA_HEADERS = ${list}|" Makefile.tem > Makefile.xx
2696		rm -f Makefile.tem
2697		mv Makefile.xx Makefile.tem
2698	fi
2699	
2700	# Set EXTRA_PASSES according to extra_passes.
2701	# This substitutes for lots of t-* files.
2702	if [ "x$extra_passes" = x ]
2703	then true
2704	else
2705		rm -f Makefile.xx
2706		sed "s/^EXTRA_PASSES =/EXTRA_PASSES = $extra_passes/" Makefile.tem > Makefile.xx
2707		rm -f Makefile.tem
2708		mv Makefile.xx Makefile.tem
2709	fi
2710	
2711	# Set EXTRA_PARTS according to extra_parts.
2712	# This substitutes for lots of t-* files.
2713	if [ "x$extra_parts" = x ]
2714	then true
2715	else
2716		rm -f Makefile.xx
2717		sed "s/^EXTRA_PARTS =/EXTRA_PARTS = $extra_parts/" Makefile.tem > Makefile.xx
2718		rm -f Makefile.tem
2719		mv Makefile.xx Makefile.tem
2720	fi
2721
2722	# Set EXTRA_PROGRAMS according to extra_programs.
2723	if [ "x$extra_programs" = x ]
2724	then true
2725	else
2726		rm -f Makefile.xx
2727		sed "s/^EXTRA_PROGRAMS =/EXTRA_PROGRAMS = $extra_programs/" Makefile.tem > Makefile.xx
2728		rm -f Makefile.tem
2729		mv Makefile.xx Makefile.tem
2730	fi
2731
2732	# Set EXTRA_OBJS according to extra_objs.
2733	# This substitutes for lots of t-* files.
2734	if [ "x$extra_objs" = x ]
2735	then true
2736	else
2737		rm -f Makefile.xx
2738		sed "s|^EXTRA_OBJS =|EXTRA_OBJS = $extra_objs|" Makefile.tem > Makefile.xx
2739		rm -f Makefile.tem
2740		mv Makefile.xx Makefile.tem
2741	fi
2742
2743	# Set EXTRA_GCC_OBJS according to extra_gcc_objs.
2744	# This substitutes for lots of t-* files.
2745	if [ "x$extra_gcc_objs" = x ]
2746	then true
2747	else
2748		rm -f Makefile.xx
2749		sed "s|^EXTRA_GCC_OBJS =|EXTRA_GCC_OBJS = $extra_gcc_objs|" Makefile.tem > Makefile.xx
2750		rm -f Makefile.tem
2751		mv Makefile.xx Makefile.tem
2752	fi
2753
2754	# Add a definition of USE_COLLECT2 if system wants one.
2755	# Also tell toplev.c what to do.
2756	# This substitutes for lots of t-* files.
2757	if [ x$use_collect2 = x ]
2758	then true
2759	else
2760		rm -f Makefile.xx
2761		(echo "USE_COLLECT2 = ld"; echo "MAYBE_USE_COLLECT2 = -DUSE_COLLECT2")\
2762	 	   | cat - Makefile.tem > Makefile.xx
2763		rm -f Makefile.tem
2764		mv Makefile.xx Makefile.tem
2765	fi
2766	
2767	# Add -DTARGET_CPU_DEFAULT for toplev.c if system wants one.
2768	# This substitutes for lots of *.h files.
2769	if [ x$target_cpu_default = x ]
2770	then true
2771	else
2772		rm -f Makefile.xx
2773	# This used cat, but rfg@netcom.com said that ran into NFS bugs.
2774		sed -e "/^# Makefile for GNU C compiler./c\\
2775MAYBE_TARGET_DEFAULT = -DTARGET_CPU_DEFAULT=$target_cpu_default\\
2776\# Makefile for GNU C compiler." Makefile.tem > Makefile.xx
2777		rm -f Makefile.tem
2778		mv Makefile.xx Makefile.tem
2779	fi
2780	
2781	# Set MD_DEPS if the real md file is in md.pre-cpp.
2782	# Set MD_CPP to the cpp to pass the md file through.  Md files use ';'
2783	# for line oriented comments, so we must always use a GNU cpp.  If
2784	# building gcc with a cross compiler, use the cross compiler just
2785	# built.  Otherwise, we can use the cpp just built.
2786	if [ "x$md_cppflags" = x ]
2787	then
2788		md_file=$srcdir/config/$md_file
2789	else
2790		rm -f Makefile.xx
2791	  	(if [ x$host = x$build ] ; then
2792			echo "MD_DEPS = $(md_file) cpp" ; echo "MD_CPP = ./cpp"
2793		else
2794			echo "MD_DEPS = md.pre-cpp" ; echo "MD_CPP = \$(HOST_CC) -x c -E"
2795		fi
2796		md_file=md
2797		echo "MD_CPPFLAGS = $md_cppflags") | \
2798		  cat - Makefile.tem | sed -e "s|^MD_FILE[ 	]*=.*|MD_FILE = md|" > Makefile.xx
2799		rm -f Makefile.tem
2800		mv Makefile.xx Makefile.tem
2801	fi
2802	
2803	# If we have gas in the build tree, make a link to it.
2804	if [ -f ../gas/Makefile ]; then
2805		rm -f as; $symbolic_link ../gas/as.new as 2>/dev/null
2806	fi
2807	
2808	# If we have ld in the build tree, make a link to it.
2809	if [ -f ../ld/Makefile ]; then
2810		if [ x$use_collect2 = x ]; then
2811			rm -f ld; $symbolic_link ../ld/ld.new ld 2>/dev/null
2812		else
2813			rm -f collect-ld; $symbolic_link ../ld/ld.new collect-ld 2>/dev/null
2814		fi
2815	fi
2816	
2817	# If using -program-transform-name, override the installation names.
2818	if [ "x${program_transform_set}" = "xyes" ] ; then
2819		sed -e "s/^program_transform_name[ 	]*=.*$/program_transform_name = $program_transform_name/" \
2820		    -e "s/^program_transform_cross_name[ 	]*=.*$/program_transform_cross_name = $program_transform_name/" \
2821		    Makefile.tem > Makefile.xx
2822		rm -f Makefile.tem
2823		mv Makefile.xx Makefile.tem
2824	fi
2825	
2826	# Conditionalize the makefile for this target machine.
2827	if [ -f ${mainsrcdir}/config/${tmake_file} ]
2828	then
2829		rm -f Makefile.xx
2830		sed -e "/####target/  r ${mainsrcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx
2831		echo "Merged ${tmake_file}."
2832		rm -f Makefile.tem
2833		mv Makefile.xx Makefile.tem
2834		dep_tmake_file=${tmake_file}
2835	else
2836	# Say in the makefile that there is no tmake_file,
2837	# by using a name which (when interpreted relative to $srcdir/config)
2838	# will duplicate another dependency: $srcdir/Makefile.in.
2839		dep_tmake_file=../Makefile.in
2840	fi
2841	
2842	# If this is the top level Makefile, add the language fragments.
2843	# Languages are added via two mechanisms.  Some information must be
2844	# recorded in makefile variables, these are defined in config-lang.in.
2845	# We accumulate them and plug them into the main Makefile.
2846	# The other mechanism is a set of hooks for each of the main targets
2847	# like `clean', `install', etc.
2848	if [ $subdir = . ]
2849	then
2850		# These (without "all_") are set in each config-lang.in.
2851		# `language' must be a single word so is spelled singularly.
2852		all_languages=
2853		all_compilers=
2854		all_stagestuff=
2855		all_diff_excludes=
2856		# List of language makefile fragments.
2857		all_lang_makefiles=
2858
2859		rm -f Makefile.xx Makefile.ll
2860		touch Makefile.ll
2861		for s in .. $subdirs
2862		do
2863			if [ $s != ".." ]
2864			then
2865				language=
2866				compilers=
2867				stagestuff=
2868				diff_excludes=
2869				. ${mainsrcdir}/$s/config-lang.in
2870				if [ "x$language" = x ]
2871				then
2872					echo "${mainsrcdir}/$s/config-lang.in doesn't set \$language." 1>&2
2873					exit 1
2874				fi
2875				all_lang_makefiles="$all_lang_makefiles ${mainsrcdir}/$s/Make-lang.in ${mainsrcdir}/$s/Makefile.in"
2876				all_languages="$all_languages $language"
2877				all_compilers="$all_compilers $compilers"
2878				all_stagestuff="$all_stagestuff $stagestuff"
2879				all_diff_excludes="$all_diff_excludes $diff_excludes"
2880
2881				cat ${mainsrcdir}/$s/Make-lang.in >> Makefile.ll
2882			fi
2883		done
2884		sed -e "/####language fragments/ r Makefile.ll" Makefile.tem > Makefile.xx
2885		rm -f Makefile.tem
2886		mv Makefile.xx Makefile.tem
2887		sed -e "s|^SUBDIRS[ 	]*=.*$|SUBDIRS = $subdirs|" \
2888		    -e "s|^LANGUAGES[ 	]*=[ 	]*\(.*\)$|LANGUAGES = \1 $all_languages|" \
2889		    -e "s|^COMPILERS[ 	]*=[ 	]*\(.*\)$|COMPILERS = \1 $all_compilers|" \
2890		    -e "s|^LANG_MAKEFILES[ 	]*=.*$|LANG_MAKEFILES = $all_lang_makefiles|" \
2891		    -e "s|^LANG_STAGESTUFF[ 	]*=.*$|LANG_STAGESTUFF = $all_stagestuff|" \
2892		    -e "s|^LANG_DIFF_EXCLUDES[ 	]*=.*$|LANG_DIFF_EXCLUDES = $all_diff_excludes|" \
2893		    Makefile.tem > Makefile.xx
2894		rm -f Makefile.tem
2895		mv Makefile.xx Makefile.tem
2896
2897		# Since we can't use `::' targets, we link each language in
2898		# with a set of hooks, reached indirectly via lang.${target}.
2899
2900		target_list="all.build all.cross start.encap rest.encap \
2901			info dvi \
2902			install-normal install-common install-info install-man \
2903			uninstall distdir \
2904			mostlyclean clean distclean extraclean maintainer-clean \
2905			stage1 stage2 stage3 stage4"
2906		rm -f Makefile.ll
2907		for t in $target_list
2908		do
2909			x=
2910			for l in .. $all_languages
2911			do
2912				if [ $l != ".." ]; then
2913					x="$x $l.$t"
2914				fi
2915			done
2916			echo "lang.$t: $x" >> Makefile.ll
2917		done
2918		sed -e "/####language hooks/ r Makefile.ll" Makefile.tem > Makefile.xx
2919		rm -f Makefile.tem
2920		mv Makefile.xx Makefile.tem
2921		rm -f Makefile.ll
2922
2923		# If the host doesn't support symlinks, modify CC in
2924		# FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
2925		# Otherwise, we can use "CC=$(CC)".
2926		rm -f symtest.tem
2927		if $symbolic_link symtest1.tem symtest.tem 2>/dev/null
2928		then
2929			sed -e 's,CC=set-by-configure,CC=$(CC),' \
2930			    Makefile.tem > Makefile.xx
2931		else
2932			sed -e "s,CC=set-by-configure,CC=\`case '$(CC)' in stage*) echo '$(CC)' | sed -e 's|stage|../stage|g';; *) echo '$(CC)';; esac\`," \
2933			    Makefile.tem > Makefile.xx
2934		fi
2935		rm -f Makefile.tem
2936		mv Makefile.xx Makefile.tem
2937		rm -f symtest.tem
2938
2939		if [ "x$all_languages" != x ]
2940		then
2941			# Missing space after `Merged' is intentional.
2942			echo "Merged$all_languages fragment(s)."
2943		fi
2944
2945	# Otherwise, this is a language subdirectory.  If the host supports
2946	# symlinks, point stage[123] at ../stage[123] so bootstrapping and the
2947	# installation procedure can still use CC="stage1/xgcc -Bstage1/".
2948	# If the host doesn't support symlinks, FLAGS_TO_PASS has been
2949	# modified to solve the problem there.
2950	else
2951		for t in stage1 stage2 stage3 stage4 include
2952		do
2953			rm -f $t
2954			$symbolic_link ../$t $t 2>/dev/null
2955		done
2956	fi
2957
2958	out_object_file=`basename $out_file .c`.o
2959	
2960	# Remove all formfeeds, since some Makes get confused by them.
2961	# Also arrange to give the variables `target', `host_xmake_file',
2962	# `tmake_file', `prefix', `local_prefix', `exec_prefix', `FIXINCLUDES'
2963	# `out_file', `out_object', `md_file', `lang_specs_files',
2964	# `lang_options_files', and `INSTALL_HEADERS_DIR' values in the
2965	# Makefile from the values they have in this script.
2966	rm -f Makefile.xx
2967	rm -f aux-output.c aux-output.o md
2968	# Create an empty Makefile.sed first, to work around a Nextstep 3.3 bug.
2969	echo 's|||' > Makefile.sed
2970	rm Makefile.sed
2971	echo 's|||' > Makefile.sed
2972	echo "s|^target=.*$|target=${target}|" >> Makefile.sed
2973	echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed
2974	echo "s|^tmake_file=.*$|tmake_file=${dep_tmake_file}|" >> Makefile.sed
2975	echo "s|^version=.*$|version=${version}|" >> Makefile.sed
2976	echo "s|^version=.*$|version=${version}|" >> Makefile.sed
2977	echo "s|^out_file=.*$|out_file=${srcdir}/config/${out_file}|" >> Makefile.sed
2978	echo "s|^out_object_file=.*$|out_object_file=${out_object_file}|" >> Makefile.sed
2979	echo "s|^md_file=.*$|md_file=${md_file}|" >> Makefile.sed
2980	echo "s|^tm_file=.*$|tm_file=${srcdir}/config/${tm_file}|" >> Makefile.sed
2981	echo "s|^host_xm_file=.*$|host_xm_file=${srcdir}/config/${host_xm_file}|" >> Makefile.sed
2982	echo "s|^build_xm_file=.*$|build_xm_file=${srcdir}/config/${build_xm_file}|" >> Makefile.sed
2983	echo "s|^lang_specs_files=.*$|lang_specs_files=${lang_specs_files}|" >> Makefile.sed
2984	echo "s|^lang_options_files=.*$|lang_options_files=${lang_options_files}|" >> Makefile.sed
2985	echo "s|^prefix[ 	]*=.*|prefix = $prefix|" >> Makefile.sed
2986	echo "s|^gxx_include_dir[ 	]*=.*|gxx_include_dir = $gxx_include_dir|" >> Makefile.sed
2987	echo "s|^local_prefix[ 	]*=.*|local_prefix = $local_prefix|" >> Makefile.sed
2988	echo "s|^exec_prefix[ 	]*=.*|exec_prefix = $exec_prefix|" >> Makefile.sed
2989	echo "s|^FIXINCLUDES[ 	]*=.*|FIXINCLUDES = $fixincludes|" >> Makefile.sed
2990	echo "s|^INSTALL_HEADERS_DIR[ 	]*=.*$|INSTALL_HEADERS_DIR = ${host_install_headers_dir}|" >> Makefile.sed
2991	sed -f Makefile.sed Makefile.tem > Makefile.xx
2992	rm -f Makefile.tem Makefile.sed
2993	mv Makefile.xx Makefile.tem
2994	
2995	# Install Makefile for real, after making final changes.
2996	# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
2997	# Also use all.cross instead of all.internal, and add cross-make to Makefile.
2998	if [ x$canon_host = x$canon_target ]
2999	then
3000		rm -f Makefile
3001	  	if [ x$canon_host = x$canon_build ]
3002		then
3003			mv Makefile.tem Makefile
3004		else
3005	#		When building gcc with a cross-compiler, we need to fix a
3006	#		few things.
3007			echo "build= $build" > Makefile
3008	    		sed -e "s|objc-runtime$||" \
3009			    -e "/####build/  r ${mainsrcdir}/build-make" Makefile.tem >> Makefile
3010			rm -f Makefile.tem Makefile.xx
3011		fi
3012	else
3013		rm -f Makefile
3014		echo "CROSS=-DCROSS_COMPILE" > Makefile
3015		sed -e "/####cross/  r ${mainsrcdir}/cross-make" Makefile.tem >> Makefile
3016		rm -f Makefile.tem Makefile.xx
3017	fi
3018
3019	echo "Created \`$subdir/Makefile'."
3020
3021	# If a subdirectory has a configure script, run it.
3022	if [ x$subdir != x. ]
3023	then
3024		if [ -f $srcdir/configure ]
3025		then
3026			${CONFIG_SHELL-sh} $srcdir/configure $arguments --srcdir=$srcdir
3027		fi
3028	fi
3029
3030	cd $STARTDIR
3031done   # end of current-dir SUBDIRS loop
3032	
3033srcdir=$savesrcdir
3034
3035# Describe the chosen configuration in config.status.
3036# Make that file a shellscript which will reestablish the same configuration.
3037echo "#!/bin/sh
3038# GCC was configured as follows:
3039${srcdir}/configure" $arguments > config.new
3040echo echo host=$canon_host target=$canon_target build=$canon_build >> config.new
3041chmod a+x config.new
3042if [ -f config.bak ] && cmp config.bak config.new >/dev/null 2>/dev/null;
3043then
3044	mv -f config.bak config.status
3045	rm -f config.new
3046else
3047	mv -f config.new config.status
3048	rm -f config.bak
3049fi
3050
3051str2=
3052str3=
3053str4=.
3054
3055if [ x$canon_host = x$canon_target ]
3056then
3057	str1="native "
3058else
3059	str1="cross-"
3060	str2=" from $canon_host"
3061fi
3062
3063if [ x$canon_host != x$canon_build ]
3064then
3065	str3=" on a $canon_build system"
3066fi
3067
3068if [ "x$str2" != x ] || [ "x$str3" != x ]
3069then
3070	str4=
3071fi
3072
3073echo "Links are now set up to build a ${str1}compiler for ${canon_target}$str4" 1>&2
3074
3075if [ "x$str2" != x ] || [ "x$str3" != x ]
3076then
3077	echo " ${str2}${str3}." 1>&2
3078fi
3079
3080exit 0
3081