* doc/c-alpha.texi: Fix typos.
[deliverable/binutils-gdb.git] / configure.in
CommitLineData
252b5132
RH
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
75205f78
DD
17# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
18# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
252b5132
RH
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
ae831be5
NN
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
252b5132
RH
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
a2cc058a 62### (library or tools, host or target), doing a dependency sort.
252b5132 63
a2cc058a
NN
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.
70
71# Double entries in build_configdirs, configdirs, or target_configdirs may
72# cause circular dependencies and break everything horribly.
252b5132
RH
73
74# these libraries are used by various programs built for the host environment
75#
54103d1e 76host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk itcl tix libgui zlib"
252b5132 77
2e8357fc 78libstdcxx_version="target-libstdc++-v3"
ba73c63f 79
252b5132
RH
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.
2af579c4
NN
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"
75205f78
DD
86
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"
252b5132
RH
93
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#
97target_libs="target-libiberty \
98 target-libgloss \
99 target-newlib \
ba73c63f
JM
100 ${libstdcxx_version} \
101 target-libf2c \
75205f78 102 ${libgcj}
ba73c63f 103 target-libobjc"
252b5132
RH
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#
dd2768ff 112target_tools="target-examples target-groff target-gperf target-rda"
252b5132
RH
113
114################################################################################
115
252b5132
RH
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
9ee1a75c
DD
135# There is no longer anything interesting in the per-host section.
136
137# per-target:
138
c712250a
DD
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
252b5132
RH
147# We always want to use the same name for this directory, so that dejagnu
148# can reliably find it.
149target_subdir=${target_alias}
150
a0c4f3a0 151if test ! -d ${target_subdir} ; then
252b5132
RH
152 if mkdir ${target_subdir} ; then true
153 else
d5de0a84 154 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
252b5132
RH
155 exit 1
156 fi
157fi
158
49b7683b
DD
159build_subdir=${build_alias}
160
a0c4f3a0
DD
161if test x"${build_alias}" != x"${host}" ; then
162 if test ! -d ${build_subdir} ; then
49b7683b
DD
163 if mkdir ${build_subdir} ; then true
164 else
d5de0a84 165 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
49b7683b
DD
166 exit 1
167 fi
168 fi
169fi
170
efeae3db
L
171if test x"${target_subdir}" = x"${build_subdir}" ; then
172 build_prefix=build-
173fi
174
f48556b1
DD
175# Skipdirs are removed silently.
176skipdirs=
177# Noconfigdirs are removed loudly.
178noconfigdirs=""
252b5132 179
f48556b1
DD
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"
252b5132
RH
185fi
186
f48556b1
DD
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"
252b5132
RH
192fi
193
f48556b1
DD
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.
252b5132 196
f48556b1
DD
197case ${with_x} in
198 yes | "") ;; # the default value for this tree is that X11 is available
ff0a3bf8
DD
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 ;;
f48556b1
DD
204 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
205esac
252b5132 206
f48556b1 207# Some tools are only suitable for building in a "native" situation.
405ea7a0 208# Remove these if host!=target.
bcaf2395 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"
405ea7a0
NN
210
211# Similarly, some are only suitable for cross toolchains.
212# Remove these if host=target.
213cross_only="target-libgloss target-newlib target-opcodes"
252b5132 214
f48556b1
DD
215case $is_cross_compiler in
216 no) skipdirs="${skipdirs} ${cross_only}" ;;
217 yes) skipdirs="${skipdirs} ${native_only}" ;;
218esac
252b5132 219
a32d391c
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
252b5132
RH
234# Configure extra directories which are host specific
235
236case "${host}" in
f48556b1 237 *-cygwin*)
3866be5d 238 configdirs="$configdirs libtermcap" ;;
252b5132
RH
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
252b5132 245case "${host}" in
75205f78
DD
246 hppa*64*-*-*)
247 noconfigdirs="$noconfigdirs byacc"
248 ;;
252b5132 249 i[3456]86-*-vsta)
07637366 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"
252b5132
RH
251 ;;
252 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
07637366 253 noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi"
252b5132
RH
254 ;;
255 i[3456]86-*-mingw32*)
07637366
DD
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"
252b5132
RH
258 ;;
259 i[3456]86-*-beos*)
260 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
261 ;;
262 *-*-cygwin*)
07637366 263 noconfigdirs="autoconf automake send-pr rcs guile perl"
252b5132
RH
264 ;;
265 *-*-netbsd*)
266 noconfigdirs="rcs"
267 ;;
268 ppc*-*-pe)
07637366 269 noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv"
252b5132 270 ;;
ba73c63f
JM
271 powerpc-*-beos*)
272 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
273 ;;
bbf7c8ac
NN
274 *-*-darwin*)
275 noconfigdirs="$noconfigdirs tk itcl tix libgui"
276 ;;
252b5132
RH
277esac
278
96111c10
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
252b5132 295case "${target}" in
75205f78
DD
296 *-*-chorusos)
297 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
298 ;;
ffb97b2f
DD
299 *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
300 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
301 ;;
e82380cc
JT
302 *-*-netbsd*)
303 # Skip some stuff on all NetBSD configurations.
ae03d6e2 304 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
e82380cc
JT
305
306 # Skip some stuff that's unsupported on some NetBSD configurations.
307 case "${target}" in
75205f78 308 i*86-*-netbsdelf*) ;;
e82380cc 309 *)
75205f78 310 noconfigdirs="$noconfigdirs ${libgcj}"
e82380cc
JT
311 ;;
312 esac
313 ;;
252b5132 314 *-*-netware)
e3b0c936 315 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
252b5132
RH
316 ;;
317 *-*-rtems*)
75205f78 318 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
d5ec694c
DD
319 case ${target} in
320 h8300*-*-* | h8500-*-*)
321 noconfigdirs="$noconfigdirs target-libf2c"
322 ;;
323 *) ;;
324 esac
252b5132
RH
325 ;;
326 *-*-vxworks*)
75205f78 327 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
252b5132
RH
328 ;;
329 alpha*-dec-osf*)
e99daf2b
DD
330 # ld works, but does not support shared libraries.
331 # newlib is not 64 bit ready. I'm not sure about fileutils.
252b5132 332 # gas doesn't generate exception information.
e99daf2b 333 noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
252b5132
RH
334 ;;
335 alpha*-*-*vms*)
75205f78
DD
336 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
337 ;;
338 alpha*-*-linux*)
339 # newlib is not 64 bit ready
340 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
252b5132 341 ;;
ffb97b2f
DD
342 alpha*-*-freebsd*)
343 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
344 ;;
252b5132
RH
345 alpha*-*-*)
346 # newlib is not 64 bit ready
75205f78 347 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
252b5132 348 ;;
75205f78
DD
349 sh-*-linux*)
350 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
75205f78 351 ;;
2fb651f6 352 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
75205f78
DD
353 noconfigdirs="$noconfigdirs ${libgcj}"
354 noconfigdirs="$noconfigdirs target-examples"
ba73c63f 355 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
2fb651f6
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
ba73c63f 359 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
ae03d6e2 360 noconfigdirs="$noconfigdirs target-newlib"
2fb651f6
NC
361 case "${host}" in
362 *-*-cygwin*) ;; # keep gdb and readline
ba73c63f 363 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
2fb651f6
NC
364 ;;
365 esac
366 ;;
252b5132 367 arc-*-*)
75205f78 368 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 369 ;;
f03b4789
NN
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 ;;
252b5132 376 arm-*-pe*)
75205f78 377 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 378 ;;
252b5132 379 arm-*-oabi*)
75205f78 380 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 381 ;;
252b5132 382 thumb-*-coff)
75205f78 383 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 384 ;;
252b5132 385 thumb-*-elf)
75205f78 386 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132
RH
387 ;;
388 thumb-*-oabi)
75205f78 389 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 390 ;;
347dad9e 391 thumb-*-pe)
75205f78 392 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132
RH
393 ;;
394 arm-*-riscix*)
75205f78 395 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
252b5132 396 ;;
c95f53ae
MM
397 avr-*-*)
398 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
399 ;;
ff72e302 400 c4x-*-* | tic4x-*-*)
e3b0c936 401 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
077b8428
NC
402 ;;
403 c54x*-*-* | tic54x-*-*)
75205f78
DD
404 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
405 ;;
406 cris-*-*)
407 noconfigdirs="$noconfigdirs ${libgcj}"
077b8428 408 ;;
252b5132 409 d10v-*-*)
e3b0c936 410 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
252b5132 411 ;;
252b5132 412 d30v-*-*)
75205f78 413 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132 414 ;;
252b5132 415 fr30-*-elf*)
75205f78 416 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132 417 ;;
d2a86414
DB
418 frv-*-*)
419 noconfigdirs="$noconfigdirs ${libgcj}"
d2a86414 420 ;;
dd1e52a4
JH
421 h8300*-*-*)
422 noconfigdirs="$noconfigdirs target-libgloss"
423 ;;
252b5132 424 h8500-*-*)
e3b0c936 425 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
75205f78
DD
426 ;;
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"
252b5132
RH
432 ;;
433 hppa*-*-*elf* | \
75205f78 434 parisc*-*-linux* | hppa*-*-linux* | \
09e90eb4 435 hppa*-*-lites* | \
17240c1f 436 hppa*-*-openbsd* | \
09e90eb4 437 hppa*64*-*-*)
75205f78 438 noconfigdirs="$noconfigdirs ${libgcj}"
ba73c63f 439 # Do configure ld/binutils/gas for this case.
252b5132
RH
440 ;;
441 hppa*-*-*)
b3ed1d6b
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}"
252b5132 445 ;;
2315914d
JW
446 ia64*-*-elf*)
447 # No gdb support yet.
448 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
449 ;;
a0c1c920
NC
450 ia64*-**-hpux*)
451 # No gdb or ld support yet.
452 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld"
453 ;;
252b5132 454 i[3456]86-*-coff | i[3456]86-*-elf)
75205f78 455 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132 456 ;;
ffb97b2f
DD
457 i[34567]86-*-freebsd*)
458 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
459 ;;
c72f388d 460 i[3456]86-*-linux*)
28f46298
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
c72f388d
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.
a018e15b 470 if test x${is_cross_compiler} != xno ; then
c72f388d
TF
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.
c72f388d 478 ;;
252b5132
RH
479 i[3456]86-*-mingw32*)
480 target_configdirs="$target_configdirs target-mingw"
b1af961c 481 noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
252b5132
RH
482
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"
487 ;;
488 esac
489 ;;
490 *-*-cygwin*)
491 target_configdirs="$target_configdirs target-libtermcap target-winsup"
b1af961c 492 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
252b5132
RH
493 # always build newlib.
494 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
495
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"
500 ;;
501 esac
502 ;;
503 i[3456]86-*-pe)
e3b0c936 504 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
252b5132
RH
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.
75205f78 509 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
252b5132
RH
510 ;;
511 i[3456]86-*-sco*)
75205f78 512 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
252b5132
RH
513 ;;
514 i[3456]86-*-solaris2*)
515 noconfigdirs="$noconfigdirs target-libgloss"
516 ;;
517 i[3456]86-*-sysv4*)
e99daf2b 518 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132
RH
519 ;;
520 i[3456]86-*-beos*)
b1af961c 521 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
252b5132 522 ;;
75205f78
DD
523 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
524 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
f9e0997d 525 ;;
75205f78
DD
526 m68k-*-elf*)
527 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132
RH
528 ;;
529 m68k-*-coff*)
75205f78 530 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132 531 ;;
75205f78
DD
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 ;;
537 mmix-*-*)
95c72c44 538 noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss"
75205f78 539 ;;
252b5132 540 mn10200-*-*)
75205f78 541 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132
RH
542 ;;
543 mn10300-*-*)
75205f78 544 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132
RH
545 ;;
546 powerpc-*-aix*)
547 # copied from rs6000-*-* entry
07637366 548 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
252b5132
RH
549 ;;
550 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
551 target_configdirs="$target_configdirs target-winsup"
75205f78 552 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
252b5132
RH
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*)
75205f78 558 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
ba73c63f
JM
559 ;;
560 powerpc-*-beos*)
75205f78 561 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
252b5132 562 ;;
c0292023 563 powerpc-*-darwin*)
bbf7c8ac 564 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
c0292023 565 ;;
252b5132 566 powerpc-*-eabi)
75205f78 567 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132 568 ;;
574e6d11
DD
569 powerpc64*-*-linux*)
570 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
571 # not yet ported.
572 noconfigdirs="$noconfigdirs target-libffi"
573 ;;
252b5132 574 rs6000-*-lynxos*)
07637366 575 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
252b5132
RH
576 ;;
577 rs6000-*-aix*)
75205f78 578 noconfigdirs="$noconfigdirs gprof ${libgcj}"
252b5132
RH
579 ;;
580 rs6000-*-*)
75205f78 581 noconfigdirs="$noconfigdirs gprof ${libgcj}"
252b5132
RH
582 ;;
583 m68k-apollo-*)
75205f78 584 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
252b5132
RH
585 ;;
586 mips*-*-irix5*)
587 # The GNU linker does not support shared libraries.
e99daf2b 588 noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
252b5132
RH
589 ;;
590 mips*-*-irix6*)
106117aa 591 # The GNU assembler does not support IRIX 6.
b3ed1d6b
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>
e99daf2b 596 noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
252b5132
RH
597 ;;
598 mips*-dec-bsd*)
75205f78 599 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
252b5132
RH
600 ;;
601 mips*-*-bsd*)
75205f78 602 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
252b5132
RH
603 ;;
604 mipstx39-*-*)
75205f78 605 noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
252b5132 606 ;;
fad93c55 607 mips*-*-linux*)
574e6d11 608 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
fad93c55 609 ;;
252b5132 610 mips*-*-*)
75205f78 611 noconfigdirs="$noconfigdirs gprof ${libgcj}"
252b5132
RH
612 ;;
613 romp-*-*)
75205f78 614 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
252b5132
RH
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
75205f78 623 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 624 ;;
20a5393b
AO
625 sh64-*-*)
626 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
627 ;;
252b5132 628 sparc-*-elf*)
d5ec694c 629 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132
RH
630 ;;
631 sparc64-*-elf*)
d5ec694c 632 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132
RH
633 ;;
634 sparclite-*-*)
75205f78 635 noconfigdirs="$noconfigdirs ${libgcj}"
252b5132
RH
636 ;;
637 sparc-*-sunos4*)
75205f78 638 noconfigdirs="$noconfigdirs ${libgcj}"
a0c4f3a0 639 if test x${is_cross_compiler} != xno ; then
c74222f7 640 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
252b5132
RH
641 else
642 use_gnu_ld=no
643 fi
644 ;;
3a036cdc 645 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
b3ed1d6b 646 ;;
252b5132 647 v810-*-*)
75205f78 648 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
252b5132
RH
649 ;;
650 v850-*-*)
75205f78 651 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132 652 ;;
347dad9e 653 v850e-*-*)
75205f78 654 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
252b5132
RH
655 ;;
656 v850ea-*-*)
75205f78 657 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
347dad9e 658 ;;
252b5132 659 vax-*-vms)
75205f78 660 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
252b5132
RH
661 ;;
662 vax-*-*)
75205f78 663 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
96ce09a7 664 ;;
f48556b1
DD
665 ip2k-*-*)
666 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
667 ;;
574e6d11
DD
668 *-*-linux*)
669 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
670 ;;
252b5132 671 *-*-lynxos*)
75205f78 672 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
252b5132 673 ;;
75205f78
DD
674 *-*-*)
675 noconfigdirs="$noconfigdirs ${libgcj}"
676 ;;
252b5132
RH
677esac
678
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" ;;
f48556b1 684esac
252b5132 685
6ee6cea6
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.
922b2485 690# NB: embedded tabs in this IF block -- do not untabify
6ee6cea6
AO
691if test x"${enable_languages+set}" != xset; then
692 if test x"${LANGUAGES+set}" = xset; then
922b2485
DD
693 enable_languages="${LANGUAGES}"
694 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
6ee6cea6
AO
695 else
696 enable_languages=all
697 fi
698else
922b2485
DD
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
6ee6cea6
AO
703 exit 1
704 fi
705fi
922b2485
DD
706enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
707
75205f78
DD
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 ;;
730 *,$lang_alias,*)
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
6ee6cea6
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`
75205f78 751 this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
6ee6cea6
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
75205f78 767 eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
6ee6cea6
AO
768 fi
769 ;;
770 esac
771done
772
252b5132
RH
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`
a0c4f3a0 780 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
252b5132 781 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
405ea7a0 782 if test -r $srcdir/$dirname/configure ; then
252b5132
RH
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
a0c4f3a0 790 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
252b5132 791 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
405ea7a0 792 if test -r $srcdir/$dirname/configure ; then
252b5132
RH
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.
a0c4f3a0 804if test -n "${target_configdirs}" ; then
252b5132
RH
805 others=
806 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
a0c4f3a0 807 if test "$i" != "libiberty" ; then
405ea7a0 808 if test -r $srcdir/$i/configure ; then
252b5132
RH
809 others=yes;
810 break;
811 fi
812 fi
813 done
a0c4f3a0 814 if test -z "${others}" ; then
252b5132
RH
815 target_configdirs=
816 fi
817fi
818
f48556b1
DD
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
f48556b1
DD
891
892copy_dirs=
893
bdc57bfd
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.
f48556b1
DD
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
bdc57bfd
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
f48556b1
DD
908fi
909
bdc57bfd
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.
f48556b1
DD
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
bdc57bfd
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
f48556b1
DD
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
252b5132 1146 done
f48556b1 1147 host_makefile_frag=mh-frag
252b5132 1148fi
f48556b1 1149
874e38b4
NN
1150extra_arflags_for_target=
1151extra_nmflags_for_target=
f48556b1 1152case "${target}" in
f48556b1 1153 i[3456]86-*-netware*)
b6f83f2a 1154 target_makefile_frag="config/mt-netware"
f48556b1
DD
1155 ;;
1156 powerpc-*-netware*)
b6f83f2a 1157 target_makefile_frag="config/mt-netware"
f48556b1
DD
1158 ;;
1159 *-*-linux*)
b6f83f2a 1160 target_makefile_frag="config/mt-linux"
f48556b1
DD
1161 ;;
1162 *-*-aix4.[3456789]* | *-*-aix[56789].*)
874e38b4
NN
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"
f48556b1
DD
1168 ;;
1169 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
b6f83f2a
DD
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"
f48556b1
DD
1180 ;;
1181esac
a0a2c6c6 1182
f48556b1
DD
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.
b6f83f2a 1186ospace_frag=
f48556b1
DD
1187case "${enable_target_optspace}:${target}" in
1188 yes:*)
b6f83f2a 1189 ospace_frag="config/mt-ospace"
f48556b1
DD
1190 ;;
1191 :d30v-*)
b6f83f2a 1192 ospace_frag="config/mt-d30v"
f48556b1
DD
1193 ;;
1194 :m32r-* | :d10v-* | :fr30-*)
b6f83f2a 1195 ospace_frag="config/mt-ospace"
f48556b1
DD
1196 ;;
1197 no:* | :*)
1198 ;;
1199 *)
1200 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
1201 ;;
1202esac
252b5132 1203
f48556b1 1204rm -f mt-frag
b6f83f2a
DD
1205if test -n "${target_makefile_frag}${alphaieee_frag}${ospace_frag}" ; then
1206 for f in ${target_makefile_frag} ${alphaieee_frag} ${ospace_frag}
f48556b1
DD
1207 do
1208 cat ${srcdir}/$f >> mt-frag
1209 done
1210 target_makefile_frag=mt-frag
252b5132
RH
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
f48556b1
DD
1226if test x${use_gnu_as} = x &&
1227 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
1228 with_gnu_as=yes
ae831be5 1229 extra_host_args="$extra_host_args --with-gnu-as"
252b5132
RH
1230fi
1231
f48556b1
DD
1232if test x${use_gnu_ld} = x &&
1233 echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
1234 with_gnu_ld=yes
ae831be5 1235 extra_host_args="$extra_host_args --with-gnu-ld"
252b5132
RH
1236fi
1237
ae831be5 1238# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
252b5132
RH
1239# can detect this case.
1240
f48556b1 1241if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
252b5132 1242 with_newlib=yes
ae831be5 1243 extra_host_args="$extra_host_args --with-newlib"
252b5132
RH
1244fi
1245
f48556b1
DD
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
252b5132
RH
1255fi
1256
f48556b1
DD
1257case "${enable_shared}" in
1258 yes) shared=yes ;;
1259 no) shared=no ;;
1260 "") shared=no ;;
1261 *) shared=yes ;;
c92a0210 1262esac
f48556b1
DD
1263
1264
1265# Default to using --with-stabs for certain targets.
1266if test x${with_stabs} = x ; then
1267 case "${target}" in
d7cf5d30
DD
1268 mips*-*-irix6*o32)
1269 with_stabs=yes;
ae831be5 1270 extra_host_args="${extra_host_args} --with-stabs"
d7cf5d30 1271 ;;
f48556b1
DD
1272 mips*-*-irix6*)
1273 ;;
1274 mips*-*-* | alpha*-*-osf*)
1275 with_stabs=yes;
ae831be5 1276 extra_host_args="${extra_host_args} --with-stabs"
f48556b1
DD
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*)
ae831be5 1285 extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
f48556b1 1286 ;;
c92a0210
DD
1287esac
1288
ae831be5
NN
1289# This will go away when we start subconfigures from the Makefile.
1290withoptions="${withoptions} ${extra_host_args}"
1291
227d98f5
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
252b5132
RH
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.
a0c4f3a0 1317we_are_ok=no
252b5132
RH
1318echo "int main () { return 0; }" > conftest.c
1319${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
a0c4f3a0
DD
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
252b5132
RH
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/ .*$//'`"
a0c4f3a0 1339 if test "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ; then
252b5132 1340 could_use=
a0c4f3a0
DD
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
252b5132
RH
1344 could_use="/opt/cygnus/bin"
1345 else
1346 could_use="$could_use or /opt/cygnus/bin"
1347 fi
1348 fi
a0c4f3a0 1349 if test "$could_use" = "" ; then
252b5132
RH
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.
a0c4f3a0 1365if test "${shared}" = "yes" ; then
8607b6c9
NN
1366 SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
1367else
1368 SET_LIB_PATH=
252b5132 1369fi
8607b6c9
NN
1370sed -e "s/@SET_LIB_PATH@/${SET_LIB_PATH}/" Makefile > Makefile.tem
1371rm -f Makefile
1372mv -f Makefile.tem Makefile
1373
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
3866be5d
NN
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.
930314a4
NN
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
3866be5d
NN
1399all_host_modules=
1400check_host_modules=
1401install_host_modules=
930314a4 1402configure_host_modules=
3866be5d
NN
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}"
930314a4 1407 configure_host_modules="${configure_host_modules} configure-${module}"
3866be5d
NN
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=
930314a4 1414configure_target_modules=
3866be5d
NN
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}"
930314a4 1419 configure_target_modules="${configure_target_modules} configure-target-${module}"
3866be5d 1420done
252b5132 1421
930314a4
NN
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
a2cc058a
NN
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
1484
91e060aa
DD
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}" | \
252b5132
RH
1488 sed -e 's/--no[^ ]*//' \
1489 -e 's/--cache[a-z-]*=[^ ]*//' \
91e060aa 1490 -e 's/--sr[a-z-]*=[^ ]*//' \
252b5132
RH
1491 -e 's/--ho[a-z-]*=[^ ]*//' \
1492 -e 's/--bu[a-z-]*=[^ ]*//' \
1493 -e 's/--ta[a-z-]*=[^ ]*//'`
1494
49b7683b
DD
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.
91e060aa
DD
1498buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
1499
ae831be5
NN
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
91e060aa 1512targargs=${baseargs}
49b7683b 1513
252b5132
RH
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.
a0c4f3a0 1519if test x${is_cross_compiler} = xyes ; then
252b5132
RH
1520 targargs="--with-cross-host=${host_alias} ${targargs}"
1521fi
1522
1523# Default to --enable-multilib.
a0c4f3a0 1524if test x${enable_multilib} = x ; then
252b5132
RH
1525 targargs="--enable-multilib ${targargs}"
1526fi
1527
1528# Pass --with-newlib if appropriate. Note that target_configdirs has
1529# changed from the earlier setting of with_newlib.
a0c4f3a0 1530if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
252b5132
RH
1531 targargs="--with-newlib ${targargs}"
1532fi
1533
49b7683b
DD
1534# Pass the appropriate --host, --build, and --cache-file arguments.
1535targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
1536
252b5132
RH
1537# provide a proper gxx_include_dir.
1538# Note, if you change the default, make sure to fix both here and in
75205f78 1539# the gcc and libstdc++-v3 subdirectories.
252b5132
RH
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
edd1b227 1557 gxx_include_dir='${libsubdir}/include/c++'
252b5132 1558 else
4d5fd396 1559 . ${srcdir}/config.if
75205f78 1560 gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
252b5132
RH
1561 fi
1562else
1563 gxx_include_dir=${gxx_include_dir}
1564fi
1565
9e449d3e 1566FLAGS_FOR_TARGET=
7c1f909c 1567case " $target_configdirs " in
75205f78
DD
1568 *" newlib "*)
1569 case " $targargs " in
1570 *" --with-newlib "*)
9e449d3e 1571 case "$target" in
63266560 1572 *-cygwin*)
9e449d3e
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
7450026c 1576 # If we're not building GCC, don't discard standard headers.
4d5fd396 1577 if test -d ${srcdir}/gcc; then
63266560 1578 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
7450026c
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
63266560
DD
1597 fi
1598
0a0d0041 1599 case "${target}-${is_cross_compiler}" in
c72f388d 1600 i[3456]86-*-linux*-no)
0a0d0041
TF
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 / /'`
0a0d0041
TF
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
9e449d3e 1612 ;;
75205f78
DD
1613 esac
1614 ;;
9e449d3e 1615esac
63266560
DD
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.
4d5fd396 1621if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
9e449d3e
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
63266560 1625
7c1f909c 1626if test "x${use_gnu_ld}" = x &&
f48556b1 1627 echo " ${configdirs} " | grep " ld " > /dev/null ; then
9e449d3e
AO
1628 # Arrange for us to find uninstalled linker scripts.
1629 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1630fi
1631
63266560
DD
1632if test "x${CC_FOR_TARGET+set}" = xset; then
1633 :
4d5fd396 1634elif test -d ${srcdir}/gcc; then
98fbe43f 1635 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
9e449d3e
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
63266560
DD
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
9e449d3e 1647
75205f78
DD
1648if test "x${GCJ_FOR_TARGET+set}" = xset; then
1649 :
4d5fd396 1650elif test -d ${srcdir}/gcc; then
75205f78
DD
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
1657case $GCJ_FOR_TARGET in
1658*' $(FLAGS_FOR_TARGET)') ;;
1659*) GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1660esac
1661
8ee424c0 1662# Don't use libstdc++-v3's flags to configure/build itself.
930314a4
NN
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'
8ee424c0 1665
63266560
DD
1666if test "x${CXX_FOR_TARGET+set}" = xset; then
1667 :
4d5fd396 1668elif test -d ${srcdir}/gcc; then
2e8357fc
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.
930314a4
NN
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
9e449d3e
AO
1676elif test "$host" = "$target"; then
1677 CXX_FOR_TARGET='$(CXX)'
930314a4 1678 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
9e449d3e
AO
1679else
1680 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
930314a4 1681 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
9e449d3e 1682fi
63266560
DD
1683case $CXX_FOR_TARGET in
1684*' $(FLAGS_FOR_TARGET)') ;;
1685*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1686esac
930314a4
NN
1687case $RAW_CXX_FOR_TARGET in
1688*' $(FLAGS_FOR_TARGET)') ;;
1689*) RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1690esac
1691
dec0cb0c 1692qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
930314a4 1693qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
dec0cb0c
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'`
930314a4 1702qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
9e449d3e 1703
15723a45
NN
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,.,'`
1709
75205f78
DD
1710sedtemp=sed.$$
1711cat >$sedtemp <<EOF
930314a4 1712s%@GDB_TK@%${GDB_TK}%
930314a4 1713s%@configure_build_modules@%${configure_build_modules}%
db1ac78d
NN
1714s%@all_build_modules@%${all_build_modules}%
1715s%@configure_host_modules@%${configure_host_modules}%
3866be5d
NN
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}%
db1ac78d 1720s%@configure_target_modules@%${configure_target_modules}%
3866be5d
NN
1721s%@all_target_modules@%${all_target_modules}%
1722s%@check_target_modules@%${check_target_modules}%
1723s%@install_target_modules@%${install_target_modules}%
58daee98
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}%
15723a45 1728s%@BASE_CC_FOR_TARGET@%${BASE_CC_FOR_TARGET}%
58daee98
NN
1729s%@GCJ_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}%
1730s%@CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}%
930314a4 1731s%@RAW_CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}%
58daee98 1732s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}%
930314a4 1733s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}%
58daee98
NN
1734s%@target_subdir@%${target_subdir}%
1735s%@build_subdir@%${build_subdir}%
efeae3db 1736s%@build_prefix@%${build_prefix}%
58daee98
NN
1737s%@build_configargs@%${buildargs}%
1738s%@gxx_include_dir@%${gxx_include_dir}%
ae831be5 1739s%@host_configargs@%${hostargs}%
75205f78
DD
1740EOF
1741sed -f $sedtemp Makefile > Makefile.tem
1742rm -f Makefile $sedtemp
252b5132
RH
1743mv -f Makefile.tem Makefile
1744
1745#
This page took 0.306009 seconds and 4 git commands to generate.