source: trunk/src/gcc/configure.in@ 44

Last change on this file since 44 was 9, checked in by bird, 22 years ago

Applied initial diff from Platon.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 53.9 KB
Line 
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
17# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
18# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
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
36### To add a new directory to the tree, first choose whether it is a target
37### or a host dependent tool. Then put it into the appropriate list
38### (library or tools, host or target), doing a dependency sort. For
39### example, gdb requires that byacc (or bison) be built first, so it is in
40### the ${host_tools} list after byacc and bison.
41
42
43# these libraries are used by various programs built for the host environment
44#
45host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tcl8.1 tk8.1 tclX itcl tix libgui zlib"
46
47if [ "${enable_gdbgui}" = "yes" ] ; then
48 host_libs="${host_libs} libgui"
49fi
50
51libstdcxx_version="target-libstdc++-v3"
52# Don't use libstdc++-v3's flags to configure/build itself.
53libstdcxx_flags='`case $$dir in libstdc++-v3 | libjava) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
54
55# these tools are built for the host environment
56# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
57# know that we are building the simulator.
58host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip fastjar"
59
60# libgcj represents the runtime libraries only used by gcj.
61libgcj="target-libffi \
62 target-boehm-gc \
63 target-zlib \
64 target-qthreads \
65 target-libjava"
66
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)
69#
70target_libs="target-libiberty \
71 target-libgloss \
72 target-newlib \
73 target-librx \
74 ${libstdcxx_version} \
75 target-libf2c \
76 ${libgcj}
77 target-libobjc"
78
79# these tools are built using the target libs, and are intended to run only
80# in the target environment
81#
82# note: any program that *uses* libraries that are in the "target_libs"
83# list belongs in this list. those programs are also very likely
84# candidates for the "native_only" list which follows
85#
86target_tools="target-examples target-groff target-gperf"
87
88################################################################################
89
90## These two lists are of directories that are to be removed from the
91## ${configdirs} list for either cross-compilations or for native-
92## compilations. For example, it doesn't make that much sense to
93## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
94## a native environment.
95
96# directories to be built in the native environment only
97#
98# This must be a single line because of the way it is searched by grep in
99# the code below.
100native_only="autoconf automake libtool cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time ash bash bzip2 prms snavigator gnuserv target-gperf"
101
102# directories to be built in a cross environment only
103#
104cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
105
106## All tools belong in one of the four categories, and are assigned above
107## We assign ${configdirs} this way to remove all embedded newlines. This
108## is important because configure will choke if they ever get through.
109## ${configdirs} is directories we build using the host tools.
110## ${target_configdirs} is directories we build using the target tools.
111#
112configdirs=`echo ${host_libs} ${host_tools}`
113target_configdirs=`echo ${target_libs} ${target_tools}`
114
115################################################################################
116
117srctrigger=move-if-change
118srcname="gnu development package"
119
120# This gets set non-empty for some net releases of packages.
121appdirs=""
122
123# per-host:
124
125# Work in distributions that contain no compiler tools, like Autoconf.
126if [ -d ${srcdir}/config ]; then
127case "${host}" in
128 m68k-hp-hpux*)
129 host_makefile_frag="${host_makefile_frag} config/mh-hp300"
130 ;;
131 m68k-apollo-sysv*)
132 host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
133 ;;
134 m68k-apollo-bsd*)
135 host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
136 ;;
137 m88k-dg-dgux*)
138 host_makefile_frag="${host_makefile_frag} config/mh-dgux"
139 ;;
140 m88k-harris-cxux*)
141 host_makefile_frag="${host_makefile_frag} config/mh-cxux"
142 ;;
143 m88k-motorola-sysv*)
144 host_makefile_frag="${host_makefile_frag} config/mh-delta88"
145 ;;
146 mips*-dec-ultrix*)
147 host_makefile_frag="${host_makefile_frag} config/mh-decstation"
148 ;;
149 mips*-nec-sysv4*)
150 host_makefile_frag="${host_makefile_frag} config/mh-necv4"
151 ;;
152 mips*-sgi-irix6*)
153 host_makefile_frag="${host_makefile_frag} config/mh-irix6"
154 ;;
155 mips*-sgi-irix5*)
156 host_makefile_frag="${host_makefile_frag} config/mh-irix5"
157 ;;
158 mips*-sgi-irix4*)
159 host_makefile_frag="${host_makefile_frag} config/mh-irix4"
160 ;;
161 mips*-sgi-irix3*)
162 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
163 ;;
164 mips*-*-sysv4*)
165 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
166 ;;
167 mips*-*-sysv*)
168 host_makefile_frag="${host_makefile_frag} config/mh-riscos"
169 ;;
170 i370-ibm-opened*)
171 host_makefile_frag="${host_makefile_frag} config/mh-openedition"
172 ;;
173 i[3456]86-*-sysv5*)
174 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
175 ;;
176 i[3456]86-*-dgux*)
177 host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
178 ;;
179 i[3456]86-ncr-sysv4.3*)
180 host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
181 ;;
182 i[3456]86-ncr-sysv4*)
183 host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
184 ;;
185 i[3456]86-*-sco3.2v5*)
186 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
187 ;;
188 i[3456]86-*-sco*)
189 host_makefile_frag="${host_makefile_frag} config/mh-sco"
190 ;;
191 i[3456]86-*-udk*)
192 host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
193 ;;
194 i[3456]86-*-isc*)
195 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
196 ;;
197 i[3456]86-*-solaris2*)
198 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
199 ;;
200 i[3456]86-*-aix*)
201 host_makefile_frag="${host_makefile_frag} config/mh-aix386"
202 ;;
203 i[3456]86-*-msdosdjgpp*)
204 host_makefile_frag="${host_makefile_frag} config/mh-djgpp"
205 ;;
206 *-cygwin*)
207 host_makefile_frag="${host_makefile_frag} config/mh-cygwin"
208 ;;
209 *-mingw32*)
210 host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
211 ;;
212 *-interix*)
213 host_makefile_frag="${host_makefile_frag} config/mh-interix"
214 ;;
215 *-windows*)
216 host_makefile_frag="${host_makefile_frag} config/mh-windows"
217 ;;
218 vax-*-ultrix2*)
219 host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
220 ;;
221 *-*-solaris2*)
222 host_makefile_frag="${host_makefile_frag} config/mh-solaris"
223 ;;
224 m68k-sun-sunos*)
225 host_makefile_frag="${host_makefile_frag} config/mh-sun3"
226 ;;
227 *-hp-hpux[78]*)
228 host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
229 ;;
230 *-hp-hpux*)
231 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
232 ;;
233 *-*-hiux*)
234 host_makefile_frag="${host_makefile_frag} config/mh-hpux"
235 ;;
236 rs6000-*-lynxos*)
237 host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
238 ;;
239 *-*-lynxos*)
240 host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
241 ;;
242 *-*-sysv4*)
243 host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
244 ;;
245 *-*-sysv*)
246 host_makefile_frag="${host_makefile_frag} config/mh-sysv"
247 ;;
248 i[3456]86-*-os2*)
249 host_makefile_frag="${host_makefile_frag} config/mh-emx"
250 ;;
251esac
252fi
253
254# If we aren't going to be using gcc, see if we can extract a definition
255# of CC from the fragment.
256if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then
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"
267 if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then
268 xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
269 if [ -n "${xx}" ] ; then
270 CC=$xx
271 fi
272 fi
273fi
274
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
279 alpha*-dec-osf*) enable_shared=yes ;;
280 alpha*-*-linux*) enable_shared=yes ;;
281 mips-sgi-irix5*) enable_shared=yes ;;
282 *) enable_shared=no ;;
283 esac
284fi
285
286# hpux11 in 64bit mode has libraries in a weird place. Arrange to find
287# them automatically.
288case "${host}" in
289 hppa*64*-*-hpux11*)
290 withoptions="$withoptions -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
291 ;;
292esac
293
294case "${enable_shared}" in
295 yes) shared=yes ;;
296 no) shared=no ;;
297 "") shared=no ;;
298 *) shared=yes ;;
299esac
300
301if [ x${shared} = xyes ]; then
302 case "${host}" in
303 alpha*-*-linux*)
304 host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
305 ;;
306 arm*-*-*)
307 host_makefile_frag="${host_makefile_frag} config/mh-armpic"
308 ;;
309 parisc*-*-* | hppa*-*-*)
310 host_makefile_frag="${host_makefile_frag} config/mh-papic"
311 ;;
312 i[3456]86-*-cygwin*)
313 # We don't want -fPIC on Cygwin.
314 ;;
315 i[3456]86-*-*)
316 host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
317 ;;
318 i370-*-*)
319 host_makefile_frag="${host_makefile_frag} config/mh-i370pic"
320 ;;
321 ia64-*-*)
322 host_makefile_frag="${host_makefile_frag} config/mh-ia64pic"
323 ;;
324 sparc64-*-*)
325 host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
326 ;;
327 powerpc*-*-aix*)
328 # We don't want -fPIC on AIX.
329 ;;
330 powerpc*-*-*)
331 host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
332 ;;
333 *-*-*)
334 if test -f ${srcdir}/config/mh-${host_cpu}pic; then
335 host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
336 fi
337 ;;
338 esac
339fi
340
341rm -f mh-frag
342if [ -n "${host_makefile_frag}" ] ; then
343 for f in ${host_makefile_frag}
344 do
345 cat ${srcdir}/$f >> mh-frag
346 done
347 host_makefile_frag=mh-frag
348fi
349
350# per-target:
351
352case "${target}" in
353 v810*)
354 target_makefile_frag="${target_makefile_frag} config/mt-v810"
355 ;;
356 i[3456]86-*-netware*)
357 target_makefile_frag="${target_makefile_frag} config/mt-netware"
358 ;;
359 powerpc-*-netware*)
360 target_makefile_frag="${target_makefile_frag} config/mt-netware"
361 ;;
362 alpha*-*-linux*)
363 target_makefile_frag="${target_makefile_frag} config/mt-linux"
364 target_makefile_frag="${target_makefile_frag} config/mt-alphaieee"
365 ;;
366 alpha*-*-*)
367 target_makefile_frag="${target_makefile_frag} config/mt-alphaieee"
368 ;;
369 *-*-linux*)
370 target_makefile_frag="${target_makefile_frag} config/mt-linux"
371 ;;
372 *-*-aix4.[3456789]* | *-*-aix[56789].*)
373 target_makefile_frag="${target_makefile_frag} config/mt-aix43"
374 ;;
375 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
376 target_makefile_frag="${target_makefile_frag} config/mt-wince"
377 ;;
378esac
379
380# If --enable-target-optspace always use -Os instead of -O2 to build
381# the target libraries, similarly if it is not specified, use -Os
382# on selected platforms.
383case "${enable_target_optspace}:${target}" in
384 yes:*)
385 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
386 ;;
387 :d30v-*)
388 target_makefile_frag="${target_makefile_frag} config/mt-d30v"
389 ;;
390 :m32r-* | :d10v-* | :fr30-*)
391 target_makefile_frag="${target_makefile_frag} config/mt-ospace"
392 ;;
393 no:* | :*)
394 ;;
395 *)
396 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
397 ;;
398esac
399
400skipdirs=
401gasdir=gas
402use_gnu_ld=
403use_gnu_as=
404
405# some tools are so dependent upon X11 that if we're not building with X,
406# it's not even worth trying to configure, much less build, that tool.
407
408case ${with_x} in
409 yes | "") # the default value for this tree is that X11 is available
410 ;;
411 no)
412 skipdirs="${skipdirs} tk libgui gash"
413 ;;
414 *)
415 echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
416 ;;
417esac
418
419# Some tools are only suitable for building in a "native" situation.
420# Those are added when we have a host==target configuration. For cross
421# toolchains, we add some directories that should only be useful in a
422# cross-compiler.
423
424is_cross_compiler=
425
426if [ x"${host}" = x"${target}" ] ; then
427 # when doing a native toolchain, don't build the targets
428 # that are in the 'cross only' list
429 skipdirs="${skipdirs} ${cross_only}"
430 is_cross_compiler=no
431else
432 # similarly, don't build the targets in the 'native only'
433 # list when building a cross compiler
434 skipdirs="${skipdirs} ${native_only}"
435 is_cross_compiler=yes
436fi
437
438# We always want to use the same name for this directory, so that dejagnu
439# can reliably find it.
440target_subdir=${target_alias}
441
442if [ ! -d ${target_subdir} ] ; then
443 if mkdir ${target_subdir} ; then true
444 else
445 echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
446 exit 1
447 fi
448fi
449
450build_subdir=${build_alias}
451
452if [ x"${build_alias}" != x"${host}" ] ; then
453 if [ ! -d ${build_subdir} ] ; then
454 if mkdir ${build_subdir} ; then true
455 else
456 echo "'*** could not make ${PWD=`pwd`}/${build_subdir}" 1>&2
457 exit 1
458 fi
459 fi
460fi
461
462copy_dirs=
463
464# Handle --with-headers=XXX. The contents of the named directory are
465# copied to $(tooldir)/sys-include.
466if [ x"${with_headers}" != x ]; then
467 if [ x${is_cross_compiler} = xno ]; then
468 echo 1>&2 '***' --with-headers is only supported when cross compiling
469 exit 1
470 fi
471 case "${exec_prefixoption}" in
472 "") x=${prefix} ;;
473 *) x=${exec_prefix} ;;
474 esac
475 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
476fi
477
478# Handle --with-libs=XXX. Multiple directories are permitted. The
479# contents are copied to $(tooldir)/lib.
480if [ x"${with_libs}" != x ]; then
481 if [ x${is_cross_compiler} = xno ]; then
482 echo 1>&2 '***' --with-libs is only supported when cross compiling
483 exit 1
484 fi
485 # Copy the libraries in reverse order, so that files in the first named
486 # library override files in subsequent libraries.
487 case "${exec_prefixoption}" in
488 "") x=${prefix} ;;
489 *) x=${exec_prefix} ;;
490 esac
491 for l in ${with_libs}; do
492 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
493 done
494fi
495
496# If both --with-headers and --with-libs are specified, default to
497# --without-newlib.
498if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
499 if [ x"${with_newlib}" = x ]; then
500 with_newlib=no
501 fi
502fi
503
504# Recognize --with-newlib/--without-newlib.
505if [ x${with_newlib} = xno ]; then
506 skipdirs="${skipdirs} target-newlib"
507elif [ x${with_newlib} = xyes ]; then
508 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
509fi
510
511# Default to using --with-stabs for certain targets.
512if [ x${with_stabs} = x ]; then
513 case "${target}" in
514 mips*-*-irix6*)
515 ;;
516 mips*-*-* | alpha*-*-osf*)
517 with_stabs=yes;
518 withoptions="${withoptions} --with-stabs"
519 ;;
520 esac
521fi
522
523# Handle ${copy_dirs}
524set fnord ${copy_dirs}
525shift
526while [ $# != 0 ]; do
527 if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
528 :
529 else
530 echo Copying $1 to $2
531
532 # Use the install script to create the directory and all required
533 # parent directories.
534 if [ -d $2 ]; then
535 :
536 else
537 echo >config.temp
538 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
539 fi
540
541 # Copy the directory, assuming we have tar.
542 # FIXME: Should we use B in the second tar? Not all systems support it.
543 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
544
545 # It is the responsibility of the user to correctly adjust all
546 # symlinks. If somebody can figure out how to handle them correctly
547 # here, feel free to add the code.
548
549 echo $1 > $2/COPIED
550 fi
551 shift; shift
552done
553
554# Configure extra directories which are host specific
555
556case "${host}" in
557 i[3456]86-*-go32*)
558 configdirs="$configdirs dosrel" ;;
559 i[3456]86-*-mingw32*)
560 configdirs="$configdirs dosrel" ;;
561 *-cygwin*)
562 configdirs="$configdirs libtermcap dosrel" ;;
563esac
564
565# Remove more programs from consideration, based on the host or
566# target this usually means that a port of the program doesn't
567# exist yet.
568
569noconfigdirs=""
570
571case "${host}" in
572 hppa*64*-*-*)
573 noconfigdirs="$noconfigdirs byacc"
574 ;;
575 i[3456]86-*-vsta)
576 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"
577 ;;
578 i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
579 noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile apache inet itcl tix db snavigator gnuserv libffi"
580 ;;
581 i[3456]86-*-mingw32*)
582 # 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"
583 noconfigdirs="expect dejagnu cvs autoconf automake send-pr rcs guile perl texinfo apache inet libtool"
584 ;;
585 i[3456]86-*-beos*)
586 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
587 ;;
588 *-*-cygwin*)
589 noconfigdirs="autoconf automake send-pr rcs guile perl apache inet"
590 ;;
591 *-*-netbsd*)
592 noconfigdirs="rcs"
593 ;;
594 ppc*-*-pe)
595 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"
596 ;;
597 powerpc-*-beos*)
598 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
599 ;;
600esac
601
602# Save it here so that, even in case of --enable-libgcj, if the Java
603# front-end isn't enabled, we still get libgcj disabled.
604libgcj_saved=$libgcj
605case $enable_libgcj in
606yes)
607 # If we reset it here, it won't get added to noconfigdirs in the
608 # target-specific build rules, so it will be forcibly enabled
609 # (unless the Java language itself isn't enabled).
610 libgcj=
611 ;;
612no)
613 # Make sure we get it printed in the list of not supported target libs.
614 noconfigdirs="$noconfigdirs ${libgcj}"
615 ;;
616esac
617
618case "${target}" in
619 *-*-chorusos)
620 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
621 ;;
622 *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
623 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
624 ;;
625 *-*-netbsd*)
626 # Skip some stuff on all NetBSD configurations.
627 skipdirs="$skipdirs target-newlib target-libiberty target-libgloss"
628
629 # Skip some stuff that's unsupported on some NetBSD configurations.
630 case "${target}" in
631 i*86-*-netbsdelf*) ;;
632 *)
633 noconfigdirs="$noconfigdirs ${libgcj}"
634 ;;
635 esac
636 ;;
637 *-*-netware)
638 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss ${libgcj}"
639 ;;
640 *-*-rtems*)
641 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
642 case ${target} in
643 h8300*-*-* | h8500-*-*)
644 noconfigdirs="$noconfigdirs target-libf2c"
645 ;;
646 *) ;;
647 esac
648 ;;
649 *-*-vxworks*)
650 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
651 ;;
652 alpha*-dec-osf*)
653 # ld works, but does not support shared libraries. emacs doesn't
654 # work. newlib is not 64 bit ready. I'm not sure about fileutils.
655 # gas doesn't generate exception information.
656 noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
657 ;;
658 alpha*-*-*vms*)
659 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
660 ;;
661 alpha*-*-linux*)
662 # newlib is not 64 bit ready
663 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
664 # linux has rx in libc
665 skipdirs="$skipdirs target-librx"
666 ;;
667 alpha*-*-freebsd*)
668 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
669 ;;
670 alpha*-*-*)
671 # newlib is not 64 bit ready
672 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
673 ;;
674 sh-*-linux*)
675 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
676 # linux has rx in libc
677 skipdirs="$skipdirs target-librx"
678 ;;
679 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
680 noconfigdirs="$noconfigdirs ${libgcj}"
681 noconfigdirs="$noconfigdirs target-examples"
682 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
683 noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
684 noconfigdirs="$noconfigdirs expect dejagnu"
685 # the C++ libraries don't build on top of CE's C libraries
686 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
687 skipdirs="$skipdirs target-newlib"
688 case "${host}" in
689 *-*-cygwin*) ;; # keep gdb and readline
690 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
691 ;;
692 esac
693 ;;
694 arc-*-*)
695 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
696 ;;
697 arm-*-pe*)
698 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
699 ;;
700 arm-*-coff*)
701 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
702 if [ x${is_cross_compiler} != xno ] ; then
703 target_configdirs="${target_configdirs} target-bsp target-cygmon"
704 fi
705 ;;
706 arm-*-elf*)
707 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
708 if [ x${is_cross_compiler} != xno ] ; then
709 target_configdirs="${target_configdirs} target-bsp target-cygmon"
710 fi
711 ;;
712 arm-*-oabi*)
713 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
714 ;;
715 c4x-*-*)
716 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
717 ;;
718 c54x*-*-* | tic54x-*-*)
719 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
720 ;;
721 thumb-*-coff)
722 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
723 ;;
724 thumb-*-elf)
725 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
726 ;;
727 thumb-*-oabi)
728 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
729 ;;
730 strongarm-*-elf)
731 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
732 if [ x${is_cross_compiler} != xno ] ; then
733 target_configdirs="${target_configdirs} target-bsp target-cygmon"
734 fi
735 ;;
736 strongarm-*-coff)
737 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
738 if [ x${is_cross_compiler} != xno ] ; then
739 target_configdirs="${target_configdirs} target-bsp target-cygmon"
740 fi
741 ;;
742 xscale-*-elf)
743 noconfigdirs="$noconfigdirs target-libgloss target-libffi target-qthreads"
744 if [ x${is_cross_compiler} != xno ] ; then
745 target_configdirs="${target_configdirs} target-bsp target-cygmon"
746 fi
747 ;;
748 xscale-*-coff)
749 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
750 if [ x${is_cross_compiler} != xno ] ; then
751 target_configdirs="${target_configdirs} target-bsp target-cygmon"
752 fi
753 ;;
754 thumb-*-pe)
755 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
756 ;;
757 arm-*-riscix*)
758 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
759 ;;
760 cris-*-*)
761 noconfigdirs="$noconfigdirs ${libgcj}"
762 ;;
763 d10v-*-*)
764 noconfigdirs="$noconfigdirs target-librx ${libstdcxx_version} target-libgloss ${libgcj}"
765 ;;
766 d30v-*-*)
767 noconfigdirs="$noconfigdirs ${libgcj}"
768 ;;
769 fr30-*-elf*)
770 noconfigdirs="$noconfigdirs ${libgcj}"
771 if [ x${is_cross_compiler} != xno ] ; then
772 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
773 fi
774 ;;
775 h8300*-*-* | \
776 h8500-*-*)
777 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj} target-libf2c"
778 ;;
779 hppa*64*-*-linux* | parisc*64*-*-linux*)
780 # In this case, it's because the hppa64-linux target is for
781 # the kernel only at this point and has no libc, and thus no
782 # headers, crt*.o, etc., all of which are needed by these.
783 noconfigdirs="$noconfigdirs target-zlib"
784 ;;
785 hppa*-*-*elf* | \
786 parisc*-*-linux* | hppa*-*-linux* | \
787 hppa*-*-lites* | \
788 hppa*64*-*-*)
789 noconfigdirs="$noconfigdirs ${libgcj}"
790 # Do configure ld/binutils/gas for this case.
791 ;;
792 hppa*-*-*)
793 # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
794 # cc is gcc, and on any system a user should be able to link cc to
795 # whatever they want. FIXME, emacs emacs19).
796 case "${CC}" in
797 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
798 *) ;;
799 esac
800 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
801 # build on HP-UX 10.20.
802 noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
803 ;;
804 ia64*-*-elf*)
805 # No gdb support yet.
806 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
807 ;;
808 i[3456]86-*-coff | i[3456]86-*-elf)
809 noconfigdirs="$noconfigdirs ${libgcj}"
810 if [ x${is_cross_compiler} != xno ] ; then
811 target_configdirs="${target_configdirs} target-libstub target-cygmon"
812 fi
813 ;;
814 i[34567]86-*-freebsd*)
815 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
816 ;;
817 s390*-*-linux*)
818 # The libffi port is not yet in the GCC tree
819 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
820 # linux has rx in libc
821 skipdirs="$skipdirs target-librx"
822 ;;
823 *-*-linux*)
824 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
825 # linux has rx in libc
826 skipdirs="$skipdirs target-librx"
827 ;;
828 i[3456]86-*-mingw32*)
829 target_configdirs="$target_configdirs target-mingw"
830 noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
831
832 # Can't build gdb for mingw32 if not native.
833 case "${host}" in
834 i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
835 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
836 ;;
837 esac
838 ;;
839 *-*-cygwin*)
840 target_configdirs="$target_configdirs target-libtermcap target-winsup"
841 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
842 # always build newlib.
843 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
844
845 # Can't build gdb for Cygwin if not native.
846 case "${host}" in
847 *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
848 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
849 ;;
850 esac
851 ;;
852 i[3456]86-*-pe)
853 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
854 ;;
855 i[3456]86-*-sco3.2v5*)
856 # The linker does not yet know about weak symbols in COFF,
857 # and is not configured to handle mixed ELF and COFF.
858 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
859 ;;
860 i[3456]86-*-sco*)
861 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
862 ;;
863 i[3456]86-*-solaris2*)
864 noconfigdirs="$noconfigdirs target-libgloss"
865 ;;
866 i[3456]86-*-sysv4*)
867 # The SYSV4 C compiler doesn't handle Emacs correctly
868 case "${CC}" in
869 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
870 *) ;;
871 esac
872 # but that's okay since emacs doesn't work anyway
873 noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss ${libgcj}"
874 ;;
875 i[3456]86-*-beos*)
876 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
877 ;;
878 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
879 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
880 ;;
881 m68k-*-elf*)
882 noconfigdirs="$noconfigdirs ${libgcj}"
883 if [ x${is_cross_compiler} != xno ] ; then
884 target_configdirs="${target_configdirs} target-bsp target-cygmon"
885 fi
886 ;;
887 m68k-*-coff*)
888 noconfigdirs="$noconfigdirs ${libgcj}"
889 if [ x${is_cross_compiler} != xno ] ; then
890 target_configdirs="${target_configdirs} target-bsp target-cygmon"
891 fi
892 ;;
893 mcore-*-pe*)
894 # The EPOC C++ environment does not support exceptions or rtti,
895 # and so building libstdc++-v3 tends not to always work.
896 noconfigdirs="$noconfigdirs target-libstdc++-v3"
897 ;;
898 mmix-*-*)
899 noconfigdirs="$noconfigdirs ${libgcj}"
900 ;;
901 mn10200-*-*)
902 noconfigdirs="$noconfigdirs ${libgcj}"
903 if [ x${is_cross_compiler} != xno ] ; then
904 target_configdirs="${target_configdirs} target-libstub target-cygmon"
905 fi
906 ;;
907 mn10300-*-*)
908 noconfigdirs="$noconfigdirs ${libgcj}"
909 if [ x${is_cross_compiler} != xno ] ; then
910 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
911 fi
912 ;;
913 powerpc-*-aix*)
914 # copied from rs6000-*-* entry
915 # The configure and build of ld are currently disabled because
916 # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
917 # The symptom is that GDBtk 4.18 fails at startup with a segfault
918 # if linked by GNU ld, but not if linked by the native ld.
919 noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss ${libgcj} ld"
920 use_gnu_ld=no
921 ;;
922 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
923 target_configdirs="$target_configdirs target-winsup"
924 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
925 # always build newlib.
926 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
927 ;;
928 # This is temporary until we can link against shared libraries
929 powerpcle-*-solaris*)
930 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
931 ;;
932 powerpc-*-beos*)
933 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
934 ;;
935 powerpc-*-eabi)
936 noconfigdirs="$noconfigdirs ${libgcj}"
937 if [ x${is_cross_compiler} != xno ] ; then
938 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
939 fi
940 ;;
941 rs6000-*-lynxos*)
942 # The CVS server code doesn't work on the RS/6000
943 noconfigdirs="$noconfigdirs target-newlib gprof cvssrc ${libgcj}"
944 ;;
945 rs6000-*-aix*)
946 # The configure and build of ld are currently disabled because
947 # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
948 # The symptom is that GDBtk 4.18 fails at startup with a segfault
949 # if linked by GNU ld, but not if linked by the native ld.
950 noconfigdirs="$noconfigdirs gprof ld ${libgcj}"
951 use_gnu_ld=no
952 ;;
953 rs6000-*-*)
954 noconfigdirs="$noconfigdirs gprof ${libgcj}"
955 ;;
956 m68k-apollo-*)
957 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
958 ;;
959 mips*-*-irix5*)
960 # The GNU linker does not support shared libraries.
961 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
962 noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss ${libgcj}"
963 ;;
964 mips*-*-irix6*)
965 # The GNU assembler does not support IRIX 6.
966 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
967 # Linking libjava exceeds command-line length limits on at least
968 # IRIX 6.2, but not on IRIX 6.5.
969 # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
970 # <oldham@codesourcery.com>
971 noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss ${libgcj}"
972 ;;
973 mips*-dec-bsd*)
974 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
975 ;;
976 mips*-*-bsd*)
977 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
978 ;;
979 mipstx39-*-*)
980 noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
981 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
982 ;;
983 mips*-*-linux*)
984 noconfigdirs="$noconfigdirs target-libffi"
985 ;;
986 mips*-*-*)
987 noconfigdirs="$noconfigdirs gprof ${libgcj}"
988 ;;
989 romp-*-*)
990 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
991 ;;
992 sh-*-*)
993 case "${host}" in
994 i[3456]86-*-vsta) ;; # don't add gprof back in
995 i[3456]86-*-go32*) ;; # don't add gprof back in
996 i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
997 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
998 esac
999 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1000 ;;
1001 sh64-*-*)
1002 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1003 ;;
1004 sparc-*-elf*)
1005 if [ x${is_cross_compiler} != xno ] ; then
1006 target_configdirs="${target_configdirs} target-libstub target-cygmon"
1007 fi
1008 noconfigdirs="$noconfigdirs ${libgcj}"
1009 ;;
1010 sparc64-*-elf*)
1011 if [ x${is_cross_compiler} != xno ] ; then
1012 target_configdirs="${target_configdirs} target-libstub target-cygmon"
1013 fi
1014 noconfigdirs="$noconfigdirs ${libgcj}"
1015 ;;
1016 sparclite-*-*)
1017 if [ x${is_cross_compiler} != xno ] ; then
1018 target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
1019 fi
1020 noconfigdirs="$noconfigdirs ${libgcj}"
1021 ;;
1022 sparc-*-sunos4*)
1023 noconfigdirs="$noconfigdirs ${libgcj}"
1024 if [ x${is_cross_compiler} != xno ] ; then
1025 noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
1026 else
1027 use_gnu_ld=no
1028 fi
1029 ;;
1030 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
1031 ;;
1032 v810-*-*)
1033 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
1034 ;;
1035 v850-*-*)
1036 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1037 ;;
1038 v850e-*-*)
1039 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1040 ;;
1041 v850ea-*-*)
1042 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
1043 ;;
1044 vax-*-vms)
1045 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
1046 ;;
1047 vax-*-*)
1048 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1049 ;;
1050 *-*-lynxos*)
1051 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1052 ;;
1053 *-*-macos* | \
1054 *-*-mpw*)
1055 # Macs want a resource compiler.
1056 configdirs="$configdirs grez"
1057 noconfigdirs="$noconfigdirs ${libgcj}"
1058 ;;
1059 *-*-*)
1060 noconfigdirs="$noconfigdirs ${libgcj}"
1061 ;;
1062esac
1063
1064# If we aren't building newlib, then don't build libgloss, since libgloss
1065# depends upon some newlib header files.
1066case "${noconfigdirs}" in
1067 *target-libgloss*) ;;
1068 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
1069esac
1070
1071# Make sure we don't let GNU ld be added if we didn't want it.
1072if [ x$with_gnu_ld = xno ]; then
1073 use_gnu_ld=no
1074 noconfigdirs="$noconfigdirs ld"
1075fi
1076
1077# Make sure we don't let GNU as be added if we didn't want it.
1078if [ x$with_gnu_as = xno ]; then
1079 use_gnu_as=no
1080 noconfigdirs="$noconfigdirs gas"
1081fi
1082
1083# Figure out what language subdirectories are present.
1084# Look if the user specified --enable-languages="..."; if not, use
1085# the environment variable $LANGUAGES if defined. $LANGUAGES might
1086# go away some day.
1087# NB: embedded tabs in this IF block -- do not untabify
1088if test x"${enable_languages+set}" != xset; then
1089 if test x"${LANGUAGES+set}" = xset; then
1090 enable_languages="${LANGUAGES}"
1091 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
1092 else
1093 enable_languages=all
1094 fi
1095else
1096 if test x"${enable_languages}" = x ||
1097 test x"${enable_languages}" = xyes;
1098 then
1099 echo configure.in: --enable-languages needs at least one language argument 1>&2
1100 exit 1
1101 fi
1102fi
1103enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
1104
1105# First scan to see if an enabled language requires some other language.
1106# We assume that a given config-lang.in will list all the language
1107# front ends it requires, even if some are required indirectly.
1108for lang in ${srcdir}/gcc/*/config-lang.in ..
1109do
1110 case $lang in
1111 ..)
1112 ;;
1113 # The odd quoting in the next line works around
1114 # an apparent bug in bash 1.12 on linux.
1115 ${srcdir}/gcc/[*]/config-lang.in)
1116 ;;
1117 *)
1118 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
1119 this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
1120 for other in $this_lang_requires
1121 do
1122 case ,${enable_languages}, in
1123 *,$other,*)
1124 ;;
1125 *,all,*)
1126 ;;
1127 *,$lang_alias,*)
1128 echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
1129 enable_languages="$enable_languages,$other"
1130 ;;
1131 esac
1132 done
1133 ;;
1134 esac
1135done
1136
1137subdirs=
1138for lang in ${srcdir}/gcc/*/config-lang.in ..
1139do
1140 case $lang in
1141 ..) ;;
1142 # The odd quoting in the next line works around
1143 # an apparent bug in bash 1.12 on linux.
1144 ${srcdir}/gcc/[*]/config-lang.in) ;;
1145 *)
1146 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
1147 this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
1148 this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
1149 build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
1150 if test "x$lang_alias" = x
1151 then
1152 echo "$lang doesn't set \$language." 1>&2
1153 exit 1
1154 fi
1155 case ${build_by_default},${enable_languages}, in
1156 *,$lang_alias,*) add_this_lang=yes ;;
1157 no,*) add_this_lang=no ;;
1158 *,all,*) add_this_lang=yes ;;
1159 *) add_this_lang=no ;;
1160 esac
1161 if test x"${add_this_lang}" = xyes; then
1162 eval target_libs='"$target_libs "'\"$this_lang_libs\"
1163 else
1164 eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
1165 fi
1166 ;;
1167 esac
1168done
1169
1170# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
1171# $target_configdirs.
1172# If we have the source for $noconfigdirs entries, add them to $notsupp.
1173
1174notsupp=""
1175for dir in . $skipdirs $noconfigdirs ; do
1176 dirname=`echo $dir | sed -e s/target-//g`
1177 if [ $dir != . ] && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1178 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
1179 if [ -r $srcdir/$dirname/configure ] \
1180 || [ -r $srcdir/$dirname/configure.in ]; then
1181 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1182 true
1183 else
1184 notsupp="$notsupp $dir"
1185 fi
1186 fi
1187 fi
1188 if [ $dir != . ] && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1189 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
1190 if [ -r $srcdir/$dirname/configure ] \
1191 || [ -r $srcdir/$dirname/configure.in ]; then
1192 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1193 true
1194 else
1195 notsupp="$notsupp $dir"
1196 fi
1197 fi
1198 fi
1199done
1200
1201# Sometimes the tools are distributed with libiberty but with no other
1202# libraries. In that case, we don't want to build target-libiberty.
1203if [ -n "${target_configdirs}" ]; then
1204 others=
1205 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
1206 if [ "$i" != "libiberty" ]; then
1207 if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
1208 others=yes;
1209 break;
1210 fi
1211 fi
1212 done
1213 if [ -z "${others}" ]; then
1214 target_configdirs=
1215 fi
1216fi
1217
1218# Deconfigure all subdirectories, in case we are changing the
1219# configuration from one where a subdirectory is supported to one where it
1220# is not.
1221if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
1222 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
1223 rm -f $i/Makefile
1224 done
1225fi
1226if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then
1227 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
1228 rm -f ${target_subdir}/$i/Makefile
1229 done
1230fi
1231
1232# Produce a warning message for the subdirs we can't configure.
1233# This isn't especially interesting in the Cygnus tree, but in the individual
1234# FSF releases, it's important to let people know when their machine isn't
1235# supported by the one or two programs in a package.
1236
1237if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
1238 # If $appdirs is non-empty, at least one of those directories must still
1239 # be configured, or we error out. (E.g., if the gas release supports a
1240 # specified target in some subdirs but not the gas subdir, we shouldn't
1241 # pretend that all is well.)
1242 if [ -n "$appdirs" ]; then
1243 for dir in $appdirs ; do
1244 if [ -r $dir/Makefile.in ]; then
1245 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1246 appdirs=""
1247 break
1248 fi
1249 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
1250 appdirs=""
1251 break
1252 fi
1253 fi
1254 done
1255 if [ -n "$appdirs" ]; then
1256 echo "*** This configuration is not supported by this package." 1>&2
1257 exit 1
1258 fi
1259 fi
1260 # Okay, some application will build, or we don't care to check. Still
1261 # notify of subdirs not getting built.
1262 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
1263 echo " ${notsupp}" 1>&2
1264 echo " (Any other directories should still work fine.)" 1>&2
1265fi
1266
1267# Set with_gnu_as and with_gnu_ld as appropriate.
1268#
1269# This is done by determining whether or not the appropriate directory
1270# is available, and by checking whether or not specific configurations
1271# have requested that this magic not happen.
1272#
1273# The command line options always override the explicit settings in
1274# configure.in, and the settings in configure.in override this magic.
1275#
1276# If the default for a toolchain is to use GNU as and ld, and you don't
1277# want to do that, then you should use the --without-gnu-as and
1278# --without-gnu-ld options for the configure script.
1279
1280if [ x${use_gnu_as} = x ] ; then
1281 if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
1282 with_gnu_as=yes
1283 withoptions="$withoptions --with-gnu-as"
1284 fi
1285fi
1286
1287if [ x${use_gnu_ld} = x ] ; then
1288 if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
1289 with_gnu_ld=yes
1290 withoptions="$withoptions --with-gnu-ld"
1291 fi
1292fi
1293
1294# If using newlib, add --with-newlib to the withoptions so that gcc/configure
1295# can detect this case.
1296
1297if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1298 with_newlib=yes
1299 withoptions="$withoptions --with-newlib"
1300fi
1301
1302if [ x${shared} = xyes ]; then
1303 case "${target}" in
1304 hppa* | parisc*)
1305 target_makefile_frag="${target_makefile_frag} config/mt-papic"
1306 ;;
1307 i[3456]86-*)
1308 target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1309 ;;
1310 ia64-*)
1311 target_makefile_frag="${target_makefile_frag} config/mt-ia64pic"
1312 ;;
1313 powerpc*-*-aix*)
1314 # We don't want -fPIC on AIX.
1315 ;;
1316 powerpc*-*)
1317 target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1318 ;;
1319 alpha*-*-linux*)
1320 target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1321 ;;
1322 *)
1323 if test -f ${srcdir}/config/mt-${target_cpu}pic; then
1324 target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1325 fi
1326 ;;
1327 esac
1328fi
1329
1330rm -f mt-frag
1331if [ -n "${target_makefile_frag}" ] ; then
1332 for f in ${target_makefile_frag}
1333 do
1334 cat ${srcdir}/$f >> mt-frag
1335 done
1336 target_makefile_frag=mt-frag
1337fi
1338
1339# post-target:
1340
1341# Make sure that the compiler is able to generate an executable. If it
1342# can't, we are probably in trouble. We don't care whether we can run the
1343# executable--we might be using a cross compiler--we only care whether it
1344# can be created. At this point the main configure script has set CC.
1345echo "int main () { return 0; }" > conftest.c
1346${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1347if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
1348 :
1349else
1350 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1351 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1352 rm -f conftest*
1353 exit 1
1354fi
1355rm -f conftest*
1356
1357# The Solaris /usr/ucb/cc compiler does not appear to work.
1358case "${host}" in
1359 sparc-sun-solaris2*)
1360 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1361 if [ "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ] ; then
1362 could_use=
1363 [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
1364 if [ -d /opt/cygnus/bin ] ; then
1365 if [ "$could_use" = "" ] ; then
1366 could_use="/opt/cygnus/bin"
1367 else
1368 could_use="$could_use or /opt/cygnus/bin"
1369 fi
1370 fi
1371 if [ "$could_use" = "" ] ; then
1372 echo "Warning: compilation may fail because you're using"
1373 echo "/usr/ucb/cc. You should change your PATH or CC "
1374 echo "variable and rerun configure."
1375 else
1376 echo "Warning: compilation may fail because you're using"
1377 echo "/usr/ucb/cc, when you should use the C compiler from"
1378 echo "$could_use. You should change your"
1379 echo "PATH or CC variable and rerun configure."
1380 fi
1381 fi
1382 ;;
1383esac
1384
1385# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1386# binutils tools will find libbfd.so.
1387if [ "${shared}" = "yes" ]; then
1388 sed -e 's/^SET_LIB_PATH[ ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
1389 Makefile > Makefile.tem
1390 rm -f Makefile
1391 mv -f Makefile.tem Makefile
1392
1393 case "${host}" in
1394 *-*-hpux*)
1395 sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
1396 Makefile > Makefile.tem
1397 rm -f Makefile
1398 mv -f Makefile.tem Makefile
1399 ;;
1400 esac
1401fi
1402
1403# Record target_configdirs and the configure arguments for target and
1404# build configuration in Makefile.
1405target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1406targargs=`echo "${arguments}" | \
1407 sed -e 's/--no[^ ]*//' \
1408 -e 's/--cache[a-z-]*=[^ ]*//' \
1409 -e 's/--ho[a-z-]*=[^ ]*//' \
1410 -e 's/--bu[a-z-]*=[^ ]*//' \
1411 -e 's/--ta[a-z-]*=[^ ]*//'`
1412
1413# For the build-side libraries, we just need to pretend we're native,
1414# and not use the same cache file. Multilibs are neither needed nor
1415# desired.
1416buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${targargs}"
1417
1418# Passing a --with-cross-host argument lets the target libraries know
1419# whether they are being built with a cross-compiler or being built
1420# native. However, it would be better to use other mechanisms to make the
1421# sorts of decisions they want to make on this basis. Please consider
1422# this option to be deprecated. FIXME.
1423if [ x${is_cross_compiler} = xyes ]; then
1424 targargs="--with-cross-host=${host_alias} ${targargs}"
1425fi
1426
1427# Default to --enable-multilib.
1428if [ x${enable_multilib} = x ]; then
1429 targargs="--enable-multilib ${targargs}"
1430fi
1431
1432# Pass --with-newlib if appropriate. Note that target_configdirs has
1433# changed from the earlier setting of with_newlib.
1434if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1435 targargs="--with-newlib ${targargs}"
1436fi
1437
1438# Pass the appropriate --host, --build, and --cache-file arguments.
1439targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
1440
1441# provide a proper gxx_include_dir.
1442# Note, if you change the default, make sure to fix both here and in
1443# the gcc and libstdc++-v3 subdirectories.
1444# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1445gxx_include_dir=
1446if test -n "${with_gxx_include_dir}"; then
1447 case "${with_gxx_include_dir}" in
1448 yes )
1449 echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
1450 exit 1
1451 ;;
1452 no )
1453 ;;
1454 * )
1455 gxx_include_dir=${with_gxx_include_dir}
1456 ;;
1457 esac
1458fi
1459if test x${gxx_include_dir} = x; then
1460 if test x${enable_version_specific_runtime_libs} = xyes; then
1461 gxx_include_dir='${libsubdir}/include/c++'
1462 else
1463 . ${topsrcdir}/config.if
1464 gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
1465 fi
1466else
1467 gxx_include_dir=${gxx_include_dir}
1468fi
1469
1470FLAGS_FOR_TARGET=
1471case " $skipdirs " in
1472*" target-newlib "*) ;;
1473*)
1474 case " $target_configdirs " in
1475 *" newlib "*)
1476 case " $targargs " in
1477 *" --with-newlib "*)
1478 case "$target" in
1479 *-cygwin*)
1480 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' ;;
1481 esac
1482
1483 # If we're not building GCC, don't discard standard headers.
1484 if test -d ${topsrcdir}/gcc; then
1485 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
1486
1487 if test "${build}" != "${host}"; then
1488 # On Canadian crosses, CC_FOR_TARGET will have already been set
1489 # by `configure', so we won't have an opportunity to add -Bgcc/
1490 # to it. This is right: we don't want to search that directory
1491 # for binaries, but we want the header files in there, so add
1492 # them explicitly.
1493 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
1494
1495 # Someone might think of using the pre-installed headers on
1496 # Canadian crosses, in case the installed compiler is not fully
1497 # compatible with the compiler being built. In this case, it
1498 # would be better to flag an error than risking having
1499 # incompatible object files being constructed. We can't
1500 # guarantee that an error will be flagged, but let's hope the
1501 # compiler will do it, when presented with incompatible header
1502 # files.
1503 fi
1504 fi
1505
1506 # If we're building newlib, use its generic headers last, but search
1507 # for any libc-related directories first (so make it the last -B
1508 # switch).
1509 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
1510 ;;
1511 esac
1512 ;;
1513 esac
1514 ;;
1515esac
1516
1517# On Canadian crosses, we'll be searching the right directories for
1518# the previously-installed cross compiler, so don't bother to add
1519# flags for directories within the install tree of the compiler
1520# being built; programs in there won't even run.
1521if test "${build}" = "${host}" && test -d ${topsrcdir}/gcc; then
1522 # Search for pre-installed headers if nothing else fits.
1523 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
1524fi
1525
1526if test "x${use_gnu_ld}" = x && test "x${with_gnu_ld}" != xno &&
1527 echo " ${configdirs} " | grep " ld " > /dev/null &&
1528 test -d ${srcdir}/ld; then
1529 # Arrange for us to find uninstalled linker scripts.
1530 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1531fi
1532
1533if test "x${CC_FOR_TARGET+set}" = xset; then
1534 :
1535elif test -d ${topsrcdir}/gcc; then
1536 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
1537elif test "$host" = "$target"; then
1538 CC_FOR_TARGET='$(CC)'
1539else
1540 CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1541fi
1542# On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
1543# if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated.
1544case $CC_FOR_TARGET in
1545*' $(FLAGS_FOR_TARGET)') ;;
1546*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1547esac
1548
1549if test "x${GCJ_FOR_TARGET+set}" = xset; then
1550 :
1551elif test -d ${topsrcdir}/gcc; then
1552 GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
1553elif test "$host" = "$target"; then
1554 GCJ_FOR_TARGET='gcj'
1555else
1556 GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
1557fi
1558case $GCJ_FOR_TARGET in
1559*' $(FLAGS_FOR_TARGET)') ;;
1560*) GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1561esac
1562
1563if test "x${CXX_FOR_TARGET+set}" = xset; then
1564 :
1565elif test -d ${topsrcdir}/gcc; then
1566 # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
1567 # of g++ for linking C++ or Java, because g++ has -shared-libgcc by
1568 # default whereas gcc does not.
1569 CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3 | libjava) echo xgcc -shared-libgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
1570elif test "$host" = "$target"; then
1571 CXX_FOR_TARGET='$(CXX)'
1572else
1573 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
1574fi
1575case $CXX_FOR_TARGET in
1576*' $(FLAGS_FOR_TARGET)') ;;
1577*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
1578esac
1579qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
1580
1581# We want to defer the evaluation of `cmd`s and shell variables in
1582# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
1583# bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
1584# quotes, but we still have to duplicate `$'s so that shell variables
1585# can be expanded by the nested make as shell variables, not as make
1586# macros.
1587qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
1588
1589sedtemp=sed.$$
1590cat >$sedtemp <<EOF
1591s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:
1592s%^TARGET_CONFIGARGS[ ]*=.*$%TARGET_CONFIGARGS = ${targargs}%
1593s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%
1594s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%
1595s%^GCJ_FOR_TARGET[ ]*=.*$%GCJ_FOR_TARGET = ${GCJ_FOR_TARGET}%
1596s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%
1597s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%
1598s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%
1599s%^BUILD_SUBDIR[ ]*=.*$%BUILD_SUBDIR = ${build_subdir}%
1600s%^BUILD_CONFIGARGS[ ]*=.*$%BUILD_CONFIGARGS = ${buildargs}%
1601s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%
1602EOF
1603sed -f $sedtemp Makefile > Makefile.tem
1604rm -f Makefile $sedtemp
1605mv -f Makefile.tem Makefile
1606
1607#
1608# Local Variables:
1609# fill-column: 131
1610# End:
1611#
Note: See TracBrowser for help on using the repository browser.