* Makefile.tpl, configure.in: Substitute libstdcxx_incdir.
[binutils.git] / configure.in
blob8276a4586dc96ca05577d75a8b6db4b29165c116
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, 1993, 1994, 1995, 1996, 1997, 1998,
18 # 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
20 # This file is free software; you can redistribute it and/or modify it
21 # under the terms of the GNU General Public License as published by
22 # the Free Software Foundation; either version 2 of the License, or
23 # (at your option) any later version.
25 # This program is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 # General Public License for more details.
30 # You should have received a copy of the GNU General Public License
31 # along with this program; if not, write to the Free Software
32 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 ##############################################################################
36 extra_host_args=
37 # Define the trigger file to make sure configure will re-run whenever
38 # the gcc version number changes.
39 if [ "${with_gcc_version_trigger+set}" = set ]; then
40 gcc_version_trigger="$with_gcc_version_trigger"
41 gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
42 else
43 # If gcc's sources are available, define the trigger file.
44 if [ -f ${topsrcdir}/gcc/version.c ] ; then
45 gcc_version_trigger=${topsrcdir}/gcc/version.c
46 gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
47 case "$arguments" in
48 *--with-gcc-version-trigger=$gcc_version_trigger* )
50 * )
51 # Add to all subconfigure arguments: build, host, and target.
52 arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments"
54 esac
55 # This will be redundant when we start all subconfigures from the Makefile.
56 extra_host_args="--with-gcc-version-trigger=$gcc_version_trigger $extra_host_args"
60 ### To add a new directory to the tree, first choose whether it is a target
61 ### or a host dependent tool. Then put it into the appropriate list
62 ### (library or tools, host or target), doing a dependency sort.
64 # Subdirs will be configured in the order listed in build_configdirs,
65 # configdirs, or target_configdirs; see the serialization section below.
67 # Dependency sorting is only needed when *configuration* must be done in
68 # a particular order. In all cases a dependency should be specified in
69 # the Makefile, whether or not it's implicitly specified here.
71 # Double entries in build_configdirs, configdirs, or target_configdirs may
72 # cause circular dependencies and break everything horribly.
74 # these libraries are used by various programs built for the host environment
76 host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk itcl tix libgui zlib"
78 libstdcxx_version="target-libstdc++-v3"
80 # these tools are built for the host environment
81 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
82 # know that we are building the simulator.
83 # binutils, gas and ld appear in that order because it makes sense to run
84 # "make check" in that particular order.
85 host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator gettext zip fastjar"
87 # libgcj represents the runtime libraries only used by gcj.
88 libgcj="target-libffi \
89 target-boehm-gc \
90 target-zlib \
91 target-qthreads \
92 target-libjava"
94 # these libraries are built for the target environment, and are built after
95 # the host libraries and the host tools (which may be a cross compiler)
97 target_libs="target-libiberty \
98 target-libgloss \
99 target-newlib \
100 ${libstdcxx_version} \
101 target-libf2c \
102 ${libgcj}
103 target-libobjc"
105 # these tools are built using the target libs, and are intended to run only
106 # in the target environment
108 # note: any program that *uses* libraries that are in the "target_libs"
109 # list belongs in this list. those programs are also very likely
110 # candidates for the "native_only" list which follows
112 target_tools="target-examples target-groff target-gperf target-rda"
114 ################################################################################
116 ## All tools belong in one of the four categories, and are assigned above
117 ## We assign ${configdirs} this way to remove all embedded newlines. This
118 ## is important because configure will choke if they ever get through.
119 ## ${configdirs} is directories we build using the host tools.
120 ## ${target_configdirs} is directories we build using the target tools.
122 configdirs=`echo ${host_libs} ${host_tools}`
123 target_configdirs=`echo ${target_libs} ${target_tools}`
125 ################################################################################
127 srctrigger=move-if-change
128 srcname="gnu development package"
130 # This gets set non-empty for some net releases of packages.
131 appdirs=""
133 # per-host:
135 # There is no longer anything interesting in the per-host section.
137 # per-target:
139 # Define is_cross_compiler to save on calls to 'test'.
140 is_cross_compiler=
141 if test x"${host}" = x"${target}" ; then
142 is_cross_compiler=no
143 else
144 is_cross_compiler=yes
147 # We always want to use the same name for this directory, so that dejagnu
148 # can reliably find it.
149 target_subdir=${target_alias}
151 if test ! -d ${target_subdir} ; then
152 if mkdir ${target_subdir} ; then true
153 else
154 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
155 exit 1
159 build_subdir=${build_alias}
161 if test x"${build_alias}" != x"${host}" ; then
162 if test ! -d ${build_subdir} ; then
163 if mkdir ${build_subdir} ; then true
164 else
165 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
166 exit 1
171 if test x"${target_subdir}" = x"${build_subdir}" ; then
172 build_prefix=build-
175 # Skipdirs are removed silently.
176 skipdirs=
177 # Noconfigdirs are removed loudly.
178 noconfigdirs=""
180 use_gnu_ld=
181 # Make sure we don't let GNU ld be added if we didn't want it.
182 if test x$with_gnu_ld = xno ; then
183 use_gnu_ld=no
184 noconfigdirs="$noconfigdirs ld"
187 use_gnu_as=
188 # Make sure we don't let GNU as be added if we didn't want it.
189 if test x$with_gnu_as = xno ; then
190 use_gnu_as=no
191 noconfigdirs="$noconfigdirs gas"
194 # some tools are so dependent upon X11 that if we're not building with X,
195 # it's not even worth trying to configure, much less build, that tool.
197 case ${with_x} in
198 yes | "") ;; # the default value for this tree is that X11 is available
200 skipdirs="${skipdirs} tk tix itcl libgui"
201 # We won't be able to build gdbtk without X.
202 enable_gdbtk=no
204 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
205 esac
207 # Some tools are only suitable for building in a "native" situation.
208 # Remove these if host!=target.
209 native_only="autoconf automake libtool fileutils find gawk gettext grep gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms snavigator gnuserv target-gperf"
211 # Similarly, some are only suitable for cross toolchains.
212 # Remove these if host=target.
213 cross_only="target-libgloss target-newlib target-opcodes"
215 case $is_cross_compiler in
216 no) skipdirs="${skipdirs} ${cross_only}" ;;
217 yes) skipdirs="${skipdirs} ${native_only}" ;;
218 esac
220 # If both --with-headers and --with-libs are specified, default to
221 # --without-newlib.
222 if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
223 if test x"${with_newlib}" = x ; then
224 with_newlib=no
228 # Recognize --with-newlib/--without-newlib.
229 case ${with_newlib} in
230 no) skipdirs="${skipdirs} target-newlib" ;;
231 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
232 esac
234 # Configure extra directories which are host specific
236 case "${host}" in
237 *-cygwin*)
238 configdirs="$configdirs libtermcap" ;;
239 esac
241 # Remove more programs from consideration, based on the host or
242 # target this usually means that a port of the program doesn't
243 # exist yet.
245 case "${host}" in
246 hppa*64*-*-*)
247 noconfigdirs="$noconfigdirs byacc"
249 i[3456]86-*-vsta)
250 noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv gettext"
252 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
253 noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi"
255 i[3456]86-*-mingw32*)
256 # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv"
257 noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
259 i[3456]86-*-beos*)
260 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
262 *-*-cygwin*)
263 noconfigdirs="autoconf automake send-pr rcs guile perl"
265 *-*-netbsd*)
266 noconfigdirs="rcs"
268 ppc*-*-pe)
269 noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv"
271 powerpc-*-beos*)
272 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
274 *-*-darwin*)
275 noconfigdirs="$noconfigdirs tk itcl tix libgui"
277 esac
279 # Save it here so that, even in case of --enable-libgcj, if the Java
280 # front-end isn't enabled, we still get libgcj disabled.
281 libgcj_saved=$libgcj
282 case $enable_libgcj in
283 yes)
284 # If we reset it here, it won't get added to noconfigdirs in the
285 # target-specific build rules, so it will be forcibly enabled
286 # (unless the Java language itself isn't enabled).
287 libgcj=
290 # Make sure we get it printed in the list of not supported target libs.
291 noconfigdirs="$noconfigdirs ${libgcj}"
293 esac
295 case "${target}" in
296 *-*-chorusos)
297 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
299 *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
300 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
302 *-*-netbsd*)
303 # Skip some stuff on all NetBSD configurations.
304 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
306 # Skip some stuff that's unsupported on some NetBSD configurations.
307 case "${target}" in
308 i*86-*-netbsdelf*) ;;
310 noconfigdirs="$noconfigdirs ${libgcj}"
312 esac
314 *-*-netware)
315 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
317 *-*-rtems*)
318 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
319 case ${target} in
320 h8300*-*-* | h8500-*-*)
321 noconfigdirs="$noconfigdirs target-libf2c"
323 *) ;;
324 esac
326 *-*-vxworks*)
327 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
329 alpha*-dec-osf*)
330 # ld works, but does not support shared libraries.
331 # newlib is not 64 bit ready. I'm not sure about fileutils.
332 # gas doesn't generate exception information.
333 noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
335 alpha*-*-*vms*)
336 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
338 alpha*-*-linux*)
339 # newlib is not 64 bit ready
340 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
342 alpha*-*-freebsd*)
343 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
345 alpha*-*-*)
346 # newlib is not 64 bit ready
347 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
349 sh-*-linux*)
350 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
352 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
353 noconfigdirs="$noconfigdirs ${libgcj}"
354 noconfigdirs="$noconfigdirs target-examples"
355 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
356 noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
357 noconfigdirs="$noconfigdirs expect dejagnu"
358 # the C++ libraries don't build on top of CE's C libraries
359 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
360 noconfigdirs="$noconfigdirs target-newlib"
361 case "${host}" in
362 *-*-cygwin*) ;; # keep gdb and readline
363 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
365 esac
367 arc-*-*)
368 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
370 arm-*-coff | strongarm-*-coff | xscale-*-coff)
371 noconfigdirs="$noconfigdirs ${libgcj}"
373 arm-*-elf* | strongarm-*-elf* | xscale-*-elf*)
374 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
376 arm-*-pe*)
377 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
379 arm-*-oabi*)
380 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
382 thumb-*-coff)
383 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
385 thumb-*-elf)
386 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
388 thumb-*-oabi)
389 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
391 thumb-*-pe)
392 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
394 arm-*-riscix*)
395 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
397 avr-*-*)
398 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
400 c4x-*-* | tic4x-*-*)
401 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
403 c54x*-*-* | tic54x-*-*)
404 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
406 cris-*-*)
407 noconfigdirs="$noconfigdirs ${libgcj}"
409 d10v-*-*)
410 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
412 d30v-*-*)
413 noconfigdirs="$noconfigdirs ${libgcj}"
415 fr30-*-elf*)
416 noconfigdirs="$noconfigdirs ${libgcj}"
418 frv-*-*)
419 noconfigdirs="$noconfigdirs ${libgcj}"
421 h8300*-*-*)
422 noconfigdirs="$noconfigdirs target-libgloss"
424 h8500-*-*)
425 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
427 hppa*64*-*-linux* | parisc*64*-*-linux*)
428 # In this case, it's because the hppa64-linux target is for
429 # the kernel only at this point and has no libc, and thus no
430 # headers, crt*.o, etc., all of which are needed by these.
431 noconfigdirs="$noconfigdirs target-zlib"
433 hppa*-*-*elf* | \
434 parisc*-*-linux* | hppa*-*-linux* | \
435 hppa*-*-lites* | \
436 hppa*-*-openbsd* | \
437 hppa*64*-*-*)
438 noconfigdirs="$noconfigdirs ${libgcj}"
439 # Do configure ld/binutils/gas for this case.
441 hppa*-*-*)
442 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
443 # build on HP-UX 10.20.
444 noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
446 ia64*-*-elf*)
447 # No gdb support yet.
448 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
450 ia64*-**-hpux*)
451 # No gdb or ld support yet.
452 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld"
454 i[3456]86-*-coff | i[3456]86-*-elf)
455 noconfigdirs="$noconfigdirs ${libgcj}"
457 i[34567]86-*-freebsd*)
458 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
460 i[3456]86-*-linux*)
461 # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
462 # not build java stuff by default.
463 case "${target}" in
464 *-*-*libc1*)
465 noconfigdirs="$noconfigdirs ${libgcj}";;
466 esac
468 # This section makes it possible to build newlib natively on linux.
469 # If we are using a cross compiler then don't configure newlib.
470 if test x${is_cross_compiler} != xno ; then
471 noconfigdirs="$noconfigdirs target-newlib"
473 noconfigdirs="$noconfigdirs target-libgloss"
474 # If we are not using a cross compiler, do configure newlib.
475 # Note however, that newlib will only be configured in this situation
476 # if the --with-newlib option has been given, because otherwise
477 # 'target-newlib' will appear in skipdirs.
479 i[3456]86-*-mingw32*)
480 target_configdirs="$target_configdirs target-mingw"
481 noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
483 # Can't build gdb for mingw32 if not native.
484 case "${host}" in
485 i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
486 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
488 esac
490 *-*-cygwin*)
491 target_configdirs="$target_configdirs target-libtermcap target-winsup"
492 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
493 # always build newlib.
494 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
496 # Can't build gdb for Cygwin if not native.
497 case "${host}" in
498 *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
499 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
501 esac
503 i[3456]86-*-pe)
504 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
506 i[3456]86-*-sco3.2v5*)
507 # The linker does not yet know about weak symbols in COFF,
508 # and is not configured to handle mixed ELF and COFF.
509 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
511 i[3456]86-*-sco*)
512 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
514 i[3456]86-*-solaris2*)
515 noconfigdirs="$noconfigdirs target-libgloss"
517 i[3456]86-*-sysv4*)
518 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
520 i[3456]86-*-beos*)
521 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
523 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
524 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
526 m68k-*-elf*)
527 noconfigdirs="$noconfigdirs ${libgcj}"
529 m68k-*-coff*)
530 noconfigdirs="$noconfigdirs ${libgcj}"
532 mcore-*-pe*)
533 # The EPOC C++ environment does not support exceptions or rtti,
534 # and so building libstdc++-v3 tends not to always work.
535 noconfigdirs="$noconfigdirs target-libstdc++-v3"
537 mmix-*-*)
538 noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss"
540 mn10200-*-*)
541 noconfigdirs="$noconfigdirs ${libgcj}"
543 mn10300-*-*)
544 noconfigdirs="$noconfigdirs ${libgcj}"
546 powerpc-*-aix*)
547 # copied from rs6000-*-* entry
548 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
550 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
551 target_configdirs="$target_configdirs target-winsup"
552 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
553 # always build newlib.
554 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
556 # This is temporary until we can link against shared libraries
557 powerpcle-*-solaris*)
558 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
560 powerpc-*-beos*)
561 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
563 powerpc-*-darwin*)
564 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
566 powerpc-*-eabi)
567 noconfigdirs="$noconfigdirs ${libgcj}"
569 powerpc64*-*-linux*)
570 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
571 # not yet ported.
572 noconfigdirs="$noconfigdirs target-libffi"
574 rs6000-*-lynxos*)
575 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
577 rs6000-*-aix*)
578 noconfigdirs="$noconfigdirs gprof ${libgcj}"
580 rs6000-*-*)
581 noconfigdirs="$noconfigdirs gprof ${libgcj}"
583 m68k-apollo-*)
584 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
586 mips*-*-irix5*)
587 # The GNU linker does not support shared libraries.
588 noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
590 mips*-*-irix6*)
591 # The GNU assembler does not support IRIX 6.
592 # Linking libjava exceeds command-line length limits on at least
593 # IRIX 6.2, but not on IRIX 6.5.
594 # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
595 # <oldham@codesourcery.com>
596 noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
598 mips*-dec-bsd*)
599 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
601 mips*-*-bsd*)
602 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
604 mipstx39-*-*)
605 noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
607 mips*-*-linux*)
608 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
610 mips*-*-*)
611 noconfigdirs="$noconfigdirs gprof ${libgcj}"
613 romp-*-*)
614 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
616 sh-*-*)
617 case "${host}" in
618 i[3456]86-*-vsta) ;; # don't add gprof back in
619 i[3456]86-*-go32*) ;; # don't add gprof back in
620 i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
621 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
622 esac
623 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
625 sh64-*-*)
626 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
628 sparc-*-elf*)
629 noconfigdirs="$noconfigdirs ${libgcj}"
631 sparc64-*-elf*)
632 noconfigdirs="$noconfigdirs ${libgcj}"
634 sparclite-*-*)
635 noconfigdirs="$noconfigdirs ${libgcj}"
637 sparc-*-sunos4*)
638 noconfigdirs="$noconfigdirs ${libgcj}"
639 if test x${is_cross_compiler} != xno ; then
640 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
641 else
642 use_gnu_ld=no
645 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
647 v810-*-*)
648 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
650 v850-*-*)
651 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
653 v850e-*-*)
654 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
656 v850ea-*-*)
657 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
659 vax-*-vms)
660 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
662 vax-*-*)
663 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
665 ip2k-*-*)
666 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
668 *-*-linux*)
669 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
671 *-*-lynxos*)
672 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
674 *-*-*)
675 noconfigdirs="$noconfigdirs ${libgcj}"
677 esac
679 # If we aren't building newlib, then don't build libgloss, since libgloss
680 # depends upon some newlib header files.
681 case "${noconfigdirs}" in
682 *target-libgloss*) ;;
683 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
684 esac
686 # Figure out what language subdirectories are present.
687 # Look if the user specified --enable-languages="..."; if not, use
688 # the environment variable $LANGUAGES if defined. $LANGUAGES might
689 # go away some day.
690 # NB: embedded tabs in this IF block -- do not untabify
691 if test x"${enable_languages+set}" != xset; then
692 if test x"${LANGUAGES+set}" = xset; then
693 enable_languages="${LANGUAGES}"
694 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
695 else
696 enable_languages=all
698 else
699 if test x"${enable_languages}" = x ||
700 test x"${enable_languages}" = xyes;
701 then
702 echo configure.in: --enable-languages needs at least one language argument 1>&2
703 exit 1
706 enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
708 # First scan to see if an enabled language requires some other language.
709 # We assume that a given config-lang.in will list all the language
710 # front ends it requires, even if some are required indirectly.
711 for lang in ${srcdir}/gcc/*/config-lang.in ..
713 case $lang in
716 # The odd quoting in the next line works around
717 # an apparent bug in bash 1.12 on linux.
718 ${srcdir}/gcc/[*]/config-lang.in)
721 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
722 this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
723 for other in $this_lang_requires
725 case ,${enable_languages}, in
726 *,$other,*)
728 *,all,*)
730 *,$lang_alias,*)
731 echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
732 enable_languages="$enable_languages,$other"
734 esac
735 done
737 esac
738 done
740 subdirs=
741 for lang in ${srcdir}/gcc/*/config-lang.in ..
743 case $lang in
744 ..) ;;
745 # The odd quoting in the next line works around
746 # an apparent bug in bash 1.12 on linux.
747 ${srcdir}/gcc/[*]/config-lang.in) ;;
749 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
750 this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
751 this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
752 build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
753 if test "x$lang_alias" = x
754 then
755 echo "$lang doesn't set \$language." 1>&2
756 exit 1
758 case ${build_by_default},${enable_languages}, in
759 *,$lang_alias,*) add_this_lang=yes ;;
760 no,*) add_this_lang=no ;;
761 *,all,*) add_this_lang=yes ;;
762 *) add_this_lang=no ;;
763 esac
764 if test x"${add_this_lang}" = xyes; then
765 eval target_libs='"$target_libs "'\"$this_lang_libs\"
766 else
767 eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
770 esac
771 done
773 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
774 # $target_configdirs.
775 # If we have the source for $noconfigdirs entries, add them to $notsupp.
777 notsupp=""
778 for dir in . $skipdirs $noconfigdirs ; do
779 dirname=`echo $dir | sed -e s/target-//g`
780 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
781 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
782 if test -r $srcdir/$dirname/configure ; then
783 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
784 true
785 else
786 notsupp="$notsupp $dir"
790 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
791 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
792 if test -r $srcdir/$dirname/configure ; then
793 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
794 true
795 else
796 notsupp="$notsupp $dir"
800 done
802 # Sometimes the tools are distributed with libiberty but with no other
803 # libraries. In that case, we don't want to build target-libiberty.
804 if test -n "${target_configdirs}" ; then
805 others=
806 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
807 if test "$i" != "libiberty" ; then
808 if test -r $srcdir/$i/configure ; then
809 others=yes;
810 break;
813 done
814 if test -z "${others}" ; then
815 target_configdirs=
819 # Deconfigure all subdirectories, in case we are changing the
820 # configuration from one where a subdirectory is supported to one where it
821 # is not.
822 if test -z "${norecursion}" && test -n "${configdirs}" ; then
823 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
824 rm -f $i/Makefile
825 done
827 if test -z "${norecursion}" && test -n "${target_configdirs}" ; then
828 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
829 rm -f ${target_subdir}/$i/Makefile
830 done
833 # Quietly strip out all directories which aren't configurable in this tree.
834 # This relies on all configurable subdirectories being autoconfiscated, which
835 # is now the case.
836 configdirs_all="$configdirs"
837 configdirs=
838 for i in ${configdirs_all} ; do
839 if test -f ${srcdir}/$i/configure ; then
840 configdirs="${configdirs} $i"
842 done
843 target_configdirs_all="$target_configdirs"
844 target_configdirs=
845 for i in ${target_configdirs_all} ; do
846 j=`echo $i | sed -e s/target-//g`
847 if test -f ${srcdir}/$j/configure ; then
848 target_configdirs="${target_configdirs} $i"
850 done
852 # Produce a warning message for the subdirs we can't configure.
853 # This isn't especially interesting in the Cygnus tree, but in the individual
854 # FSF releases, it's important to let people know when their machine isn't
855 # supported by the one or two programs in a package.
857 if test -n "${notsupp}" && test -z "${norecursion}" ; then
858 # If $appdirs is non-empty, at least one of those directories must still
859 # be configured, or we error out. (E.g., if the gas release supports a
860 # specified target in some subdirs but not the gas subdir, we shouldn't
861 # pretend that all is well.)
862 if test -n "$appdirs" ; then
863 for dir in $appdirs ; do
864 if test -r $dir/Makefile.in ; then
865 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
866 appdirs=""
867 break
869 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
870 appdirs=""
871 break
874 done
875 if test -n "$appdirs" ; then
876 echo "*** This configuration is not supported by this package." 1>&2
877 exit 1
880 # Okay, some application will build, or we don't care to check. Still
881 # notify of subdirs not getting built.
882 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
883 echo " ${notsupp}" 1>&2
884 echo " (Any other directories should still work fine.)" 1>&2
887 case "$host" in
888 *msdosdjgpp*)
889 enable_gdbtk=no ;;
890 esac
892 copy_dirs=
894 # Handle --with-headers=XXX. If the value is not "yes", the contents of
895 # the named directory are copied to $(tooldir)/sys-include.
896 if test x"${with_headers}" != x ; then
897 if test x${is_cross_compiler} = xno ; then
898 echo 1>&2 '***' --with-headers is only supported when cross compiling
899 exit 1
901 if test x"${with_headers}" != xyes ; then
902 case "${exec_prefixoption}" in
903 "") x=${prefix} ;;
904 *) x=${exec_prefix} ;;
905 esac
906 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
910 # Handle --with-libs=XXX. If the value is not "yes", the contents of
911 # the name directories are copied to $(tooldir)/lib. Multiple directories
912 # are permitted.
913 if test x"${with_libs}" != x ; then
914 if test x${is_cross_compiler} = xno ; then
915 echo 1>&2 '***' --with-libs is only supported when cross compiling
916 exit 1
918 if test x"${with_libs}" != xyes ; then
919 # Copy the libraries in reverse order, so that files in the first named
920 # library override files in subsequent libraries.
921 case "${exec_prefixoption}" in
922 "") x=${prefix} ;;
923 *) x=${exec_prefix} ;;
924 esac
925 for l in ${with_libs}; do
926 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
927 done
931 # Handle ${copy_dirs}
932 set fnord ${copy_dirs}
933 shift
934 while test $# != 0 ; do
935 if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
937 else
938 echo Copying $1 to $2
940 # Use the install script to create the directory and all required
941 # parent directories.
942 if test -d $2 ; then
944 else
945 echo >config.temp
946 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
949 # Copy the directory, assuming we have tar.
950 # FIXME: Should we use B in the second tar? Not all systems support it.
951 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
953 # It is the responsibility of the user to correctly adjust all
954 # symlinks. If somebody can figure out how to handle them correctly
955 # here, feel free to add the code.
957 echo $1 > $2/COPIED
959 shift; shift
960 done
962 # Work in distributions that contain no compiler tools, like Autoconf.
963 tentative_cc=""
964 if test -d ${srcdir}/config ; then
965 case "${host}" in
966 m68k-hp-hpux*)
967 # Avoid "too much defining" errors from HPUX compiler.
968 tentative_cc="cc -Wp,-H256000"
969 host_makefile_frag="config/mh-hp300"
971 m68k-apollo-sysv*)
972 tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
973 host_makefile_frag="config/mh-apollo68"
975 m68k-apollo-bsd*)
976 #None of the Apollo compilers can compile gas or binutils. The preprocessor
977 # chokes on bfd, the compiler won't let you assign integers to enums, and
978 # other problems. Defining CC to gcc is a questionable way to say "don't use
979 # the apollo compiler" (the preferred version of GCC could be called cc,
980 # or whatever), but I'm not sure leaving CC as cc is any better...
981 #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
982 tentative_cc=gcc
983 host_makefile_frag="config/mh-a68bsd"
985 m88k-dg-dgux*)
986 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
987 host_makefile_frag="config/mh-dgux"
989 m88k-harris-cxux*)
990 # Under CX/UX, we want to tell the compiler to use ANSI mode.
991 tentative_cc="cc -Xa"
992 host_makefile_frag="config/mh-cxux"
994 m88k-motorola-sysv*)
995 host_makefile_frag="config/mh-delta88"
997 mips*-dec-ultrix*)
998 tentative_cc="cc -Wf,-XNg1000"
999 host_makefile_frag="config/mh-decstation"
1001 mips*-nec-sysv4*)
1002 # The C compiler on NEC MIPS SVR4 needs bigger tables.
1003 tentative_cc="cc -ZXNd=5000 -ZXNg=1000"
1004 host_makefile_frag="config/mh-necv4"
1006 mips*-sgi-irix6*)
1007 host_makefile_frag="config/mh-irix6"
1009 mips*-sgi-irix5*)
1010 host_makefile_frag="config/mh-irix5"
1012 mips*-sgi-irix4*)
1013 # Tell compiler to use K&R C. We can't compile under the SGI Ansi
1014 # environment. Also bump switch table size so that cp-parse will
1015 # compile. Bump string length limit so linker builds.
1016 tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192"
1018 mips*-sgi-irix3*)
1019 host_makefile_frag="config/mh-sysv"
1021 mips*-*-sysv4*)
1022 host_makefile_frag="config/mh-sysv4"
1024 mips*-*-sysv*)
1025 # This is for a MIPS running RISC/os 4.52C.
1027 # This is needed for GDB, but needs to be in the top-level make because
1028 # if a library is compiled with the bsd headers and gets linked with the
1029 # sysv system libraries all hell can break loose (e.g. a jmp_buf might be
1030 # a different size).
1031 # ptrace(2) apparently has problems in the BSD environment. No workaround is
1032 # known except to select the sysv environment. Could we use /proc instead?
1033 # These "sysv environments" and "bsd environments" often end up being a pain.
1035 # This is not part of CFLAGS because perhaps not all C compilers have this
1036 # option.
1037 tentative_cc="cc -systype sysv"
1038 host_makefile_frag="config/mh-riscos"
1040 i370-ibm-opened*)
1041 tentative_cc="c89"
1042 host_makefile_frag="config/mh-openedition"
1044 i[3456]86-*-sysv5*)
1045 host_makefile_frag="config/mh-sysv5"
1047 i[3456]86-*-dgux*)
1048 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1049 host_makefile_frag="config/mh-dgux386"
1051 i[3456]86-ncr-sysv4.3*)
1052 # The MetaWare compiler will generate a copyright message unless you
1053 # turn it off by adding the -Hnocopyr flag.
1054 tentative_cc="cc -Hnocopyr"
1055 host_makefile_frag="config/mh-ncrsvr43"
1057 i[3456]86-ncr-sysv4*)
1058 # for an NCR 3000 (i486/SVR4) system.
1059 # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
1060 # This compiler not only emits obnoxious copyright messages every time
1061 # you run it, but it chokes and dies on a whole bunch of GNU source
1062 # files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
1063 tentative_cc="/usr/ccs/ATT/cc"
1064 host_makefile_frag="config/mh-ncr3000"
1066 i[3456]86-*-sco3.2v5*)
1067 host_makefile_frag="config/mh-sysv"
1069 i[3456]86-*-sco*)
1070 # The native C compiler botches some simple uses of const. Unfortunately,
1071 # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
1072 tentative_cc="cc -Dconst="
1073 host_makefile_frag="config/mh-sco"
1075 i[3456]86-*-udk*)
1076 host_makefile_frag="config/mh-sysv5"
1078 i[3456]86-*-isc*)
1079 host_makefile_frag="config/mh-sysv"
1081 i[3456]86-*-solaris2*)
1082 host_makefile_frag="config/mh-sysv4"
1084 i[3456]86-*-aix*)
1085 host_makefile_frag="config/mh-aix386"
1087 i[3456]86-*-msdosdjgpp*)
1088 host_makefile_frag="config/mh-djgpp"
1090 *-cygwin*)
1091 host_makefile_frag="config/mh-cygwin"
1093 *-mingw32*)
1094 host_makefile_frag="config/mh-mingw32"
1096 *-interix*)
1097 host_makefile_frag="config/mh-interix"
1099 vax-*-ultrix2*)
1100 # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1101 tentative_cc=gcc
1103 *-*-solaris2*)
1104 host_makefile_frag="config/mh-solaris"
1106 m68k-sun-sunos*)
1107 # Sun's C compiler needs the -J flag to be able to compile cp-parse.c
1108 # without overflowing the jump tables (-J says to use a 32 bit table)
1109 tentative_cc="cc -J"
1111 *-hp-hpux[78]*)
1112 tentative_cc="cc -Wp,-H256000"
1113 host_makefile_frag="config/mh-hpux8"
1115 *-hp-hpux*)
1116 tentative_cc="cc -Wp,-H256000"
1117 host_makefile_frag="config/mh-hpux"
1119 *-*-hiux*)
1120 tentative_cc="cc -Wp,-H256000"
1121 host_makefile_frag="config/mh-hpux"
1123 rs6000-*-lynxos*)
1124 # /bin/cc is less than useful for our purposes. Always use GCC
1125 tentative_cc="/usr/cygnus/progressive/bin/gcc"
1126 host_makefile_frag="config/mh-lynxrs6k"
1128 *-*-lynxos*)
1129 # /bin/cc is less than useful for our purposes. Always use GCC
1130 tentative_cc="/bin/gcc"
1132 *-*-sysv4*)
1133 host_makefile_frag="config/mh-sysv4"
1135 *-*-sysv*)
1136 host_makefile_frag="config/mh-sysv"
1138 esac
1141 rm -f mh-frag
1142 if test -n "${host_makefile_frag}" ; then
1143 for f in ${host_makefile_frag}
1145 cat ${srcdir}/$f >> mh-frag
1146 done
1147 host_makefile_frag=mh-frag
1150 extra_arflags_for_target=
1151 extra_nmflags_for_target=
1152 case "${target}" in
1153 i[3456]86-*-netware*)
1154 target_makefile_frag="config/mt-netware"
1156 powerpc-*-netware*)
1157 target_makefile_frag="config/mt-netware"
1159 *-*-linux*)
1160 target_makefile_frag="config/mt-linux"
1162 *-*-aix4.[3456789]* | *-*-aix[56789].*)
1163 # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
1164 # commands to handle both 32-bit and 64-bit objects. These flags are
1165 # harmless if we're using GNU nm or ar.
1166 extra_arflags_for_target=" -X32_64"
1167 extra_nmflags_for_target=" -B -X32_64"
1169 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
1170 target_makefile_frag="config/mt-wince"
1172 esac
1174 alphaieee_frag=
1175 case $target in
1176 alpha*-*-*)
1177 # This just makes sure to use the -mieee option to build target libs.
1178 # This should probably be set individually by each library.
1179 alphaieee_frag="config/mt-alphaieee"
1181 esac
1183 # If --enable-target-optspace always use -Os instead of -O2 to build
1184 # the target libraries, similarly if it is not specified, use -Os
1185 # on selected platforms.
1186 ospace_frag=
1187 case "${enable_target_optspace}:${target}" in
1188 yes:*)
1189 ospace_frag="config/mt-ospace"
1191 :d30v-*)
1192 ospace_frag="config/mt-d30v"
1194 :m32r-* | :d10v-* | :fr30-*)
1195 ospace_frag="config/mt-ospace"
1197 no:* | :*)
1200 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
1202 esac
1204 rm -f mt-frag
1205 if test -n "${target_makefile_frag}${alphaieee_frag}${ospace_frag}" ; then
1206 for f in ${target_makefile_frag} ${alphaieee_frag} ${ospace_frag}
1208 cat ${srcdir}/$f >> mt-frag
1209 done
1210 target_makefile_frag=mt-frag
1213 # Set with_gnu_as and with_gnu_ld as appropriate.
1215 # This is done by determining whether or not the appropriate directory
1216 # is available, and by checking whether or not specific configurations
1217 # have requested that this magic not happen.
1219 # The command line options always override the explicit settings in
1220 # configure.in, and the settings in configure.in override this magic.
1222 # If the default for a toolchain is to use GNU as and ld, and you don't
1223 # want to do that, then you should use the --without-gnu-as and
1224 # --without-gnu-ld options for the configure script.
1226 if test x${use_gnu_as} = x &&
1227 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
1228 with_gnu_as=yes
1229 extra_host_args="$extra_host_args --with-gnu-as"
1232 if test x${use_gnu_ld} = x &&
1233 echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
1234 with_gnu_ld=yes
1235 extra_host_args="$extra_host_args --with-gnu-ld"
1238 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
1239 # can detect this case.
1241 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
1242 with_newlib=yes
1243 extra_host_args="$extra_host_args --with-newlib"
1246 # We default to --with-shared on platforms where -fpic is meaningless.
1247 # Well, we don't yet, but we will.
1248 if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then
1249 case "${target}" in
1250 alpha*-dec-osf*) enable_shared=yes ;;
1251 alpha*-*-linux*) enable_shared=yes ;;
1252 mips-sgi-irix5*) enable_shared=yes ;;
1253 *) enable_shared=no ;;
1254 esac
1257 case "${enable_shared}" in
1258 yes) shared=yes ;;
1259 no) shared=no ;;
1260 "") shared=no ;;
1261 *) shared=yes ;;
1262 esac
1265 # Default to using --with-stabs for certain targets.
1266 if test x${with_stabs} = x ; then
1267 case "${target}" in
1268 mips*-*-irix6*o32)
1269 with_stabs=yes;
1270 extra_host_args="${extra_host_args} --with-stabs"
1272 mips*-*-irix6*)
1274 mips*-*-* | alpha*-*-osf*)
1275 with_stabs=yes;
1276 extra_host_args="${extra_host_args} --with-stabs"
1278 esac
1281 # hpux11 in 64bit mode has libraries in a weird place. Arrange to find
1282 # them automatically.
1283 case "${host}" in
1284 hppa*64*-*-hpux11*)
1285 extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
1287 esac
1289 # This will go away when we start subconfigures from the Makefile.
1290 withoptions="${withoptions} ${extra_host_args}"
1292 # If we aren't going to be using gcc, see if we can extract a definition
1293 # of CC from the fragment.
1294 # Actually, use the 'pre-extracted' version above.
1295 if test -z "${CC}" && test "${build}" = "${host}" ; then
1296 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1297 found=
1298 for dir in $PATH; do
1299 test -z "$dir" && dir=.
1300 if test -f $dir/gcc; then
1301 found=yes
1302 break
1304 done
1305 IFS="$save_ifs"
1306 if test -z "${found}" && test -n "${tentative_cc}" ; then
1307 CC=$tentative_cc
1311 # post-target:
1313 # Make sure that the compiler is able to generate an executable. If it
1314 # can't, we are probably in trouble. We don't care whether we can run the
1315 # executable--we might be using a cross compiler--we only care whether it
1316 # can be created. At this point the main configure script has set CC.
1317 we_are_ok=no
1318 echo "int main () { return 0; }" > conftest.c
1319 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1320 if test $? = 0 ; then
1321 if test -s conftest || test -s conftest.exe ; then
1322 we_are_ok=yes
1325 case $we_are_ok in
1327 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1328 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1329 rm -f conftest*
1330 exit 1
1332 esac
1333 rm -f conftest*
1335 # The Solaris /usr/ucb/cc compiler does not appear to work.
1336 case "${host}" in
1337 sparc-sun-solaris2*)
1338 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1339 if test "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ; then
1340 could_use=
1341 test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
1342 if test -d /opt/cygnus/bin ; then
1343 if test "$could_use" = "" ; then
1344 could_use="/opt/cygnus/bin"
1345 else
1346 could_use="$could_use or /opt/cygnus/bin"
1349 if test "$could_use" = "" ; then
1350 echo "Warning: compilation may fail because you're using"
1351 echo "/usr/ucb/cc. You should change your PATH or CC "
1352 echo "variable and rerun configure."
1353 else
1354 echo "Warning: compilation may fail because you're using"
1355 echo "/usr/ucb/cc, when you should use the C compiler from"
1356 echo "$could_use. You should change your"
1357 echo "PATH or CC variable and rerun configure."
1361 esac
1363 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1364 # binutils tools will find libbfd.so.
1365 if test "${shared}" = "yes" ; then
1366 SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
1367 else
1368 SET_LIB_PATH=
1370 sed -e "s/@SET_LIB_PATH@/${SET_LIB_PATH}/" Makefile > Makefile.tem
1371 rm -f Makefile
1372 mv -f Makefile.tem Makefile
1375 case "${host}" in
1376 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
1377 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
1378 esac
1379 sed -e "s/@RPATH_ENVVAR@/${RPATH_ENVVAR}/" Makefile > Makefile.tem
1380 rm -f Makefile
1381 mv -f Makefile.tem Makefile
1383 # Record target_configdirs and the configure arguments for target and
1384 # build configuration in Makefile.
1385 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1387 # This is the final value for target_configdirs. configdirs already
1388 # has its final value. It's time to create some lists of valid targets.
1390 all_build_modules=
1391 configure_build_modules=
1392 # Only make build modules if build != host.
1393 # This should be done more generally, but at the moment it doesn't matter.
1394 if test ${host_alias} != ${build_alias} ; then
1395 all_build_modules=all-build-libiberty
1396 configure_build_modules=configure-build-libiberty
1399 all_host_modules=
1400 check_host_modules=
1401 install_host_modules=
1402 configure_host_modules=
1403 for module in ${configdirs} ; do
1404 all_host_modules="${all_host_modules} all-${module}"
1405 check_host_modules="${check_host_modules} check-${module}"
1406 install_host_modules="${install_host_modules} install-${module}"
1407 configure_host_modules="${configure_host_modules} configure-${module}"
1408 done
1409 install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
1411 all_target_modules=
1412 check_target_modules=
1413 install_target_modules=
1414 configure_target_modules=
1415 for module in ${target_configdirs} ; do
1416 all_target_modules="${all_target_modules} all-target-${module}"
1417 check_target_modules="${check_target_modules} check-target-${module}"
1418 install_target_modules="${install_target_modules} install-target-${module}"
1419 configure_target_modules="${configure_target_modules} configure-target-${module}"
1420 done
1422 # Determine whether gdb needs tk/tcl or not.
1423 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
1424 # and in that case we want gdb to be built without tk. Ugh!
1425 # In fact I believe gdb is the *only* package directly dependent on tk,
1426 # so we should be able to put the 'maybe's in unconditionally and
1427 # leave out the maybe dependencies when enable_gdbtk is false. I'm not
1428 # 100% sure that that's safe though.
1429 case "$enable_gdbtk" in
1431 GDB_TK="" ;;
1433 GDB_TK="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" ;;
1434 esac
1436 # Create the 'maybe dependencies'. This uses a temporary file.
1437 rm -f maybedep.tmp
1438 for item in ${all_build_modules} ${all_host_modules} ${all_target_modules} \
1439 ${install_host_modules} ${install_target_modules} \
1440 ${configure_build_modules} ${configure_host_modules} ${configure_target_modules} \
1441 ; do
1442 echo "maybe-${item}: ${item}" >> maybedep.tmp
1443 done
1444 sed -e '/@maybe_dependencies@/r maybedep.tmp' \
1445 -e 's/@maybe_dependencies@//' Makefile > Makefile.tem
1446 rm -f Makefile
1447 mv -f Makefile.tem Makefile
1448 rm -f maybedep.tmp
1450 # Create the serialization dependencies. This uses a temporary file.
1452 # These force 'configure's to be done one at a time, to avoid problems
1453 # with contention over a shared config.cache.
1454 rm -f serdep.tmp
1455 olditem=
1456 for item in ${build_configdirs} ; do
1457 case ${olditem} in
1458 "") ;;
1459 *) echo "\$(BUILD_SUBDIR)/${item}/Makefile: \$(BUILD_SUBDIR)/${olditem}/Makefile" >> serdep.tmp ;;
1460 esac
1461 olditem=${item}
1462 done
1463 olditem=
1464 for item in ${configdirs} ; do
1465 case ${olditem} in
1466 "") ;;
1467 *) echo "${item}/Makefile: ${olditem}/Makefile" >> serdep.tmp ;;
1468 esac
1469 olditem=${item}
1470 done
1471 olditem=
1472 for item in ${target_configdirs} ; do
1473 case ${olditem} in
1474 "") ;;
1475 *) echo "\$(TARGET_SUBDIR)/${item}/Makefile: \$(TARGET_SUBDIR)/${olditem}/Makefile" >> serdep.tmp ;;
1476 esac
1477 olditem=${item}
1478 done
1479 sed -e '/@serialization_dependencies@/r serdep.tmp' \
1480 -e 's/@serialization_dependencies@//' Makefile > Makefile.tem
1481 rm -f Makefile
1482 mv -f Makefile.tem Makefile
1483 rm -f serdep.tmp
1485 # Base args. Strip norecursion, cache-file, srcdir, host, build, target.
1486 # These are the ones we might not want to pass down to subconfigures.
1487 baseargs=`echo "${arguments}" | \
1488 sed -e 's/--no[^ ]*//' \
1489 -e 's/--cache[a-z-]*=[^ ]*//' \
1490 -e 's/--sr[a-z-]*=[^ ]*//' \
1491 -e 's/--ho[a-z-]*=[^ ]*//' \
1492 -e 's/--bu[a-z-]*=[^ ]*//' \
1493 -e 's/--ta[a-z-]*=[^ ]*//'`
1495 # For the build-side libraries, we just need to pretend we're native,
1496 # and not use the same cache file. Multilibs are neither needed nor
1497 # desired.
1498 buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
1500 # For host modules, accept cache file option, or specification as blank.
1501 case "${cache_file}" in
1502 "") # empty
1503 cache_file_option="" ;;
1504 /* | [A-Za-z]:[\\/]* ) # absolute path
1505 cache_file_option="--cache-file=${cache_file}" ;;
1506 *) # relative path
1507 cache_file_option="--cache-file=../${cache_file}" ;;
1508 esac
1510 hostargs="${cache_file_option} ${buildopt} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
1512 targargs=${baseargs}
1514 # Passing a --with-cross-host argument lets the target libraries know
1515 # whether they are being built with a cross-compiler or being built
1516 # native. However, it would be better to use other mechanisms to make the
1517 # sorts of decisions they want to make on this basis. Please consider
1518 # this option to be deprecated. FIXME.
1519 if test x${is_cross_compiler} = xyes ; then
1520 targargs="--with-cross-host=${host_alias} ${targargs}"
1523 # Default to --enable-multilib.
1524 if test x${enable_multilib} = x ; then
1525 targargs="--enable-multilib ${targargs}"
1528 # Pass --with-newlib if appropriate. Note that target_configdirs has
1529 # changed from the earlier setting of with_newlib.
1530 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
1531 targargs="--with-newlib ${targargs}"
1534 # Pass the appropriate --host, --build, and --cache-file arguments.
1535 targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
1537 # provide a proper gxx_include_dir.
1538 # Note, if you change the default, make sure to fix both here and in
1539 # the gcc and libstdc++-v3 subdirectories.
1540 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1541 gxx_include_dir=
1542 if test -n "${with_gxx_include_dir}"; then
1543 case "${with_gxx_include_dir}" in
1544 yes )
1545 echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
1546 exit 1
1548 no )
1551 gxx_include_dir=${with_gxx_include_dir}
1553 esac
1555 if test x${gxx_include_dir} = x; then
1556 if test x${enable_version_specific_runtime_libs} = xyes; then
1557 gxx_include_dir='${libsubdir}/include/c++'
1558 else
1559 . ${srcdir}/config.if
1560 gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
1562 else
1563 gxx_include_dir=${gxx_include_dir}
1566 FLAGS_FOR_TARGET=
1567 case " $target_configdirs " in
1568 *" newlib "*)
1569 case " $targargs " in
1570 *" --with-newlib "*)
1571 case "$target" in
1572 *-cygwin*)
1573 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' ;;
1574 esac
1576 # If we're not building GCC, don't discard standard headers.
1577 if test -d ${srcdir}/gcc; then
1578 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
1580 if test "${build}" != "${host}"; then
1581 # On Canadian crosses, CC_FOR_TARGET will have already been set
1582 # by `configure', so we won't have an opportunity to add -Bgcc/
1583 # to it. This is right: we don't want to search that directory
1584 # for binaries, but we want the header files in there, so add
1585 # them explicitly.
1586 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
1588 # Someone might think of using the pre-installed headers on
1589 # Canadian crosses, in case the installed compiler is not fully
1590 # compatible with the compiler being built. In this case, it
1591 # would be better to flag an error than risking having
1592 # incompatible object files being constructed. We can't
1593 # guarantee that an error will be flagged, but let's hope the
1594 # compiler will do it, when presented with incompatible header
1595 # files.
1599 case "${target}-${is_cross_compiler}" in
1600 i[3456]86-*-linux*-no)
1601 # Here host == target, so we don't need to build gcc,
1602 # so we don't want to discard standard headers.
1603 FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
1606 # If we're building newlib, use its generic headers last, but search
1607 # for any libc-related directories first (so make it the last -B
1608 # switch).
1609 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
1611 esac
1613 esac
1615 esac
1617 # On Canadian crosses, we'll be searching the right directories for
1618 # the previously-installed cross compiler, so don't bother to add
1619 # flags for directories within the install tree of the compiler
1620 # being built; programs in there won't even run.
1621 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
1622 # Search for pre-installed headers if nothing else fits.
1623 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
1626 if test "x${use_gnu_ld}" = x &&
1627 echo " ${configdirs} " | grep " ld " > /dev/null ; then
1628 # Arrange for us to find uninstalled linker scripts.
1629 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1632 if test "x${CC_FOR_TARGET+set}" = xset; then
1634 elif test -d ${srcdir}/gcc; then
1635 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
1636 elif test "$host" = "$target"; then
1637 CC_FOR_TARGET='$(CC)'
1638 else
1639 CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1641 # On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
1642 # if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated.
1643 case $CC_FOR_TARGET in
1644 *' $(FLAGS_FOR_TARGET)') ;;
1645 *) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1646 esac
1648 if test "x${GCJ_FOR_TARGET+set}" = xset; then
1650 elif test -d ${srcdir}/gcc; then
1651 GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
1652 elif test "$host" = "$target"; then
1653 GCJ_FOR_TARGET='gcj'
1654 else
1655 GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
1657 case $GCJ_FOR_TARGET in
1658 *' $(FLAGS_FOR_TARGET)') ;;
1659 *) GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1660 esac
1662 # Don't use libstdc++-v3's flags to configure/build itself.
1663 libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
1664 raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
1666 if test "x${CXX_FOR_TARGET+set}" = xset; then
1668 elif test -d ${srcdir}/gcc; then
1669 # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
1670 # of g++ for linking C++ or Java, because g++ has -shared-libgcc by
1671 # default whereas gcc does not.
1672 # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for
1673 # all other cases.
1674 CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
1675 RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags
1676 elif test "$host" = "$target"; then
1677 CXX_FOR_TARGET='$(CXX)'
1678 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
1679 else
1680 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
1681 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
1683 case $CXX_FOR_TARGET in
1684 *' $(FLAGS_FOR_TARGET)') ;;
1685 *) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1686 esac
1687 case $RAW_CXX_FOR_TARGET in
1688 *' $(FLAGS_FOR_TARGET)') ;;
1689 *) RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1690 esac
1692 qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
1693 qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
1695 # We want to defer the evaluation of `cmd`s and shell variables in
1696 # CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
1697 # bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
1698 # quotes, but we still have to duplicate `$'s so that shell variables
1699 # can be expanded by the nested make as shell variables, not as make
1700 # macros.
1701 qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
1702 qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
1704 # BASE_CC_FOR_TARGET is the actual program file of CC_FOR_TARGET,
1705 # for use in dependencies. Replace $$r with a relative
1706 # path if it's present.
1707 set dummy $CC_FOR_TARGET; cc_for_target_first_word=$2
1708 BASE_CC_FOR_TARGET=`echo "$cc_for_target_first_word" | sed -e 's,[$][$]r,.,'`
1710 sedtemp=sed.$$
1711 cat >$sedtemp <<EOF
1712 s%@GDB_TK@%${GDB_TK}%
1713 s%@configure_build_modules@%${configure_build_modules}%
1714 s%@all_build_modules@%${all_build_modules}%
1715 s%@configure_host_modules@%${configure_host_modules}%
1716 s%@all_host_modules@%${all_host_modules}%
1717 s%@check_host_modules@%${check_host_modules}%
1718 s%@install_host_modules@%${install_host_modules}%
1719 s%@install_host_modules_nogcc@%${install_host_modules_nogcc}%
1720 s%@configure_target_modules@%${configure_target_modules}%
1721 s%@all_target_modules@%${all_target_modules}%
1722 s%@check_target_modules@%${check_target_modules}%
1723 s%@install_target_modules@%${install_target_modules}%
1724 s:@target_configdirs@:${target_configdirs}:
1725 s%@target_configargs@%${targargs}%
1726 s%@FLAGS_FOR_TARGET@%${FLAGS_FOR_TARGET}%
1727 s%@CC_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}%
1728 s%@BASE_CC_FOR_TARGET@%${BASE_CC_FOR_TARGET}%
1729 s%@GCJ_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}%
1730 s%@CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}%
1731 s%@RAW_CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}%
1732 s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}%
1733 s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}%
1734 s%@target_subdir@%${target_subdir}%
1735 s%@build_subdir@%${build_subdir}%
1736 s%@build_prefix@%${build_prefix}%
1737 s%@build_configargs@%${buildargs}%
1738 s%@gxx_include_dir@%${gxx_include_dir}%
1739 s%@libstdcxx_incdir@%${libstdcxx_incdir}%
1740 s%@host_configargs@%${hostargs}%
1742 sed -f $sedtemp Makefile > Makefile.tem
1743 rm -f Makefile $sedtemp
1744 mv -f Makefile.tem Makefile