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
=c
1/convex
209 basic_machine
=c
2/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 c
1/convex
) # Convex C1
504 if [ -r /usr
/include
/stdlib.h
]
508 tm_file
=tm-conv1os7.h
512 c
2/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 # This file is a shell script that supplies the information necessary
589 # to tailor a template configure script into the configure script
590 # appropriate for this directory. For more information, check any
591 # existing configure script.
617 files
="ho-${host}.h tc-${cpu_type}.c tc-${cpu_type}.h te-generic.h obj-${obj_format}.h obj-${obj_format}.c atof-${atof}.c"
618 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
619 ### end of configure.in
621 # are we rebuilding config itself?
622 if [ -n "$template" ]
624 if [ ! -r $template ]
626 echo "Can't find template ${template}."
630 mv configure configure.old
631 echo "#!/bin/sh" > configure
632 echo "# Do not edit this file. It is generated automatically from configure.in" >> configure
633 echo "# and a configure template." >> configure
634 echo "configdirs=" >> configure
637 if [ -r configure.
in ]
639 sed -e "/^####/ r configure.in" $template >> configure
641 cat $template >> configure
646 # echo Rebuilt configure in `pwd` from ${template}.
647 echo Rebuilt configure
in `pwd`
649 if [ x
$norecurse = x
]
651 while [ -n "$configdirs" ]
653 # set configdir to car of configdirs, configdirs to cdr of configdirs
654 set $configdirs; configdir
=$1; shift; configdirs
=$
*
656 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
658 targetspecificdirs
=${configdir}.
*
663 for i
in ${configdir} ${targetspecificdirs}
665 if [ -r $i/configure
]
668 configure
+template
=${template})
670 echo No configure
script in `pwd`/$i
679 # Temporarily, we support only direct subdir builds.
680 hostsubdir
=Host-
$host
681 targetsubdir
=Target-
$target
683 if [ -n "$removing" ]
685 rm -rf $hostsubdir/$targetsubdir
687 if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ]
692 if [ ! -d $hostsubdir ] ; then mkdir
$hostsubdir ; fi
695 if [ ! -d $targetsubdir ] ; then mkdir
$targetsubdir ; fi
700 ## Find the source files, if location was not specified.
705 # if [ ! -r ${srctrigger} ]
711 #if [ ! -r ${srcdir}/${srctrigger} ]
713 # if [ x$srcdirdefaulted = x ]
715 # echo "$progname: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
717 # echo "$progname: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
724 # Set up the list of links to be made.
725 # $links is the list of link names, and $files is the list of names to link to.
728 while [ -n "$files" ]
730 # set file to car of files, files to cdr of files
731 set $files; file=$1; shift; files
=$
*
732 set $links; link
=$1; shift; links
=$
*
734 if [ ! -r ${srcdir}/config
/$file ]
736 echo "$progname: cannot create a link \`$link'," 1>&2
737 echo "since the file \`config/$file' does not exist." 1>&2
743 # Make a symlink if possible, otherwise try a hard link
744 $symbolic_link ${srcdir}/config
/$file $link 2>/dev
/null ||
$hard_link ${srcdir}/config
/$file $link
748 echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
751 echo "Linked \`$link' to \`${srcdir}/config/$file'."
754 # Install a makefile, and make it set VPATH
755 # if necessary so that the sources are found.
756 # Also change its value of srcdir.
757 # Also create a .gdbinit file which runs the one in srcdir
758 # and tells GDB to look there for source files.
763 echo "VPATH = ${srcdir}" > x
764 cat x
${srcdir}/Makefile.
in |
sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.
in
766 echo "dir ." > .gdbinit
767 echo "dir ${srcdir}" >> .gdbinit
768 echo "source ${srcdir}/.gdbinit" >> .gdbinit
772 host_var_file
=hmake-
${host}
773 target_var_file
=tmake-
${target}
775 # Conditionalize the makefile for this machine.
776 if [ -f ${srcdir}/config
/${host_var_file} ]
778 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.
in > Makefile.tem
780 cp Makefile.
in Makefile.tem
783 if [ -f ${srcdir}/config
/${target_var_file} ]
785 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem
> Makefile.tem1
786 mv Makefile.tem1 Makefile.tem
789 # Remove all formfeeds, since some Makes get confused by them.
790 sed "s/\f//" Makefile.tem
>> Makefile.tem1
791 mv Makefile.tem1 Makefile.tem
794 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem
> Makefile.tem1
795 mv Makefile.tem1 Makefile.tem
798 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem
> Makefile.tem1
799 mv Makefile.tem1 Makefile.tem
801 # Delete the intermediate files
802 if [ x
$srcdir != x.
] ; then rm Makefile.
in ; fi
806 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
807 if [ x
$host != x
$target ]
809 echo "CROSS=-DCROSS_COMPILE" > Makefile
810 echo "ALL=start.encap" >> Makefile
812 echo "ALL=all.internal" > Makefile
815 # set target and host
816 echo "host = $host" >> Makefile
817 echo "target = $target" >> Makefile
819 cat Makefile.tem
>> Makefile
823 if [ -f ${srcdir}/config
/${host_var_file} ]
825 using
=" using \"${host_var_file}\""
828 if [ -f ${srcdir}/config
/${target_var_file} ]
832 andusing
=" using \"${target_var_file}\""
834 andusing
="${using} and \"${target_var_file}\""
840 echo "Created \"Makefile\""${andusing}.
842 if [ x
$host = x
$target ]
844 echo "Links are now set up for use with a $target." \
845 |
tee ${srcdir}/config.status
847 echo "Links are now set up for host $host and target $target." \
848 |
tee ${srcdir}/config.status
854 # If there are subdirectories, then recurse.
856 if [ x
$norecurse != x
] ; then exit 0 ; fi
858 while [ -n "$configdirs" ]
860 # set configdir to car of configdirs, configdirs to cdr of configdirs
861 set $configdirs; configdir
=$1; shift; configdirs
=$
*
863 # check for target override
864 targetspecificdir
=${configdir}.
${target}
865 if [ -d ${targetspecificdir} ]
867 configdir
=${targetspecificdir}
870 echo Configuring
${configdir}...
872 configure
+host=${host} ${target} ${removing}) \