1#!/bin/sh 2# Configuration script for GNU CC 3# Copyright (C) 1988, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. 20 21# 22# Shell script to create proper links to machine-dependent files in 23# preparation for compiling gcc. 24# 25# Options: --srcdir=DIR specifies directory where sources are. 26# --host=HOST specifies host configuration. 27# --target=TARGET specifies target configuration. 28# --build=TARGET specifies configuration of machine you are 29# using to compile GCC. 30# --prefix=DIR specifies directory to install in. 31# --exec-prefix=DIR specifies directory to install executables in. 32# --with-gnu-ld arrange to work with GNU ld. 33# --with-gnu-as arrange to work with GAS. 34# --with-stabs arrange to use stabs instead of host debug format. 35# --nfp assume system has no FPU. 36# 37# If configure succeeds, it leaves its status in config.status. 38# If configure fails after disturbing the status quo, 39# config.status is removed. 40# 41 42progname=$0 43 44# Default --srcdir to the directory where the script is found, 45# if a directory was specified. 46# The second sed call is to convert `.//configure' to `./configure'. 47srcdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'` 48if [ x$srcdir = x$0 ] 49then 50srcdir= 51fi 52 53host= 54 55# Default prefix to /usr/local. 56#prefix=/usr/local 57prefix=/usr/libexec 58# Default is to let the Makefile set exec_prefix from $(prefix) 59#exec_prefix='$(prefix)' 60exec_prefix='$(prefix)/gcc2' 61 62remove=rm 63hard_link=ln 64symbolic_link='ln -s' 65copy=cp 66 67# Record all the arguments, to write them in config.status. 68arguments=$* 69 70#for Test 71#remove="echo rm" 72#hard_link="echo ln" 73#symbolic_link="echo ln -s" 74 75target= 76host= 77build= 78 79for arg in $*; 80do 81 case $next_arg in 82 --srcdir) 83 srcdir=$arg 84 next_arg= 85 ;; 86 --host) 87 host=$arg 88 next_arg= 89 ;; 90 --target) 91 target=$arg 92 next_arg= 93 ;; 94 --build) 95 build=$arg 96 next_arg= 97 ;; 98 --prefix) 99 prefix=$arg 100 next_arg= 101 ;; 102 --exec-prefix) 103 exec_prefix=$arg 104 next_arg= 105 ;; 106 *) 107 case $arg in 108 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s) 109 next_arg=--srcdir 110 ;; 111 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*) 112 srcdir=`echo $arg | sed 's/-*s[a-z]*=//'` 113 ;; 114 -host | --host | --hos | --ho | --h) 115 next_arg=--host 116 ;; 117 -host=* | --host=* | --hos=* | --ho=* | --h=*) 118 host=`echo $arg | sed 's/-*h[a-z]*=//'` 119 ;; 120 -target | --target | --targe | --targ | --tar | --ta | --t) 121 next_arg=--target 122 ;; 123 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) 124 target=`echo $arg | sed 's/-*t[a-z]*=//'` 125 ;; 126 -build | --build | --buil | --bui | --bu | --b) 127 next_arg=--build 128 ;; 129 -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) 130 build=`echo $arg | sed 's/-*b[a-z]*=//'` 131 ;; 132 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) 133 next_arg=--prefix 134 ;; 135 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) 136 prefix=`echo $arg | sed 's/-*p[a-z]*=//'` 137 ;; 138 -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \ 139 | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e) 140 next_arg=--exec-prefix 141 ;; 142 -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* \ 143 | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \ 144 | --exe=* | --ex=* | --e=*) 145 exec_prefix=`echo $arg | sed 's/-*e[-a-z]*=//'` 146 ;; 147 -with-gnu-ld | --with-gnu-ld | --with-gnu-l) 148 gnu_ld=yes 149 ;; 150 -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a) 151 gas=yes 152 ;; 153 -nfp | --nfp | --nf | --n) 154 nfp=yes 155 ;; 156 -with-stabs | -with-stab | -with-sta | -with-st | -with-s \ 157 | --with-stabs | --with-stab | --with-sta | --with-st | --with-s \ 158 | -stabs | -stab | -sta | -st \ 159 | --stabs | --stab | --sta | --st) 160 stabs=yes 161 ;; 162 -with-* | --with-*) ;; #ignored 163 -x | --x) ;; # ignored 164 -*) 165 echo "Invalid option \`$arg'" 1>&2 166 exit 1 167 ;; 168 *) 169# Allow configure HOST TARGET 170 if [ x$host = x ] 171 then 172 host=$target 173 fi 174 target=$arg 175 ;; 176 esac 177 esac 178done 179 180# Find the source files, if location was not specified. 181if [ x$srcdir = x ] 182then 183 srcdirdefaulted=1 184 srcdir=. 185 if [ ! -r tree.c ] 186 then 187 srcdir=.. 188 fi 189fi 190 191if [ ! -r ${srcdir}/tree.c ] 192then 193 if [ x$srcdirdefaulted = x ] 194 then 195 echo "$progname: Can't find compiler sources in \`${srcdir}'" 1>&2 196 else 197 echo "$progname: Can't find compiler sources in \`.' or \`..'" 1>&2 198 fi 199 exit 1 200fi 201 202if [ -r ${srcdir}/config.status ] && [ x$srcdir != x. ] 203then 204 echo "$progname: \`configure' has been run in \`${srcdir}'" 1>&2 205 exit 1 206fi 207 208# Complain if an arg is missing 209if [ x$target = x ] 210then 211 echo "No target specified." 1>&2 212 213 echo "\ 214Usage: `basename $progname` [--host=HOST] [--build=BUILD] 215 [--prefix=DIR] [--exec-pref=DIR] 216 [--with-gnu-as] [--with-gnu-ld] [--with-stabs] [--nfp] TARGET" 1>&2 217 echo "Where HOST, TARGET and BUILD are three-part configuration names " 1>&2 218 if [ -r config.status ] 219 then 220 tail +2 config.status 1>&2 221 fi 222 exit 1 223fi 224 225# Default other arg 226if [ x$host = x ] 227then 228 host=$target 229fi 230# If $build was not specified, use $host. 231if [ x$build = x ] 232then 233 build=$host 234fi 235 236build_xm_file= 237host_xm_file= 238host_xmake_file= 239host_broken_install= 240 241# Validate the specs, and canonicalize them. 242canon_build=`$srcdir/config.sub $build` || exit 1 243canon_host=`$srcdir/config.sub $host` || exit 1 244canon_target=`$srcdir/config.sub $target` || exit 1 245 246# Decode the host machine, then the target machine. 247# For the host machine, we save the xm_file variable as host_xm_file; 248# then we decode the target machine and forget everything else 249# that came from the host machine. 250for machine in $canon_build $canon_host $canon_target; do 251 252 cpu_type= 253 xm_file= 254 tm_file= 255 out_file= 256 xmake_file= 257 tmake_file= 258 header_files= 259 # Set this to force installation and use of collect2. 260 use_collect2= 261 # Set this to override the default target model. 262 target_cpu_default= 263 # Set this to force use of install.sh. 264 broken_install= 265 # Set this to control which fixincludes program to use. 266 fixincludes=fixincludes 267 268 case $machine in 269 # Support site-specific machine types. 270 *local*) 271 cpu_type=$machine 272 xm_file=xm-$machine.h 273 tm_file=$machine.h 274 if [ -f $srcdir/config/x-$machine ] ; \ 275 then xmake_file=x-$machine; \ 276 else true; \ 277 fi 278 if [ -f $srcdir/config/t-$machine ] ; \ 279 then tmake_file=t-$machine; \ 280 else true; \ 281 fi 282 ;; 283 vax-*-bsd*) # vaxen running BSD 284 tm_file=vax.h 285 use_collect2=yes 286 ;; 287 vax-*-ultrix*) # vaxen running ultrix 288 tm_file=ultrix.h 289 use_collect2=yes 290 ;; 291 vax-*-vms*) # vaxen running VMS 292 xm_file=xm-vax-vms.h 293 tm_file=vax-vms.h 294 ;; 295 vax-*-sysv*) # vaxen running system V 296 xm_file=xm-vaxv.h 297 tm_file=vaxv.h 298 ;; 299# This hasn't been upgraded to GCC 2. 300# tahoe-harris-*) # Harris tahoe, using COFF. 301# tm_file=harris.h 302# ;; 303# tahoe-*-bsd*) # tahoe running BSD 304# xm_file=xm-tahoe.h 305# tm_file=tahoe.h 306# ;; 307 i[34]86-*-osfrose*) # 386 using OSF/rose 308 tm_file=i386rose.h 309 xmake_file=x-i386rose 310 tmake_file=t-i386rose 311 use_collect2=yes 312 ;; 313 i[34]86-sequent-bsd*) # 80386 from Sequent 314 xm_file=xm-i386.h 315 use_collect2=yes 316 if [ x$gas = xyes ] 317 then 318 tm_file=seq386gas.h 319 else 320 tm_file=seq386.h 321 fi 322 ;; 323 i[34]86-*-bsd*) 324 xm_file=xm-i386.h 325 tm_file=i386bsd.h 326# tmake_file=t-libc-ok 327 use_collect2=yes 328 ;; 329 i[34]86-*-mach*) 330 xm_file=xm-i386.h 331 tm_file=i386mach.h 332# tmake_file=t-libc-ok 333 use_collect2=yes 334 ;; 335 i[34]86-*-sco3.2v4*) # 80386 running SCO 3.2v4 system 336 xm_file=xm-i386sco.h 337 tm_file=i386sco4.h 338 xmake_file=x-i386s4 339 tmake_file=t-i386sco 340 fixincludes=fixinc.sco 341 broken_install=yes 342 ;; 343 i[34]86-*-sco*) # 80386 running SCO system 344 xm_file=xm-i386sco.h 345 tm_file=i386sco.h 346 xmake_file=x-i386sco 347 tmake_file=t-i386sco 348 broken_install=yes 349 ;; 350 i[34]86-*-isc*) # 80386 running ISC system 351 xm_file=xm-i386isc.h 352 xmake_file=x-i386isc 353 if [ x$gas = xyes ] 354 then 355 tm_file=i386iscgas.h 356 tmake_file=t-i386iscgas 357 else 358 tm_file=i386isc.h 359 tmake_file=t-i386isc 360 fi 361 broken_install=yes 362 ;; 363 i[34]86-ibm-aix*) # IBM PS/2 running AIX 364 if [ x$gas = xyes ] 365 then 366 tm_file=aix386.h 367 else 368 tm_file=aix386ng.h 369 use_collect2=yes 370 fi 371 xm_file=xm-aix386.h 372 xmake_file=x-aix386 373 broken_install=yes 374 ;; 375 i386-sun-sunos*) # Sun i386 roadrunner 376 xm_file=xm-sun386.h 377 tm_file=i386sun.h 378 use_collect2=yes 379 ;; 380 i[34]86-*-linux*) # Intel 80386's running Linux 381 cpu_type=i386 382 xm_file=xm-linux.h 383 xmake_file=x-linux 384 tm_file=i386linux.h 385 broken_install=yes 386 ;; 387 i486-ncr-sysv4*) # NCR 3000 - i486 running system V.4 388 cpu_type=i386 389 xm_file=xm-i38v4.h 390 xmake_file=x-ncr3000 391 tm_file=i386v4.h 392 tmake_file=t-svr4 393 ;; 394 i[34]86-*-sysv4*) # Intel 80386's running system V.4 395 cpu_type=i386 396 xm_file=xm-i38v4.h 397 tm_file=i386v4.h 398 tmake_file=t-svr4 399 xmake_file=x-svr4 400 ;; 401 i[34]86-*-sysv*) # Intel 80386's running system V 402 xm_file=xm-i386v.h 403 xmake_file=x-i386v 404 tmake_file=t-svr3 405 if [ x$gas = xyes ] 406 then 407 if [ x$stabs = xyes ] 408 then 409 tm_file=i386gstabs.h 410 else 411 tm_file=i386gas.h 412 fi 413 else 414 tm_file=i386v.h 415 fi 416 ;; 417 i860-*-mach*) 418 xm_file=xm-i860.h 419 tm_file=i860mach.h 420 tmake_file=t-libc-ok 421 ;; 422 i860-*-sysv3*) 423 xm_file=xm-i86v3.h 424 xmake_file=x-i860v3 425 tm_file=i860v3.h 426 tmake_file=t-svr3 427 ;; 428 i860-*-sysv4*) 429 xm_file=xm-i86v4.h 430 xmake_file=x-i860v4 431 tm_file=i860v4.h 432 tmake_file=t-svr4 433 ;; 434 i860-alliant-*) # Alliant FX/2800 435 xm_file=xm-fx2800.h 436 xmake_file=x-fx2800 437 tm_file=fx2800.h 438 tmake_file=t-fx2800 439 ;; 440 i860-*-bsd*) 441 if [ x$gas = xyes ] 442 then 443 tm_file=i860bg.h 444 else 445 tm_file=i860b.h 446 fi 447 use_collect2=yes 448 ;; 449 sparc-tti-*) 450 tm_file=pbd.h 451 xm_file=xm-pbd.h 452 use_collect2=yes 453 ;; 454 elxsi-elxsi-*) 455 tm_file=elxsi.h 456 xm_file=xm-elxsi.h 457 use_collect2=yes 458 ;; 459 sparc-*-sunos4*) 460 tm_file=sparc.h 461 use_collect2=yes 462 ;; 463 sparc-*-sunos3*) 464 tm_file=sun4o3.h 465 use_collect2=yes 466 ;; 467 sparc-*-sysv4*) 468 xm_file=xm-spcv4.h 469 tm_file=sparcv4.h 470 tmake_file=t-svr4 471 xmake_file=x-sparcv4 472 ;; 473 sparc-*-solaris2* | sparc-*-sunos5*) 474 xm_file=xm-spc-sol2.h 475 tm_file=spc-sol2.h 476 tmake_file=t-sol2 477 xmake_file=x-sparcv4 478 fixincludes=fixinc.svr4 479 broken_install=yes 480 ;; 481 m68k-cbm-sysv4*) # Commodore variant of V.4. 482 tm_file=amix.h 483 xm_file=xm-amix.h 484 xmake_file=x-amix 485 tmake_file=t-svr4 486 header_files=math-68881.h 487 ;; 488 m68k-*-sysv4*) # Motorola m68k's running system V.4 489 tm_file=m68kv4.h 490 xm_file=xm-m68kv.h 491 tmake_file=t-svr4 492 header_files=math-68881.h 493 ;; 494 m68k-bull-sysv*) # Bull DPX/2 495 if [ x$gas = xyes ] 496 then 497 tm_file=dpx2g.h 498 else 499 echo dpx2 supported only with GAS 1>&2 500 exit 1 501 tm_file=dpx2.h 502 fi 503 xm_file=xm-m68kv.h 504 xmake_file=x-dpx2 505 use_collect2=yes 506 header_files=math-68881.h 507 ;; 508 m68k-next-*) 509 tm_file=next.h 510 out_file=next.c 511 xm_file=xm-next.h 512 tmake_file=t-next 513 xmake_file=x-next 514 use_collect2=yes 515 header_files=math-68881.h 516 ;; 517 m68k-sun-sunos3*) 518 if [ x$nfp = xyes ] 519 then 520 tm_file=sun3n3.h 521 else 522 tm_file=sun3o3.h 523 fi 524 use_collect2=yes 525 header_files=math-68881.h 526 ;; 527 m68k-sun-sunos*) # For SunOS 4 (the default). 528 if [ x$nfp = xyes ] 529 then 530 tm_file=sun3n.h 531 else 532 tm_file=sun3.h 533 fi 534 use_collect2=yes 535 header_files=math-68881.h 536 ;; 537 m68k-sun-mach*) 538 tm_file=sun3mach.h 539 use_collect2=yes 540 header_files=math-68881.h 541 ;; 542 m68k-tti-*) 543 tm_file=pbb.h 544 xm_file=xm-m68kv.h 545 use_collect2=yes 546 header_files=math-68881.h 547 ;; 548 m68k-hp-hpux*) # HP 9000 series 300 549 xm_file=xm-hp320.h 550 if [ x$gas = xyes ] 551 then 552 xmake_file=x-hp320g 553 tmake_file=t-hp320g 554 tm_file=hp320g.h 555 else 556 xmake_file=x-hp320 557 tm_file=hp320.h 558 fi 559 broken_install=yes 560 use_collect2=yes 561 header_files=math-68881.h 562 ;; 563 m68k-hp-bsd*) # HP 9000/3xx running Berkeley Unix 564 tm_file=hp3bsd.h 565 use_collect2=yes 566 header_files=math-68881.h 567 ;; 568 m68k-omron-bsd*) # OMRON LUNA-I/LUNA-II running Berkeley Unix 569 tm_file=luna68k.h 570 use_collect2=yes 571# header_files=math-68881.h 572 ;; 573 m68k-isi-bsd*) 574 if [ x$nfp = xyes ] 575 then 576 tm_file=isi-nfp.h 577 else 578 tm_file=isi.h 579 fi 580 use_collect2=yes 581 header_files=math-68881.h 582 ;; 583 m68k-sony-newsos3*) 584 xm_file=xm-m68k.h 585 if [ x$gas = xyes ] 586 then 587 tm_file=news3gas.h 588 else 589 tm_file=news3.h 590 fi 591 use_collect2=yes 592 header_files=math-68881.h 593 ;; 594 m68k-sony-bsd* | m68k-sony-newsos*) 595 xm_file=xm-m68k.h 596 if [ x$gas = xyes ] 597 then 598 tm_file=newsgas.h 599 else 600 tm_file=news.h 601 fi 602 use_collect2=yes 603 header_files=math-68881.h 604 ;; 605 m68k-altos-sysv*) # Altos 3068 606 if [ x$gas = xyes ] 607 then 608 xm_file=xm-altos3068.h 609 tm_file=altos3068.h 610 else 611 echo "The Altos is supported only with the GNU assembler" 1>&2 612 exit 1 613 fi 614 header_files=math-68881.h 615 ;; 616 m68k-motorola-sysv*) 617 tm_file=mot3300.h 618 xm_file=xm-mot3300.h 619 use_collect2=yes 620 header_files=math-68881.h 621 ;; 622 m68k-crds-unos*) 623 xm_file=xm-crds.h 624 xmake_file=x-crds 625 tm_file=crds.h 626 broken_install=yes 627 use_collect2=yes 628 header_files=math-68881.h 629 ;; 630 m68k-apollo-*) 631 xmake_file=x-apollo68 632 tm_file=apollo68.h 633 use_collect2=yes 634 header_files=math-68881.h 635 ;; 636 m68k-plexus-sysv*) 637 cpu_type=m68k 638 tm_file=plexus.h 639 use_collect2=yes 640 xm_file=xm-plexus.h 641 header_files=math-68881.h 642 ;; 643 m68k-ncr-sysv*) # NCR Tower 32 SVR3 644 tm_file=tower-as.h 645 xm_file=xm-tower.h 646 xmake_file=x-tower 647 tmake_file=t-svr3 648 header_files=math-68881.h 649 ;; 650 m68k-*-sysv3*) # Motorola m68k's running system V.3 651 tm_file=m68k.h 652 xm_file=xm-m68kv.h 653 xmake_file=x-m68kv 654 tmake_file=t-svr3 655 header_files=math-68881.h 656 ;; 657 m68000-sun-sunos3*) 658 cpu_type=m68k 659 tm_file=sun2.h 660 use_collect2=yes 661 header_files=math-68881.h 662 ;; 663 m68000-sun-sunos4*) 664 cpu_type=m68k 665 tm_file=sun2o4.h 666 use_collect2=yes 667 header_files=math-68881.h 668 ;; 669 m68000-hp-hpux*) # HP 9000 series 300 670 cpu_type=m68k 671 xm_file=xm-hp320.h 672 if [ x$gas = xyes ] 673 then 674 xmake_file=x-hp320g 675 tm_file=hp310g.h 676 else 677 xmake_file=x-hp320 678 tm_file=hp310.h 679 fi 680 broken_install=yes 681 use_collect2=yes 682 header_files=math-68881.h 683 ;; 684 m68000-hp-bsd*) # HP 9000/200 running BSD 685 cpu_type=m68k 686 tm_file=hp2bsd.h 687 xmake_file=x-hp2bsd 688 use_collect2=yes 689 header_files=math-68881.h 690 ;; 691 m68000-att-sysv*) 692 cpu_type=m68k 693 xm_file=xm-3b1.h 694 if [ x$gas = xyes ] 695 then 696 tm_file=3b1g.h 697 else 698 tm_file=3b1.h 699 fi 700 use_collect2=yes 701 header_files=math-68881.h 702 ;; 703 m68000-convergent-sysv*) 704 cpu_type=m68k 705 xm_file=xm-3b1.h 706 tm_file=ctix.h 707 use_collect2=yes 708 header_files=math-68881.h 709 ;; 710 ns32k-encore-osf*) # Encore with OSF/rose 711 tm_file=encrose.h 712 xmake_file=x-encrose 713 tmake_file=t-encrose 714 use_collect2=yes 715 ;; 716 ns32k-sequent-bsd*) 717 tm_file=sequent.h 718 use_collect2=yes 719 ;; 720 ns32k-encore-bsd*) 721 tm_file=encore.h 722 use_collect2=yes 723 ;; 724# This has not been updated to GCC 2. 725# ns32k-ns-genix*) 726# xm_file=xm-genix.h 727# xmake_file=x-genix 728# tm_file=genix.h 729# broken_install=yes 730# use_collect2=yes 731# ;; 732 ns32k-merlin-*) 733 tm_file=merlin.h 734 use_collect2=yes 735 ;; 736 ns32k-tek6100-bsd*) 737 tm_file=tek6100.h 738 broken_install=yes 739 use_collect2=yes 740 ;; 741 ns32k-tek6200-bsd*) 742 tm_file=tek6200.h 743 broken_install=yes 744 use_collect2=yes 745 ;; 746 ns32k-pc532-mach*) 747 tm_file=pc532-mach.h 748 use_collect2=yes 749 ;; 750 ns32k-pc532-minix*) 751 tm_file=pc532-min.h 752 xm_file=xm-pc532-min.h 753 use_collect2=yes 754 ;; 755 m88k-*-luna*) 756 tm_file=m88kluna.h 757 tmake_file=t-m88kluna 758 ;; 759 m88k-dg-dgux*) 760 tm_file=m88kdgux.h 761 xmake_file=x-m88kdgux 762 broken_install=yes 763 ;; 764 m88k-*-sysv4*) 765 tm_file=m88kv4.h 766 xmake_file=x-m88kv4 767 tmake_file=t-m88kv4 768 ;; 769 m88k-dolphin-sysv3*) 770 tm_file=m88kdolph.h 771 xm_file=xm-m88kv3.h 772 xmake_file=x-m88kdolph 773 ;; 774 m88k-*-sysv3*) 775 tm_file=m88kv3.h 776 xm_file=xm-m88kv3.h 777 ;; 778# This hasn't been upgraded to GCC 2. 779# fx80-alliant-*) # Alliant FX/80 780# tm_file=fx80.h 781# ;; 782 arm-*-*) # Acorn RISC machine 783 tm_file=arm.h 784 ;; 785 c1-convex-*) # Convex C1 786 tm_file=convex1.h 787 cpu_type=convex 788 use_collect2=yes 789 ;; 790 c2-convex-*) # Convex C2 791 tm_file=convex2.h 792 cpu_type=convex 793 use_collect2=yes 794 ;; 795 c32-convex-*) 796 tm_file=convex32.h # Convex C32xx 797 cpu_type=convex 798 use_collect2=yes 799 ;; 800 c34-convex-*) 801 tm_file=convex34.h # Convex C34xx 802 cpu_type=convex 803 use_collect2=yes 804 ;; 805 c38-convex-*) 806 tm_file=convex38.h # Convex C38xx 807 cpu_type=convex 808 use_collect2=yes 809 ;; 810 mips-sgi-irix4*) # Mostly like a MIPS. 811 if [ x$stabs = xyes ]; then 812 tm_file=iris4g.h 813 else 814 tm_file=iris4.h 815 fi 816 xm_file=xm-irix4.h 817 broken_install=yes 818 xmake_file=x-iris 819 use_collect2=yes 820 ;; 821 mips-sgi-*) # Mostly like a MIPS. 822 if [ x$stabs = xyes ]; then 823 tm_file=irisgdb.h 824 else 825 tm_file=iris.h 826 fi 827 xm_file=xm-iris.h 828 broken_install=yes 829 xmake_file=x-iris 830 use_collect2=yes 831 ;; 832 mips-dec-ultrix*) # Decstation. 833 if [ x$stabs = xyes ]; then 834 tm_file=decstabs.h 835 else 836 tm_file=decstatn.h 837 fi 838 tmake_file=t-decstatn 839 xmake_file=x-decstatn 840 use_collect2=yes 841 ;; 842 mips-dec-osfrose*) # Decstation running OSF/1 reference port with OSF/rose. 843 tm_file=decrose.h 844 xmake_file=x-decrose 845 tmake_file=t-decrose 846 use_collect2=yes 847 ;; 848 mips-dec-osf*) # Decstation running OSF/1 as shipped by DIGITAL 849 if [ x$stabs = xyes ]; then 850 tm_file=dec-gosf1.h 851 else 852 tm_file=dec-osf1.h 853 fi 854 xmake_file=x-dec-osf1 855 tmake_file=t-decstatn 856 use_collect2=yes 857 ;; 858 mips-sony-bsd* | mips-sony-newsos*) # Sony NEWS 3600 or risc/news. 859 if [ x$stabs = xyes ]; then 860 tm_file=mips-gnews.h 861 else 862 tm_file=mips-news.h 863 fi 864 xm_file=xm-mips.h 865 use_collect2=yes 866 ;; 867 mips-sony-sysv*) # Sony NEWS 3800 with NEWSOS5.0. 868 # That is based on svr4. 869 # t-svr4 is not right because this system doesn't use ELF. 870 if [ x$stabs = xyes ]; then 871 tm_file=mips-gn5.h 872 else 873 tm_file=mips-n5.h 874 fi 875 xm_file=xm-mipsnews.h 876 use_collect2=yes 877 ;; 878 mips-*riscos[56789]bsd* | mips-*riscos[56789]-bsd*) 879 if [ x$stabs = xyes ]; then # MIPS BSD 4.3, RISC-OS 5.0 880 tm_file=mips-5gbsd.h 881 else 882 tm_file=mips-5bsd.h 883 fi 884 use_collect2=yes 885 ;; 886 mips-*-bsd* | mips-*riscosbsd* | mips-*riscos[1234]bsd* \ 887 | mips-*riscos-bsd* | mips-*riscos[1234]-bsd*) 888 if [ x$stabs = xyes ]; then # MIPS BSD 4.3, RISC-OS 4.0 889 tm_file=mips-gbsd.h 890 else 891 tm_file=mips-bsd.h 892 fi 893 use_collect2=yes 894 ;; 895 mips-*riscos[56789]sysv4* | mips-*riscos[56789]-sysv4*) 896 if [ x$stabs = xyes ]; then # MIPS System V.4., RISC-OS 5.0 897 tm_file=mips-5gsvr4.h 898 else 899 tm_file=mips-5svr4.h 900 fi 901 xm_file=xm-umips.h 902 xmake_file=x-mipsv 903 ;; 904 mips-*-sysv4* | mips-*riscos[1234]sysv4* | mips-*riscossysv4* \ 905 | mips-*riscos[1234]-sysv4* | mips-*riscos-sysv4*) 906 if [ x$stabs = xyes ]; then # MIPS System V.4. RISC-OS 4.0 907 tm_file=mips-gsvr4.h 908 else 909 tm_file=mips-svr4.h 910 fi 911 xm_file=xm-umips.h 912 xmake_file=x-mipsv 913 ;; 914 mips-*riscos[56789]sysv* | mips-*-riscos[56788]-sysv*) 915 if [ x$stabs = xyes ]; then # MIPS System V.3, RISC-OS 5.0 916 tm_file=mips-5gsysv.h 917 else 918 tm_file=mips-5sysv.h 919 fi 920 xm_file=xm-umips.h 921 xmake_file=x-mipsv 922 use_collect2=yes 923 ;; 924 mips-*-sysv* | mips-*riscossysv* | mips-*riscos-sysv*) 925 if [ x$stabs = xyes ]; then # MIPS System V.3, RISC-OS 4.0 926 tm_file=mips-gsysv.h 927 else 928 tm_file=mips-sysv.h 929 fi 930 xm_file=xm-umips.h 931 xmake_file=x-mipsv 932 use_collect2=yes 933 ;; 934 mips-*riscos[56789]*) # Default MIPS RISC-OS 5.0. 935 if [ x$stabs = xyes ]; then 936 tm_file=mips-5gdb.h 937 else 938 tm_file=mips-5.h 939 fi 940 use_collect2=yes 941 ;; 942 mips-*-*) # Default MIPS RISC-OS 4.0. 943 if [ x$stabs = xyes ]; then 944 tm_file=mips-gdb.h 945 else 946 tm_file=mips.h 947 fi 948 use_collect2=yes 949 ;; 950 pyramid-*-*) 951 cpu_type=pyr 952 tm_file=pyr.h 953 use_collect2=yes 954 ;; 955# This hasn't been upgraded to GCC 2. 956# tron-*-*) 957# cpu_type=gmicro 958# tm_file=gmicro.h 959# use_collect2=yes 960# ;; 961 a29k-*-bsd*) 962 tm_file=a29kunix.h 963 xm_file=xm-a29kunix.h 964 xmake_file=x-a29kunix 965 use_collect2=yes 966 ;; 967 a29k-*-*) # Default a29k environment. 968 use_collect2=yes 969 ;; 970 romp-*-aos*) 971 xm_file=xm-romp.h 972 tm_file=romp.h 973 use_collect2=yes 974 ;; 975 romp-*-mach*) 976 xm_file=xm-romp.h 977 tm_file=romp.h 978 xmake_file=x-romp-mach 979 use_collect2=yes 980 ;; 981 rs6000-*-mach*) 982 xm_file=xm-rs6k-m.h 983 tm_file=rs6000-mach.h 984 xmake_file=x-rs6k-mach 985 use_collect2=yes 986 ;; 987 rs6000-ibm-aix32) 988 xm_file=xm-rs6000.h 989 tm_file=rs6000-aix32.h 990 use_collect2=yes 991 ;; 992 rs6000-ibm-aix*) 993 xm_file=xm-rs6000.h 994 tm_file=rs6000.h 995 use_collect2=yes 996 ;; 997 hppa1.1-*-bsd*) 998 cpu_type=pa 999 xm_file=xm-pa.h 1000 tm_file=pa1.h 1001 xmake_file=x-pa 1002 tmake_file=t-pa 1003 use_collect2=yes 1004 ;; 1005 hppa1.0-*-bsd*) 1006 cpu_type=pa 1007 xm_file=xm-pa.h 1008 tm_file=pa.h 1009 xmake_file=x-pa 1010 tmake_file=t-pa 1011 use_collect2=yes 1012 ;; 1013 hppa1.0-*-hpux7*) 1014 cpu_type=pa 1015 xm_file=xm-pahpux.h 1016 xmake_file=x-pa-hpux 1017 tmake_file=t-libc-ok 1018 if [ x$gas = xyes ] 1019 then 1020 tm_file=pa-gux7.h 1021 else 1022 tm_file=pa-hpux7.h 1023 fi 1024 broken_install=yes 1025 use_collect2=yes 1026 ;; 1027 hppa1.1-*-hpux*) 1028 cpu_type=pa 1029 xm_file=xm-pahpux.h 1030 xmake_file=x-pa-hpux 1031 tmake_file=t-libc-ok 1032 if [ x$gas = xyes ] 1033 then 1034 tm_file=pa1-ghpux.h 1035 else 1036 tm_file=pa1-hpux.h 1037 fi 1038 broken_install=yes 1039 use_collect2=yes 1040 ;; 1041 hppa1.0-*-hpux*) 1042 cpu_type=pa 1043 xm_file=xm-pahpux.h 1044 xmake_file=x-pa-hpux 1045 tmake_file=t-libc-ok 1046 if [ x$gas = xyes ] 1047 then 1048 tm_file=pa-ghpux.h 1049 else 1050 tm_file=pa-hpux.h 1051 fi 1052 broken_install=yes 1053 use_collect2=yes 1054 ;; 1055 we32k-att-sysv*) 1056 cpu_type=we32k 1057 use_collect2=yes 1058 ;; 1059 alpha-*-osf*) 1060 cpu_type=alpha 1061 broken_install=yes 1062 use_collect2=yes 1063 ;; 1064 i960-*-*) # Default i960 environment. 1065 use_collect2=yes 1066 ;; 1067 *) 1068 echo "Configuration $machine not supported" 1>&2 1069 exit 1 1070 ;; 1071 esac 1072 1073 case $machine in 1074 *-*-sysv4*) 1075 fixincludes=fixinc.svr4 1076 xmake_try_sysv=x-sysv 1077 broken_install=yes 1078 ;; 1079 *-*-sysv*) 1080 broken_install=yes 1081 ;; 1082 esac 1083 1084 # Distinguish i386 from i486. 1085 case $machine in 1086 i486-*-*) 1087 target_cpu_default=2 1088 ;; 1089 esac 1090 1091 # No need for collect2 if we have the GNU linker. 1092 case x$gnu_ld in 1093 xyes) 1094 use_collect2= 1095 ;; 1096 esac 1097 1098# Default certain vars that apply to both host and target in turn. 1099 if [ x$cpu_type = x ] 1100 then cpu_type=`echo $machine | sed 's/-.*$//'` 1101 fi 1102 1103# Save data on machine being used to compile GCC in build_xm_file. 1104# Save data on host machine in vars host_xm_file and host_xmake_file. 1105 if [ x$pass1done = x ] 1106 then 1107 if [ x$xm_file = x ]; then build_xm_file=xm-$cpu_type.h 1108 else build_xm_file=$xm_file 1109 fi 1110 pass1done=yes 1111 else 1112 if [ x$pass2done = x ] 1113 then 1114 if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h 1115 else host_xm_file=$xm_file 1116 fi 1117 if [ x$xmake_file = x ] 1118 then xmake_file=x-$cpu_type 1119 fi 1120 host_xmake_file=$xmake_file 1121 host_broken_install=$broken_install 1122 pass2done=yes 1123 fi 1124 fi 1125done 1126 1127# Default the target-machine variables that were not explicitly set. 1128if [ x$tm_file = x ] 1129then tm_file=$cpu_type.h; fi 1130 1131if [ x$header_files = x ] 1132then header_files=; fi 1133 1134if [ x$xm_file = x ] 1135then xm_file=xm-$cpu_type.h; fi 1136 1137md_file=${cpu_type}.md 1138 1139if [ x$out_file = x ] 1140then out_file=$cpu_type.c; fi 1141 1142if [ x$tmake_file = x ] 1143then tmake_file=t-$cpu_type 1144fi 1145 1146 1147# Set up the list of links to be made. 1148# $links is the list of link names, and $files is the list of names to link to. 1149files="$host_xm_file $tm_file $md_file $out_file $xm_file $build_xm_file" 1150links="config.h tm.h md aux-output.c tconfig.h hconfig.h" 1151 1152# Make the links. 1153while [ -n "$files" ] 1154do 1155 # set file to car of files, files to cdr of files 1156 set $files; file=$1; shift; files=$* 1157 set $links; link=$1; shift; links=$* 1158 1159 if [ ! -r ${srcdir}/config/$file ] 1160 then 1161 echo "$progname: cannot create a link \`$link'," 1>&2 1162 echo "since the file \`config/$file' does not exist" 1>&2 1163 exit 1 1164 fi 1165 1166 $remove -f $link 1167 rm -f config.status 1168 # Make a symlink if possible, otherwise try a hard link 1169 $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link || $copy ${srcdir}/config/$file $link 1170 1171 if [ ! -r $link ] 1172 then 1173 echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'" 1>&2 1174 exit 1 1175 fi 1176 echo "Linked \`$link' to \`${srcdir}/config/$file'" 1177done 1178 1179# Create Makefile.tem from Makefile.in. 1180# Make it set VPATH if necessary so that the sources are found. 1181# Also change its value of srcdir. 1182# Also create a .gdbinit file which runs the one in srcdir 1183# and tells GDB to look there for source files. 1184case $srcdir in 1185.) 1186 rm -f Makefile.tem 1187 cp Makefile.in Makefile.tem 1188 chmod +w Makefile.tem 1189 ;; 1190*) 1191 rm -f Makefile.tem 1192 echo "VPATH = ${srcdir}" \ 1193 | cat - ${srcdir}/Makefile.in \ 1194 | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem 1195 rm -f .gdbinit 1196 echo "dir ." > .gdbinit 1197 echo "dir ${srcdir}" >> .gdbinit 1198 echo "source ${srcdir}/.gdbinit" >> .gdbinit 1199 ;; 1200esac 1201 1202# Conditionalize the makefile for this host machine. 1203if [ -f ${srcdir}/config/${host_xmake_file} ] 1204then 1205 rm -f Makefile.xx 1206 sed -e "/####host/ r ${srcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx 1207 echo "Merged ${host_xmake_file}." 1208 rm -f Makefile.tem 1209 mv Makefile.xx Makefile.tem 1210else 1211# Say in the makefile that there is no host_xmake_file, 1212# by using a name which (when interpreted relative to $srcdir/config) 1213# will duplicate another dependency: $srcdir/Makefile.in. 1214 host_xmake_file=../Makefile.in 1215fi 1216 1217# Add a definition for INSTALL if system wants one. 1218# This substitutes for lots of x-* files. 1219if [ x$host_broken_install = x ] 1220then true 1221else 1222 rm -f Makefile.xx 1223 abssrcdir=`cd ${srcdir}; pwd` 1224 sed "s|^INSTALL = .*|INSTALL = ${abssrcdir}/install.sh -c|" Makefile.tem > Makefile.xx 1225 rm -f Makefile.tem 1226 mv Makefile.xx Makefile.tem 1227fi 1228 1229# Set EXTRA_HEADERS according to header_files. 1230# This substitutes for lots of t-* files. 1231if [ x$header_files = x ] 1232then true 1233else 1234 rm -f Makefile.xx 1235 sed "s/^EXTRA_HEADERS =/EXTRA_HEADERS = $header_files/" Makefile.tem > Makefile.xx 1236 rm -f Makefile.tem 1237 mv Makefile.xx Makefile.tem 1238fi 1239 1240# Add a definition of USE_COLLECT2 if system wants one. 1241# Also tell toplev.c what to do. 1242# This substitutes for lots of t-* files. 1243if [ x$use_collect2 = x ] 1244then true 1245else 1246 rm -f Makefile.xx 1247 (echo "USE_COLLECT2 = ld"; echo "MAYBE_USE_COLLECT2 = -DUSE_COLLECT2")\ 1248 | cat - Makefile.tem > Makefile.xx 1249 rm -f Makefile.tem 1250 mv Makefile.xx Makefile.tem 1251fi 1252 1253# Add -DTARGET_CPU_DEFAULT for toplev.c if system wants one. 1254# This substitutes for lots of *.h files. 1255if [ x$target_cpu_default = x ] 1256then true 1257else 1258 rm -f Makefile.xx 1259 (echo "MAYBE_TARGET_DEFAULT = -DTARGET_CPU_DEFAULT=$target_cpu_default")\ 1260 | cat - Makefile.tem > Makefile.xx 1261 rm -f Makefile.tem 1262 mv Makefile.xx Makefile.tem 1263fi 1264 1265# Conditionalize the makefile for this target machine. 1266if [ -f ${srcdir}/config/${tmake_file} ] 1267then 1268 rm -f Makefile.xx 1269 sed -e "/####target/ r ${srcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx 1270 echo "Merged ${tmake_file}." 1271 rm -f Makefile.tem 1272 mv Makefile.xx Makefile.tem 1273else 1274# Say in the makefile that there is no tmake_file, 1275# by using a name which (when interpreted relative to $srcdir/config) 1276# will duplicate another dependency: $srcdir/Makefile.in. 1277 tmake_file=../Makefile.in 1278fi 1279 1280# Remove all formfeeds, since some Makes get confused by them. 1281# Also arrange to give the variables `target', `host_xmake_file', 1282# `tmake_file', `prefix', `exec_prefix' and `FIXINCLUDES' 1283# values in the Makefile from the values they have in this script. 1284rm -f Makefile.xx 1285sed -e "s///" -e "s/^target=.*$/target=${target}/" \ 1286 -e "s|^xmake_file=.*$|xmake_file=${host_xmake_file}|" \ 1287 -e "s|^tmake_file=.*$|tmake_file=${tmake_file}|" \ 1288 -e "s|^prefix[ ]*=.*|prefix = $prefix|" \ 1289 -e "s|^exec_prefix[ ]*=.*|exec_prefix = $exec_prefix|" \ 1290 -e "s|^FIXINCLUDES[ ]*=.*|FIXINCLUDES = $fixincludes|" \ 1291 Makefile.tem > Makefile.xx 1292rm -f Makefile.tem 1293mv Makefile.xx Makefile.tem 1294 1295# Install Makefile for real, after making final changes. 1296# Define macro CROSS_COMPILE in compilation if this is a cross-compiler. 1297# Also use all.cross instead of all.internal, and add cross-make to Makefile. 1298if [ x$host = x$target ] 1299then 1300 rm -f Makefile 1301 if [ x$host = x$build ] 1302 then 1303 mv Makefile.tem Makefile 1304 else 1305# When build gcc with cross-compiler, we need to fix a 1306# few things. 1307 echo "build= $build" > Makefile 1308 sed -e "/####build/ r ${srcdir}/build-make" Makefile.tem >> Makefile 1309 rm -f Makefile.tem Makefile.xx 1310 fi 1311else 1312 rm -f Makefile 1313 echo "CROSS=-DCROSS_COMPILE" > Makefile 1314 sed -e "/####cross/ r ${srcdir}/cross-make" Makefile.tem >> Makefile 1315 rm -f Makefile.tem Makefile.xx 1316fi 1317 1318echo "Created \`Makefile'." 1319 1320if [ xx${vint} != xx ] 1321then 1322 vintmsg=" (vint)" 1323fi 1324 1325# Describe the chosen configuration in config.status. 1326# Make that file a shellscript which will reestablish the same configuration. 1327echo "#!/bin/sh 1328# GCC was configured as follows: 1329${srcdir}/configure" $arguments > config.status 1330echo echo host=$canon_host target=$canon_target build=$canon_build >> config.status 1331chmod a+x config.status 1332 1333if [ x$canon_host = x$canon_target ] 1334then 1335 echo "Links are now set up for target $canon_target." 1336else 1337 echo "Links are now set up for host $canon_host and target $canon_target." 1338fi 1339 1340exit 0 1341