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-dec-bsd*) # Decstation running 4.4 BSD 859 tm_file=mips-dec-bsd.h 860 xmake_file=x-mipsbsd 861 tmake_file=t-mipsbsd 862 fixincludes= 863 ;; 864 mips-sony-bsd* | mips-sony-newsos*) # Sony NEWS 3600 or risc/news. 865 if [ x$stabs = xyes ]; then 866 tm_file=mips-gnews.h 867 else 868 tm_file=mips-news.h 869 fi 870 xm_file=xm-mips.h 871 use_collect2=yes 872 ;; 873 mips-sony-sysv*) # Sony NEWS 3800 with NEWSOS5.0. 874 # That is based on svr4. 875 # t-svr4 is not right because this system doesn't use ELF. 876 if [ x$stabs = xyes ]; then 877 tm_file=mips-gn5.h 878 else 879 tm_file=mips-n5.h 880 fi 881 xm_file=xm-mipsnews.h 882 use_collect2=yes 883 ;; 884 mips-*riscos[56789]bsd* | mips-*riscos[56789]-bsd*) 885 if [ x$stabs = xyes ]; then # MIPS BSD 4.3, RISC-OS 5.0 886 tm_file=mips-5gbsd.h 887 else 888 tm_file=mips-5bsd.h 889 fi 890 use_collect2=yes 891 ;; 892 mips-*-bsd* | mips-*riscosbsd* | mips-*riscos[1234]bsd* \ 893 | mips-*riscos-bsd* | mips-*riscos[1234]-bsd*) 894 if [ x$stabs = xyes ]; then # MIPS BSD 4.3, RISC-OS 4.0 895 tm_file=mips-gbsd.h 896 else 897 tm_file=mips-bsd.h 898 fi 899 use_collect2=yes 900 ;; 901 mips-*riscos[56789]sysv4* | mips-*riscos[56789]-sysv4*) 902 if [ x$stabs = xyes ]; then # MIPS System V.4., RISC-OS 5.0 903 tm_file=mips-5gsvr4.h 904 else 905 tm_file=mips-5svr4.h 906 fi 907 xm_file=xm-umips.h 908 xmake_file=x-mipsv 909 ;; 910 mips-*-sysv4* | mips-*riscos[1234]sysv4* | mips-*riscossysv4* \ 911 | mips-*riscos[1234]-sysv4* | mips-*riscos-sysv4*) 912 if [ x$stabs = xyes ]; then # MIPS System V.4. RISC-OS 4.0 913 tm_file=mips-gsvr4.h 914 else 915 tm_file=mips-svr4.h 916 fi 917 xm_file=xm-umips.h 918 xmake_file=x-mipsv 919 ;; 920 mips-*riscos[56789]sysv* | mips-*-riscos[56788]-sysv*) 921 if [ x$stabs = xyes ]; then # MIPS System V.3, RISC-OS 5.0 922 tm_file=mips-5gsysv.h 923 else 924 tm_file=mips-5sysv.h 925 fi 926 xm_file=xm-umips.h 927 xmake_file=x-mipsv 928 use_collect2=yes 929 ;; 930 mips-*-sysv* | mips-*riscossysv* | mips-*riscos-sysv*) 931 if [ x$stabs = xyes ]; then # MIPS System V.3, RISC-OS 4.0 932 tm_file=mips-gsysv.h 933 else 934 tm_file=mips-sysv.h 935 fi 936 xm_file=xm-umips.h 937 xmake_file=x-mipsv 938 use_collect2=yes 939 ;; 940 mips-*riscos[56789]*) # Default MIPS RISC-OS 5.0. 941 if [ x$stabs = xyes ]; then 942 tm_file=mips-5gdb.h 943 else 944 tm_file=mips-5.h 945 fi 946 use_collect2=yes 947 ;; 948 mips-*-*) # Default MIPS RISC-OS 4.0. 949 if [ x$stabs = xyes ]; then 950 tm_file=mips-gdb.h 951 else 952 tm_file=mips.h 953 fi 954 use_collect2=yes 955 ;; 956 pyramid-*-*) 957 cpu_type=pyr 958 tm_file=pyr.h 959 use_collect2=yes 960 ;; 961# This hasn't been upgraded to GCC 2. 962# tron-*-*) 963# cpu_type=gmicro 964# tm_file=gmicro.h 965# use_collect2=yes 966# ;; 967 a29k-*-bsd*) 968 tm_file=a29kunix.h 969 xm_file=xm-a29kunix.h 970 xmake_file=x-a29kunix 971 use_collect2=yes 972 ;; 973 a29k-*-*) # Default a29k environment. 974 use_collect2=yes 975 ;; 976 romp-*-aos*) 977 xm_file=xm-romp.h 978 tm_file=romp.h 979 use_collect2=yes 980 ;; 981 romp-*-mach*) 982 xm_file=xm-romp.h 983 tm_file=romp.h 984 xmake_file=x-romp-mach 985 use_collect2=yes 986 ;; 987 rs6000-*-mach*) 988 xm_file=xm-rs6k-m.h 989 tm_file=rs6000-mach.h 990 xmake_file=x-rs6k-mach 991 use_collect2=yes 992 ;; 993 rs6000-ibm-aix32) 994 xm_file=xm-rs6000.h 995 tm_file=rs6000-aix32.h 996 use_collect2=yes 997 ;; 998 rs6000-ibm-aix*) 999 xm_file=xm-rs6000.h 1000 tm_file=rs6000.h 1001 use_collect2=yes 1002 ;; 1003 hppa1.1-*-bsd*) 1004 cpu_type=pa 1005 xm_file=xm-pa.h 1006 tm_file=pa1.h 1007 xmake_file=x-pa 1008 tmake_file=t-pa 1009 use_collect2=yes 1010 ;; 1011 hppa1.0-*-bsd*) 1012 cpu_type=pa 1013 xm_file=xm-pa.h 1014 tm_file=pa.h 1015 xmake_file=x-pa 1016 tmake_file=t-pa 1017 use_collect2=yes 1018 ;; 1019 hppa1.0-*-hpux7*) 1020 cpu_type=pa 1021 xm_file=xm-pahpux.h 1022 xmake_file=x-pa-hpux 1023 tmake_file=t-libc-ok 1024 if [ x$gas = xyes ] 1025 then 1026 tm_file=pa-gux7.h 1027 else 1028 tm_file=pa-hpux7.h 1029 fi 1030 broken_install=yes 1031 use_collect2=yes 1032 ;; 1033 hppa1.1-*-hpux*) 1034 cpu_type=pa 1035 xm_file=xm-pahpux.h 1036 xmake_file=x-pa-hpux 1037 tmake_file=t-libc-ok 1038 if [ x$gas = xyes ] 1039 then 1040 tm_file=pa1-ghpux.h 1041 else 1042 tm_file=pa1-hpux.h 1043 fi 1044 broken_install=yes 1045 use_collect2=yes 1046 ;; 1047 hppa1.0-*-hpux*) 1048 cpu_type=pa 1049 xm_file=xm-pahpux.h 1050 xmake_file=x-pa-hpux 1051 tmake_file=t-libc-ok 1052 if [ x$gas = xyes ] 1053 then 1054 tm_file=pa-ghpux.h 1055 else 1056 tm_file=pa-hpux.h 1057 fi 1058 broken_install=yes 1059 use_collect2=yes 1060 ;; 1061 we32k-att-sysv*) 1062 cpu_type=we32k 1063 use_collect2=yes 1064 ;; 1065 alpha-*-osf*) 1066 cpu_type=alpha 1067 broken_install=yes 1068 use_collect2=yes 1069 ;; 1070 i960-*-*) # Default i960 environment. 1071 use_collect2=yes 1072 ;; 1073 *) 1074 echo "Configuration $machine not supported" 1>&2 1075 exit 1 1076 ;; 1077 esac 1078 1079 case $machine in 1080 *-*-sysv4*) 1081 fixincludes=fixinc.svr4 1082 xmake_try_sysv=x-sysv 1083 broken_install=yes 1084 ;; 1085 *-*-sysv*) 1086 broken_install=yes 1087 ;; 1088 esac 1089 1090 # Distinguish i386 from i486. 1091 case $machine in 1092 i486-*-*) 1093 target_cpu_default=2 1094 ;; 1095 esac 1096 1097 # No need for collect2 if we have the GNU linker. 1098 case x$gnu_ld in 1099 xyes) 1100 use_collect2= 1101 ;; 1102 esac 1103 1104# Default certain vars that apply to both host and target in turn. 1105 if [ x$cpu_type = x ] 1106 then cpu_type=`echo $machine | sed 's/-.*$//'` 1107 fi 1108 1109# Save data on machine being used to compile GCC in build_xm_file. 1110# Save data on host machine in vars host_xm_file and host_xmake_file. 1111 if [ x$pass1done = x ] 1112 then 1113 if [ x$xm_file = x ]; then build_xm_file=xm-$cpu_type.h 1114 else build_xm_file=$xm_file 1115 fi 1116 pass1done=yes 1117 else 1118 if [ x$pass2done = x ] 1119 then 1120 if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h 1121 else host_xm_file=$xm_file 1122 fi 1123 if [ x$xmake_file = x ] 1124 then xmake_file=x-$cpu_type 1125 fi 1126 host_xmake_file=$xmake_file 1127 host_broken_install=$broken_install 1128 pass2done=yes 1129 fi 1130 fi 1131done 1132 1133# Default the target-machine variables that were not explicitly set. 1134if [ x$tm_file = x ] 1135then tm_file=$cpu_type.h; fi 1136 1137if [ x$header_files = x ] 1138then header_files=; fi 1139 1140if [ x$xm_file = x ] 1141then xm_file=xm-$cpu_type.h; fi 1142 1143md_file=${cpu_type}.md 1144 1145if [ x$out_file = x ] 1146then out_file=$cpu_type.c; fi 1147 1148if [ x$tmake_file = x ] 1149then tmake_file=t-$cpu_type 1150fi 1151 1152 1153# Set up the list of links to be made. 1154# $links is the list of link names, and $files is the list of names to link to. 1155files="$host_xm_file $tm_file $md_file $out_file $xm_file $build_xm_file" 1156links="config.h tm.h md aux-output.c tconfig.h hconfig.h" 1157 1158# Make the links. 1159while [ -n "$files" ] 1160do 1161 # set file to car of files, files to cdr of files 1162 set $files; file=$1; shift; files=$* 1163 set $links; link=$1; shift; links=$* 1164 1165 if [ ! -r ${srcdir}/config/$file ] 1166 then 1167 echo "$progname: cannot create a link \`$link'," 1>&2 1168 echo "since the file \`config/$file' does not exist" 1>&2 1169 exit 1 1170 fi 1171 1172 $remove -f $link 1173 rm -f config.status 1174 # Make a symlink if possible, otherwise try a hard link 1175 $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link || $copy ${srcdir}/config/$file $link 1176 1177 if [ ! -r $link ] 1178 then 1179 echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'" 1>&2 1180 exit 1 1181 fi 1182 echo "Linked \`$link' to \`${srcdir}/config/$file'" 1183done 1184 1185# Create Makefile.tem from Makefile.in. 1186# Make it set VPATH if necessary so that the sources are found. 1187# Also change its value of srcdir. 1188# Also create a .gdbinit file which runs the one in srcdir 1189# and tells GDB to look there for source files. 1190case $srcdir in 1191.) 1192 rm -f Makefile.tem 1193 cp Makefile.in Makefile.tem 1194 chmod +w Makefile.tem 1195 ;; 1196*) 1197 rm -f Makefile.tem 1198 echo "VPATH = ${srcdir}" \ 1199 | cat - ${srcdir}/Makefile.in \ 1200 | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem 1201 rm -f .gdbinit 1202 echo "dir ." > .gdbinit 1203 echo "dir ${srcdir}" >> .gdbinit 1204 echo "source ${srcdir}/.gdbinit" >> .gdbinit 1205 ;; 1206esac 1207 1208# Conditionalize the makefile for this host machine. 1209if [ -f ${srcdir}/config/${host_xmake_file} ] 1210then 1211 rm -f Makefile.xx 1212 sed -e "/####host/ r ${srcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx 1213 echo "Merged ${host_xmake_file}." 1214 rm -f Makefile.tem 1215 mv Makefile.xx Makefile.tem 1216else 1217# Say in the makefile that there is no host_xmake_file, 1218# by using a name which (when interpreted relative to $srcdir/config) 1219# will duplicate another dependency: $srcdir/Makefile.in. 1220 host_xmake_file=../Makefile.in 1221fi 1222 1223# Add a definition for INSTALL if system wants one. 1224# This substitutes for lots of x-* files. 1225if [ x$host_broken_install = x ] 1226then true 1227else 1228 rm -f Makefile.xx 1229 abssrcdir=`cd ${srcdir}; pwd` 1230 sed "s|^INSTALL = .*|INSTALL = ${abssrcdir}/install.sh -c|" Makefile.tem > Makefile.xx 1231 rm -f Makefile.tem 1232 mv Makefile.xx Makefile.tem 1233fi 1234 1235# Set EXTRA_HEADERS according to header_files. 1236# This substitutes for lots of t-* files. 1237if [ x$header_files = x ] 1238then true 1239else 1240 rm -f Makefile.xx 1241 sed "s/^EXTRA_HEADERS =/EXTRA_HEADERS = $header_files/" Makefile.tem > Makefile.xx 1242 rm -f Makefile.tem 1243 mv Makefile.xx Makefile.tem 1244fi 1245 1246# Add a definition of USE_COLLECT2 if system wants one. 1247# Also tell toplev.c what to do. 1248# This substitutes for lots of t-* files. 1249if [ x$use_collect2 = x ] 1250then true 1251else 1252 rm -f Makefile.xx 1253 (echo "USE_COLLECT2 = ld"; echo "MAYBE_USE_COLLECT2 = -DUSE_COLLECT2")\ 1254 | cat - Makefile.tem > Makefile.xx 1255 rm -f Makefile.tem 1256 mv Makefile.xx Makefile.tem 1257fi 1258 1259# Add -DTARGET_CPU_DEFAULT for toplev.c if system wants one. 1260# This substitutes for lots of *.h files. 1261if [ x$target_cpu_default = x ] 1262then true 1263else 1264 rm -f Makefile.xx 1265 (echo "MAYBE_TARGET_DEFAULT = -DTARGET_CPU_DEFAULT=$target_cpu_default")\ 1266 | cat - Makefile.tem > Makefile.xx 1267 rm -f Makefile.tem 1268 mv Makefile.xx Makefile.tem 1269fi 1270 1271# Conditionalize the makefile for this target machine. 1272if [ -f ${srcdir}/config/${tmake_file} ] 1273then 1274 rm -f Makefile.xx 1275 sed -e "/####target/ r ${srcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx 1276 echo "Merged ${tmake_file}." 1277 rm -f Makefile.tem 1278 mv Makefile.xx Makefile.tem 1279else 1280# Say in the makefile that there is no tmake_file, 1281# by using a name which (when interpreted relative to $srcdir/config) 1282# will duplicate another dependency: $srcdir/Makefile.in. 1283 tmake_file=../Makefile.in 1284fi 1285 1286# Remove all formfeeds, since some Makes get confused by them. 1287# Also arrange to give the variables `target', `host_xmake_file', 1288# `tmake_file', `prefix', `exec_prefix' and `FIXINCLUDES' 1289# values in the Makefile from the values they have in this script. 1290rm -f Makefile.xx 1291sed -e "s///" -e "s/^target=.*$/target=${target}/" \ 1292 -e "s|^xmake_file=.*$|xmake_file=${host_xmake_file}|" \ 1293 -e "s|^tmake_file=.*$|tmake_file=${tmake_file}|" \ 1294 -e "s|^prefix[ ]*=.*|prefix = $prefix|" \ 1295 -e "s|^exec_prefix[ ]*=.*|exec_prefix = $exec_prefix|" \ 1296 -e "s|^FIXINCLUDES[ ]*=.*|FIXINCLUDES = $fixincludes|" \ 1297 Makefile.tem > Makefile.xx 1298rm -f Makefile.tem 1299mv Makefile.xx Makefile.tem 1300 1301# Install Makefile for real, after making final changes. 1302# Define macro CROSS_COMPILE in compilation if this is a cross-compiler. 1303# Also use all.cross instead of all.internal, and add cross-make to Makefile. 1304if [ x$host = x$target ] 1305then 1306 rm -f Makefile 1307 if [ x$host = x$build ] 1308 then 1309 mv Makefile.tem Makefile 1310 else 1311# When build gcc with cross-compiler, we need to fix a 1312# few things. 1313 echo "build= $build" > Makefile 1314 sed -e "/####build/ r ${srcdir}/build-make" Makefile.tem >> Makefile 1315 rm -f Makefile.tem Makefile.xx 1316 fi 1317else 1318 rm -f Makefile 1319 echo "CROSS=-DCROSS_COMPILE" > Makefile 1320 sed -e "/####cross/ r ${srcdir}/cross-make" Makefile.tem >> Makefile 1321 rm -f Makefile.tem Makefile.xx 1322fi 1323 1324echo "Created \`Makefile'." 1325 1326if [ xx${vint} != xx ] 1327then 1328 vintmsg=" (vint)" 1329fi 1330 1331# Describe the chosen configuration in config.status. 1332# Make that file a shellscript which will reestablish the same configuration. 1333echo "#!/bin/sh 1334# GCC was configured as follows: 1335${srcdir}/configure" $arguments > config.status 1336echo echo host=$canon_host target=$canon_target build=$canon_build >> config.status 1337chmod a+x config.status 1338 1339if [ x$canon_host = x$canon_target ] 1340then 1341 echo "Links are now set up for target $canon_target." 1342else 1343 echo "Links are now set up for host $canon_host and target $canon_target." 1344fi 1345 1346exit 0 1347