2 # Do not edit this file. It is generated automatically from configure.in
3 # and a configure template.
7 # Do not edit this file. It is generated automatically from configure.in
8 # and a configure template.
11 # Configuration script template
12 # Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
14 #This file is part of GNU.
16 #GNU CC is free software; you can redistribute it and/or modify
17 #it under the terms of the GNU General Public License as published by
18 #the Free Software Foundation; either version 1, or (at your option)
21 #GNU CC is distributed in the hope that it will be useful,
22 #but WITHOUT ANY WARRANTY; without even the implied warranty of
23 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 #GNU General Public License for more details.
26 #You should have received a copy of the GNU General Public License
27 #along with GNU CC; see the file COPYING. If not, write to
28 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
31 # Shell script to create proper links to machine-dependent files in
32 # preparation for compiling gcc.
34 # Usage: configure [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET
36 # If configure succeeds, it leaves its status in config.status.
37 # If configure fails after disturbing the status quo,
38 # config.status is removed.
50 #symbolic_link="echo ln -s"
52 # clear some things potentially inherited from environment.
65 -template=* | +template=*)
66 template=`echo $arg | sed 's/[+-]template=//'`
68 -norecurse | +norecurse)
74 -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
75 srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'`
77 -host=* | +host=* | +hos=* | +ho=* | +h=*)
78 host=`echo $arg | sed 's/[+-]h[a-z]*=//'`
80 -languages=* | +languages=* | -languag=* | +languag=* | langua=* \
81 | +langua=* | -langu=* | +langu=* | -lang=* | +lang=* | -lan=* \
82 | +lan=* | -la=* | +la=* | -l=* | +l=*)
83 languages="$languages `echo $arg | sed 's/[+-]l[a-z]*=//'`"
85 -gas | +gas | +ga | +g)
88 -nfp | +nfp | +nf | +n)
92 # Allow configure HOST TARGET
93 if [ x$host = x ] ; then host=$target ; fi
99 # process host and target only if not rebuilding configure itself.
100 if [ -z "$template" ]
102 # Complain if an arg is missing
105 echo "Usage: $progname [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET"
106 echo -n "Where HOST and TARGET are something like "
107 echo "\`vax', \`sun3', \`encore', etc."
108 if [ -r config.status ]
121 # Decode the host machine, then the target machine.
122 # For the host machine, we save the xm_file variable as host_xm_file;
123 # then we decode the target machine and forget everything else
124 # that came from the host machine.
125 for machine in $host $target; do
127 # Separate what the user gave into CPU/company and OS (if any).
128 basic_machine=`echo $machine | sed 's/-[^-]*$//'`
129 if [ $basic_machine != $machine ]
130 then os=`echo $machine | sed 's/[^-]*-/-/'`
133 # Decode aliases for certain machine/company combinations.
134 case $basic_machine in
136 basic_machine=mips/sgi
139 basic_machine=m68k/sony
141 3b1 | 7300 | 7300/att | att-7300)
142 basic_machine=m68k/att
144 delta | 3300 | motorola-3300 | motorola-delta \
145 | 3300/motorola | delta/motorola)
146 basic_machine=m68k/motorola
152 basic_machine=ns32k/sequent
155 basic_machine=i386/sequent
158 basic_machine=m68000/sun
161 basic_machine=m68k/sun
164 basic_machine=sparc/sun
167 basic_machine=i386/sun
170 basic_machine=i386/ibm
173 basic_machine=m68k/next
176 basic_machine=m68k/hp
178 hp9k31[0-9] | hp9k2[0-9][0-9])
179 basic_machine=m68000/hp
182 basic_machine=m68k/isi
185 basic_machine=m68k/apollo
188 basic_machine=m68k/altos
191 basic_machine=m68000/convergent
194 basic_machine=m68k/ncr
196 news-3600 | risc-news)
197 basic_machine=mips/sony
199 decstation | decstation-3100 | pmax)
200 basic_machine=mips/dec
206 basic_machine=c1/convex
209 basic_machine=c2/convex
213 # Decode manufacturer-specific aliases for certain operating systems.
230 machine=$basic_machine$os
238 vax | vax-bsd*) # vaxen running BSD
240 vax-vms | vms) # vaxen running VMS
245 vax-sysv* | vaxv) # vaxen running system V
250 tahoe | tahoe-bsd*) # tahoe running BSD
252 tahoe/harris*) # Harris tahoe, using COFF.
255 i386/sequent* | i386/sequent-bsd*) # 80386 from Sequent
260 i386-mach | i386/*-mach)
265 i386/sco | i386/sco-sysv* | i386/*-sco) # 80386 running SCO system
269 make_var_file=make-i386sco
271 i386/isc | i386/isc-sysv* | i386/*-isc) # 80386 running ISC system
275 make_var_file=make-i386isc
277 i386/ibm | i386-aix | i386/ibm-aix) # IBM PS/2 running AIX
281 make_var_file=make-i386v
288 i386-sysv4 | i386/*-sysv4 | i386v4) # Intel 80386's running system V.4
291 make_var_file=make-i386v
294 i386-sysv* | i386/*-sysv* | i386v) # Intel 80386's running system V
297 make_var_file=make-i386v
305 i860 | i860-sysv* | i860/*-sysv*)
314 i860-bsd* | i860/*-bsd*)
318 tm_file=tm-i860bsdg.h
323 sparc | sparc/* | sparc-*os4 | sparc/*-*os4)
327 sparc-*os3 | sparc/*-*os3)
341 tm_file=tm-sun3os3nf.h
348 tm_file=tm-sun3mach.h
350 m68k/sun | m68k/sun-*os4)
359 m68k/hp | m68k/hp-hpux*) # HP 9000 series 300
364 make_var_file=make-hp9k320g
365 tm_file=tm-hp9k320g.h
367 make_var_file=make-hp9k320
371 m68k/hp-bsd*) # HP 9000/3xx running Berkeley Unix
373 tm_file=tm-hp9k3bsd.h
375 m68k/isi | m68k/isi-bsd*)
379 tm_file=tm-isi68-nfp.h
384 m68k/sony | m68k/sony-bsd*)
394 m68k/altos | m68k/altos-sysv*) # Altos 3068
398 xm_file=xm-altos3068.h
399 tm_file=tm-altos3068.h
401 echo "The Altos is supported only with the GNU assembler" 1>&2
405 m68k/motorola | m68k/motorola-sysv*)
410 m68k/crds | m68k/crds-unos | m68k-unos | crds | unos)
413 make_var_file=make-crds
418 make_var_file=make-apollo68
419 tm_file=tm-apollo68.h
421 m68k/ncr | m68k/ncr-sysv*) # NCR Tower 32 SVR3
423 tm_file=tm-tower-as.h
426 m68000/sun | m68000/sun-*os3)
434 m68000/hp | m68000/hp-hpux*) # HP 9000 series 300
439 make_var_file=make-hp9k320g
440 tm_file=tm-hp9k310g.h
442 make_var_file=make-hp9k320
446 m68000/hp-bsd*) # HP 9000/200 running BSD
448 tm_file=tm-hp9k2bsd.h
449 make_var_file=make-hp9k2bsd
451 m68000/att | m68000/att-sysv*)
461 m68000/convergent | m68000/convergent-sysv*)
466 ns32k/sequent | ns32k/sequent-bsd*)
470 ns32k/encore | ns32k/encore-bsd* | encore | encore-bsd*)
474 ns32k-genix* | ns32k/*-genix* | genix)
477 make_var_file=make-genix
483 m88k/dg | m88k/dg-dgux* | m88k-dgux*)
485 xm_file=xm-m88kdgux.h
486 make_var_file=make-m88kdgux
487 tm_file=tm-m88kdgux.h
489 m88k-v88r32 | m88k/*-v88r32)
494 m88k-sysv* | m88k/*-sysv*)
496 tm_file=tm-m88ksvr4.h
497 xm_file=xm-m88ksvr4.h
499 alliant | alliant/alliant) # Alliant FX/8
503 c1/convex) # Convex C1
504 if [ -r /usr/include/stdlib.h ]
508 tm_file=tm-conv1os7.h
512 c2/convex) # Convex C2
513 if [ -r /usr/include/stdlib.h ]
517 tm_file=tm-conv2os7.h
521 mips/sgi | mips/sgi-sysv*) # Mostly like a MIPS.
526 mips | mips/mips) # Default MIPS environment.
528 mips/dec | mips/dec-bsd*) # Decstation.
530 tm_file=tm-decstatn.h
532 mips/sony | mips/sony-bsd*) # Sony NEWS 3600 or risc/news.
534 tm_file=tm-mips-news.h
536 mips/*-sysv* | mips-sysv*) # SYSV variant of MIPS system.
538 tm_file=tm-mips-sysv.h
540 mips/*-bsd* | mips-bsd*) # BSD 4.3 variant of MIPS system.
542 tm_file=tm-mips-bsd.h
544 pyramid | pyramid/* | pyramid-*)
552 a29k-bsd* | a29k/*-bsd*)
554 tm_file=tm-a29kunix.h
556 i960) # Default i960 environment.
561 if [ x$pass1done = x ]
563 if [ x$cpu_type = x ]; then cpu_type=$host; fi
564 if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h
565 else host_xm_file=$xm_file
567 if [ x$make_var_file = x ]
568 then make_var_file=make-$cpu_type; fi
569 host_make_var_file=$make_var_file
574 # Default the machine-specific variables that were not explicitly set.
575 if [ x$cpu_type = x ]
576 then cpu_type=$target; fi
579 then tm_file=tm-$target.h; fi
581 md_file=${cpu_type}.md
583 if [ x$out_file = x ]
584 then out_file=out-$cpu_type.c; fi
587 #### configure.in files go here.
588 ### end of configure.in
590 # are we rebuilding config itself?
591 if [ -n "$template" ]
593 if [ ! -r $template ]
595 echo "Can't find template ${template}."
599 mv configure configure.old
600 echo "#!/bin/sh" > configure
601 echo "# Do not edit this file. It is generated automatically from configure.in" >> configure
602 echo "# and a configure template." >> configure
603 echo "configdirs=" >> configure
606 if [ -r configure.in ]
608 sed -e "/^####/ r configure.in" $template >> configure
610 cat $template >> configure
615 # echo Rebuilt configure in `pwd` from ${template}.
616 echo Rebuilt configure in `pwd`
618 if [ x$norecurse = x ]
620 while [ -n "$configdirs" ]
622 # set configdir to car of configdirs, configdirs to cdr of configdirs
623 set $configdirs; configdir=$1; shift; configdirs=$*
625 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
627 targetspecificdirs=${configdir}.*
632 for i in ${configdir} ${targetspecificdirs}
634 if [ -r $i/configure ]
637 configure +template=${template})
639 echo No configure script in `pwd`/$i
648 # Temporarily, we support only direct subdir builds.
649 hostsubdir=Host-$host
650 targetsubdir=Target-$target
652 if [ -n "$removing" ]
654 rm -rf $hostsubdir/$targetsubdir
656 if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ]
661 if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi
664 if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi
669 ## Find the source files, if location was not specified.
674 # if [ ! -r ${srctrigger} ]
680 #if [ ! -r ${srcdir}/${srctrigger} ]
682 # if [ x$srcdirdefaulted = x ]
684 # echo "$progname: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
686 # echo "$progname: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
693 # Set up the list of links to be made.
694 # $links is the list of link names, and $files is the list of names to link to.
697 while [ -n "$files" ]
699 # set file to car of files, files to cdr of files
700 set $files; file=$1; shift; files=$*
701 set $links; link=$1; shift; links=$*
703 if [ ! -r ${srcdir}/config/$file ]
705 echo "$progname: cannot create a link \`$link'," 1>&2
706 echo "since the file \`config/$file' does not exist." 1>&2
712 # Make a symlink if possible, otherwise try a hard link
713 $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link
717 echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
720 echo "Linked \`$link' to \`${srcdir}/config/$file'."
723 # Install a makefile, and make it set VPATH
724 # if necessary so that the sources are found.
725 # Also change its value of srcdir.
726 # Also create a .gdbinit file which runs the one in srcdir
727 # and tells GDB to look there for source files.
732 echo "VPATH = ${srcdir}" > x
733 cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in
735 echo "dir ." > .gdbinit
736 echo "dir ${srcdir}" >> .gdbinit
737 echo "source ${srcdir}/.gdbinit" >> .gdbinit
741 host_var_file=hmake-${host}
742 target_var_file=tmake-${target}
744 # Conditionalize the makefile for this machine.
745 if [ -f ${srcdir}/config/${host_var_file} ]
747 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem
749 cp Makefile.in Makefile.tem
752 if [ -f ${srcdir}/config/${target_var_file} ]
754 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1
755 mv Makefile.tem1 Makefile.tem
758 # Remove all formfeeds, since some Makes get confused by them.
759 sed "s/
\f//" Makefile.tem >> Makefile.tem1
760 mv Makefile.tem1 Makefile.tem
763 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1
764 mv Makefile.tem1 Makefile.tem
767 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1
768 mv Makefile.tem1 Makefile.tem
770 # Delete the intermediate files
771 if [ x$srcdir != x. ] ; then rm Makefile.in ; fi
775 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
776 if [ x$host != x$target ]
778 echo "CROSS=-DCROSS_COMPILE" > Makefile
779 echo "ALL=start.encap" >> Makefile
781 echo "ALL=all.internal" > Makefile
784 # set target and host
785 echo "host = $host" >> Makefile
786 echo "target = $target" >> Makefile
788 cat Makefile.tem >> Makefile
792 if [ -f ${srcdir}/config/${host_var_file} ]
794 using=" using \"${host_var_file}\""
797 if [ -f ${srcdir}/config/${target_var_file} ]
801 andusing=" using \"${target_var_file}\""
803 andusing="${using} and \"${target_var_file}\""
809 echo "Created \"Makefile\""${andusing}.
811 if [ x$host = x$target ]
813 echo "Links are now set up for use with a $target." \
814 | tee ${srcdir}/config.status
816 echo "Links are now set up for host $host and target $target." \
817 | tee ${srcdir}/config.status
823 # If there are subdirectories, then recurse.
825 if [ x$norecurse != x ] ; then exit 0 ; fi
827 while [ -n "$configdirs" ]
829 # set configdir to car of configdirs, configdirs to cdr of configdirs
830 set $configdirs; configdir=$1; shift; configdirs=$*
832 # check for target override
833 targetspecificdir=${configdir}.${target}
834 if [ -d ${targetspecificdir} ]
836 configdir=${targetspecificdir}
839 echo Configuring ${configdir}...
841 configure +host=${host} ${target} ${removing}) \