source: branches/libc-0.6/src/gcc/configure.in@ 2442

Last change on this file since 2442 was 1394, checked in by bird, 21 years ago

#1040: Joined the GCC 3.3.3 with the trunk.

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