* gdbint.texinfo: Complete overhaul. Group descriptions more
[deliverable/binutils-gdb.git] / configure.in
CommitLineData
59d95e81 1#! /bin/bash
9bdd52dd 2##############################################################################
eb02fd64 3
041164e4
DZ
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.
ba4513e7 8
041164e4
DZ
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.
ba4513e7 13
041164e4
DZ
14## For more information on these two systems, check out the documentation
15## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
ba4513e7 16
d20af0bd 17# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
85f533f7
TT
18#
19# This file is free software; you can redistribute it and/or modify it
20# under the terms of the GNU General Public License as published by
21# the Free Software Foundation; either version 2 of the License, or
22# (at your option) any later version.
23#
24# This program is distributed in the hope that it will be useful, but
25# WITHOUT ANY WARRANTY; without even the implied warranty of
26# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27# General Public License for more details.
28#
29# You should have received a copy of the GNU General Public License
30# along with this program; if not, write to the Free Software
31# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32
9bdd52dd 33##############################################################################
041164e4
DZ
34
35### To add a new directory to the tree, first choose whether it is a target
36### or a host dependent tool. Then put it into the appropriate list
37### (library or tools, host or target), doing a dependency sort. For
38### example, gdb requires that byacc (or bison) be built first, so it is in
39### the ${host_tools} list after byacc and bison.
40
41
42# these libraries are used by various programs built for the host environment
43#
d20af0bd 44host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tclX itcl tix libgui"
6f1e2150 45# start-sanitize-ide
f46d03c5 46host_libs="${host_libs} libide libidetcl"
6f1e2150 47# end-sanitize-ide
5f9e41cd
BE
48# start-sanitize-cygnus
49host_libs="${host_libs} flexlm"
50# end-sanitize-cygnus
041164e4 51
f4a7dca7
TL
52if [ "${enable_gdbgui}" = "yes" ] ; then
53 host_libs="${host_libs} libgui"
54fi
55
041164e4 56# these tools are built for the host environment
23e92f3f
MM
57# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
58# know that we are building the simulator.
5412dceb 59host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext"
3718029f 60# start-sanitize-ide
c070fb34 61host_tools="${host_tools} ilu vmake jstools"
3718029f 62# end-sanitize-ide
5ea0771f
DE
63# start-sanitize-cygnus
64host_tools="${host_tools} cgen"
65# end-sanitize-cygnus
041164e4 66
9bdd52dd
DZ
67# these libraries are built for the target environment, and are built after
68# the host libraries and the host tools (which may be a cross compiler)
041164e4 69#
6d2d3edc
SG
70target_libs="target-libiberty \
71 target-libgloss \
72 target-newlib \
d46c1ae3
JJ
73 ${start-sanitize-dsp}
74 target-libdsp \
75 ${end-sanitize-dsp}
6d2d3edc
SG
76 target-libio \
77 target-librx \
78 target-libstdc++ \
79 ${start-sanitize-java}
80 target-libjava \
81 target-boehm-gc \
a69b70c4 82 target-qthreads \
6d2d3edc
SG
83 ${end-sanitize-java}
84 target-libg++"
041164e4 85
9bdd52dd 86# these tools are built using the target libs, and are intended to run only
9623e828 87# in the target environment
83a47678 88#
9bdd52dd
DZ
89# note: any program that *uses* libraries that are in the "target_libs"
90# list belongs in this list. those programs are also very likely
91# candidates for the "native_only" list which follows
041164e4 92#
10be59aa 93target_tools="target-examples target-groff target-gperf"
041164e4
DZ
94
95################################################################################
96
97## These two lists are of directories that are to be removed from the
98## ${configdirs} list for either cross-compilations or for native-
99## compilations. For example, it doesn't make that much sense to
ab1cbc67 100## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
041164e4
DZ
101## a native environment.
102
103# directories to be built in the native environment only
104#
cd0ae558
ILT
105# This must be a single line because of the way it is searched by grep in
106# the code below.
2f5ed6bc 107native_only="autoconf automake libtool cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time ash bash prms snavigator gnuserv target-gperf"
041164e4 108
9bdd52dd 109# directories to be built in a cross environment only
041164e4 110#
f4434c50 111cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
041164e4
DZ
112
113## All tools belong in one of the four categories, and are assigned above
8f30a41e
DE
114## We assign ${configdirs} this way to remove all embedded newlines. This
115## is important because configure will choke if they ever get through.
ca2ce3b3
ILT
116## ${configdirs} is directories we build using the host tools.
117## ${target_configdirs} is directories we build using the target tools.
041164e4 118#
ca2ce3b3
ILT
119configdirs=`echo ${host_libs} ${host_tools}`
120target_configdirs=`echo ${target_libs} ${target_tools}`
041164e4
DZ
121
122################################################################################
ba4513e7 123
378fd382 124srctrigger=move-if-change
eb02fd64 125srcname="gnu development package"
0df06ca0 126
af9fa3c1
ILT
127# This gets set non-empty for some net releases of packages.
128appdirs=""
129
0df06ca0
RP
130# per-host:
131
594c548a
DM
132# Work in distributions that contain no compiler tools, like Autoconf.
133if [ -d ${srcdir}/config ]; then
cec673a2 134case "${host}" in
9cfb301e
JL
135 m68k-hp-hpux*)
136 host_makefile_frag="${host_makefile_frag} config/mh-hp300"
137 ;;
138 m68k-apollo-sysv*)
139 host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
140 ;;
141 m68k-apollo-bsd*)
142 host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
143 ;;
144 m88k-dg-dgux*)
145 host_makefile_frag="${host_makefile_frag} config/mh-dgux"
146 ;;
147 m88k-harris-cxux*)
148 host_makefile_frag="${host_makefile_frag} config/mh-cxux"
149 ;;
150 m88k-motorola-sysv*)
151 host_makefile_frag="${host_makefile_frag} config/mh-delta88"
152 ;;
153 mips*-dec-ultrix*)
154 host_makefile_frag="${host_makefile_frag} config/mh-decstation"
155 ;;
156 mips*-nec-sysv4*)
157 host_makefile_frag="${host_makefile_frag} config/mh-necv4"
158 ;;
159 mips*-sgi-irix6*)
160 host_makefile_frag="${host_makefile_frag} config/mh-irix6"
161 ;;
162 mips*-sgi-irix5*)
163 host_makefile_frag="${host_makefile_frag} config/mh-irix5"
164 ;;
165 mips*-sgi-irix4*)
166 host_makefile_frag="${host_makefile_frag} config/mh-irix4"
167 ;;
168 mips*-sgi-irix3*)
169 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
170 ;;
171 mips*-*-sysv4*)
172 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
173 ;;
174 mips*-*-sysv*)
175 host_makefile_frag="${host_makefile_frag} config/mh-riscos"
176 ;;
f43cc8f7
JM
177 i[3456]86-*-sysv5*)
178 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
179 ;;
9cfb301e
JL
180 i[3456]86-*-dgux*)
181 host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
182 ;;
183 i[3456]86-ncr-sysv4.3*)
184 host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
185 ;;
186 i[3456]86-ncr-sysv4*)
187 host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
188 ;;
189 i[3456]86-*-sco3.2v5*)
190 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
191 ;;
192 i[3456]86-*-sco*)
193 host_makefile_frag="${host_makefile_frag} config/mh-sco"
194 ;;
195 i[3456]86-*-isc*)
196 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
197 ;;
198 i[3456]86-*-solaris2*)
199 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
200 ;;
201 i[3456]86-*-aix*)
202 host_makefile_frag="${host_makefile_frag} config/mh-aix386"
203 ;;
204 i[3456]86-*-go32*)
205 host_makefile_frag="${host_makefile_frag} config/mh-go32"
206 ;;
207 i[3456]86-*-msdosdjgpp*)
208 host_makefile_frag="${host_makefile_frag} config/mh-go32"
209 ;;
210 *-cygwin32*)
211 host_makefile_frag="${host_makefile_frag} config/mh-cygwin32"
212 ;;
0b0bd98b
JL
213 *-mingw32*)
214 host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
215 ;;
6271cadd 216# start-sanitize-mswin
9cfb301e
JL
217 *-windows*)
218 host_makefile_frag="${host_makefile_frag} config/mh-windows"
219 ;;
6271cadd 220# end-sanitize-mswin
9cfb301e
JL
221 vax-*-ultrix2*)
222 host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
223 ;;
224 *-*-solaris2*)
225 host_makefile_frag="${host_makefile_frag} config/mh-solaris"
226 ;;
227 m68k-sun-sunos*)
228 host_makefile_frag="${host_makefile_frag} config/mh-sun3"
229 ;;
230 *-hp-hpux[78]*)
231 host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
232 ;;
233 *-hp-hpux*)
234 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
235 ;;
236 *-*-hiux*)
237 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
238 ;;
239 rs6000-*-lynxos*)
240 host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
241 ;;
242 *-*-lynxos*)
243 host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
244 ;;
245 *-*-sysv4*)
246 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
247 ;;
248 *-*-sysv*)
249 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
250 ;;
f4bda0ff 251esac
594c548a 252fi
f4bda0ff 253
0e47ce97
ILT
254# If we aren't going to be using gcc, see if we can extract a definition
255# of CC from the fragment.
8beb827a 256if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then
0e47ce97
ILT
257 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
258 found=
259 for dir in $PATH; do
260 test -z "$dir" && dir=.
261 if test -f $dir/gcc; then
262 found=yes
263 break
264 fi
265 done
266 IFS="$save_ifs"
8beb827a 267 if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then
2f9bfdfa
SG
268 xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
269 if [ -n "${xx}" ] ; then
270 CC=$xx
271 fi
ca2ce3b3
ILT
272 fi
273fi
274
45329a2c
JM
275# We default to --with-shared on platforms where -fpic is meaningless.
276# Well, we don't yet, but we will.
277if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
278 case "${target}" in
bf31116d
ILT
279 alpha*-dec-osf*) enable_shared=yes ;;
280 alpha*-*-linux*) enable_shared=yes ;;
45329a2c
JM
281 mips-sgi-irix5*) enable_shared=yes ;;
282 *) enable_shared=no ;;
283 esac
284fi
285
d4be7765
ILT
286case "${enable_shared}" in
287 yes) shared=yes ;;
288 no) shared=no ;;
feb522ad 289 "") shared=no ;;
d4be7765
ILT
290 *) shared=yes ;;
291esac
292
293if [ x${shared} = xyes ]; then
45329a2c 294 case "${host}" in
9cfb301e
JL
295 hppa*)
296 host_makefile_frag="${host_makefile_frag} config/mh-papic"
297 ;;
f4132507
ILT
298 i[3456]86-*-cygwin32*)
299 # We don't want -fPIC on cygwin32.
300 ;;
9cfb301e
JL
301 i[3456]86-*)
302 host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
303 ;;
304 sparc64-*)
305 host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
306 ;;
307 powerpc*-*)
308 host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
309 ;;
bf31116d 310 alpha*-*-linux*)
9cfb301e
JL
311 host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
312 ;;
313 *)
5a67071d 314 if test -f ${srcdir}/config/mh-${host_cpu}pic; then
8e123593
JL
315 host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
316 fi
9cfb301e 317 ;;
45329a2c 318 esac
9cfb301e
JL
319fi
320
321rm -f mh-frag
322if [ -n "${host_makefile_frag}" ] ; then
323 for f in ${host_makefile_frag}
324 do
325 cat ${srcdir}/$f >> mh-frag
326 done
327 host_makefile_frag=mh-frag
45329a2c
JM
328fi
329
0df06ca0 330# per-target:
bc58b41d 331
9ab10a5b 332case "${target}" in
9cfb301e
JL
333 v810*)
334 target_makefile_frag="${target_makefile_frag} config/mt-v810"
335 ;;
336 i[3456]86-*-netware*)
337 target_makefile_frag="${target_makefile_frag} config/mt-netware"
338 ;;
339 powerpc-*-netware*)
340 target_makefile_frag="${target_makefile_frag} config/mt-netware"
341 ;;
456876c8
DE
342# start-sanitize-sky
343 mips64r59*-sky-elf*)
344 target_makefile_frag="${target_makefile_frag} config/mt-r5900 config/mt-sky"
345 ;;
346# end-sanitize-sky
276c2d7d 347# start-sanitize-r5900
9cfb301e
JL
348 mips64r59*)
349 target_makefile_frag="${target_makefile_frag} config/mt-r5900"
350 ;;
276c2d7d 351# end-sanitize-r5900
9cfb301e
JL
352 *-*-linux-gnu)
353 target_makefile_frag="${target_makefile_frag} config/mt-linux"
354 ;;
9ab10a5b
SEF
355esac
356
bcb92b02
MM
357# If --enable-target-optspace always use -Os instead of -O2 to build
358# the target libraries, similarly if it is not specified, use -Os
359# on selected platforms.
360case "${enable_target_optspace}:${target}" in
361 yes:*)
362 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
363 ;;
8c4774d9 364 :m32r-* | :d10v-* | :d30v-*)
bcb92b02
MM
365 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
366 ;;
34b65ac5 367 no:* | :*)
bcb92b02
MM
368 ;;
369 *)
370 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
371 ;;
372esac
373
ca2ce3b3 374skipdirs=
719cb03f
DZ
375gasdir=gas
376use_gnu_ld=
377use_gnu_as=
378
9f579565
DZ
379# some tools are so dependent upon X11 that if we're not building with X,
380# it's not even worth trying to configure, much less build, that tool.
381
382case ${with_x} in
e13fa011 383 yes | "") # the default value for this tree is that X11 is available
6a42d184 384 ;;
e13fa011 385 no)
6f1e2150 386 skipdirs="${skipdirs} tk libgui gash"
3718029f 387# start-sanitize-ide
f46d03c5 388 skipdirs="${skipdirs} libide libidetcl vmake jstools"
3718029f 389# end-sanitize-ide
9f579565
DZ
390 ;;
391 *)
392 echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
393 ;;
394esac
395
5357f128 396# Some tools are only suitable for building in a "native" situation.
ba4513e7
DZ
397# Those are added when we have a host==target configuration. For cross
398# toolchains, we add some directories that should only be useful in a
399# cross-compiler.
43557c0a 400
2a38983c
DHW
401is_cross_compiler=
402
94028943 403if [ x"${host}" = x"${target}" ] ; then
041164e4
DZ
404 # when doing a native toolchain, don't build the targets
405 # that are in the 'cross only' list
ca2ce3b3 406 skipdirs="${skipdirs} ${cross_only}"
2a38983c 407 is_cross_compiler=no
5b0b3ba6
ILT
408 # Default to --enable-multilib. See similar code below.
409 if [ x${enable_multilib} = xno ]; then
410 target_subdir=.
411 else
412 target_subdir=${target_alias}
413 fi
43557c0a 414else
041164e4
DZ
415 # similarly, don't build the targets in the 'native only'
416 # list when building a cross compiler
ca2ce3b3 417 skipdirs="${skipdirs} ${native_only}"
2a38983c 418 is_cross_compiler=yes
ab1cbc67 419 target_subdir=${target_alias}
43557c0a
DZ
420fi
421
3c4e3186
BK
422if [ ! -d ${target_subdir} ] ; then
423 if mkdir ${target_subdir} ; then true
424 else
425 echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
426 exit 1
427 fi
428fi
429
055cca84
ILT
430copy_dirs=
431
432# Handle --with-headers=XXX. The contents of the named directory are
52b5deb9 433# copied to $(tooldir)/sys-include.
055cca84
ILT
434if [ x"${with_headers}" != x ]; then
435 if [ x${is_cross_compiler} = xno ]; then
436 echo 1>&2 '***' --with-headers is only supported when cross compiling
437 exit 1
438 fi
439 case "${exec_prefixoption}" in
440 "") x=${prefix} ;;
441 *) x=${exec_prefix} ;;
442 esac
52b5deb9 443 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
055cca84
ILT
444fi
445
446# Handle --with-libs=XXX. Multiple directories are permitted. The
447# contents are copied to $(tooldir)/lib.
448if [ x"${with_libs}" != x ]; then
449 if [ x${is_cross_compiler} = xno ]; then
450 echo 1>&2 '***' --with-libs is only supported when cross compiling
451 exit 1
452 fi
453 # Copy the libraries in reverse order, so that files in the first named
454 # library override files in subsequent libraries.
455 case "${exec_prefixoption}" in
456 "") x=${prefix} ;;
457 *) x=${exec_prefix} ;;
458 esac
459 for l in ${with_libs}; do
460 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
461 done
462fi
463
464# If both --with-headers and --with-libs are specified, default to
465# --without-newlib.
466if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
467 if [ x"${with_newlib}" = x ]; then
468 with_newlib=no
469 fi
470fi
471
99dff294 472# Recognize --with-newlib/--without-newlib.
055cca84 473if [ x${with_newlib} = xno ]; then
ab1cbc67 474 skipdirs="${skipdirs} target-newlib"
99dff294 475elif [ x${with_newlib} = xyes ]; then
ab1cbc67 476 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
055cca84
ILT
477fi
478
4f0ad91b
ILT
479# Default to using --with-stabs for certain targets.
480if [ x${with_stabs} = x ]; then
481 case "${target}" in
780da94c
JM
482 mips*-*-irix6*)
483 ;;
f7954d86 484 mips*-*-* | alpha*-*-osf* | i[3456]86*-*-sysv4* | i[3456]86*-*-unixware*)
4f0ad91b
ILT
485 with_stabs=yes;
486 withoptions="${withoptions} --with-stabs"
487 ;;
488 esac
489fi
490
055cca84
ILT
491# Handle ${copy_dirs}
492set fnord ${copy_dirs}
493shift
494while [ $# != 0 ]; do
495 if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
496 :
497 else
498 echo Copying $1 to $2
499
500 # Use the install script to create the directory and all required
501 # parent directories.
502 if [ -d $2 ]; then
503 :
504 else
505 echo >config.temp
cc7e1635 506 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
055cca84
ILT
507 fi
508
509 # Copy the directory, assuming we have tar.
510 # FIXME: Should we use B in the second tar? Not all systems support it.
511 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
512
513 # It is the responsibility of the user to correctly adjust all
514 # symlinks. If somebody can figure out how to handle them correctly
515 # here, feel free to add the code.
516
517 echo $1 > $2/COPIED
518 fi
519 shift; shift
520done
521
eebd76cb
SC
522# Configure extra directories which are host specific
523
524case "${host}" in
f7954d86 525 i[3456]86-*-go32*)
a220ba0f 526 configdirs="$configdirs dosrel" ;;
0b0bd98b
JL
527 i[3456]86-*-mingw32*)
528 configdirs="$configdirs dosrel" ;;
e39c2bd2
GN
529 *-cygwin32*)
530 configdirs="$configdirs dosrel" ;;
eebd76cb
SC
531esac
532
5357f128 533# Remove more programs from consideration, based on the host or
dfa891fc 534# target this usually means that a port of the program doesn't
8ae559b7 535# exist yet.
dfa891fc 536
52e3ad87
KR
537noconfigdirs=""
538
9f579565 539case "${host}" in
f7954d86 540 i[3456]86-*-vsta)
d20af0bd 541 noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
3718029f 542# start-sanitize-ide
f46d03c5 543 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
3718029f 544# end-sanitize-ide
5f9e41cd
BE
545# start-sanitize-cygnus
546 noconfigdirs="$noconfigdirs flexlm"
547# end-sanitize-cygnus
8a3871bb 548 ;;
e087efc1 549 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
d20af0bd 550 noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
3718029f 551# start-sanitize-ide
f46d03c5 552 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
3718029f 553# end-sanitize-ide
5f9e41cd
BE
554# start-sanitize-cygnus
555 noconfigdirs="$noconfigdirs flexlm"
556# end-sanitize-cygnus
8c7fd353 557 ;;
0b0bd98b 558 i[3456]86-*-mingw32*)
c6c22ffe 559 # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
db5d8d39 560 noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
0b0bd98b 561 ;;
341aa377 562 *-*-cygwin32)
0db468b8 563 noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
9f579565 564 ;;
341aa377 565 *-*-windows*)
5707b74f 566# This is only used to build WinGDB...
e8f6afa3
FL
567# note that powerpc-eabi depends on sim configured before gdb.
568 configdirs="bfd libiberty opcodes readline sim gdb"
5707b74f 569 target_configdirs=
341aa377 570 ;;
c49f612a
JL
571 *-*-netbsd*)
572 noconfigdirs="rcs"
573 ;;
a51794f1 574 ppc*-*-pe)
c6c22ffe 575 noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
3718029f 576# start-sanitize-ide
f46d03c5 577 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
3718029f 578# end-sanitize-ide
5f9e41cd
BE
579# start-sanitize-cygnus
580 noconfigdirs="$noconfigdirs flexlm"
581# end-sanitize-cygnus
a51794f1 582 ;;
4f5f38f2
RH
583# start-sanitize-beos
584 i[3456]86-*-beos)
585 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
586 ;;
587# end-sanitize-beos
9f579565 588esac
dfa891fc 589
eebd76cb 590
43557c0a 591case "${target}" in
0f45fbc1 592 *-*-netware)
35cb2108 593 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
0f45fbc1 594 ;;
107e5276
DE
595 *-*-rtems*)
596 noconfigdirs="$noconfigdirs target-libgloss"
597 ;;
406477a6 598 *-*-vxworks*)
35cb2108 599 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
849367a2 600 ;;
bf31116d 601 alpha*-dec-osf*)
6bd3f765 602 # ld works, but does not support shared libraries. emacs doesn't
f5152f73 603 # work. newlib is not 64 bit ready. I'm not sure about fileutils.
2a3486d2 604 # gas doesn't generate exception information.
f5152f73 605 noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
0f45fbc1 606 ;;
bc70a918
ILT
607 alpha*-*-*vms*)
608 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
609 ;;
bf31116d 610 alpha*-*-linux*)
9cfb301e
JL
611 # newlib is not 64 bit ready
612 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
613 # linux has rx in libc
614 skipdirs="$skipdirs target-librx"
615 ;;
04b9315f 616 alpha*-*-*)
6bd3f765 617 # newlib is not 64 bit ready
35cb2108 618 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
0f45fbc1 619 ;;
7c71fc39 620 arc-*-*)
35cb2108 621 noconfigdirs="$noconfigdirs target-libgloss"
7c71fc39 622 ;;
bf150019 623 arm-*-pe*)
35cb2108 624 noconfigdirs="$noconfigdirs target-libgloss"
bf150019 625 ;;
875c8d5c
JSC
626 arm-*-coff*)
627 noconfigdirs="$noconfigdirs target-libgloss"
628 ;;
dd5ed749 629# CYGNUS LOCAL clm/arm-elf
db8f7171
CM
630 arm-*-elf*)
631 noconfigdirs="$noconfigdirs target-libgloss"
632 ;;
dd5ed749 633# END CYGNUS LOCAL
51654893 634 thumb-*-coff)
28b6fd89
NC
635 noconfigdirs="$noconfigdirs target-libgloss"
636 ;;
dd5ed749 637# CYGNUS LOCAL clm/arm-elf
db8f7171
CM
638 thumb-*-elf)
639 noconfigdirs="$noconfigdirs target-libgloss"
640 ;;
dd5ed749 641# END CYGNUS LOCAL
1f984018
NC
642 thumb-*-pe) # CYGNUS LOCAL nickc/thumb
643 noconfigdirs="$noconfigdirs target-libgloss"
644 ;;
ff15324f 645 arm-*-riscix*)
35cb2108 646 noconfigdirs="$noconfigdirs ld target-libgloss"
318b02b6 647 ;;
a1e636c8 648 d10v-*-*)
c1f6b406 649 noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss"
a1e636c8 650 ;;
c2304cba 651 d30v-*-*)
c2304cba 652 ;;
52e3ad87 653 h8300*-*-* | \
8388b9df 654 h8500-*-*)
35cb2108 655 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
15ae586e 656 ;;
8a71f0f3 657 hppa*-*-*elf* | \
107e5276 658 hppa*-*-lites*)
8c92a7d1 659 # Do configure ld/binutils/gas for this case.
99a5da15 660 ;;
15ae586e 661 hppa*-*-*)
408f64bc
JK
662 # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
663 # cc is gcc, and on any system a user should be able to link cc to
e37bb3c7 664 # whatever they want. FIXME, emacs emacs19).
8b5405d2 665 case "${CC}" in
e37bb3c7 666 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
772ebace 667 *) ;;
8b5405d2 668 esac
d9f1d487 669 noconfigdirs="$noconfigdirs ld shellutils"
15ae586e 670 ;;
e087efc1 671 i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
632ee4a1 672 # but don't build gdb
ab1cbc67 673 noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
8c92a7d1 674 ;;
0b0bd98b
JL
675 i[3456]86-*-mingw32*)
676 target_configdirs="$target_configdirs target-mingw"
677 noconfigdirs="$noconfigdirs expect target-libgloss"
678
53b0f196 679 # Can't build gdb for mingw32 if not native.
0b0bd98b
JL
680 case "${host}" in
681 i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
c6c22ffe 682 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
5f9e41cd
BE
683# start-sanitize-cygnus
684 noconfigdirs="$noconfigdirs flexlm"
685# end-sanitize-cygnus
0b0bd98b
JL
686 ;;
687 esac
688 ;;
ccac0df1 689 *-*-cygwin32*)
77cd090a 690 target_configdirs="$target_configdirs target-winsup"
53b0f196 691 noconfigdirs="$noconfigdirs target-gperf target-libgloss"
e1a1ddc6 692 # always build newlib.
ab1cbc67 693 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
9daacfc4
SC
694
695 # Can't build gdb for cygwin32 if not native.
5f8d8c91 696 case "${host}" in
ccac0df1 697 *-*-cygwin32*) ;; # keep gdb tcl tk expect etc.
c6c22ffe 698 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
64434418 699# start-sanitize-ide
f46d03c5 700 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
64434418 701# end-sanitize-ide
5f9e41cd
BE
702# start-sanitize-cygnus
703 noconfigdirs="$noconfigdirs flexlm"
704# end-sanitize-cygnus
64434418 705 ;;
9daacfc4 706 esac
a220ba0f 707 ;;
f7954d86 708 i[3456]86-*-pe)
35cb2108 709 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
8c7fd353 710 ;;
f7954d86 711 i[3456]86-*-sco3.2v5*)
a48876fc
SS
712 # The linker does not yet know about weak symbols in COFF,
713 # and is not configured to handle mixed ELF and COFF.
f43cc8f7 714 noconfigdirs="$noconfigdirs ld target-libgloss"
a48876fc 715 ;;
f7954d86 716 i[3456]86-*-sco*)
35cb2108 717 noconfigdirs="$noconfigdirs gprof target-libgloss"
de9117a7 718 ;;
f7954d86 719 i[3456]86-*-solaris2*)
320c9fff
KR
720 # The linker does static linking correctly, but the Solaris C library
721 # has bugs such that some important functions won't work when statically
722 # linked. (See man pages for getpwuid, for example.)
35cb2108 723 noconfigdirs="$noconfigdirs ld target-libgloss"
320c9fff 724 ;;
f7954d86 725 i[3456]86-*-sysv4*)
8b5405d2
DZ
726 # The SYSV4 C compiler doesn't handle Emacs correctly
727 case "${CC}" in
e37bb3c7 728 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
8b5405d2
DZ
729 *) ;;
730 esac
731 # but that's okay since emacs doesn't work anyway
35cb2108 732 noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
8b5405d2 733 ;;
ae1b99e4 734 mn10200-*-*)
5bf639ac
MA
735 noconfigdirs="$noconfigdirs"
736 if [ x${is_cross_compiler} != xno ] ; then
737 target_configdirs="${target_configdirs} target-libstub target-cygmon"
738 fi
ae1b99e4
JL
739 ;;
740 mn10300-*-*)
f33a8aa5 741 noconfigdirs="$noconfigdirs"
529fce81
MA
742 if [ x${is_cross_compiler} != xno ] ; then
743 target_configdirs="${target_configdirs} target-libstub target-cygmon"
744 fi
be9b9d69 745 ;;
3e1e245d
ILT
746 powerpc-*-aix*)
747 # copied from rs6000-*-* entry
7751f03a 748 noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss"
3d40ace0
ILT
749 # This is needed until gcc and ld are fixed to work together.
750 use_gnu_ld=no
3e1e245d 751 ;;
a51794f1
JM
752 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
753 target_configdirs="$target_configdirs target-winsup"
c6c22ffe 754 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
3718029f 755# start-sanitize-ide
f46d03c5 756 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
3718029f 757# end-sanitize-ide
5f9e41cd
BE
758# start-sanitize-cygnus
759 noconfigdirs="$noconfigdirs flexlm"
760# end-sanitize-cygnus
a51794f1
JM
761 # always build newlib.
762 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
81d08d0c 763 ;;
59d95e81 764 # This is temporary until we can link against shared libraries
8970d123 765 powerpcle-*-solaris*)
c6c22ffe 766 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
3718029f 767# start-sanitize-ide
f46d03c5 768 noconfigdirs="$noconfigdirs libide libidetcl vmake jstools"
3718029f 769# end-sanitize-ide
5f9e41cd
BE
770# start-sanitize-cygnus
771 noconfigdirs="$noconfigdirs flexlm"
772# end-sanitize-cygnus
8970d123 773 ;;
2a38983c 774 rs6000-*-lynxos*)
2a38983c
DHW
775 # The CVS server code doesn't work on the RS/6000
776 # Newlib makes problems for libg++ in crosses.
7751f03a 777 noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
2a38983c 778 ;;
3d40ace0
ILT
779 rs6000-*-aix*)
780 noconfigdirs="$noconfigdirs gprof"
781 # This is needed until gcc and ld are fixed to work together.
782 use_gnu_ld=no
783 ;;
8388b9df 784 rs6000-*-*)
92caaa6a 785 noconfigdirs="$noconfigdirs gprof"
fcf4d286 786 ;;
becf2d8a 787 m68k-apollo-*)
35cb2108 788 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
becf2d8a 789 ;;
04b9315f
ILT
790 mips*-*-irix5*)
791 # The GNU linker does not support shared libraries.
82633710 792 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
35cb2108 793 noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
04b9315f 794 ;;
79a2d56d 795 mips*-*-irix6*)
07057350 796 # The GNU assembler and linker do not support IRIX 6.
79a2d56d 797 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
4ceaca77 798 noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
79a2d56d 799 ;;
af9fa3c1 800 mips*-dec-bsd*)
35cb2108 801 noconfigdirs="$noconfigdirs gprof target-libgloss"
af9fa3c1
ILT
802 ;;
803 mips*-*-bsd*)
35cb2108 804 noconfigdirs="$noconfigdirs gprof target-libgloss"
af9fa3c1 805 ;;
456876c8
DE
806 mipstx39-*-*)
807 noconfigdirs="$noconfigdirs gprof" # same as generic mips
b57c473d
JM
808 target_configdirs="${target_configdirs} target-libstub target-cygmon"
809 ;;
456876c8
DE
810# start-sanitize-sky
811 mips64r5900-sky-elf*)
812 noconfigdirs="$noconfigdirs gprof"
813 extraconfigdirs="$extraconfigdirs gas,dvp-gas,dvp-elf"
814 ;;
815# end-sanitize-sky
04b9315f 816 mips*-*-*)
52e3ad87 817 noconfigdirs="$noconfigdirs gprof"
fcf4d286 818 ;;
de9117a7 819 romp-*-*)
35cb2108 820 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
de9117a7 821 ;;
817382d1 822 sh-*-*)
719cb03f 823 case "${host}" in
f7954d86 824 i[3456]86-*-vsta) ;; # don't add gprof back in
e087efc1
ILT
825 i[3456]86-*-go32*) ;; # don't add gprof back in
826 i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
ca2ce3b3 827 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
719cb03f 828 esac
35cb2108 829 noconfigdirs="$noconfigdirs target-libgloss"
719cb03f 830 ;;
664298e6
BM
831 sparc-*-elf*)
832 if [ x${is_cross_compiler} != xno ] ; then
f4434c50 833 target_configdirs="${target_configdirs} target-libstub target-cygmon"
664298e6
BM
834 fi
835 ;;
ddfa23cb
BM
836 sparc64-*-elf*)
837 if [ x${is_cross_compiler} != xno ] ; then
f4434c50 838 target_configdirs="${target_configdirs} target-libstub target-cygmon"
ddfa23cb
BM
839 fi
840 ;;
664298e6
BM
841 sparclite-*-aout*)
842 if [ x${is_cross_compiler} != xno ] ; then
f4434c50 843 target_configdirs="${target_configdirs} target-libstub target-cygmon"
664298e6
BM
844 fi
845 ;;
719cb03f 846 sparc-*-sunos4*)
2a38983c 847 if [ x${is_cross_compiler} != xno ] ; then
35cb2108 848 noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
2a38983c
DHW
849 else
850 use_gnu_ld=no
851 fi
1f69e88d 852 ;;
69f273d8 853# start-sanitize-sky
e086cc6c 854 dvp-*-elf*)
587c41ae 855 noconfigdirs="$noconfigdirs gcc gdb sim"
83f35963 856 noconfigdirs="$noconfigdirs itcl libgui tk tix"
e086cc6c
DE
857 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty"
858 noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio"
859 ;;
69f273d8 860# end-sanitize-sky
486e0f0a 861 v810-*-*)
35cb2108 862 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
486e0f0a 863 ;;
3f5d1c2c 864 v850-*-*)
d77852a4 865 noconfigdirs="$noconfigdirs target-libgloss"
3f5d1c2c 866 ;;
492c2670
NC
867# start-sanitize-v850e
868 v850e-*-*)
869 noconfigdirs="$noconfigdirs target-libgloss"
870 ;;
67a46fe9 871 v850ea-*-*)
492c2670
NC
872 noconfigdirs="$noconfigdirs target-libgloss"
873 ;;
092859e8 874# end-sanitize-v850e
de9117a7 875 vax-*-vms)
35cb2108 876 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
de9117a7
KR
877 ;;
878 vax-*-*)
35cb2108 879 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
8388b9df 880 ;;
de9117a7 881 *-*-lynxos*)
19b1d034 882 # Newlib makes problems for libg++ in crosses.
35cb2108 883 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
19b1d034
SS
884 ;;
885 *-*-macos* | \
886 *-*-mpw*)
887 # Macs want a resource compiler.
888 configdirs="$configdirs grez"
889 ;;
4f5f38f2
RH
890# start-sanitize-beos
891 i[3456]86-*-beos)
892 noconfigdirs="$noconfigdirs target-gperf"
893 ;;
894# end-sanitize-beos
05cd8d98
HS
895esac
896
9a8629d5
ILT
897# If we aren't building newlib, then don't build libgloss, since libgloss
898# depends upon some newlib header files.
899case "${noconfigdirs}" in
900 *target-libgloss*) ;;
901 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
902esac
903
5ea0771f
DE
904# start-sanitize-cygnus
905# Only configure cgen if --enable-cgen-maint.
906if [ x$"enable_cgen_maint" != xyes ] ; then
907 noconfigdirs="$noconfigdirs cgen"
908fi
909
910# end-sanitize-cygnus
d4cf72b3
BK
911# Make sure we don't let GNU ld be added if we didn't want it.
912if [ x$with_gnu_ld = xno ]; then
913 use_gnu_ld=no
914 noconfigdirs="$noconfigdirs ld"
0b0124c6
BK
915fi
916
d4cf72b3
BK
917# Make sure we don't let GNU as be added if we didn't want it.
918if [ x$with_gnu_as = xno ]; then
919 use_gnu_as=no
920 noconfigdirs="$noconfigdirs gas"
0b0124c6
BK
921fi
922
ca2ce3b3
ILT
923# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
924# $target_configdirs.
925# If we have the source for $noconfigdirs entries, add them to $notsupp.
efd7b806 926
52e3ad87 927notsupp=""
ca2ce3b3 928for dir in . $skipdirs $noconfigdirs ; do
b58d9e5d 929 dirname=`echo $dir | sed -e s/target-//g`
1c15a33d 930 if [ $dir != . ] && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
8f30a41e 931 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
b58d9e5d
PB
932 if [ -r $srcdir/$dirname/configure ] \
933 || [ -r $srcdir/$dirname/configure.in ]; then
ca2ce3b3
ILT
934 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
935 true
936 else
937 notsupp="$notsupp $dir"
938 fi
939 fi
940 fi
941 if [ $dir != . ] && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
942 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
b58d9e5d
PB
943 if [ -r $srcdir/$dirname/configure ] \
944 || [ -r $srcdir/$dirname/configure.in ]; then
ca2ce3b3
ILT
945 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
946 true
947 else
948 notsupp="$notsupp $dir"
949 fi
52e3ad87
KR
950 fi
951 fi
952done
953
fba66802
ILT
954# Sometimes the tools are distributed with libiberty but with no other
955# libraries. In that case, we don't want to build target-libiberty.
956if [ -n "${target_configdirs}" ]; then
957 others=
b58d9e5d 958 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
fba66802
ILT
959 if [ "$i" != "libiberty" ]; then
960 if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
961 others=yes;
962 break;
963 fi
964 fi
965 done
966 if [ -z "${others}" ]; then
967 target_configdirs=
968 fi
969fi
970
ca2ce3b3
ILT
971# Deconfigure all subdirectories, in case we are changing the
972# configuration from one where a subdirectory is supported to one where it
973# is not.
8beb827a 974if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
b58d9e5d 975 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
ca2ce3b3
ILT
976 rm -f $i/Makefile
977 done
978fi
8beb827a 979if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then
9bbc0d58 980 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
ab1cbc67
PB
981 rm -f ${target_subdir}/$i/Makefile
982 done
983fi
ca2ce3b3 984
52e3ad87
KR
985# Produce a warning message for the subdirs we can't configure.
986# This isn't especially interesting in the Cygnus tree, but in the individual
987# FSF releases, it's important to let people know when their machine isn't
988# supported by the one or two programs in a package.
989
9fe444b5 990if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
af9fa3c1
ILT
991 # If $appdirs is non-empty, at least one of those directories must still
992 # be configured, or we error out. (E.g., if the gas release supports a
993 # specified target in some subdirs but not the gas subdir, we shouldn't
994 # pretend that all is well.)
995 if [ -n "$appdirs" ]; then
996 for dir in $appdirs ; do
ca2ce3b3
ILT
997 if [ -r $dir/Makefile.in ]; then
998 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
999 appdirs=""
1000 break
1001 fi
1002 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1003 appdirs=""
1004 break
1005 fi
af9fa3c1
ILT
1006 fi
1007 done
1008 if [ -n "$appdirs" ]; then
1009 echo "*** This configuration is not supported by this package." 1>&2
1010 exit 1
1011 fi
1012 fi
1013 # Okay, some application will build, or we don't care to check. Still
1014 # notify of subdirs not getting built.
52e3ad87
KR
1015 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
1016 echo " ${notsupp}" 1>&2
1017 echo " (Any other directories should still work fine.)" 1>&2
1018fi
1019
d4cf72b3
BK
1020# Set with_gnu_as and with_gnu_ld as appropriate.
1021#
1022# This is done by determining whether or not the appropriate directory
1023# is available, and by checking whether or not specific configurations
1024# have requested that this magic not happen.
1025#
1026# The command line options always override the explicit settings in
1027# configure.in, and the settings in configure.in override this magic.
1028#
1029# If the default for a toolchain is to use GNU as and ld, and you don't
1030# want to do that, then you should use the --without-gnu-as and
1031# --without-gnu-ld options for the configure script.
1032
1033if [ x${use_gnu_as} = x ] ; then
1034 if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
1035 with_gnu_as=yes
1036 withoptions="$withoptions --with-gnu-as"
1037 fi
1038fi
1039
1040if [ x${use_gnu_ld} = x ] ; then
1041 if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
1042 with_gnu_ld=yes
1043 withoptions="$withoptions --with-gnu-ld"
1044 fi
1045fi
1046
d5a8bfde
ILT
1047# If using newlib, add --with-newlib to the withoptions so that gcc/configure
1048# can detect this case.
1049
1050if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1051 with_newlib=yes
1052 withoptions="$withoptions --with-newlib"
1053fi
1054
d4be7765 1055if [ x${shared} = xyes ]; then
45329a2c 1056 case "${target}" in
9cfb301e
JL
1057 hppa*)
1058 target_makefile_frag="${target_makefile_frag} config/mt-papic"
1059 ;;
1060 i[3456]86-*)
1061 target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1062 ;;
1063 powerpc*-*)
1064 target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1065 ;;
bf31116d 1066 alpha*-*-linux*)
9cfb301e
JL
1067 target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1068 ;;
1069 *)
5a67071d 1070 if test -f ${srcdir}/config/mt-${target_cpu}pic; then
8e123593
JL
1071 target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1072 fi
9cfb301e 1073 ;;
45329a2c
JM
1074 esac
1075fi
1076
9cfb301e
JL
1077rm -f mt-frag
1078if [ -n "${target_makefile_frag}" ] ; then
1079 for f in ${target_makefile_frag}
1080 do
1081 cat ${srcdir}/$f >> mt-frag
1082 done
1083 target_makefile_frag=mt-frag
1084fi
1085
ca2ce3b3
ILT
1086# post-target:
1087
b5ae8419
ILT
1088# Make sure that the compiler is able to generate an executable. If it
1089# can't, we are probably in trouble. We don't care whether we can run the
1090# executable--we might be using a cross compiler--we only care whether it
1091# can be created. At this point the main configure script has set CC.
1092echo "int main () { return 0; }" > conftest.c
1093${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
51654893 1094if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
b5ae8419
ILT
1095 :
1096else
1097 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1098 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1099 rm -f conftest*
1100 exit 1
1101fi
1102rm -f conftest*
1103
0e47ce97
ILT
1104# The Solaris /usr/ucb/cc compiler does not appear to work.
1105case "${host}" in
1106 sparc-sun-solaris2*)
e94c0e40
JM
1107 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1108 if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
0e47ce97
ILT
1109 could_use=
1110 [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
1111 if [ -d /opt/cygnus/bin ] ; then
1112 if [ "$could_use" = "" ] ; then
1113 could_use="/opt/cygnus/bin"
1114 else
1115 could_use="$could_use or /opt/cygnus/bin"
1116 fi
1117 fi
1118 if [ "$could_use" = "" ] ; then
1119 echo "Warning: compilation may fail because you're using"
1120 echo "/usr/ucb/cc. You should change your PATH or CC "
1121 echo "variable and rerun configure."
1122 else
1123 echo "Warning: compilation may fail because you're using"
1124 echo "/usr/ucb/cc, when you should use the C compiler from"
1125 echo "$could_use. You should change your"
1126 echo "PATH or CC variable and rerun configure."
1127 fi
1128 fi
1129 ;;
1130esac
1131
294fde1f
ILT
1132# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1133# binutils tools will find libbfd.so.
d4be7765 1134if [ "${shared}" = "yes" ]; then
294fde1f
ILT
1135 sed -e 's/^SET_LIB_PATH[ ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
1136 Makefile > Makefile.tem
1137 rm -f Makefile
1138 mv -f Makefile.tem Makefile
f2693093
ILT
1139
1140 case "${host}" in
1141 *-*-hpux*)
2ac94d51 1142 sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
f2693093
ILT
1143 Makefile > Makefile.tem
1144 rm -f Makefile
1145 mv -f Makefile.tem Makefile
1146 ;;
1147 esac
294fde1f
ILT
1148fi
1149
ca2ce3b3 1150# Record target_configdirs and the configure arguments in Makefile.
ab1cbc67 1151target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
ca2ce3b3 1152targargs=`echo "${arguments}" | \
72743e37 1153 sed -e 's/--no[^ ]*//' \
7fc36fda
ILT
1154 -e 's/--cache[a-z-]*=[^ ]*//' \
1155 -e 's/--ho[a-z-]*=[^ ]*//' \
41547e90 1156 -e 's/--bu[a-z-]*=[^ ]*//' \
7fc36fda
ILT
1157 -e 's/--ta[a-z-]*=[^ ]*//'`
1158
1159# Passing a --with-cross-host argument lets the target libraries know
1160# whether they are being built with a cross-compiler or being built
1161# native. However, it would be better to use other mechanisms to make the
1162# sorts of decisions they want to make on this basis. Please consider
1163# this option to be deprecated. FIXME.
1164if [ x${is_cross_compiler} = xyes ]; then
41547e90 1165 targargs="--with-cross-host=${host_alias} ${targargs}"
7fc36fda
ILT
1166fi
1167
07057350
JM
1168# Default to --enable-multilib.
1169if [ x${enable_multilib} = x ]; then
1170 targargs="--enable-multilib ${targargs}"
1171fi
1172
ff2664fc
ILT
1173# Pass --with-newlib if appropriate. Note that target_configdirs has
1174# changed from the earlier setting of with_newlib.
1175if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1176 targargs="--with-newlib ${targargs}"
1177fi
1178
41547e90 1179targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
ca2ce3b3
ILT
1180sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
1181 -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
ab1cbc67 1182 -e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
ca2ce3b3
ILT
1183 Makefile > Makefile.tem
1184rm -f Makefile
1185mv -f Makefile.tem Makefile
1186
bc58b41d
RP
1187#
1188# Local Variables:
1189# fill-column: 131
1190# End:
1191#
This page took 0.299603 seconds and 4 git commands to generate.