* config/avr/avr.md ("*negsi2"): substitute %@ to __zero_reg__
[official-gcc.git] / configure.in
blob87e8a2a07505ac1bf6c22ed75bb86fadfd0a6982
1 #! /bin/bash
2 ##############################################################################
4 ## This file is a shell script fragment that supplies the information
5 ## necessary to tailor a template configure script into the configure
6 ## script appropriate for this directory. For more information, check
7 ## any existing configure script.
9 ## Be warned, there are two types of configure.in files. There are those
10 ## used by Autoconf, which are macros which are expanded into a configure
11 ## script by autoconf. The other sort, of which this is one, is executed
12 ## by Cygnus configure.
14 ## For more information on these two systems, check out the documentation
15 ## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
17 # Copyright (C) 1992-99, 2000 Free Software Foundation, Inc.
19 # This file is free software; you can redistribute it and/or modify it
20 # under the terms of the GNU General Public License as published by
21 # the Free Software Foundation; either version 2 of the License, or
22 # (at your option) any later version.
24 # This program is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 # General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with this program; if not, write to the Free Software
31 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 ##############################################################################
35 ### To add a new directory to the tree, first choose whether it is a target
36 ### or a host dependent tool. Then put it into the appropriate list
37 ### (library or tools, host or target), doing a dependency sort. For
38 ### example, gdb requires that byacc (or bison) be built first, so it is in
39 ### the ${host_tools} list after byacc and bison.
42 # these libraries are used by various programs built for the host environment
44 host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tcl8.1 tk8.1 tclX itcl tix libgui"
46 if [ "${enable_gdbgui}" = "yes" ] ; then
47 host_libs="${host_libs} libgui"
50 # Set up configure/Makefile variables if libstdc++-v3 is to be built.
51 if [ "${enable_libstdcxx_v3}" = "yes" ] && test -d $srcdir/libstdc++-v3; then
52 libstdcxx_version="target-libstdc++-v3"
53 # Don't use libstdc++-v3's flags to configure/build itself.
54 libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) cat $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/libstdc++.INC 2>/dev/null || : ;; esac` -L$$r/$(TARGET_SUBDIR)/libstd++-v3/src -L$$r/$(TARGET_SUBDIR)/libstd++-v3/src/.libs'
55 else
56 libstdcxx_version="target-libio target-libstdc++"
57 libstdcxx_flags='-isystem $$s/libstdc++ -isystem $$s/libstdc++/std -isystem $$s/libstdc++/stl -isystem $$s/libio -isystem $$r/$(TARGET_SUBDIR)/libio -L$$r/$(TARGET_SUBDIR)/libstdc++'
60 # these tools are built for the host environment
61 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
62 # know that we are building the simulator.
63 host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
65 # these libraries are built for the target environment, and are built after
66 # the host libraries and the host tools (which may be a cross compiler)
68 target_libs="target-libiberty \
69 target-libgloss \
70 target-newlib \
71 target-librx \
72 ${libstdcxx_version} \
73 target-libg++ \
74 target-libf2c \
75 target-libchill \
76 target-libffi \
77 target-libjava \
78 target-zlib \
79 target-boehm-gc \
80 target-qthreads \
81 target-libobjc"
83 # these tools are built using the target libs, and are intended to run only
84 # in the target environment
86 # note: any program that *uses* libraries that are in the "target_libs"
87 # list belongs in this list. those programs are also very likely
88 # candidates for the "native_only" list which follows
90 target_tools="target-examples target-groff target-gperf"
92 ################################################################################
94 ## These two lists are of directories that are to be removed from the
95 ## ${configdirs} list for either cross-compilations or for native-
96 ## compilations. For example, it doesn't make that much sense to
97 ## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
98 ## a native environment.
100 # directories to be built in the native environment only
102 # This must be a single line because of the way it is searched by grep in
103 # the code below.
104 native_only="autoconf automake libtool cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time ash bash bzip2 prms snavigator gnuserv target-gperf"
106 # directories to be built in a cross environment only
108 cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
110 ## All tools belong in one of the four categories, and are assigned above
111 ## We assign ${configdirs} this way to remove all embedded newlines. This
112 ## is important because configure will choke if they ever get through.
113 ## ${configdirs} is directories we build using the host tools.
114 ## ${target_configdirs} is directories we build using the target tools.
116 configdirs=`echo ${host_libs} ${host_tools}`
117 target_configdirs=`echo ${target_libs} ${target_tools}`
119 ################################################################################
121 srctrigger=move-if-change
122 srcname="gnu development package"
124 # This gets set non-empty for some net releases of packages.
125 appdirs=""
127 # per-host:
129 # Work in distributions that contain no compiler tools, like Autoconf.
130 if [ -d ${srcdir}/config ]; then
131 case "${host}" in
132 m68k-hp-hpux*)
133 host_makefile_frag="${host_makefile_frag} config/mh-hp300"
135 m68k-apollo-sysv*)
136 host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
138 m68k-apollo-bsd*)
139 host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
141 m88k-dg-dgux*)
142 host_makefile_frag="${host_makefile_frag} config/mh-dgux"
144 m88k-harris-cxux*)
145 host_makefile_frag="${host_makefile_frag} config/mh-cxux"
147 m88k-motorola-sysv*)
148 host_makefile_frag="${host_makefile_frag} config/mh-delta88"
150 mips*-dec-ultrix*)
151 host_makefile_frag="${host_makefile_frag} config/mh-decstation"
153 mips*-nec-sysv4*)
154 host_makefile_frag="${host_makefile_frag} config/mh-necv4"
156 mips*-sgi-irix6*)
157 host_makefile_frag="${host_makefile_frag} config/mh-irix6"
159 mips*-sgi-irix5*)
160 host_makefile_frag="${host_makefile_frag} config/mh-irix5"
162 mips*-sgi-irix4*)
163 host_makefile_frag="${host_makefile_frag} config/mh-irix4"
165 mips*-sgi-irix3*)
166 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
168 mips*-*-sysv4*)
169 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
171 mips*-*-sysv*)
172 host_makefile_frag="${host_makefile_frag} config/mh-riscos"
174 i370-ibm-opened*)
175 host_makefile_frag="${host_makefile_frag} config/mh-openedition"
177 i[3456]86-*-sysv5*)
178 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
180 i[3456]86-*-dgux*)
181 host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
183 i[3456]86-ncr-sysv4.3*)
184 host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
186 i[3456]86-ncr-sysv4*)
187 host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
189 i[3456]86-*-sco3.2v5*)
190 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
192 i[3456]86-*-sco*)
193 host_makefile_frag="${host_makefile_frag} config/mh-sco"
195 i[3456]86-*-udk*)
196 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
198 i[3456]86-*-isc*)
199 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
201 i[3456]86-*-solaris2*)
202 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
204 i[3456]86-*-aix*)
205 host_makefile_frag="${host_makefile_frag} config/mh-aix386"
207 i[3456]86-*-msdosdjgpp*)
208 host_makefile_frag="${host_makefile_frag} config/mh-djgpp"
210 *-cygwin*)
211 host_makefile_frag="${host_makefile_frag} config/mh-cygwin"
213 *-mingw32*)
214 host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
216 *-interix*)
217 host_makefile_frag="${host_makefile_frag} config/mh-interix"
219 *-windows*)
220 host_makefile_frag="${host_makefile_frag} config/mh-windows"
222 vax-*-ultrix2*)
223 host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
225 *-*-solaris2*)
226 host_makefile_frag="${host_makefile_frag} config/mh-solaris"
228 m68k-sun-sunos*)
229 host_makefile_frag="${host_makefile_frag} config/mh-sun3"
231 *-hp-hpux[78]*)
232 host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
234 *-hp-hpux*)
235 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
237 *-*-hiux*)
238 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
240 rs6000-*-lynxos*)
241 host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
243 *-*-lynxos*)
244 host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
246 *-*-sysv4*)
247 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
249 *-*-sysv*)
250 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
252 esac
255 # If we aren't going to be using gcc, see if we can extract a definition
256 # of CC from the fragment.
257 if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then
258 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
259 found=
260 for dir in $PATH; do
261 test -z "$dir" && dir=.
262 if test -f $dir/gcc; then
263 found=yes
264 break
266 done
267 IFS="$save_ifs"
268 if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then
269 xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
270 if [ -n "${xx}" ] ; then
271 CC=$xx
276 # We default to --with-shared on platforms where -fpic is meaningless.
277 # Well, we don't yet, but we will.
278 if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
279 case "${target}" in
280 alpha*-dec-osf*) enable_shared=yes ;;
281 alpha*-*-linux*) enable_shared=yes ;;
282 mips-sgi-irix5*) enable_shared=yes ;;
283 *) enable_shared=no ;;
284 esac
287 case "${enable_shared}" in
288 yes) shared=yes ;;
289 no) shared=no ;;
290 "") shared=no ;;
291 *) shared=yes ;;
292 esac
294 if [ x${shared} = xyes ]; then
295 case "${host}" in
296 alpha*-*-linux*)
297 host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
299 arm*-*-*)
300 host_makefile_frag="${host_makefile_frag} config/mh-armpic"
302 hppa*-*-*)
303 host_makefile_frag="${host_makefile_frag} config/mh-papic"
305 i[3456]86-*-cygwin*)
306 # We don't want -fPIC on Cygwin.
308 i[3456]86-*-*)
309 host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
311 i370-*-*)
312 host_makefile_frag="${host_makefile_frag} config/mh-i370pic"
314 ia64-*-*)
315 host_makefile_frag="${host_makefile_frag} config/mh-ia64pic"
317 sparc64-*-*)
318 host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
320 powerpc*-*-aix*)
321 # We don't want -fPIC on AIX.
323 powerpc*-*-*)
324 host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
326 *-*-*)
327 if test -f ${srcdir}/config/mh-${host_cpu}pic; then
328 host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
331 esac
334 rm -f mh-frag
335 if [ -n "${host_makefile_frag}" ] ; then
336 for f in ${host_makefile_frag}
338 cat ${srcdir}/$f >> mh-frag
339 done
340 host_makefile_frag=mh-frag
343 # per-target:
345 case "${target}" in
346 v810*)
347 target_makefile_frag="${target_makefile_frag} config/mt-v810"
349 i[3456]86-*-netware*)
350 target_makefile_frag="${target_makefile_frag} config/mt-netware"
352 powerpc-*-netware*)
353 target_makefile_frag="${target_makefile_frag} config/mt-netware"
355 *-*-linux*)
356 target_makefile_frag="${target_makefile_frag} config/mt-linux"
358 *-*-aix4.[3456789]* | *-*-aix[56789].*)
359 target_makefile_frag="${target_makefile_frag} config/mt-aix43"
361 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
362 target_makefile_frag="${target_makefile_frag} config/mt-wince"
364 esac
366 # If --enable-target-optspace always use -Os instead of -O2 to build
367 # the target libraries, similarly if it is not specified, use -Os
368 # on selected platforms.
369 case "${enable_target_optspace}:${target}" in
370 yes:*)
371 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
373 :d30v-*)
374 target_makefile_frag="${target_makefile_frag} config/mt-d30v"
376 :m32r-* | :d10v-* | :fr30-*)
377 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
379 no:* | :*)
382 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
384 esac
386 skipdirs=
387 gasdir=gas
388 use_gnu_ld=
389 use_gnu_as=
391 # some tools are so dependent upon X11 that if we're not building with X,
392 # it's not even worth trying to configure, much less build, that tool.
394 case ${with_x} in
395 yes | "") # the default value for this tree is that X11 is available
398 skipdirs="${skipdirs} tk libgui gash"
401 echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
403 esac
405 # Some tools are only suitable for building in a "native" situation.
406 # Those are added when we have a host==target configuration. For cross
407 # toolchains, we add some directories that should only be useful in a
408 # cross-compiler.
410 is_cross_compiler=
412 if [ x"${host}" = x"${target}" ] ; then
413 # when doing a native toolchain, don't build the targets
414 # that are in the 'cross only' list
415 skipdirs="${skipdirs} ${cross_only}"
416 is_cross_compiler=no
417 else
418 # similarly, don't build the targets in the 'native only'
419 # list when building a cross compiler
420 skipdirs="${skipdirs} ${native_only}"
421 is_cross_compiler=yes
424 # We always want to use the same name for this directory, so that dejagnu
425 # can reliably find it.
426 target_subdir=${target_alias}
428 if [ ! -d ${target_subdir} ] ; then
429 if mkdir ${target_subdir} ; then true
430 else
431 echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
432 exit 1
436 copy_dirs=
438 # Handle --with-headers=XXX. The contents of the named directory are
439 # copied to $(tooldir)/sys-include.
440 if [ x"${with_headers}" != x ]; then
441 if [ x${is_cross_compiler} = xno ]; then
442 echo 1>&2 '***' --with-headers is only supported when cross compiling
443 exit 1
445 case "${exec_prefixoption}" in
446 "") x=${prefix} ;;
447 *) x=${exec_prefix} ;;
448 esac
449 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
452 # Handle --with-libs=XXX. Multiple directories are permitted. The
453 # contents are copied to $(tooldir)/lib.
454 if [ x"${with_libs}" != x ]; then
455 if [ x${is_cross_compiler} = xno ]; then
456 echo 1>&2 '***' --with-libs is only supported when cross compiling
457 exit 1
459 # Copy the libraries in reverse order, so that files in the first named
460 # library override files in subsequent libraries.
461 case "${exec_prefixoption}" in
462 "") x=${prefix} ;;
463 *) x=${exec_prefix} ;;
464 esac
465 for l in ${with_libs}; do
466 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
467 done
470 # If both --with-headers and --with-libs are specified, default to
471 # --without-newlib.
472 if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
473 if [ x"${with_newlib}" = x ]; then
474 with_newlib=no
478 # Recognize --with-newlib/--without-newlib.
479 if [ x${with_newlib} = xno ]; then
480 skipdirs="${skipdirs} target-newlib"
481 elif [ x${with_newlib} = xyes ]; then
482 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
485 # Default to using --with-stabs for certain targets.
486 if [ x${with_stabs} = x ]; then
487 case "${target}" in
488 mips*-*-irix6*)
490 mips*-*-* | alpha*-*-osf*)
491 with_stabs=yes;
492 withoptions="${withoptions} --with-stabs"
494 esac
497 # Handle ${copy_dirs}
498 set fnord ${copy_dirs}
499 shift
500 while [ $# != 0 ]; do
501 if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
503 else
504 echo Copying $1 to $2
506 # Use the install script to create the directory and all required
507 # parent directories.
508 if [ -d $2 ]; then
510 else
511 echo >config.temp
512 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
515 # Copy the directory, assuming we have tar.
516 # FIXME: Should we use B in the second tar? Not all systems support it.
517 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
519 # It is the responsibility of the user to correctly adjust all
520 # symlinks. If somebody can figure out how to handle them correctly
521 # here, feel free to add the code.
523 echo $1 > $2/COPIED
525 shift; shift
526 done
528 # Configure extra directories which are host specific
530 case "${host}" in
531 i[3456]86-*-go32*)
532 configdirs="$configdirs dosrel" ;;
533 i[3456]86-*-mingw32*)
534 configdirs="$configdirs dosrel" ;;
535 *-cygwin*)
536 configdirs="$configdirs libtermcap dosrel" ;;
537 esac
539 # Remove more programs from consideration, based on the host or
540 # target this usually means that a port of the program doesn't
541 # exist yet.
543 noconfigdirs=""
545 case "${host}" in
546 i[3456]86-*-vsta)
547 noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
549 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
550 noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext libffi"
552 i[3456]86-*-mingw32*)
553 # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
554 noconfigdirs="expect dejagnu cvs autoconf automake send-pr rcs guile perl texinfo apache inet libtool"
556 i[3456]86-*-beos*)
557 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
559 *-*-cygwin*)
560 noconfigdirs="autoconf automake send-pr rcs guile perl texinfo apache inet"
562 *-*-netbsd*)
563 noconfigdirs="rcs"
565 ppc*-*-pe)
566 noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
568 powerpc-*-beos*)
569 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
571 esac
574 case "${target}" in
575 *-*-netware)
576 noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss target-libffi"
578 *-*-rtems*)
579 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
581 *-*-vxworks*)
582 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
584 alpha*-dec-osf*)
585 # ld works, but does not support shared libraries. emacs doesn't
586 # work. newlib is not 64 bit ready. I'm not sure about fileutils.
587 # gas doesn't generate exception information.
588 noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
590 alpha*-*-*vms*)
591 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss target-libffi"
593 alpha*-*-linux*)
594 # newlib is not 64 bit ready
595 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
596 # linux has rx in libc
597 skipdirs="$skipdirs target-librx"
599 alpha*-*-*)
600 # newlib is not 64 bit ready
601 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
603 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
604 noconfigdirs="$noconfigdirs target-libjava target-libffi target-zlib"
605 noconfigdirs="$noconfigdirs target-boehm-gc target-qthreads target-examples"
606 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
607 noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
608 noconfigdirs="$noconfigdirs expect dejagnu"
609 # the C++ libraries don't build on top of CE's C libraries
610 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
611 skipdirs="$skipdirs target-newlib"
612 case "${host}" in
613 *-*-cygwin*) ;; # keep gdb and readline
614 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
616 esac
618 arc-*-*)
619 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
621 arm-*-pe*)
622 noconfigdirs="$noconfigdirs target-libgloss"
624 arm-*-coff*)
625 noconfigdirs="$noconfigdirs target-libgloss"
626 if [ x${is_cross_compiler} != xno ] ; then
627 target_configdirs="${target_configdirs} target-bsp target-cygmon"
630 arm-*-elf*)
631 noconfigdirs="$noconfigdirs target-libgloss"
632 if [ x${is_cross_compiler} != xno ] ; then
633 target_configdirs="${target_configdirs} target-bsp target-cygmon"
636 arm-*-oabi*)
637 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
639 c4x-*-*)
640 noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss target-libffi"
642 c54x*-*-* | tic54x-*-*)
643 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi gcc gdb newlib"
645 thumb-*-coff)
646 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
648 thumb-*-elf)
649 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
651 thumb-*-oabi)
652 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
654 strongarm-*-elf)
655 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
656 if [ x${is_cross_compiler} != xno ] ; then
657 target_configdirs="${target_configdirs} target-bsp target-cygmon"
660 strongarm-*-coff)
661 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
662 if [ x${is_cross_compiler} != xno ] ; then
663 target_configdirs="${target_configdirs} target-bsp target-cygmon"
666 thumb-*-pe)
667 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
669 arm-*-riscix*)
670 noconfigdirs="$noconfigdirs ld target-libgloss target-libffi"
672 d10v-*-*)
673 noconfigdirs="$noconfigdirs target-librx target-libg++ ${libstdcxx_version} target-libgloss target-libffi"
675 d30v-*-*)
677 fr30-*-elf*)
678 if [ x${is_cross_compiler} != xno ] ; then
679 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
682 h8300*-*-* | \
683 h8500-*-*)
684 noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss target-libffi"
686 hppa*-*-*elf* | \
687 hppa*-*-linux* | \
688 hppa*-*-lites* | \
689 hppa*64*-*-*)
690 # Do configure ld/binutils/gas for this case.
692 hppa*-*-*)
693 # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
694 # cc is gcc, and on any system a user should be able to link cc to
695 # whatever they want. FIXME, emacs emacs19).
696 case "${CC}" in
697 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
698 *) ;;
699 esac
700 noconfigdirs="$noconfigdirs ld shellutils"
702 ia64*-*-elf*)
703 # No gdb support yet.
704 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
706 i[3456]86-*-coff | i[3456]86-*-elf)
707 if [ x${is_cross_compiler} != xno ] ; then
708 target_configdirs="${target_configdirs} target-libstub target-cygmon"
711 i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
712 # but don't build gdb
713 noconfigdirs="$noconfigdirs gdb target-libg++ ${libstdcxx_version} target-librx target-libffi"
715 *-*-linux*)
716 # linux has rx in libc
717 skipdirs="$skipdirs target-librx"
719 i[3456]86-*-mingw32*)
720 target_configdirs="$target_configdirs target-mingw"
721 noconfigdirs="$noconfigdirs expect target-libgloss target-libffi"
723 # Can't build gdb for mingw32 if not native.
724 case "${host}" in
725 i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
726 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
728 esac
730 *-*-cygwin*)
731 target_configdirs="$target_configdirs target-libtermcap target-winsup"
732 noconfigdirs="$noconfigdirs target-gperf target-libgloss target-libffi"
733 # always build newlib.
734 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
736 # Can't build gdb for Cygwin if not native.
737 case "${host}" in
738 *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
739 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
741 esac
743 i[3456]86-*-pe)
744 noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss target-libffi"
746 i[3456]86-*-sco3.2v5*)
747 # The linker does not yet know about weak symbols in COFF,
748 # and is not configured to handle mixed ELF and COFF.
749 noconfigdirs="$noconfigdirs ld target-libgloss target-libffi"
751 i[3456]86-*-sco*)
752 noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
754 i[3456]86-*-solaris2*)
755 noconfigdirs="$noconfigdirs target-libgloss"
757 i[3456]86-*-sysv4*)
758 # The SYSV4 C compiler doesn't handle Emacs correctly
759 case "${CC}" in
760 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
761 *) ;;
762 esac
763 # but that's okay since emacs doesn't work anyway
764 noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss target-libffi"
766 i[3456]86-*-beos*)
767 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
769 m68k-*-elf*)
770 if [ x${is_cross_compiler} != xno ] ; then
771 target_configdirs="${target_configdirs} target-bsp target-cygmon"
774 m68k-*-coff*)
775 if [ x${is_cross_compiler} != xno ] ; then
776 target_configdirs="${target_configdirs} target-bsp target-cygmon"
779 mn10200-*-*)
780 noconfigdirs="$noconfigdirs target-libffi"
781 if [ x${is_cross_compiler} != xno ] ; then
782 target_configdirs="${target_configdirs} target-libstub target-cygmon"
785 mn10300-*-*)
786 noconfigdirs="$noconfigdirs target-libffi"
787 if [ x${is_cross_compiler} != xno ] ; then
788 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
791 powerpc-*-aix*)
792 # copied from rs6000-*-* entry
793 # The configure and build of ld are currently disabled because
794 # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
795 # The symptom is that GDBtk 4.18 fails at startup with a segfault
796 # if linked by GNU ld, but not if linked by the native ld.
797 noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss target-libffi ld"
798 use_gnu_ld=no
800 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
801 target_configdirs="$target_configdirs target-winsup"
802 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv target-libffi"
803 # always build newlib.
804 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
806 # This is temporary until we can link against shared libraries
807 powerpcle-*-solaris*)
808 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv target-libffi"
810 powerpc-*-beos*)
811 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
813 powerpc-*-eabi)
814 if [ x${is_cross_compiler} != xno ] ; then
815 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
818 rs6000-*-lynxos*)
819 # The CVS server code doesn't work on the RS/6000
820 noconfigdirs="$noconfigdirs target-newlib gprof cvssrc target-libffi"
822 rs6000-*-aix*)
823 # The configure and build of ld are currently disabled because
824 # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
825 # The symptom is that GDBtk 4.18 fails at startup with a segfault
826 # if linked by GNU ld, but not if linked by the native ld.
827 noconfigdirs="$noconfigdirs gprof target-libffi ld"
828 use_gnu_ld=no
830 rs6000-*-*)
831 noconfigdirs="$noconfigdirs gprof target-libffi"
833 m68k-apollo-*)
834 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss target-libffi"
836 mips*-*-irix5*)
837 # The GNU linker does not support shared libraries.
838 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
839 noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
841 mips*-*-irix6*)
842 # The GNU assembler does not support IRIX 6.
843 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
844 noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss"
846 mips*-dec-bsd*)
847 noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
849 mips*-*-bsd*)
850 noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
852 mipstx39-*-*)
853 noconfigdirs="$noconfigdirs gprof target-libffi" # same as generic mips
854 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
856 mips*-*-*)
857 noconfigdirs="$noconfigdirs gprof target-libffi"
859 romp-*-*)
860 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss target-libffi"
862 sh-*-*)
863 case "${host}" in
864 i[3456]86-*-vsta) ;; # don't add gprof back in
865 i[3456]86-*-go32*) ;; # don't add gprof back in
866 i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
867 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
868 esac
869 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
871 sparc-*-elf*)
872 if [ x${is_cross_compiler} != xno ] ; then
873 target_configdirs="${target_configdirs} target-libstub target-cygmon"
876 sparc64-*-elf*)
877 if [ x${is_cross_compiler} != xno ] ; then
878 target_configdirs="${target_configdirs} target-libstub target-cygmon"
880 noconfigdirs="target-libffi"
882 sparclite-*-*)
883 if [ x${is_cross_compiler} != xno ] ; then
884 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
886 noconfigdirs="target-libffi"
888 sparc-*-sunos4*)
889 if [ x${is_cross_compiler} != xno ] ; then
890 noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
891 else
892 use_gnu_ld=no
895 v810-*-*)
896 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libg++ ${libstdcxx_version} opcodes target-libgloss target-libffi"
898 v850-*-*)
899 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
901 v850e-*-*)
902 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
904 v850ea-*-*)
905 noconfigdirs="$noconfigdirs target-libgloss target-libffi"
907 vax-*-vms)
908 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss target-libffi"
910 vax-*-*)
911 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
913 *-*-lynxos*)
914 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
916 *-*-macos* | \
917 *-*-mpw*)
918 # Macs want a resource compiler.
919 configdirs="$configdirs grez"
920 noconfigdirs="target-libffi"
922 esac
924 # If we aren't building newlib, then don't build libgloss, since libgloss
925 # depends upon some newlib header files.
926 case "${noconfigdirs}" in
927 *target-libgloss*) ;;
928 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
929 esac
931 # Make sure we don't let GNU ld be added if we didn't want it.
932 if [ x$with_gnu_ld = xno ]; then
933 use_gnu_ld=no
934 noconfigdirs="$noconfigdirs ld"
937 # Make sure we don't let GNU as be added if we didn't want it.
938 if [ x$with_gnu_as = xno ]; then
939 use_gnu_as=no
940 noconfigdirs="$noconfigdirs gas"
943 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
944 # $target_configdirs.
945 # If we have the source for $noconfigdirs entries, add them to $notsupp.
947 notsupp=""
948 for dir in . $skipdirs $noconfigdirs ; do
949 dirname=`echo $dir | sed -e s/target-//g`
950 if [ $dir != . ] && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
951 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
952 if [ -r $srcdir/$dirname/configure ] \
953 || [ -r $srcdir/$dirname/configure.in ]; then
954 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
955 true
956 else
957 notsupp="$notsupp $dir"
961 if [ $dir != . ] && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
962 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
963 if [ -r $srcdir/$dirname/configure ] \
964 || [ -r $srcdir/$dirname/configure.in ]; then
965 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
966 true
967 else
968 notsupp="$notsupp $dir"
972 done
974 # Sometimes the tools are distributed with libiberty but with no other
975 # libraries. In that case, we don't want to build target-libiberty.
976 if [ -n "${target_configdirs}" ]; then
977 others=
978 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
979 if [ "$i" != "libiberty" ]; then
980 if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
981 others=yes;
982 break;
985 done
986 if [ -z "${others}" ]; then
987 target_configdirs=
991 # Deconfigure all subdirectories, in case we are changing the
992 # configuration from one where a subdirectory is supported to one where it
993 # is not.
994 if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
995 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
996 rm -f $i/Makefile
997 done
999 if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then
1000 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
1001 rm -f ${target_subdir}/$i/Makefile
1002 done
1005 # Produce a warning message for the subdirs we can't configure.
1006 # This isn't especially interesting in the Cygnus tree, but in the individual
1007 # FSF releases, it's important to let people know when their machine isn't
1008 # supported by the one or two programs in a package.
1010 if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
1011 # If $appdirs is non-empty, at least one of those directories must still
1012 # be configured, or we error out. (E.g., if the gas release supports a
1013 # specified target in some subdirs but not the gas subdir, we shouldn't
1014 # pretend that all is well.)
1015 if [ -n "$appdirs" ]; then
1016 for dir in $appdirs ; do
1017 if [ -r $dir/Makefile.in ]; then
1018 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1019 appdirs=""
1020 break
1022 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1023 appdirs=""
1024 break
1027 done
1028 if [ -n "$appdirs" ]; then
1029 echo "*** This configuration is not supported by this package." 1>&2
1030 exit 1
1033 # Okay, some application will build, or we don't care to check. Still
1034 # notify of subdirs not getting built.
1035 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
1036 echo " ${notsupp}" 1>&2
1037 echo " (Any other directories should still work fine.)" 1>&2
1040 # Set with_gnu_as and with_gnu_ld as appropriate.
1042 # This is done by determining whether or not the appropriate directory
1043 # is available, and by checking whether or not specific configurations
1044 # have requested that this magic not happen.
1046 # The command line options always override the explicit settings in
1047 # configure.in, and the settings in configure.in override this magic.
1049 # If the default for a toolchain is to use GNU as and ld, and you don't
1050 # want to do that, then you should use the --without-gnu-as and
1051 # --without-gnu-ld options for the configure script.
1053 if [ x${use_gnu_as} = x ] ; then
1054 if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
1055 with_gnu_as=yes
1056 withoptions="$withoptions --with-gnu-as"
1060 if [ x${use_gnu_ld} = x ] ; then
1061 if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
1062 with_gnu_ld=yes
1063 withoptions="$withoptions --with-gnu-ld"
1067 # If using newlib, add --with-newlib to the withoptions so that gcc/configure
1068 # can detect this case.
1070 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1071 with_newlib=yes
1072 withoptions="$withoptions --with-newlib"
1075 if [ x${shared} = xyes ]; then
1076 case "${target}" in
1077 hppa*)
1078 target_makefile_frag="${target_makefile_frag} config/mt-papic"
1080 i[3456]86-*)
1081 target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1083 ia64-*)
1084 target_makefile_frag="${target_makefile_frag} config/mt-ia64pic"
1086 powerpc*-*-aix*)
1087 # We don't want -fPIC on AIX.
1089 powerpc*-*)
1090 target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1092 alpha*-*-linux*)
1093 target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1096 if test -f ${srcdir}/config/mt-${target_cpu}pic; then
1097 target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1100 esac
1103 rm -f mt-frag
1104 if [ -n "${target_makefile_frag}" ] ; then
1105 for f in ${target_makefile_frag}
1107 cat ${srcdir}/$f >> mt-frag
1108 done
1109 target_makefile_frag=mt-frag
1112 # post-target:
1114 # Make sure that the compiler is able to generate an executable. If it
1115 # can't, we are probably in trouble. We don't care whether we can run the
1116 # executable--we might be using a cross compiler--we only care whether it
1117 # can be created. At this point the main configure script has set CC.
1118 echo "int main () { return 0; }" > conftest.c
1119 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1120 if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
1122 else
1123 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1124 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1125 rm -f conftest*
1126 exit 1
1128 rm -f conftest*
1130 # The Solaris /usr/ucb/cc compiler does not appear to work.
1131 case "${host}" in
1132 sparc-sun-solaris2*)
1133 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1134 if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
1135 could_use=
1136 [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
1137 if [ -d /opt/cygnus/bin ] ; then
1138 if [ "$could_use" = "" ] ; then
1139 could_use="/opt/cygnus/bin"
1140 else
1141 could_use="$could_use or /opt/cygnus/bin"
1144 if [ "$could_use" = "" ] ; then
1145 echo "Warning: compilation may fail because you're using"
1146 echo "/usr/ucb/cc. You should change your PATH or CC "
1147 echo "variable and rerun configure."
1148 else
1149 echo "Warning: compilation may fail because you're using"
1150 echo "/usr/ucb/cc, when you should use the C compiler from"
1151 echo "$could_use. You should change your"
1152 echo "PATH or CC variable and rerun configure."
1156 esac
1158 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1159 # binutils tools will find libbfd.so.
1160 if [ "${shared}" = "yes" ]; then
1161 sed -e 's/^SET_LIB_PATH[ ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
1162 Makefile > Makefile.tem
1163 rm -f Makefile
1164 mv -f Makefile.tem Makefile
1166 case "${host}" in
1167 *-*-hpux*)
1168 sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
1169 Makefile > Makefile.tem
1170 rm -f Makefile
1171 mv -f Makefile.tem Makefile
1173 esac
1176 # Record target_configdirs and the configure arguments in Makefile.
1177 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1178 targargs=`echo "${arguments}" | \
1179 sed -e 's/--no[^ ]*//' \
1180 -e 's/--cache[a-z-]*=[^ ]*//' \
1181 -e 's/--ho[a-z-]*=[^ ]*//' \
1182 -e 's/--bu[a-z-]*=[^ ]*//' \
1183 -e 's/--ta[a-z-]*=[^ ]*//'`
1185 # Passing a --with-cross-host argument lets the target libraries know
1186 # whether they are being built with a cross-compiler or being built
1187 # native. However, it would be better to use other mechanisms to make the
1188 # sorts of decisions they want to make on this basis. Please consider
1189 # this option to be deprecated. FIXME.
1190 if [ x${is_cross_compiler} = xyes ]; then
1191 targargs="--with-cross-host=${host_alias} ${targargs}"
1194 # Default to --enable-multilib.
1195 if [ x${enable_multilib} = x ]; then
1196 targargs="--enable-multilib ${targargs}"
1199 # Pass --with-newlib if appropriate. Note that target_configdirs has
1200 # changed from the earlier setting of with_newlib.
1201 if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1202 targargs="--with-newlib ${targargs}"
1205 # provide a proper gxx_include_dir.
1206 # Note, if you change the default, make sure to fix both here and in
1207 # the gcc, libio, libstdc++ and libg++ subdirectories.
1208 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1209 gxx_include_dir=
1210 if test -n "${with_gxx_include_dir}"; then
1211 case "${with_gxx_include_dir}" in
1212 yes )
1213 echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
1214 exit 1
1216 no )
1219 gxx_include_dir=${with_gxx_include_dir}
1221 esac
1223 if test x${gxx_include_dir} = x; then
1224 if test x${enable_version_specific_runtime_libs} = xyes; then
1225 gxx_include_dir='${libsubdir}/include/g++'
1226 else
1227 . ${topsrcdir}/config.if
1228 gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
1230 else
1231 gxx_include_dir=${gxx_include_dir}
1234 FLAGS_FOR_TARGET=
1235 case " $skipdirs " in
1236 *" target-newlib "*) ;;
1238 case " $target_configdirs " in
1239 *" newlib "*)
1240 case " $targargs " in
1241 *" --with-newlib "*)
1242 case "$target" in
1243 *-cygwin*)
1244 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;;
1245 esac
1247 # If we're not building GCC, don't discard standard headers.
1248 if test -d ${topsrcdir}/gcc; then
1249 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
1251 if test "${build}" != "${host}"; then
1252 # On Canadian crosses, CC_FOR_TARGET will have already been set
1253 # by `configure', so we won't have an opportunity to add -Bgcc/
1254 # to it. This is right: we don't want to search that directory
1255 # for binaries, but we want the header files in there, so add
1256 # them explicitly.
1257 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
1259 # Someone might think of using the pre-installed headers on
1260 # Canadian crosses, in case the installed compiler is not fully
1261 # compatible with the compiler being built. In this case, it
1262 # would be better to flag an error than risking having
1263 # incompatible object files being constructed. We can't
1264 # guarantee that an error will be flagged, but let's hope the
1265 # compiler will do it, when presented with incompatible header
1266 # files.
1270 # If we're building newlib, use its generic headers last, but search
1271 # for any libc-related directories first (so make it the last -B
1272 # switch).
1273 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
1275 esac
1277 esac
1279 esac
1281 # On Canadian crosses, we'll be searching the right directories for
1282 # the previously-installed cross compiler, so don't bother to add
1283 # flags for directories within the install tree of the compiler
1284 # being built; programs in there won't even run.
1285 if test "${build}" = "${host}" && test -d ${topsrcdir}/gcc; then
1286 # Search for pre-installed headers if nothing else fits.
1287 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
1290 if test "x${use_gnu_ld}" = x && test "x${with_gnu_ld}" != xno &&
1291 echo " ${configdirs} " | grep " ld " > /dev/null &&
1292 test -d ${srcdir}/ld; then
1293 # Arrange for us to find uninstalled linker scripts.
1294 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1297 if test "x${CC_FOR_TARGET+set}" = xset; then
1299 elif test -d ${topsrcdir}/gcc; then
1300 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
1301 elif test "$host" = "$target"; then
1302 CC_FOR_TARGET='$(CC)'
1303 else
1304 CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1306 # On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
1307 # if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated.
1308 case $CC_FOR_TARGET in
1309 *' $(FLAGS_FOR_TARGET)') ;;
1310 *) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1311 esac
1313 if test "x${CHILL_FOR_TARGET+set}" = xset; then
1315 elif test -d ${topsrcdir}/gcc; then
1316 CHILL_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/'
1317 elif test "$host" = "$target"; then
1318 CHILL_FOR_TARGET='$(CC)'
1319 else
1320 CHILL_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1322 case $CHILL_FOR_TARGET in
1323 *' $(FLAGS_FOR_TARGET)') ;;
1324 *) CHILL_FOR_TARGET=$CHILL_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1325 esac
1327 if test "x${CXX_FOR_TARGET+set}" = xset; then
1329 elif test -d ${topsrcdir}/gcc; then
1330 CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
1331 elif test "$host" = "$target"; then
1332 CXX_FOR_TARGET='$(CXX)'
1333 else
1334 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
1336 case $CXX_FOR_TARGET in
1337 *' $(FLAGS_FOR_TARGET)') ;;
1338 *) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1339 esac
1340 qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,&,\\\&,g'`
1342 targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
1343 sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
1344 -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
1345 -e "s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \
1346 -e "s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
1347 -e "s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
1348 -e "s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
1349 -e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
1350 -e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
1351 Makefile > Makefile.tem
1352 rm -f Makefile
1353 mv -f Makefile.tem Makefile
1356 # Local Variables:
1357 # fill-column: 131
1358 # End: