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

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

We don't want -fPIC on OS/2.

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