]> gcc.gnu.org Git - gcc.git/blame - configure.in
Makefile.tpl: Add @build_prefix@ before $(BUILD_SUBDIR).
[gcc.git] / configure.in
CommitLineData
6599da04
JM
1#! /bin/bash
2##############################################################################
3
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.
8
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.
13
14## For more information on these two systems, check out the documentation
15## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
16
e601f9e9 17# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
18b467f1 18# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
6599da04
JM
19#
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.
24#
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.
29#
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.
33
34##############################################################################
35
4977bab6
ZW
36extra_host_args=
37# Define the trigger file to make sure configure will re-run whenever
38# the gcc version number changes.
39if [ "${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/'`
42else
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* )
49 ;;
50 * )
51 # Add to all subconfigure arguments: build, host, and target.
52 arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments"
53 ;;
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"
57 fi
58fi
59
6599da04
JM
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
4977bab6
ZW
62### (library or tools, host or target), doing a dependency sort.
63
64# Subdirs will be configured in the order listed in build_configdirs,
65# configdirs, or target_configdirs; see the serialization section below.
66
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.
6599da04 70
4977bab6
ZW
71# Double entries in build_configdirs, configdirs, or target_configdirs may
72# cause circular dependencies and break everything horribly.
6599da04
JM
73
74# these libraries are used by various programs built for the host environment
75#
4977bab6 76host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk itcl tix libgui zlib"
6599da04 77
22fdd65e 78libstdcxx_version="target-libstdc++-v3"
17090313 79
6599da04
JM
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.
4977bab6
ZW
83# binutils, gas and ld appear in that order because it makes sense to run
84# "make check" in that particular order.
85host_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"
5d4a5ee6 86
7743113b
AG
87# libgcj represents the runtime libraries only used by gcj.
88libgcj="target-libffi \
89 target-boehm-gc \
90 target-zlib \
91 target-qthreads \
92 target-libjava"
93
6599da04
JM
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)
96#
5d4a5ee6
JL
97target_libs="target-libiberty \
98 target-libgloss \
99 target-newlib \
17090313 100 ${libstdcxx_version} \
5d4a5ee6 101 target-libf2c \
7743113b 102 ${libgcj}
5d4a5ee6 103 target-libobjc"
6599da04
JM
104
105# these tools are built using the target libs, and are intended to run only
106# in the target environment
107#
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
111#
40673d2b 112target_tools="target-examples target-groff target-gperf target-rda"
6599da04
JM
113
114################################################################################
115
6599da04
JM
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.
121#
122configdirs=`echo ${host_libs} ${host_tools}`
123target_configdirs=`echo ${target_libs} ${target_tools}`
124
125################################################################################
126
127srctrigger=move-if-change
128srcname="gnu development package"
129
130# This gets set non-empty for some net releases of packages.
131appdirs=""
132
133# per-host:
134
8bc2fff1
NN
135# There is no longer anything interesting in the per-host section.
136
137# per-target:
138
e1848dde
NN
139# Define is_cross_compiler to save on calls to 'test'.
140is_cross_compiler=
141if test x"${host}" = x"${target}" ; then
142 is_cross_compiler=no
143else
144 is_cross_compiler=yes
145fi
146
494933e4
JL
147# We always want to use the same name for this directory, so that dejagnu
148# can reliably find it.
149target_subdir=${target_alias}
f653f0ab 150
aeaa0f2f 151if test ! -d ${target_subdir} ; then
6599da04
JM
152 if mkdir ${target_subdir} ; then true
153 else
1e6347d8 154 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
6599da04
JM
155 exit 1
156 fi
157fi
158
e490616e
ZW
159build_subdir=${build_alias}
160
aeaa0f2f
NN
161if test x"${build_alias}" != x"${host}" ; then
162 if test ! -d ${build_subdir} ; then
e490616e
ZW
163 if mkdir ${build_subdir} ; then true
164 else
1e6347d8 165 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
e490616e
ZW
166 exit 1
167 fi
168 fi
169fi
170
782d0c02
L
171if test x"${target_subdir}" = x"${build_subdir}" ; then
172 build_prefix=build-
173fi
174
55380b08
NN
175# Skipdirs are removed silently.
176skipdirs=
177# Noconfigdirs are removed loudly.
178noconfigdirs=""
6599da04 179
55380b08
NN
180use_gnu_ld=
181# Make sure we don't let GNU ld be added if we didn't want it.
182if test x$with_gnu_ld = xno ; then
183 use_gnu_ld=no
184 noconfigdirs="$noconfigdirs ld"
6599da04
JM
185fi
186
55380b08
NN
187use_gnu_as=
188# Make sure we don't let GNU as be added if we didn't want it.
189if test x$with_gnu_as = xno ; then
190 use_gnu_as=no
191 noconfigdirs="$noconfigdirs gas"
6599da04
JM
192fi
193
55380b08
NN
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.
6599da04 196
55380b08
NN
197case ${with_x} in
198 yes | "") ;; # the default value for this tree is that X11 is available
423ce3eb
NN
199 no)
200 skipdirs="${skipdirs} tk tix itcl libgui"
201 # We won't be able to build gdbtk without X.
202 enable_gdbtk=no
203 ;;
55380b08
NN
204 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
205esac
6599da04 206
55380b08 207# Some tools are only suitable for building in a "native" situation.
95ddd785
NN
208# Remove these if host!=target.
209native_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"
210
211# Similarly, some are only suitable for cross toolchains.
212# Remove these if host=target.
213cross_only="target-libgloss target-newlib target-opcodes"
6599da04 214
55380b08
NN
215case $is_cross_compiler in
216 no) skipdirs="${skipdirs} ${cross_only}" ;;
217 yes) skipdirs="${skipdirs} ${native_only}" ;;
218esac
6599da04 219
0c639b89
DD
220# If both --with-headers and --with-libs are specified, default to
221# --without-newlib.
222if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
223 if test x"${with_newlib}" = x ; then
224 with_newlib=no
225 fi
226fi
227
228# Recognize --with-newlib/--without-newlib.
229case ${with_newlib} in
230 no) skipdirs="${skipdirs} target-newlib" ;;
231 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
232esac
233
6599da04
JM
234# Configure extra directories which are host specific
235
236case "${host}" in
55380b08 237 *-cygwin*)
4977bab6 238 configdirs="$configdirs libtermcap" ;;
6599da04
JM
239esac
240
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.
244
6599da04 245case "${host}" in
18a53ffe
JL
246 hppa*64*-*-*)
247 noconfigdirs="$noconfigdirs byacc"
248 ;;
6599da04 249 i[3456]86-*-vsta)
98186934 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"
6599da04
JM
251 ;;
252 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
98186934 253 noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi"
6599da04 254 ;;
d39cd7a1 255 i[3456]86-*-mingw32*)
98186934
NN
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"
d39cd7a1 258 ;;
0da3b5a7
RH
259 i[3456]86-*-beos*)
260 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
261 ;;
d207ebef 262 *-*-cygwin*)
98186934 263 noconfigdirs="autoconf automake send-pr rcs guile perl"
6599da04 264 ;;
5d4a5ee6
JL
265 *-*-netbsd*)
266 noconfigdirs="rcs"
267 ;;
6599da04 268 ppc*-*-pe)
98186934 269 noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv"
c135ea39 270 ;;
0da3b5a7
RH
271 powerpc-*-beos*)
272 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
273 ;;
743f054e
GK
274 *-*-darwin*)
275 noconfigdirs="$noconfigdirs tk itcl tix libgui"
276 ;;
6599da04
JM
277esac
278
8343765d
AO
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.
281libgcj_saved=$libgcj
282case $enable_libgcj in
283yes)
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=
288 ;;
289no)
290 # Make sure we get it printed in the list of not supported target libs.
291 noconfigdirs="$noconfigdirs ${libgcj}"
292 ;;
293esac
294
6599da04 295case "${target}" in
3fa03ff9
AG
296 *-*-chorusos)
297 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
298 ;;
ef98ad7b
LR
299 *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
300 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
301 ;;
51584787
JT
302 *-*-netbsd*)
303 # Skip some stuff on all NetBSD configurations.
fbf86afb 304 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
51584787
JT
305
306 # Skip some stuff that's unsupported on some NetBSD configurations.
307 case "${target}" in
320d7e7a 308 i*86-*-netbsdelf*) ;;
51584787
JT
309 *)
310 noconfigdirs="$noconfigdirs ${libgcj}"
311 ;;
312 esac
313 ;;
6599da04 314 *-*-netware)
ba3292db 315 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
6599da04 316 ;;
3fbc0b70 317 *-*-rtems*)
7743113b 318 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
9e847666
JS
319 case ${target} in
320 h8300*-*-* | h8500-*-*)
321 noconfigdirs="$noconfigdirs target-libf2c"
322 ;;
323 *) ;;
324 esac
3fbc0b70 325 ;;
6599da04 326 *-*-vxworks*)
7743113b 327 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
6599da04 328 ;;
b104e095 329 alpha*-dec-osf*)
603606e7
NN
330 # ld works, but does not support shared libraries.
331 # newlib is not 64 bit ready. I'm not sure about fileutils.
6599da04 332 # gas doesn't generate exception information.
603606e7 333 noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
6599da04
JM
334 ;;
335 alpha*-*-*vms*)
7743113b 336 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
6599da04 337 ;;
9e9af119
MH
338 alpha*-*-linux*)
339 # newlib is not 64 bit ready
d340e0ac 340 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
9e9af119 341 ;;
ef98ad7b
LR
342 alpha*-*-freebsd*)
343 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
344 ;;
6599da04
JM
345 alpha*-*-*)
346 # newlib is not 64 bit ready
7743113b 347 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
6599da04 348 ;;
53b475f0
AH
349 sh-*-linux*)
350 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
53b475f0 351 ;;
3a685f6f 352 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
7743113b
AG
353 noconfigdirs="$noconfigdirs ${libgcj}"
354 noconfigdirs="$noconfigdirs target-examples"
d207ebef 355 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
3a685f6f
NC
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
d207ebef 359 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
fbf86afb 360 noconfigdirs="$noconfigdirs target-newlib"
3a685f6f
NC
361 case "${host}" in
362 *-*-cygwin*) ;; # keep gdb and readline
d207ebef 363 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
3a685f6f
NC
364 ;;
365 esac
366 ;;
d207ebef 367 arc-*-*)
7743113b 368 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d207ebef 369 ;;
5831424e
RE
370 arm-*-coff | strongarm-*-coff | xscale-*-coff)
371 noconfigdirs="$noconfigdirs ${libgcj}"
372 ;;
373 arm-*-elf* | strongarm-*-elf* | xscale-*-elf*)
374 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
375 ;;
6599da04 376 arm-*-pe*)
7743113b 377 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
6599da04 378 ;;
bbd8fa7f 379 arm-*-oabi*)
7743113b 380 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
bbd8fa7f 381 ;;
e98e406f 382 thumb-*-coff)
7743113b 383 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
e98e406f 384 ;;
d207ebef 385 thumb-*-elf)
7743113b 386 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d207ebef
JM
387 ;;
388 thumb-*-oabi)
7743113b 389 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d207ebef 390 ;;
d207ebef 391 thumb-*-pe)
7743113b 392 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d207ebef 393 ;;
5d4a5ee6 394 arm-*-riscix*)
7743113b 395 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
5d4a5ee6 396 ;;
6ff14f32
MM
397 avr-*-*)
398 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
399 ;;
a5a438f5 400 c4x-*-* | tic4x-*-*)
ba3292db 401 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
ab50d72b
DD
402 ;;
403 c54x*-*-* | tic54x-*-*)
404 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
405 ;;
f48a3b5c
HPN
406 cris-*-*)
407 noconfigdirs="$noconfigdirs ${libgcj}"
408 ;;
6599da04 409 d10v-*-*)
ba3292db 410 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
d207ebef
JM
411 ;;
412 d30v-*-*)
b1bb2302 413 noconfigdirs="$noconfigdirs ${libgcj}"
6599da04 414 ;;
09b5f8bf 415 fr30-*-elf*)
b1bb2302 416 noconfigdirs="$noconfigdirs ${libgcj}"
09b5f8bf 417 ;;
ee777171
DB
418 frv-*-*)
419 noconfigdirs="$noconfigdirs ${libgcj}"
ee777171 420 ;;
ab50d72b
DD
421 h8300*-*-*)
422 noconfigdirs="$noconfigdirs target-libgloss"
423 ;;
6599da04 424 h8500-*-*)
ba3292db 425 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
6599da04 426 ;;
cdbff0ab
AM
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"
432 ;;
6599da04 433 hppa*-*-*elf* | \
cdbff0ab 434 parisc*-*-linux* | hppa*-*-linux* | \
bae29210 435 hppa*-*-lites* | \
66350331 436 hppa*-*-openbsd* | \
bae29210 437 hppa*64*-*-*)
b1bb2302 438 noconfigdirs="$noconfigdirs ${libgcj}"
6599da04
JM
439 # Do configure ld/binutils/gas for this case.
440 ;;
441 hppa*-*-*)
b2964d63
AO
442 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
443 # build on HP-UX 10.20.
444 noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
d207ebef
JM
445 ;;
446 ia64*-*-elf*)
447 # No gdb support yet.
448 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
449 ;;
ab50d72b
DD
450 ia64*-**-hpux*)
451 # No gdb or ld support yet.
452 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld"
453 ;;
d207ebef 454 i[3456]86-*-coff | i[3456]86-*-elf)
a393bca0 455 noconfigdirs="$noconfigdirs ${libgcj}"
6599da04 456 ;;
ef98ad7b
LR
457 i[34567]86-*-freebsd*)
458 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
459 ;;
9a06dc7d 460 i[3456]86-*-linux*)
d0af82b0
HPN
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
467
9a06dc7d
TF
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"
472 fi
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.
9a06dc7d 478 ;;
d39cd7a1
MK
479 i[3456]86-*-mingw32*)
480 target_configdirs="$target_configdirs target-mingw"
ca3667c4 481 noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
d39cd7a1 482
5d4a5ee6 483 # Can't build gdb for mingw32 if not native.
d39cd7a1
MK
484 case "${host}" in
485 i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
5d4a5ee6 486 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
d39cd7a1
MK
487 ;;
488 esac
489 ;;
d207ebef
JM
490 *-*-cygwin*)
491 target_configdirs="$target_configdirs target-libtermcap target-winsup"
ca3667c4 492 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
6599da04
JM
493 # always build newlib.
494 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
495
d207ebef 496 # Can't build gdb for Cygwin if not native.
6599da04 497 case "${host}" in
d207ebef 498 *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
5d4a5ee6 499 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
6599da04
JM
500 ;;
501 esac
502 ;;
503 i[3456]86-*-pe)
ba3292db 504 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
6599da04
JM
505 ;;
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.
7743113b 509 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
6599da04
JM
510 ;;
511 i[3456]86-*-sco*)
7743113b 512 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
6599da04
JM
513 ;;
514 i[3456]86-*-solaris2*)
7c01b2b5 515 noconfigdirs="$noconfigdirs target-libgloss"
6599da04
JM
516 ;;
517 i[3456]86-*-sysv4*)
603606e7 518 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
6599da04 519 ;;
0da3b5a7 520 i[3456]86-*-beos*)
ca3667c4 521 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
0da3b5a7 522 ;;
2b997990
SC
523 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
524 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
525 ;;
d207ebef 526 m68k-*-elf*)
a393bca0 527 noconfigdirs="$noconfigdirs ${libgcj}"
d207ebef
JM
528 ;;
529 m68k-*-coff*)
a393bca0 530 noconfigdirs="$noconfigdirs ${libgcj}"
d207ebef 531 ;;
56ae9405
NC
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"
536 ;;
d344dce9 537 mmix-*-*)
d8437e1b 538 noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss"
d344dce9 539 ;;
6599da04 540 mn10200-*-*)
7743113b 541 noconfigdirs="$noconfigdirs ${libgcj}"
6599da04
JM
542 ;;
543 mn10300-*-*)
7743113b 544 noconfigdirs="$noconfigdirs ${libgcj}"
6599da04
JM
545 ;;
546 powerpc-*-aix*)
547 # copied from rs6000-*-* entry
98186934 548 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
6599da04
JM
549 ;;
550 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
551 target_configdirs="$target_configdirs target-winsup"
7743113b 552 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
6599da04
JM
553 # always build newlib.
554 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
555 ;;
556 # This is temporary until we can link against shared libraries
557 powerpcle-*-solaris*)
7743113b 558 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
6599da04 559 ;;
0da3b5a7 560 powerpc-*-beos*)
7743113b 561 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
0da3b5a7 562 ;;
b7f3b15b 563 powerpc-*-darwin*)
743f054e 564 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
b7f3b15b 565 ;;
d207ebef 566 powerpc-*-eabi)
b1bb2302 567 noconfigdirs="$noconfigdirs ${libgcj}"
d207ebef 568 ;;
c01d477a
AM
569 powerpc64*-*-linux*)
570 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
571 # not yet ported.
572 noconfigdirs="$noconfigdirs target-libffi"
573 ;;
6599da04 574 rs6000-*-lynxos*)
98186934 575 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
6599da04
JM
576 ;;
577 rs6000-*-aix*)
ab50d72b 578 noconfigdirs="$noconfigdirs gprof ${libgcj}"
6599da04
JM
579 ;;
580 rs6000-*-*)
7743113b 581 noconfigdirs="$noconfigdirs gprof ${libgcj}"
6599da04
JM
582 ;;
583 m68k-apollo-*)
7743113b 584 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
6599da04
JM
585 ;;
586 mips*-*-irix5*)
587 # The GNU linker does not support shared libraries.
603606e7 588 noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
6599da04
JM
589 ;;
590 mips*-*-irix6*)
d207ebef 591 # The GNU assembler does not support IRIX 6.
b2964d63
AO
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>
603606e7 596 noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
6599da04
JM
597 ;;
598 mips*-dec-bsd*)
7743113b 599 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
6599da04
JM
600 ;;
601 mips*-*-bsd*)
7743113b 602 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
6599da04 603 ;;
5d4a5ee6 604 mipstx39-*-*)
7743113b 605 noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
5d4a5ee6 606 ;;
9bec4bf0 607 mips*-*-linux*)
c01d477a 608 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
9bec4bf0 609 ;;
6599da04 610 mips*-*-*)
7743113b 611 noconfigdirs="$noconfigdirs gprof ${libgcj}"
6599da04
JM
612 ;;
613 romp-*-*)
7743113b 614 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
6599da04
JM
615 ;;
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
7743113b 623 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
6599da04 624 ;;
40fe0ec3
AO
625 sh64-*-*)
626 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
627 ;;
5d4a5ee6 628 sparc-*-elf*)
9e847666 629 noconfigdirs="$noconfigdirs ${libgcj}"
5d4a5ee6
JL
630 ;;
631 sparc64-*-elf*)
9e847666 632 noconfigdirs="$noconfigdirs ${libgcj}"
5d4a5ee6 633 ;;
d207ebef 634 sparclite-*-*)
b1bb2302 635 noconfigdirs="$noconfigdirs ${libgcj}"
5d4a5ee6 636 ;;
6599da04 637 sparc-*-sunos4*)
a393bca0 638 noconfigdirs="$noconfigdirs ${libgcj}"
aeaa0f2f 639 if test x${is_cross_compiler} != xno ; then
e1da1089 640 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
6599da04
JM
641 else
642 use_gnu_ld=no
643 fi
644 ;;
b7c13625 645 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
1ace7e15 646 ;;
6599da04 647 v810-*-*)
4d88a68a 648 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
6599da04 649 ;;
5d4a5ee6 650 v850-*-*)
7743113b 651 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
5d4a5ee6 652 ;;
d207ebef 653 v850e-*-*)
7743113b 654 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d207ebef
JM
655 ;;
656 v850ea-*-*)
7743113b 657 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d207ebef 658 ;;
6599da04 659 vax-*-vms)
7743113b 660 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
6599da04
JM
661 ;;
662 vax-*-*)
7743113b 663 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
6599da04 664 ;;
b03bcd37
DC
665 ip2k-*-*)
666 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
667 ;;
c01d477a
AM
668 *-*-linux*)
669 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
670 ;;
6599da04 671 *-*-lynxos*)
7743113b 672 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
6599da04 673 ;;
41dfe3a2 674 *-*-*)
a393bca0 675 noconfigdirs="$noconfigdirs ${libgcj}"
41dfe3a2 676 ;;
6599da04
JM
677esac
678
6599da04
JM
679# If we aren't building newlib, then don't build libgloss, since libgloss
680# depends upon some newlib header files.
681case "${noconfigdirs}" in
682 *target-libgloss*) ;;
683 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
55380b08 684esac
6599da04 685
2a50f859
AO
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.
132e4bd7 690# NB: embedded tabs in this IF block -- do not untabify
2a50f859
AO
691if test x"${enable_languages+set}" != xset; then
692 if test x"${LANGUAGES+set}" = xset; then
132e4bd7
PE
693 enable_languages="${LANGUAGES}"
694 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
2a50f859
AO
695 else
696 enable_languages=all
697 fi
698else
132e4bd7
PE
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
2a50f859
AO
703 exit 1
704 fi
705fi
132e4bd7 706enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
6a556ad6
TT
707
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.
711for lang in ${srcdir}/gcc/*/config-lang.in ..
712do
713 case $lang in
714 ..)
715 ;;
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)
719 ;;
720 *)
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
724 do
725 case ,${enable_languages}, in
726 *,$other,*)
727 ;;
728 *,all,*)
729 ;;
4698d2cf 730 *,$lang_alias,*)
6a556ad6
TT
731 echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
732 enable_languages="$enable_languages,$other"
733 ;;
734 esac
735 done
736 ;;
737 esac
738done
739
2a50f859
AO
740subdirs=
741for lang in ${srcdir}/gcc/*/config-lang.in ..
742do
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) ;;
748 *)
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`
3896f13e 751 this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
2a50f859
AO
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
757 fi
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
3896f13e 767 eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
2a50f859
AO
768 fi
769 ;;
770 esac
771done
772
6599da04
JM
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.
776
777notsupp=""
778for dir in . $skipdirs $noconfigdirs ; do
779 dirname=`echo $dir | sed -e s/target-//g`
aeaa0f2f 780 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
6599da04 781 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
95ddd785 782 if test -r $srcdir/$dirname/configure ; then
6599da04
JM
783 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
784 true
785 else
786 notsupp="$notsupp $dir"
787 fi
788 fi
789 fi
aeaa0f2f 790 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
6599da04 791 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
95ddd785 792 if test -r $srcdir/$dirname/configure ; then
6599da04
JM
793 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
794 true
795 else
796 notsupp="$notsupp $dir"
797 fi
798 fi
799 fi
800done
801
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.
aeaa0f2f 804if test -n "${target_configdirs}" ; then
6599da04
JM
805 others=
806 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
aeaa0f2f 807 if test "$i" != "libiberty" ; then
95ddd785 808 if test -r $srcdir/$i/configure ; then
6599da04
JM
809 others=yes;
810 break;
811 fi
812 fi
813 done
aeaa0f2f 814 if test -z "${others}" ; then
6599da04
JM
815 target_configdirs=
816 fi
817fi
818
55380b08
NN
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.
822if 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
826fi
827if 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
831fi
832
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.
836configdirs_all="$configdirs"
837configdirs=
838for i in ${configdirs_all} ; do
839 if test -f ${srcdir}/$i/configure ; then
840 configdirs="${configdirs} $i"
841 fi
842done
843target_configdirs_all="$target_configdirs"
844target_configdirs=
845for 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"
849 fi
850done
851
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.
856
857if 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
868 fi
869 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
870 appdirs=""
871 break
872 fi
873 fi
874 done
875 if test -n "$appdirs" ; then
876 echo "*** This configuration is not supported by this package." 1>&2
877 exit 1
878 fi
879 fi
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
885fi
886
887case "$host" in
888 *msdosdjgpp*)
889 enable_gdbtk=no ;;
890esac
55380b08
NN
891
892copy_dirs=
893
65a824f6
JT
894# Handle --with-headers=XXX. If the value is not "yes", the contents of
895# the named directory are copied to $(tooldir)/sys-include.
55380b08
NN
896if 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
900 fi
65a824f6
JT
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"
907 fi
55380b08
NN
908fi
909
65a824f6
JT
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.
55380b08
NN
913if 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
917 fi
65a824f6
JT
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
928 fi
55380b08
NN
929fi
930
931# Handle ${copy_dirs}
932set fnord ${copy_dirs}
933shift
934while test $# != 0 ; do
935 if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
936 :
937 else
938 echo Copying $1 to $2
939
940 # Use the install script to create the directory and all required
941 # parent directories.
942 if test -d $2 ; then
943 :
944 else
945 echo >config.temp
946 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
947 fi
948
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 -)
952
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.
956
957 echo $1 > $2/COPIED
958 fi
959 shift; shift
960done
961
962# Work in distributions that contain no compiler tools, like Autoconf.
963tentative_cc=""
964if test -d ${srcdir}/config ; then
965case "${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"
970 ;;
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"
974 ;;
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"
984 ;;
985 m88k-dg-dgux*)
986 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
987 host_makefile_frag="config/mh-dgux"
988 ;;
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"
993 ;;
994 m88k-motorola-sysv*)
995 host_makefile_frag="config/mh-delta88"
996 ;;
997 mips*-dec-ultrix*)
998 tentative_cc="cc -Wf,-XNg1000"
999 host_makefile_frag="config/mh-decstation"
1000 ;;
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"
1005 ;;
1006 mips*-sgi-irix6*)
1007 host_makefile_frag="config/mh-irix6"
1008 ;;
1009 mips*-sgi-irix5*)
1010 host_makefile_frag="config/mh-irix5"
1011 ;;
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"
1017 ;;
1018 mips*-sgi-irix3*)
1019 host_makefile_frag="config/mh-sysv"
1020 ;;
1021 mips*-*-sysv4*)
1022 host_makefile_frag="config/mh-sysv4"
1023 ;;
1024 mips*-*-sysv*)
1025 # This is for a MIPS running RISC/os 4.52C.
1026
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.
1034 #
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"
1039 ;;
1040 i370-ibm-opened*)
1041 tentative_cc="c89"
1042 host_makefile_frag="config/mh-openedition"
1043 ;;
1044 i[3456]86-*-sysv5*)
1045 host_makefile_frag="config/mh-sysv5"
1046 ;;
1047 i[3456]86-*-dgux*)
1048 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1049 host_makefile_frag="config/mh-dgux386"
1050 ;;
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"
1056 ;;
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"
1065 ;;
1066 i[3456]86-*-sco3.2v5*)
1067 host_makefile_frag="config/mh-sysv"
1068 ;;
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"
1074 ;;
1075 i[3456]86-*-udk*)
1076 host_makefile_frag="config/mh-sysv5"
1077 ;;
1078 i[3456]86-*-isc*)
1079 host_makefile_frag="config/mh-sysv"
1080 ;;
1081 i[3456]86-*-solaris2*)
1082 host_makefile_frag="config/mh-sysv4"
1083 ;;
1084 i[3456]86-*-aix*)
1085 host_makefile_frag="config/mh-aix386"
1086 ;;
1087 i[3456]86-*-msdosdjgpp*)
1088 host_makefile_frag="config/mh-djgpp"
1089 ;;
1090 *-cygwin*)
1091 host_makefile_frag="config/mh-cygwin"
1092 ;;
1093 *-mingw32*)
1094 host_makefile_frag="config/mh-mingw32"
1095 ;;
1096 *-interix*)
1097 host_makefile_frag="config/mh-interix"
1098 ;;
1099 vax-*-ultrix2*)
1100 # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1101 tentative_cc=gcc
1102 ;;
1103 *-*-solaris2*)
1104 host_makefile_frag="config/mh-solaris"
1105 ;;
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"
1110 ;;
1111 *-hp-hpux[78]*)
1112 tentative_cc="cc -Wp,-H256000"
1113 host_makefile_frag="config/mh-hpux8"
1114 ;;
1115 *-hp-hpux*)
1116 tentative_cc="cc -Wp,-H256000"
1117 host_makefile_frag="config/mh-hpux"
1118 ;;
1119 *-*-hiux*)
1120 tentative_cc="cc -Wp,-H256000"
1121 host_makefile_frag="config/mh-hpux"
1122 ;;
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"
1127 ;;
1128 *-*-lynxos*)
1129 # /bin/cc is less than useful for our purposes. Always use GCC
1130 tentative_cc="/bin/gcc"
1131 ;;
1132 *-*-sysv4*)
1133 host_makefile_frag="config/mh-sysv4"
1134 ;;
1135 *-*-sysv*)
1136 host_makefile_frag="config/mh-sysv"
1137 ;;
1138esac
1139fi
1140
1141rm -f mh-frag
1142if test -n "${host_makefile_frag}" ; then
1143 for f in ${host_makefile_frag}
1144 do
1145 cat ${srcdir}/$f >> mh-frag
6599da04 1146 done
55380b08 1147 host_makefile_frag=mh-frag
6599da04 1148fi
55380b08 1149
4977bab6
ZW
1150extra_arflags_for_target=
1151extra_nmflags_for_target=
55380b08 1152case "${target}" in
55380b08 1153 i[3456]86-*-netware*)
c3b7d169 1154 target_makefile_frag="config/mt-netware"
55380b08
NN
1155 ;;
1156 powerpc-*-netware*)
c3b7d169 1157 target_makefile_frag="config/mt-netware"
55380b08
NN
1158 ;;
1159 *-*-linux*)
c3b7d169 1160 target_makefile_frag="config/mt-linux"
55380b08
NN
1161 ;;
1162 *-*-aix4.[3456789]* | *-*-aix[56789].*)
4977bab6
ZW
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"
55380b08
NN
1168 ;;
1169 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
c3b7d169
NN
1170 target_makefile_frag="config/mt-wince"
1171 ;;
1172esac
1173
1174alphaieee_frag=
1175case $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"
55380b08
NN
1180 ;;
1181esac
701afd4d 1182
55380b08
NN
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.
c3b7d169 1186ospace_frag=
55380b08
NN
1187case "${enable_target_optspace}:${target}" in
1188 yes:*)
c3b7d169 1189 ospace_frag="config/mt-ospace"
55380b08
NN
1190 ;;
1191 :d30v-*)
c3b7d169 1192 ospace_frag="config/mt-d30v"
55380b08
NN
1193 ;;
1194 :m32r-* | :d10v-* | :fr30-*)
c3b7d169 1195 ospace_frag="config/mt-ospace"
55380b08
NN
1196 ;;
1197 no:* | :*)
1198 ;;
1199 *)
1200 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
1201 ;;
1202esac
6599da04 1203
55380b08 1204rm -f mt-frag
c3b7d169
NN
1205if test -n "${target_makefile_frag}${alphaieee_frag}${ospace_frag}" ; then
1206 for f in ${target_makefile_frag} ${alphaieee_frag} ${ospace_frag}
55380b08
NN
1207 do
1208 cat ${srcdir}/$f >> mt-frag
1209 done
1210 target_makefile_frag=mt-frag
6599da04
JM
1211fi
1212
1213# Set with_gnu_as and with_gnu_ld as appropriate.
1214#
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.
1218#
1219# The command line options always override the explicit settings in
1220# configure.in, and the settings in configure.in override this magic.
1221#
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.
1225
55380b08
NN
1226if test x${use_gnu_as} = x &&
1227 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
1228 with_gnu_as=yes
4977bab6 1229 extra_host_args="$extra_host_args --with-gnu-as"
6599da04
JM
1230fi
1231
55380b08
NN
1232if test x${use_gnu_ld} = x &&
1233 echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
1234 with_gnu_ld=yes
4977bab6 1235 extra_host_args="$extra_host_args --with-gnu-ld"
6599da04
JM
1236fi
1237
4977bab6 1238# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
6599da04
JM
1239# can detect this case.
1240
55380b08 1241if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
6599da04 1242 with_newlib=yes
4977bab6 1243 extra_host_args="$extra_host_args --with-newlib"
6599da04
JM
1244fi
1245
55380b08
NN
1246# We default to --with-shared on platforms where -fpic is meaningless.
1247# Well, we don't yet, but we will.
1248if 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
e2de3a46
L
1255fi
1256
55380b08
NN
1257case "${enable_shared}" in
1258 yes) shared=yes ;;
1259 no) shared=no ;;
1260 "") shared=no ;;
1261 *) shared=yes ;;
6cdef75d 1262esac
55380b08
NN
1263
1264
1265# Default to using --with-stabs for certain targets.
1266if test x${with_stabs} = x ; then
1267 case "${target}" in
789b7de5
RO
1268 mips*-*-irix6*o32)
1269 with_stabs=yes;
4977bab6 1270 extra_host_args="${extra_host_args} --with-stabs"
789b7de5 1271 ;;
55380b08
NN
1272 mips*-*-irix6*)
1273 ;;
1274 mips*-*-* | alpha*-*-osf*)
1275 with_stabs=yes;
4977bab6 1276 extra_host_args="${extra_host_args} --with-stabs"
55380b08
NN
1277 ;;
1278 esac
1279fi
1280
1281# hpux11 in 64bit mode has libraries in a weird place. Arrange to find
1282# them automatically.
1283case "${host}" in
1284 hppa*64*-*-hpux11*)
4977bab6 1285 extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
55380b08 1286 ;;
6cdef75d
NN
1287esac
1288
4977bab6
ZW
1289# This will go away when we start subconfigures from the Makefile.
1290withoptions="${withoptions} ${extra_host_args}"
1291
8f89dbf4
NN
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.
1295if 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
1303 fi
1304 done
1305 IFS="$save_ifs"
1306 if test -z "${found}" && test -n "${tentative_cc}" ; then
1307 CC=$tentative_cc
1308 fi
1309fi
1310
6599da04
JM
1311# post-target:
1312
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.
aeaa0f2f 1317we_are_ok=no
6599da04
JM
1318echo "int main () { return 0; }" > conftest.c
1319${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
aeaa0f2f
NN
1320if test $? = 0 ; then
1321 if test -s conftest || test -s conftest.exe ; then
1322 we_are_ok=yes
1323 fi
1324fi
1325case $we_are_ok in
1326 no)
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
1331 ;;
1332esac
6599da04
JM
1333rm -f conftest*
1334
1335# The Solaris /usr/ucb/cc compiler does not appear to work.
1336case "${host}" in
1337 sparc-sun-solaris2*)
1338 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
aeaa0f2f 1339 if test "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ; then
6599da04 1340 could_use=
aeaa0f2f
NN
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
6599da04
JM
1344 could_use="/opt/cygnus/bin"
1345 else
1346 could_use="$could_use or /opt/cygnus/bin"
1347 fi
1348 fi
aeaa0f2f 1349 if test "$could_use" = "" ; then
6599da04
JM
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."
1358 fi
1359 fi
1360 ;;
1361esac
1362
1363# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1364# binutils tools will find libbfd.so.
aeaa0f2f 1365if test "${shared}" = "yes" ; then
aba8a494
NN
1366 SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
1367else
1368 SET_LIB_PATH=
6599da04 1369fi
aba8a494
NN
1370sed -e "s/@SET_LIB_PATH@/${SET_LIB_PATH}/" Makefile > Makefile.tem
1371rm -f Makefile
1372mv -f Makefile.tem Makefile
6599da04 1373
fe3d5b7f
NN
1374
1375case "${host}" in
1376 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
1377 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
1378esac
1379sed -e "s/@RPATH_ENVVAR@/${RPATH_ENVVAR}/" Makefile > Makefile.tem
1380rm -f Makefile
1381mv -f Makefile.tem Makefile
1382
4977bab6
ZW
1383# Record target_configdirs and the configure arguments for target and
1384# build configuration in Makefile.
1385target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1386
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.
1389
1390all_build_modules=
1391configure_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.
1394if test ${host_alias} != ${build_alias} ; then
1395 all_build_modules=all-build-libiberty
1396 configure_build_modules=configure-build-libiberty
1397fi
1398
1399all_host_modules=
1400check_host_modules=
1401install_host_modules=
1402configure_host_modules=
1403for 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}"
1408done
1409install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
1410
1411all_target_modules=
1412check_target_modules=
1413install_target_modules=
1414configure_target_modules=
1415for 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}"
1420done
1421
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.
1429case "$enable_gdbtk" in
1430 no)
1431 GDB_TK="" ;;
1432 *)
1433 GDB_TK="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" ;;
1434esac
1435
1436# Create the 'maybe dependencies'. This uses a temporary file.
1437rm -f maybedep.tmp
1438for 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
1443done
1444sed -e '/@maybe_dependencies@/r maybedep.tmp' \
1445 -e 's/@maybe_dependencies@//' Makefile > Makefile.tem
1446rm -f Makefile
1447mv -f Makefile.tem Makefile
1448rm -f maybedep.tmp
1449
1450# Create the serialization dependencies. This uses a temporary file.
1451
1452# These force 'configure's to be done one at a time, to avoid problems
1453# with contention over a shared config.cache.
1454rm -f serdep.tmp
1455olditem=
1456for 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}
1462done
1463olditem=
1464for item in ${configdirs} ; do
1465 case ${olditem} in
1466 "") ;;
1467 *) echo "${item}/Makefile: ${olditem}/Makefile" >> serdep.tmp ;;
1468 esac
1469 olditem=${item}
1470done
1471olditem=
1472for 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}
1478done
1479sed -e '/@serialization_dependencies@/r serdep.tmp' \
1480 -e 's/@serialization_dependencies@//' Makefile > Makefile.tem
1481rm -f Makefile
1482mv -f Makefile.tem Makefile
1483rm -f serdep.tmp
fe3d5b7f 1484
e254d6b5
NN
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.
1487baseargs=`echo "${arguments}" | \
5d4a5ee6 1488 sed -e 's/--no[^ ]*//' \
6599da04 1489 -e 's/--cache[a-z-]*=[^ ]*//' \
e254d6b5 1490 -e 's/--sr[a-z-]*=[^ ]*//' \
6599da04
JM
1491 -e 's/--ho[a-z-]*=[^ ]*//' \
1492 -e 's/--bu[a-z-]*=[^ ]*//' \
1493 -e 's/--ta[a-z-]*=[^ ]*//'`
1494
e490616e
ZW
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.
e254d6b5
NN
1498buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
1499
4977bab6
ZW
1500# For host modules, accept cache file option, or specification as blank.
1501case "${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}" ;;
1508esac
1509
1510hostargs="${cache_file_option} ${buildopt} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
1511
e254d6b5 1512targargs=${baseargs}
e490616e 1513
6599da04
JM
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.
aeaa0f2f 1519if test x${is_cross_compiler} = xyes ; then
6599da04
JM
1520 targargs="--with-cross-host=${host_alias} ${targargs}"
1521fi
1522
1523# Default to --enable-multilib.
aeaa0f2f 1524if test x${enable_multilib} = x ; then
6599da04
JM
1525 targargs="--enable-multilib ${targargs}"
1526fi
1527
5d4a5ee6
JL
1528# Pass --with-newlib if appropriate. Note that target_configdirs has
1529# changed from the earlier setting of with_newlib.
aeaa0f2f 1530if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
5d4a5ee6
JL
1531 targargs="--with-newlib ${targargs}"
1532fi
1533
e490616e
ZW
1534# Pass the appropriate --host, --build, and --cache-file arguments.
1535targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
1536
88101ab9
L
1537# provide a proper gxx_include_dir.
1538# Note, if you change the default, make sure to fix both here and in
4d88a68a 1539# the gcc and libstdc++-v3 subdirectories.
88101ab9
L
1540# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1541gxx_include_dir=
1542if 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
1547 ;;
1548 no )
1549 ;;
1550 * )
1551 gxx_include_dir=${with_gxx_include_dir}
1552 ;;
1553 esac
1554fi
1555if test x${gxx_include_dir} = x; then
1556 if test x${enable_version_specific_runtime_libs} = xyes; then
57c905fa 1557 gxx_include_dir='${libsubdir}/include/c++'
88101ab9 1558 else
ef40bc65 1559 . ${srcdir}/config.if
cc330df9 1560 gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
88101ab9
L
1561 fi
1562else
1563 gxx_include_dir=${gxx_include_dir}
1564fi
1565
b87487b6 1566FLAGS_FOR_TARGET=
bb654703 1567case " $target_configdirs " in
7965440a
AO
1568 *" newlib "*)
1569 case " $targargs " in
1570 *" --with-newlib "*)
b87487b6 1571 case "$target" in
d4eb109c 1572 *-cygwin*)
b87487b6
AO
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
1575
afd7db25 1576 # If we're not building GCC, don't discard standard headers.
ef40bc65 1577 if test -d ${srcdir}/gcc; then
d4eb109c 1578 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
afd7db25
AO
1579
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'
1587
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.
1596 fi
d4eb109c
AO
1597 fi
1598
ab50d72b 1599 case "${target}-${is_cross_compiler}" in
9a06dc7d 1600 i[3456]86-*-linux*-no)
ab50d72b
DD
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 / /'`
ab50d72b
DD
1604 ;;
1605 *)
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'
1610 ;;
1611 esac
b87487b6 1612 ;;
7965440a
AO
1613 esac
1614 ;;
b87487b6 1615esac
d4eb109c
AO
1616
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.
ef40bc65 1621if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
b87487b6
AO
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'
1624fi
d4eb109c 1625
bb654703 1626if test "x${use_gnu_ld}" = x &&
55380b08 1627 echo " ${configdirs} " | grep " ld " > /dev/null ; then
b87487b6
AO
1628 # Arrange for us to find uninstalled linker scripts.
1629 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1630fi
1631
d4eb109c
AO
1632if test "x${CC_FOR_TARGET+set}" = xset; then
1633 :
ef40bc65 1634elif test -d ${srcdir}/gcc; then
1fc8c51c 1635 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
b87487b6
AO
1636elif test "$host" = "$target"; then
1637 CC_FOR_TARGET='$(CC)'
1638else
1639 CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1640fi
d4eb109c
AO
1641# On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
1642# if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated.
1643case $CC_FOR_TARGET in
1644*' $(FLAGS_FOR_TARGET)') ;;
1645*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1646esac
b87487b6 1647
85b99cbe
AG
1648if test "x${GCJ_FOR_TARGET+set}" = xset; then
1649 :
ef40bc65 1650elif test -d ${srcdir}/gcc; then
85b99cbe
AG
1651 GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
1652elif test "$host" = "$target"; then
1653 GCJ_FOR_TARGET='gcj'
1654else
1655 GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
1656fi
90def2b2
TT
1657case $GCJ_FOR_TARGET in
1658*' $(FLAGS_FOR_TARGET)') ;;
1659*) GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1660esac
85b99cbe 1661
7a0be465 1662# Don't use libstdc++-v3's flags to configure/build itself.
4977bab6
ZW
1663libstdcxx_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'
1664raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
7a0be465 1665
d4eb109c
AO
1666if test "x${CXX_FOR_TARGET+set}" = xset; then
1667 :
ef40bc65 1668elif test -d ${srcdir}/gcc; then
6bff33fb
AO
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.
4977bab6
ZW
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
b87487b6
AO
1676elif test "$host" = "$target"; then
1677 CXX_FOR_TARGET='$(CXX)'
4977bab6 1678 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
b87487b6
AO
1679else
1680 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
4977bab6 1681 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
b87487b6 1682fi
d4eb109c
AO
1683case $CXX_FOR_TARGET in
1684*' $(FLAGS_FOR_TARGET)') ;;
1685*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1686esac
4977bab6
ZW
1687case $RAW_CXX_FOR_TARGET in
1688*' $(FLAGS_FOR_TARGET)') ;;
1689*) RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1690esac
1691
a3406c06 1692qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
4977bab6 1693qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
a3406c06
AO
1694
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.
1701qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
4977bab6
ZW
1702qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
1703
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.
1707set dummy $CC_FOR_TARGET; cc_for_target_first_word=$2
1708BASE_CC_FOR_TARGET=`echo "$cc_for_target_first_word" | sed -e 's,[$][$]r,.,'`
b87487b6 1709
4ee43206
DR
1710sedtemp=sed.$$
1711cat >$sedtemp <<EOF
4977bab6
ZW
1712s%@GDB_TK@%${GDB_TK}%
1713s%@configure_build_modules@%${configure_build_modules}%
1714s%@all_build_modules@%${all_build_modules}%
1715s%@configure_host_modules@%${configure_host_modules}%
1716s%@all_host_modules@%${all_host_modules}%
1717s%@check_host_modules@%${check_host_modules}%
1718s%@install_host_modules@%${install_host_modules}%
1719s%@install_host_modules_nogcc@%${install_host_modules_nogcc}%
1720s%@configure_target_modules@%${configure_target_modules}%
1721s%@all_target_modules@%${all_target_modules}%
1722s%@check_target_modules@%${check_target_modules}%
1723s%@install_target_modules@%${install_target_modules}%
ec0461f6
NN
1724s:@target_configdirs@:${target_configdirs}:
1725s%@target_configargs@%${targargs}%
1726s%@FLAGS_FOR_TARGET@%${FLAGS_FOR_TARGET}%
1727s%@CC_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}%
4977bab6 1728s%@BASE_CC_FOR_TARGET@%${BASE_CC_FOR_TARGET}%
ec0461f6
NN
1729s%@GCJ_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}%
1730s%@CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}%
4977bab6 1731s%@RAW_CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}%
ec0461f6 1732s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}%
4977bab6 1733s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}%
ec0461f6
NN
1734s%@target_subdir@%${target_subdir}%
1735s%@build_subdir@%${build_subdir}%
782d0c02 1736s%@build_prefix@%${build_prefix}%
ec0461f6
NN
1737s%@build_configargs@%${buildargs}%
1738s%@gxx_include_dir@%${gxx_include_dir}%
4977bab6 1739s%@host_configargs@%${hostargs}%
4ee43206
DR
1740EOF
1741sed -f $sedtemp Makefile > Makefile.tem
1742rm -f Makefile $sedtemp
6599da04
JM
1743mv -f Makefile.tem Makefile
1744
1745#
This page took 0.495865 seconds and 5 git commands to generate.