(toplev)
[deliverable/binutils-gdb.git] / configure.in
1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2 # 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3 #
4 # This file is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 ##############################################################################
19 ### WARNING: this file contains embedded tabs. Do not run untabify on this file.
20
21 AC_INIT(move-if-change)
22 AC_CANONICAL_SYSTEM
23 AC_ARG_PROGRAM
24
25 sinclude(config/acx.m4)
26
27 # clear some things potentially inherited from environment.
28
29 enable_threads=no
30 enable_shared=no
31 enable_libstdcxx_v3=yes
32 floating_point=default
33 gas=default
34 x11=default
35
36 ### we might need to use some other shell than /bin/sh for running subshells
37 ### If we are on Windows, search for the shell. This will permit people
38 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
39 ### without also having to set CONFIG_SHELL. This code will work when
40 ### using bash, which sets OSTYPE.
41 case "${OSTYPE}" in
42 *win32*)
43 if test x${CONFIG_SHELL} = x ; then
44 if test ! -f /bin/sh ; then
45 if test x${SHELL} != x && test -f ${SHELL} ; then
46 CONFIG_SHELL=${SHELL}
47 export CONFIG_SHELL
48 else
49 for prog in sh sh.exe bash bash.exe; do
50 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
51 for dir in $PATH; do
52 test -z "$dir" && dir=.
53 if test -f $dir/$prog; then
54 CONFIG_SHELL=$dir/$prog
55 export CONFIG_SHELL
56 break
57 fi
58 done
59 IFS="$save_ifs"
60 test -n "${CONFIG_SHELL}" && break
61 done
62 fi
63 fi
64 fi
65 ;;
66 esac
67
68 config_shell=${CONFIG_SHELL-/bin/sh}
69
70 ## this is a little touchy and won't always work, but...
71 ##
72 ## if the argv[[0]] starts with a slash then it is an absolute name that can (and
73 ## must) be used as is.
74 ##
75 ## otherwise, if argv[[0]] has no slash in it, we can assume that it is on the
76 ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
77 ##
78
79 progname=$0
80 # if PWD already has a value, it is probably wrong.
81 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
82
83 case "${progname}" in
84 /* | [[A-Za-z]]:[[\\/]]* ) ;;
85 */*) ;;
86 *)
87 PATH=$PATH:${PWD=`${PWDCMD-pwd}`} ; export PATH
88 ;;
89 esac
90
91 # Export original configure arguments for use by sub-configures.
92 TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
93 export TOPLEVEL_CONFIGURE_ARGUMENTS
94
95 moveifchange=${srcdir}/move-if-change
96
97 # Set srcdir to "." if that's what it is.
98 # This is important for multilib support.
99 pwd=`${PWDCMD-pwd}`
100 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
101 if test "${pwd}" = "${srcpwd}" ; then
102 srcdir=.
103 fi
104
105 topsrcdir=$srcpwd
106
107 extra_host_args=
108 # Define the trigger file to make sure configure will re-run whenever
109 # the gcc version number changes.
110 if test "${with_gcc_version_trigger+set}" = set ; then
111 gcc_version_trigger="$with_gcc_version_trigger"
112 gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
113 else
114 # If gcc's sources are available, define the trigger file.
115 if test -f ${topsrcdir}/gcc/version.c ; then
116 gcc_version_trigger=${topsrcdir}/gcc/version.c
117 gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
118 case "$ac_configure_args" in
119 *--with-gcc-version-trigger=$gcc_version_trigger* )
120 ;;
121 * )
122 # Add to all subconfigure arguments: build, host, and target.
123 ac_configure_args="--with-gcc-version-trigger=$gcc_version_trigger $ac_configure_args"
124 ;;
125 esac
126 fi
127 fi
128
129 ### To add a new directory to the tree, first choose whether it is a target
130 ### or a host dependent tool. Then put it into the appropriate list
131 ### (library or tools, host or target), doing a dependency sort.
132
133 # Subdirs will be configured in the order listed in build_configdirs,
134 # configdirs, or target_configdirs; see the serialization section below.
135
136 # Dependency sorting is only needed when *configuration* must be done in
137 # a particular order. In all cases a dependency should be specified in
138 # the Makefile, whether or not it's implicitly specified here.
139
140 # Double entries in build_configdirs, configdirs, or target_configdirs may
141 # cause circular dependencies and break everything horribly.
142
143 # these libraries are used by various programs built for the host environment
144 #
145 host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk itcl tix libgui zlib"
146
147 libstdcxx_version="target-libstdc++-v3"
148
149 # these tools are built for the host environment
150 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
151 # know that we are building the simulator.
152 # binutils, gas and ld appear in that order because it makes sense to run
153 # "make check" in that particular order.
154 host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator gettext zip fastjar"
155
156 # libgcj represents the runtime libraries only used by gcj.
157 libgcj="target-libffi \
158 target-boehm-gc \
159 target-zlib \
160 target-qthreads \
161 target-libjava"
162
163 # these libraries are built for the target environment, and are built after
164 # the host libraries and the host tools (which may be a cross compiler)
165 #
166 target_libs="target-libiberty \
167 target-libgloss \
168 target-newlib \
169 ${libstdcxx_version} \
170 target-libf2c \
171 ${libgcj}
172 target-libobjc"
173
174 # these tools are built using the target libs, and are intended to run only
175 # in the target environment
176 #
177 # note: any program that *uses* libraries that are in the "target_libs"
178 # list belongs in this list. those programs are also very likely
179 # candidates for the "native_only" list which follows
180 #
181 target_tools="target-examples target-groff target-gperf target-rda"
182
183 ################################################################################
184
185 ## All tools belong in one of the four categories, and are assigned above
186 ## We assign ${configdirs} this way to remove all embedded newlines. This
187 ## is important because configure will choke if they ever get through.
188 ## ${configdirs} is directories we build using the host tools.
189 ## ${target_configdirs} is directories we build using the target tools.
190 #
191 configdirs=`echo ${host_libs} ${host_tools}`
192 target_configdirs=`echo ${target_libs} ${target_tools}`
193
194 ################################################################################
195
196 srcname="gnu development package"
197
198 # This gets set non-empty for some net releases of packages.
199 appdirs=""
200
201 # Define is_cross_compiler to save on calls to 'test'.
202 is_cross_compiler=
203 if test x"${host}" = x"${target}" ; then
204 is_cross_compiler=no
205 else
206 is_cross_compiler=yes
207 fi
208
209 # We always want to use the same name for this directory, so that dejagnu
210 # can reliably find it.
211 target_subdir=${target_alias}
212
213 if test ! -d ${target_subdir} ; then
214 if mkdir ${target_subdir} ; then true
215 else
216 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
217 exit 1
218 fi
219 fi
220
221 build_prefix=build-
222 build_subdir=${build_prefix}${build_alias}
223
224 if test x"${build_alias}" != x"${host}" ; then
225 if test ! -d ${build_subdir} ; then
226 if mkdir ${build_subdir} ; then true
227 else
228 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
229 exit 1
230 fi
231 fi
232 fi
233
234 # Skipdirs are removed silently.
235 skipdirs=
236 # Noconfigdirs are removed loudly.
237 noconfigdirs=""
238
239 use_gnu_ld=
240 # Make sure we don't let GNU ld be added if we didn't want it.
241 if test x$with_gnu_ld = xno ; then
242 use_gnu_ld=no
243 noconfigdirs="$noconfigdirs ld"
244 fi
245
246 use_gnu_as=
247 # Make sure we don't let GNU as be added if we didn't want it.
248 if test x$with_gnu_as = xno ; then
249 use_gnu_as=no
250 noconfigdirs="$noconfigdirs gas"
251 fi
252
253 # some tools are so dependent upon X11 that if we're not building with X,
254 # it's not even worth trying to configure, much less build, that tool.
255
256 case ${with_x} in
257 yes | "") ;; # the default value for this tree is that X11 is available
258 no)
259 skipdirs="${skipdirs} tk tix itcl libgui"
260 # We won't be able to build gdbtk without X.
261 enable_gdbtk=no
262 ;;
263 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
264 esac
265
266 # Some tools are only suitable for building in a "native" situation.
267 # Remove these if host!=target.
268 native_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"
269
270 # Similarly, some are only suitable for cross toolchains.
271 # Remove these if host=target.
272 cross_only="target-libgloss target-newlib target-opcodes"
273
274 case $is_cross_compiler in
275 no) skipdirs="${skipdirs} ${cross_only}" ;;
276 yes) skipdirs="${skipdirs} ${native_only}" ;;
277 esac
278
279 # If both --with-headers and --with-libs are specified, default to
280 # --without-newlib.
281 if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
282 if test x"${with_newlib}" = x ; then
283 with_newlib=no
284 fi
285 fi
286
287 # Recognize --with-newlib/--without-newlib.
288 case ${with_newlib} in
289 no) skipdirs="${skipdirs} target-newlib" ;;
290 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
291 esac
292
293 # Configure extra directories which are host specific
294
295 case "${host}" in
296 *-cygwin*)
297 configdirs="$configdirs libtermcap" ;;
298 esac
299
300 # Remove more programs from consideration, based on the host or
301 # target this usually means that a port of the program doesn't
302 # exist yet.
303
304 case "${host}" in
305 hppa*64*-*-*)
306 noconfigdirs="$noconfigdirs byacc"
307 ;;
308 i[[3456]]86-*-vsta)
309 noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv gettext"
310 ;;
311 i[[3456]]86-*-go32* | i[[3456]]86-*-msdosdjgpp*)
312 noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi"
313 ;;
314 i[[3456]]86-*-mingw32*)
315 # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv"
316 noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
317 ;;
318 i[[3456]]86-*-beos*)
319 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
320 ;;
321 *-*-cygwin*)
322 noconfigdirs="autoconf automake send-pr rcs guile perl"
323 ;;
324 *-*-netbsd*)
325 noconfigdirs="rcs"
326 ;;
327 ppc*-*-pe)
328 noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv"
329 ;;
330 powerpc-*-beos*)
331 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
332 ;;
333 *-*-darwin*)
334 noconfigdirs="$noconfigdirs tk itcl tix libgui"
335 ;;
336 esac
337
338 # Save it here so that, even in case of --enable-libgcj, if the Java
339 # front-end isn't enabled, we still get libgcj disabled.
340 libgcj_saved=$libgcj
341 case $enable_libgcj in
342 yes)
343 # If we reset it here, it won't get added to noconfigdirs in the
344 # target-specific build rules, so it will be forcibly enabled
345 # (unless the Java language itself isn't enabled).
346 libgcj=
347 ;;
348 no)
349 # Make sure we get it printed in the list of not supported target libs.
350 noconfigdirs="$noconfigdirs ${libgcj}"
351 ;;
352 esac
353
354 case "${target}" in
355 *-*-chorusos)
356 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
357 ;;
358 *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
359 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
360 ;;
361 *-*-netbsd*)
362 # Skip some stuff on all NetBSD configurations.
363 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
364
365 # Skip some stuff that's unsupported on some NetBSD configurations.
366 case "${target}" in
367 i*86-*-netbsdelf*) ;;
368 *)
369 noconfigdirs="$noconfigdirs ${libgcj}"
370 ;;
371 esac
372 ;;
373 *-*-netware)
374 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
375 ;;
376 *-*-rtems*)
377 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
378 case ${target} in
379 h8300*-*-* | h8500-*-*)
380 noconfigdirs="$noconfigdirs target-libf2c"
381 ;;
382 *) ;;
383 esac
384 ;;
385 *-*-vxworks*)
386 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
387 ;;
388 alpha*-dec-osf*)
389 # ld works, but does not support shared libraries.
390 # newlib is not 64 bit ready. I'm not sure about fileutils.
391 # gas doesn't generate exception information.
392 noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
393 ;;
394 alpha*-*-*vms*)
395 noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
396 ;;
397 alpha*-*-linux*)
398 # newlib is not 64 bit ready
399 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
400 ;;
401 alpha*-*-freebsd*)
402 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
403 ;;
404 alpha*-*-*)
405 # newlib is not 64 bit ready
406 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
407 ;;
408 sh-*-linux*)
409 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
410 ;;
411 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
412 noconfigdirs="$noconfigdirs ${libgcj}"
413 noconfigdirs="$noconfigdirs target-examples"
414 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
415 noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
416 noconfigdirs="$noconfigdirs expect dejagnu"
417 # the C++ libraries don't build on top of CE's C libraries
418 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
419 noconfigdirs="$noconfigdirs target-newlib"
420 case "${host}" in
421 *-*-cygwin*) ;; # keep gdb and readline
422 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
423 ;;
424 esac
425 ;;
426 arc-*-*)
427 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
428 ;;
429 arm-*-coff | strongarm-*-coff | xscale-*-coff)
430 noconfigdirs="$noconfigdirs ${libgcj}"
431 ;;
432 arm-*-elf* | strongarm-*-elf* | xscale-*-elf*)
433 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
434 ;;
435 arm-*-pe*)
436 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
437 ;;
438 arm-*-oabi*)
439 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
440 ;;
441 thumb-*-coff)
442 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
443 ;;
444 thumb-*-elf)
445 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
446 ;;
447 thumb-*-oabi)
448 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
449 ;;
450 thumb-*-pe)
451 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
452 ;;
453 arm-*-riscix*)
454 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
455 ;;
456 avr-*-*)
457 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
458 ;;
459 c4x-*-* | tic4x-*-*)
460 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
461 ;;
462 c54x*-*-* | tic54x-*-*)
463 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
464 ;;
465 cris-*-*)
466 noconfigdirs="$noconfigdirs ${libgcj}"
467 ;;
468 d10v-*-*)
469 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
470 ;;
471 d30v-*-*)
472 noconfigdirs="$noconfigdirs ${libgcj}"
473 ;;
474 fr30-*-elf*)
475 noconfigdirs="$noconfigdirs ${libgcj}"
476 ;;
477 frv-*-*)
478 noconfigdirs="$noconfigdirs ${libgcj}"
479 ;;
480 h8300*-*-*)
481 noconfigdirs="$noconfigdirs target-libgloss"
482 ;;
483 h8500-*-*)
484 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
485 ;;
486 hppa*64*-*-linux* | parisc*64*-*-linux*)
487 # In this case, it's because the hppa64-linux target is for
488 # the kernel only at this point and has no libc, and thus no
489 # headers, crt*.o, etc., all of which are needed by these.
490 noconfigdirs="$noconfigdirs target-zlib"
491 ;;
492 hppa*-*-*elf* | \
493 parisc*-*-linux* | hppa*-*-linux* | \
494 hppa*-*-lites* | \
495 hppa*-*-openbsd* | \
496 hppa*64*-*-*)
497 noconfigdirs="$noconfigdirs ${libgcj}"
498 # Do configure ld/binutils/gas for this case.
499 ;;
500 hppa*-*-*)
501 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
502 # build on HP-UX 10.20.
503 noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
504 ;;
505 ia64*-*-elf*)
506 # No gdb support yet.
507 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
508 ;;
509 ia64*-**-hpux*)
510 # No gdb or ld support yet.
511 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld"
512 ;;
513 i[[3456]]86-*-coff | i[[3456]]86-*-elf)
514 noconfigdirs="$noconfigdirs ${libgcj}"
515 ;;
516 i[[34567]]86-*-freebsd*)
517 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
518 ;;
519 i[[3456]]86-*-linux*)
520 # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
521 # not build java stuff by default.
522 case "${target}" in
523 *-*-*libc1*)
524 noconfigdirs="$noconfigdirs ${libgcj}";;
525 esac
526
527 # This section makes it possible to build newlib natively on linux.
528 # If we are using a cross compiler then don't configure newlib.
529 if test x${is_cross_compiler} != xno ; then
530 noconfigdirs="$noconfigdirs target-newlib"
531 fi
532 noconfigdirs="$noconfigdirs target-libgloss"
533 # If we are not using a cross compiler, do configure newlib.
534 # Note however, that newlib will only be configured in this situation
535 # if the --with-newlib option has been given, because otherwise
536 # 'target-newlib' will appear in skipdirs.
537 ;;
538 i[[3456]]86-*-mingw32*)
539 target_configdirs="$target_configdirs target-mingw"
540 noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
541
542 # Can't build gdb for mingw32 if not native.
543 case "${host}" in
544 i[[3456]]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
545 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
546 ;;
547 esac
548 ;;
549 *-*-cygwin*)
550 target_configdirs="$target_configdirs target-libtermcap target-winsup"
551 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
552 # always build newlib.
553 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
554
555 # Can't build gdb for Cygwin if not native.
556 case "${host}" in
557 *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
558 *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
559 ;;
560 esac
561 ;;
562 i[[3456]]86-*-pe)
563 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
564 ;;
565 i[[3456]]86-*-sco3.2v5*)
566 # The linker does not yet know about weak symbols in COFF,
567 # and is not configured to handle mixed ELF and COFF.
568 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
569 ;;
570 i[[3456]]86-*-sco*)
571 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
572 ;;
573 i[[3456]]86-*-solaris2*)
574 noconfigdirs="$noconfigdirs target-libgloss"
575 ;;
576 i[[3456]]86-*-sysv4*)
577 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
578 ;;
579 i[[3456]]86-*-beos*)
580 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
581 ;;
582 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
583 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
584 ;;
585 m68k-*-elf*)
586 noconfigdirs="$noconfigdirs ${libgcj}"
587 ;;
588 m68k-*-coff*)
589 noconfigdirs="$noconfigdirs ${libgcj}"
590 ;;
591 mcore-*-pe*)
592 # The EPOC C++ environment does not support exceptions or rtti,
593 # and so building libstdc++-v3 tends not to always work.
594 noconfigdirs="$noconfigdirs target-libstdc++-v3"
595 ;;
596 mmix-*-*)
597 noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss"
598 ;;
599 mn10200-*-*)
600 noconfigdirs="$noconfigdirs ${libgcj}"
601 ;;
602 mn10300-*-*)
603 noconfigdirs="$noconfigdirs ${libgcj}"
604 ;;
605 powerpc-*-aix*)
606 # copied from rs6000-*-* entry
607 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
608 ;;
609 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
610 target_configdirs="$target_configdirs target-winsup"
611 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
612 # always build newlib.
613 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
614 ;;
615 # This is temporary until we can link against shared libraries
616 powerpcle-*-solaris*)
617 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
618 ;;
619 powerpc-*-beos*)
620 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
621 ;;
622 powerpc-*-darwin*)
623 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
624 ;;
625 powerpc-*-eabi)
626 noconfigdirs="$noconfigdirs ${libgcj}"
627 ;;
628 powerpc64*-*-linux*)
629 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
630 # not yet ported.
631 noconfigdirs="$noconfigdirs target-libffi"
632 ;;
633 rs6000-*-lynxos*)
634 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
635 ;;
636 rs6000-*-aix*)
637 noconfigdirs="$noconfigdirs gprof ${libgcj}"
638 ;;
639 rs6000-*-*)
640 noconfigdirs="$noconfigdirs gprof ${libgcj}"
641 ;;
642 m68k-apollo-*)
643 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
644 ;;
645 mips*-*-irix5*)
646 # The GNU linker does not support shared libraries.
647 noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
648 ;;
649 mips*-*-irix6*)
650 # The GNU assembler does not support IRIX 6.
651 # Linking libjava exceeds command-line length limits on at least
652 # IRIX 6.2, but not on IRIX 6.5.
653 # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
654 # <oldham@codesourcery.com>
655 noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
656 ;;
657 mips*-dec-bsd*)
658 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
659 ;;
660 mips*-*-bsd*)
661 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
662 ;;
663 mipstx39-*-*)
664 noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
665 ;;
666 mips*-*-linux*)
667 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
668 ;;
669 mips*-*-*)
670 noconfigdirs="$noconfigdirs gprof ${libgcj}"
671 ;;
672 romp-*-*)
673 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
674 ;;
675 sh-*-*)
676 case "${host}" in
677 i[[3456]]86-*-vsta) ;; # don't add gprof back in
678 i[[3456]]86-*-go32*) ;; # don't add gprof back in
679 i[[3456]]86-*-msdosdjgpp*) ;; # don't add gprof back in
680 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
681 esac
682 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
683 ;;
684 sh64-*-*)
685 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
686 ;;
687 sparc-*-elf*)
688 noconfigdirs="$noconfigdirs ${libgcj}"
689 ;;
690 sparc64-*-elf*)
691 noconfigdirs="$noconfigdirs ${libgcj}"
692 ;;
693 sparclite-*-*)
694 noconfigdirs="$noconfigdirs ${libgcj}"
695 ;;
696 sparc-*-sunos4*)
697 noconfigdirs="$noconfigdirs ${libgcj}"
698 if test x${is_cross_compiler} != xno ; then
699 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
700 else
701 use_gnu_ld=no
702 fi
703 ;;
704 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
705 ;;
706 v810-*-*)
707 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
708 ;;
709 v850-*-*)
710 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
711 ;;
712 v850e-*-*)
713 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
714 ;;
715 v850ea-*-*)
716 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
717 ;;
718 vax-*-vms)
719 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
720 ;;
721 vax-*-*)
722 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
723 ;;
724 ip2k-*-*)
725 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
726 ;;
727 *-*-linux*)
728 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
729 ;;
730 *-*-lynxos*)
731 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
732 ;;
733 *-*-*)
734 noconfigdirs="$noconfigdirs ${libgcj}"
735 ;;
736 esac
737
738 # If we aren't building newlib, then don't build libgloss, since libgloss
739 # depends upon some newlib header files.
740 case "${noconfigdirs}" in
741 *target-libgloss*) ;;
742 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
743 esac
744
745 # Figure out what language subdirectories are present.
746 # Look if the user specified --enable-languages="..."; if not, use
747 # the environment variable $LANGUAGES if defined. $LANGUAGES might
748 # go away some day.
749 # NB: embedded tabs in this IF block -- do not untabify
750 if test x"${enable_languages+set}" != xset; then
751 if test x"${LANGUAGES+set}" = xset; then
752 enable_languages="${LANGUAGES}"
753 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
754 else
755 enable_languages=all
756 fi
757 else
758 if test x"${enable_languages}" = x ||
759 test x"${enable_languages}" = xyes;
760 then
761 echo configure.in: --enable-languages needs at least one language argument 1>&2
762 exit 1
763 fi
764 fi
765 enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
766
767 # First scan to see if an enabled language requires some other language.
768 # We assume that a given config-lang.in will list all the language
769 # front ends it requires, even if some are required indirectly.
770 for lang in ${srcdir}/gcc/*/config-lang.in ..
771 do
772 case $lang in
773 ..)
774 ;;
775 # The odd quoting in the next line works around
776 # an apparent bug in bash 1.12 on linux.
777 ${srcdir}/gcc/[[*]]/config-lang.in)
778 ;;
779 *)
780 lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
781 this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^ ]]*\).*$,\1,p' $lang`
782 for other in $this_lang_requires
783 do
784 case ,${enable_languages}, in
785 *,$other,*)
786 ;;
787 *,all,*)
788 ;;
789 *,$lang_alias,*)
790 echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
791 enable_languages="$enable_languages,$other"
792 ;;
793 esac
794 done
795 ;;
796 esac
797 done
798
799 subdirs=
800 for lang in ${srcdir}/gcc/*/config-lang.in ..
801 do
802 case $lang in
803 ..) ;;
804 # The odd quoting in the next line works around
805 # an apparent bug in bash 1.12 on linux.
806 ${srcdir}/gcc/[[*]]/config-lang.in) ;;
807 *)
808 lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
809 this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^ ]]*\).*$,\1,p' $lang`
810 this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^ ]]*\).*$,\1,p' $lang`
811 build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^ ]]*\).*$,\1,p' $lang`
812 if test "x$lang_alias" = x
813 then
814 echo "$lang doesn't set \$language." 1>&2
815 exit 1
816 fi
817 case ${build_by_default},${enable_languages}, in
818 *,$lang_alias,*) add_this_lang=yes ;;
819 no,*) add_this_lang=no ;;
820 *,all,*) add_this_lang=yes ;;
821 *) add_this_lang=no ;;
822 esac
823 if test x"${add_this_lang}" = xyes; then
824 eval target_libs='"$target_libs "'\"$this_lang_libs\"
825 else
826 eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
827 fi
828 ;;
829 esac
830 done
831
832 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
833 # $target_configdirs.
834 # If we have the source for $noconfigdirs entries, add them to $notsupp.
835
836 notsupp=""
837 for dir in . $skipdirs $noconfigdirs ; do
838 dirname=`echo $dir | sed -e s/target-//g`
839 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
840 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
841 if test -r $srcdir/$dirname/configure ; then
842 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
843 true
844 else
845 notsupp="$notsupp $dir"
846 fi
847 fi
848 fi
849 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
850 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
851 if test -r $srcdir/$dirname/configure ; then
852 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
853 true
854 else
855 notsupp="$notsupp $dir"
856 fi
857 fi
858 fi
859 done
860
861 # Sometimes the tools are distributed with libiberty but with no other
862 # libraries. In that case, we don't want to build target-libiberty.
863 if test -n "${target_configdirs}" ; then
864 others=
865 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
866 if test "$i" != "libiberty" ; then
867 if test -r $srcdir/$i/configure ; then
868 others=yes;
869 break;
870 fi
871 fi
872 done
873 if test -z "${others}" ; then
874 target_configdirs=
875 fi
876 fi
877
878 # Deconfigure all subdirectories, in case we are changing the
879 # configuration from one where a subdirectory is supported to one where it
880 # is not.
881 if test -z "${norecursion}" && test -n "${configdirs}" ; then
882 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
883 rm -f $i/Makefile
884 done
885 fi
886 if test -z "${norecursion}" && test -n "${target_configdirs}" ; then
887 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
888 rm -f ${target_subdir}/$i/Makefile
889 done
890 fi
891
892 # Quietly strip out all directories which aren't configurable in this tree.
893 # This relies on all configurable subdirectories being autoconfiscated, which
894 # is now the case.
895 configdirs_all="$configdirs"
896 configdirs=
897 for i in ${configdirs_all} ; do
898 if test -f ${srcdir}/$i/configure ; then
899 configdirs="${configdirs} $i"
900 fi
901 done
902 target_configdirs_all="$target_configdirs"
903 target_configdirs=
904 for i in ${target_configdirs_all} ; do
905 j=`echo $i | sed -e s/target-//g`
906 if test -f ${srcdir}/$j/configure ; then
907 target_configdirs="${target_configdirs} $i"
908 fi
909 done
910
911 # Produce a warning message for the subdirs we can't configure.
912 # This isn't especially interesting in the Cygnus tree, but in the individual
913 # FSF releases, it's important to let people know when their machine isn't
914 # supported by the one or two programs in a package.
915
916 if test -n "${notsupp}" && test -z "${norecursion}" ; then
917 # If $appdirs is non-empty, at least one of those directories must still
918 # be configured, or we error out. (E.g., if the gas release supports a
919 # specified target in some subdirs but not the gas subdir, we shouldn't
920 # pretend that all is well.)
921 if test -n "$appdirs" ; then
922 for dir in $appdirs ; do
923 if test -r $dir/Makefile.in ; then
924 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
925 appdirs=""
926 break
927 fi
928 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
929 appdirs=""
930 break
931 fi
932 fi
933 done
934 if test -n "$appdirs" ; then
935 echo "*** This configuration is not supported by this package." 1>&2
936 exit 1
937 fi
938 fi
939 # Okay, some application will build, or we don't care to check. Still
940 # notify of subdirs not getting built.
941 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
942 echo " ${notsupp}" 1>&2
943 echo " (Any other directories should still work fine.)" 1>&2
944 fi
945
946 case "$host" in
947 *msdosdjgpp*)
948 enable_gdbtk=no ;;
949 esac
950
951 copy_dirs=
952
953 # Handle --with-headers=XXX. If the value is not "yes", the contents of
954 # the named directory are copied to $(tooldir)/sys-include.
955 if test x"${with_headers}" != x ; then
956 if test x${is_cross_compiler} = xno ; then
957 echo 1>&2 '***' --with-headers is only supported when cross compiling
958 exit 1
959 fi
960 if test x"${with_headers}" != xyes ; then
961 case "${exec_prefixoption}" in
962 "") x=${prefix} ;;
963 *) x=${exec_prefix} ;;
964 esac
965 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
966 fi
967 fi
968
969 # Handle --with-libs=XXX. If the value is not "yes", the contents of
970 # the name directories are copied to $(tooldir)/lib. Multiple directories
971 # are permitted.
972 if test x"${with_libs}" != x ; then
973 if test x${is_cross_compiler} = xno ; then
974 echo 1>&2 '***' --with-libs is only supported when cross compiling
975 exit 1
976 fi
977 if test x"${with_libs}" != xyes ; then
978 # Copy the libraries in reverse order, so that files in the first named
979 # library override files in subsequent libraries.
980 case "${exec_prefixoption}" in
981 "") x=${prefix} ;;
982 *) x=${exec_prefix} ;;
983 esac
984 for l in ${with_libs}; do
985 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
986 done
987 fi
988 fi
989
990 # Handle ${copy_dirs}
991 set fnord ${copy_dirs}
992 shift
993 while test $# != 0 ; do
994 if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
995 :
996 else
997 echo Copying $1 to $2
998
999 # Use the install script to create the directory and all required
1000 # parent directories.
1001 if test -d $2 ; then
1002 :
1003 else
1004 echo >config.temp
1005 ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
1006 fi
1007
1008 # Copy the directory, assuming we have tar.
1009 # FIXME: Should we use B in the second tar? Not all systems support it.
1010 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
1011
1012 # It is the responsibility of the user to correctly adjust all
1013 # symlinks. If somebody can figure out how to handle them correctly
1014 # here, feel free to add the code.
1015
1016 echo $1 > $2/COPIED
1017 fi
1018 shift; shift
1019 done
1020
1021 # Work in distributions that contain no compiler tools, like Autoconf.
1022 tentative_cc=""
1023 host_makefile_frag=/dev/null
1024 if test -d ${srcdir}/config ; then
1025 case "${host}" in
1026 m68k-hp-hpux*)
1027 # Avoid "too much defining" errors from HPUX compiler.
1028 tentative_cc="cc -Wp,-H256000"
1029 # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding.
1030 # If it's HP/UX ar, this should be harmless.
1031 RANLIB="ar ts"
1032 ;;
1033 m68k-apollo-sysv*)
1034 tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
1035 ;;
1036 m68k-apollo-bsd*)
1037 #None of the Apollo compilers can compile gas or binutils. The preprocessor
1038 # chokes on bfd, the compiler won't let you assign integers to enums, and
1039 # other problems. Defining CC to gcc is a questionable way to say "don't use
1040 # the apollo compiler" (the preferred version of GCC could be called cc,
1041 # or whatever), but I'm not sure leaving CC as cc is any better...
1042 #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
1043 # Used to have BISON=yacc.
1044 tentative_cc=gcc
1045 ;;
1046 m88k-dg-dgux*)
1047 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1048 host_makefile_frag="config/mh-dgux"
1049 ;;
1050 m88k-harris-cxux*)
1051 # Under CX/UX, we want to tell the compiler to use ANSI mode.
1052 tentative_cc="cc -Xa"
1053 host_makefile_frag="config/mh-cxux"
1054 ;;
1055 m88k-motorola-sysv*)
1056 ;;
1057 mips*-dec-ultrix*)
1058 tentative_cc="cc -Wf,-XNg1000"
1059 host_makefile_frag="config/mh-decstation"
1060 ;;
1061 mips*-nec-sysv4*)
1062 # The C compiler on NEC MIPS SVR4 needs bigger tables.
1063 tentative_cc="cc -ZXNd=5000 -ZXNg=1000"
1064 host_makefile_frag="config/mh-necv4"
1065 ;;
1066 mips*-sgi-irix4*)
1067 # Tell compiler to use K&R C. We can't compile under the SGI Ansi
1068 # environment. Also bump switch table size so that cp-parse will
1069 # compile. Bump string length limit so linker builds.
1070 tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192"
1071 ;;
1072 mips*-*-sysv4*)
1073 host_makefile_frag="config/mh-sysv4"
1074 ;;
1075 mips*-*-sysv*)
1076 # This is for a MIPS running RISC/os 4.52C.
1077
1078 # This is needed for GDB, but needs to be in the top-level make because
1079 # if a library is compiled with the bsd headers and gets linked with the
1080 # sysv system libraries all hell can break loose (e.g. a jmp_buf might be
1081 # a different size).
1082 # ptrace(2) apparently has problems in the BSD environment. No workaround is
1083 # known except to select the sysv environment. Could we use /proc instead?
1084 # These "sysv environments" and "bsd environments" often end up being a pain.
1085 #
1086 # This is not part of CFLAGS because perhaps not all C compilers have this
1087 # option.
1088 tentative_cc="cc -systype sysv"
1089 ;;
1090 i370-ibm-opened*)
1091 tentative_cc="c89"
1092 ;;
1093 i[[3456]]86-*-sysv5*)
1094 host_makefile_frag="config/mh-sysv5"
1095 ;;
1096 i[[3456]]86-*-dgux*)
1097 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1098 host_makefile_frag="config/mh-dgux386"
1099 ;;
1100 i[[3456]]86-ncr-sysv4.3*)
1101 # The MetaWare compiler will generate a copyright message unless you
1102 # turn it off by adding the -Hnocopyr flag.
1103 tentative_cc="cc -Hnocopyr"
1104 ;;
1105 i[[3456]]86-ncr-sysv4*)
1106 # for an NCR 3000 (i486/SVR4) system.
1107 # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
1108 # This compiler not only emits obnoxious copyright messages every time
1109 # you run it, but it chokes and dies on a whole bunch of GNU source
1110 # files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
1111 tentative_cc="/usr/ccs/ATT/cc"
1112 host_makefile_frag="config/mh-ncr3000"
1113 ;;
1114 i[[3456]]86-*-sco3.2v5*)
1115 ;;
1116 i[[3456]]86-*-sco*)
1117 # The native C compiler botches some simple uses of const. Unfortunately,
1118 # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
1119 tentative_cc="cc -Dconst="
1120 host_makefile_frag="config/mh-sco"
1121 ;;
1122 i[[3456]]86-*-udk*)
1123 host_makefile_frag="config/mh-sysv5"
1124 ;;
1125 i[[3456]]86-*-solaris2*)
1126 host_makefile_frag="config/mh-sysv4"
1127 ;;
1128 i[[3456]]86-*-msdosdjgpp*)
1129 host_makefile_frag="config/mh-djgpp"
1130 ;;
1131 *-cygwin*)
1132 host_makefile_frag="config/mh-cygwin"
1133 ;;
1134 *-mingw32*)
1135 host_makefile_frag="config/mh-mingw32"
1136 ;;
1137 *-interix*)
1138 host_makefile_frag="config/mh-interix"
1139 ;;
1140 vax-*-ultrix2*)
1141 # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1142 tentative_cc=gcc
1143 ;;
1144 *-*-solaris2*)
1145 host_makefile_frag="config/mh-solaris"
1146 ;;
1147 m68k-sun-sunos*)
1148 # Sun's C compiler needs the -J flag to be able to compile cp-parse.c
1149 # without overflowing the jump tables (-J says to use a 32 bit table)
1150 tentative_cc="cc -J"
1151 ;;
1152 *-hp-hpux*)
1153 tentative_cc="cc -Wp,-H256000"
1154 ;;
1155 *-*-hiux*)
1156 tentative_cc="cc -Wp,-H256000"
1157 ;;
1158 rs6000-*-lynxos*)
1159 # /bin/cc is less than useful for our purposes. Always use GCC
1160 tentative_cc="/usr/cygnus/progressive/bin/gcc"
1161 host_makefile_frag="config/mh-lynxrs6k"
1162 ;;
1163 *-*-lynxos*)
1164 # /bin/cc is less than useful for our purposes. Always use GCC
1165 tentative_cc="/bin/gcc"
1166 ;;
1167 *-*-sysv4*)
1168 host_makefile_frag="config/mh-sysv4"
1169 ;;
1170 esac
1171 fi
1172
1173 extra_arflags_for_target=
1174 extra_nmflags_for_target=
1175 extra_ranlibflags_for_target=
1176 target_makefile_frag=/dev/null
1177 case "${target}" in
1178 i[[3456]]86-*-netware*)
1179 target_makefile_frag="config/mt-netware"
1180 ;;
1181 powerpc-*-netware*)
1182 target_makefile_frag="config/mt-netware"
1183 ;;
1184 *-*-linux*)
1185 target_makefile_frag="config/mt-linux"
1186 ;;
1187 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
1188 # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
1189 # commands to handle both 32-bit and 64-bit objects. These flags are
1190 # harmless if we're using GNU nm or ar.
1191 extra_arflags_for_target=" -X32_64"
1192 extra_nmflags_for_target=" -B -X32_64"
1193 ;;
1194 *-*-darwin*)
1195 # ranlib from Darwin requires the -c flag to look at common symbols.
1196 extra_ranlibflags_for_target=" -c"
1197 ;;
1198 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
1199 target_makefile_frag="config/mt-wince"
1200 ;;
1201 esac
1202
1203 alphaieee_frag=/dev/null
1204 case $target in
1205 alpha*-*-*)
1206 # This just makes sure to use the -mieee option to build target libs.
1207 # This should probably be set individually by each library.
1208 alphaieee_frag="config/mt-alphaieee"
1209 ;;
1210 esac
1211
1212 # If --enable-target-optspace always use -Os instead of -O2 to build
1213 # the target libraries, similarly if it is not specified, use -Os
1214 # on selected platforms.
1215 ospace_frag=/dev/null
1216 case "${enable_target_optspace}:${target}" in
1217 yes:*)
1218 ospace_frag="config/mt-ospace"
1219 ;;
1220 :d30v-*)
1221 ospace_frag="config/mt-d30v"
1222 ;;
1223 :m32r-* | :d10v-* | :fr30-*)
1224 ospace_frag="config/mt-ospace"
1225 ;;
1226 no:* | :*)
1227 ;;
1228 *)
1229 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
1230 ;;
1231 esac
1232
1233 # Set with_gnu_as and with_gnu_ld as appropriate.
1234 #
1235 # This is done by determining whether or not the appropriate directory
1236 # is available, and by checking whether or not specific configurations
1237 # have requested that this magic not happen.
1238 #
1239 # The command line options always override the explicit settings in
1240 # configure.in, and the settings in configure.in override this magic.
1241 #
1242 # If the default for a toolchain is to use GNU as and ld, and you don't
1243 # want to do that, then you should use the --without-gnu-as and
1244 # --without-gnu-ld options for the configure script.
1245
1246 if test x${use_gnu_as} = x &&
1247 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
1248 with_gnu_as=yes
1249 extra_host_args="$extra_host_args --with-gnu-as"
1250 fi
1251
1252 if test x${use_gnu_ld} = x &&
1253 echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
1254 with_gnu_ld=yes
1255 extra_host_args="$extra_host_args --with-gnu-ld"
1256 fi
1257
1258 # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
1259 # can detect this case.
1260
1261 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
1262 with_newlib=yes
1263 extra_host_args="$extra_host_args --with-newlib"
1264 fi
1265
1266 # We default to --with-shared on platforms where -fpic is meaningless.
1267 # Well, we don't yet, but we will.
1268 if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then
1269 case "${target}" in
1270 alpha*-dec-osf*) enable_shared=yes ;;
1271 alpha*-*-linux*) enable_shared=yes ;;
1272 mips-sgi-irix5*) enable_shared=yes ;;
1273 *) enable_shared=no ;;
1274 esac
1275 fi
1276
1277 case "${enable_shared}" in
1278 yes) shared=yes ;;
1279 no) shared=no ;;
1280 "") shared=no ;;
1281 *) shared=yes ;;
1282 esac
1283
1284
1285 # Default to using --with-stabs for certain targets.
1286 if test x${with_stabs} = x ; then
1287 case "${target}" in
1288 mips*-*-irix6*o32)
1289 with_stabs=yes;
1290 extra_host_args="${extra_host_args} --with-stabs"
1291 ;;
1292 mips*-*-irix6*)
1293 ;;
1294 mips*-*-* | alpha*-*-osf*)
1295 with_stabs=yes;
1296 extra_host_args="${extra_host_args} --with-stabs"
1297 ;;
1298 esac
1299 fi
1300
1301 # hpux11 in 64bit mode has libraries in a weird place. Arrange to find
1302 # them automatically.
1303 case "${host}" in
1304 hppa*64*-*-hpux11*)
1305 extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
1306 ;;
1307 esac
1308
1309 # If we aren't going to be using gcc, see if we can extract a definition
1310 # of CC from the fragment.
1311 # Actually, use the 'pre-extracted' version above.
1312 if test -z "${CC}" && test "${build}" = "${host}" ; then
1313 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1314 found=
1315 for dir in $PATH; do
1316 test -z "$dir" && dir=.
1317 if test -f $dir/gcc; then
1318 found=yes
1319 break
1320 fi
1321 done
1322 IFS="$save_ifs"
1323 if test -z "${found}" && test -n "${tentative_cc}" ; then
1324 CC=$tentative_cc
1325 fi
1326 fi
1327
1328 # Some systems (e.g., one of the i386-aix systems the gas testers are
1329 # using) don't handle "\$" correctly, so don't use it here.
1330 tooldir='$(exec_prefix)'/${target_alias}
1331 build_tooldir=${tooldir}
1332
1333 # Generate a default definition for YACC. This is used if the makefile can't
1334 # locate bison or byacc in objdir.
1335
1336 for prog in 'bison -y' byacc yacc
1337 do
1338 set dummy $prog; tmp=$2
1339 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1340 for dir in $PATH; do
1341 test -z "$dir" && dir=.
1342 if test -f $dir/$tmp; then
1343 DEFAULT_YACC="$prog"
1344 break
1345 fi
1346 done
1347 IFS="$save_ifs"
1348
1349 test -n "$DEFAULT_YACC" && break
1350 done
1351
1352 # Generate a default definition for M4. This is used if the makefile can't
1353 # locate m4 in objdir.
1354
1355 for prog in gm4 gnum4 m4
1356 do
1357 set dummy $prog; tmp=$2
1358 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1359 for dir in $PATH; do
1360 test -z "$dir" && dir=.
1361 if test -f $dir/$tmp; then
1362 DEFAULT_M4="$prog"
1363 break
1364 fi
1365 done
1366 IFS="$save_ifs"
1367
1368 test -n "$DEFAULT_M4" && break
1369 done
1370
1371 # Generate a default definition for LEX. This is used if the makefile can't
1372 # locate flex in objdir.
1373
1374 for prog in flex lex
1375 do
1376 set dummy $prog; tmp=$2
1377 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1378 for dir in $PATH; do
1379 test -z "$dir" && dir=.
1380 if test -f $dir/$tmp; then
1381 DEFAULT_LEX="$prog"
1382 break
1383 fi
1384 done
1385 IFS="$save_ifs"
1386
1387 test -n "$DEFAULT_LEX" && break
1388 done
1389
1390 if test "${build}" != "${host}" ; then
1391 # If we are doing a Canadian Cross, in which the host and build systems
1392 # are not the same, we set reasonable default values for the tools.
1393
1394 BISON=${BISON-bison}
1395 CC=${CC-${host_alias}-gcc}
1396 CFLAGS=${CFLAGS-"-g -O2"}
1397 CXX=${CXX-${host_alias}-c++}
1398 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1399 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
1400 CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
1401 CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
1402 GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
1403 GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
1404 BUILD_PREFIX=${build_alias}-
1405 BUILD_PREFIX_1=${build_alias}-
1406 MAKEINFO=${MAKEINFO-makeinfo}
1407
1408 if test -z "${YACC}" ; then
1409 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1410 for dir in $PATH; do
1411 test -z "$dir" && dir=.
1412 if test -f $dir/bison; then
1413 YACC="bison -y"
1414 break
1415 fi
1416 if test -f $dir/byacc; then
1417 YACC=byacc
1418 break
1419 fi
1420 if test -f $dir/yacc; then
1421 YACC=yacc
1422 break
1423 fi
1424 done
1425 IFS="$save_ifs"
1426 if test -z "${YACC}" ; then
1427 YACC="bison -y"
1428 fi
1429 fi
1430
1431 if test -z "${LEX}" ; then
1432 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1433 for dir in $PATH; do
1434 test -z "$dir" && dir=.
1435 if test -f $dir/flex; then
1436 LEX=flex
1437 break
1438 fi
1439 if test -f $dir/lex; then
1440 LEX=lex
1441 break
1442 fi
1443 done
1444 IFS="$save_ifs"
1445 LEX=${LEX-flex}
1446 fi
1447
1448 else
1449 # Set reasonable default values for some tools even if not Canadian.
1450 # Of course, these are different reasonable default values, originally
1451 # specified directly in the Makefile.
1452 # We don't export, so that autoconf can do its job.
1453 # Note that all these settings are above the fragment inclusion point
1454 # in Makefile.in, so can still be overridden by fragments.
1455 # This is all going to change when we autoconfiscate...
1456
1457 BISON="\$(USUAL_BISON)"
1458 CC_FOR_BUILD="\$(CC)"
1459 GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
1460 BUILD_PREFIX=
1461 BUILD_PREFIX_1=loser-
1462 MAKEINFO="\$(USUAL_MAKEINFO)"
1463 LEX="\$(USUAL_LEX)"
1464 YACC="\$(USUAL_YACC)"
1465
1466 # If CC is still not set, try to get gcc.
1467 if test -z "${CC}" ; then
1468 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1469 for dir in $PATH; do
1470 test -z "$dir" && dir=.
1471 if test -f $dir/gcc; then
1472 CC="gcc"
1473 echo 'void f(){}' > conftest.c
1474 if test -z "`${CC} -g -c conftest.c 2>&1`"; then
1475 CFLAGS=${CFLAGS-"-g -O2"}
1476 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1477 else
1478 CFLAGS=${CFLAGS-"-O2"}
1479 CXXFLAGS=${CXXFLAGS-"-O2"}
1480 fi
1481 rm -f conftest*
1482 break
1483 fi
1484 done
1485 IFS="$save_ifs"
1486 CC=${CC-cc}
1487 else
1488 if test -z "${CFLAGS}"; then
1489 # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC
1490 # is set to a version of gcc.
1491 case "${CC}" in
1492 *gcc)
1493 echo 'void f(){}' > conftest.c
1494 if test -z "`${CC} -g -c conftest.c 2>&1`"; then
1495 CFLAGS=${CFLAGS-"-g -O2"}
1496 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1497 else
1498 CFLAGS=${CFLAGS-"-O2"}
1499 CXXFLAGS=${CXXFLAGS-"-O2"}
1500 fi
1501 rm -f conftest*
1502 ;;
1503 esac
1504 fi
1505 fi
1506
1507 CXX=${CXX-"c++"}
1508 CFLAGS=${CFLAGS-"-g"}
1509 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1510 fi
1511
1512 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
1513 # Set up the list of links to be made.
1514 # ${links} is the list of link names, and ${files} is the list of names to link to.
1515
1516 # Make the links.
1517 configlinks="${links}"
1518 if test -r ./config.status ; then
1519 mv -f ./config.status ./config.back
1520 fi
1521 while test -n "${files}" ; do
1522 # set file to car of files, files to cdr of files
1523 set ${files}; file=$1; shift; files=$*
1524 set ${links}; link=$1; shift; links=$*
1525
1526 if test ! -r ${srcdir}/${file} ; then
1527 if test ! -r ${file} ; then
1528 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
1529 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
1530 exit 1
1531 else
1532 srcfile=${file}
1533 fi
1534 else
1535 srcfile=${srcdir}/${file}
1536 fi
1537
1538 ${remove} -f ${link}
1539 # Make a symlink if possible, otherwise try a hard link
1540 if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then
1541 true
1542 else
1543 # We need to re-remove the file because Lynx leaves a
1544 # very strange directory there when it fails an NFS symlink.
1545 ${remove} -r -f ${link}
1546 ${hard_link} ${srcfile} ${link}
1547 fi
1548 if test ! -r ${link} ; then
1549 echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2
1550 exit 1
1551 fi
1552
1553 echo "Linked \"${link}\" to \"${srcfile}\"."
1554 done
1555
1556 # Create a .gdbinit file which runs the one in srcdir
1557 # and tells GDB to look there for source files.
1558
1559 if test -r ${srcdir}/.gdbinit ; then
1560 case ${srcdir} in
1561 .) ;;
1562 *) cat > ./.gdbinit <<EOF
1563 # ${NO_EDIT}
1564 dir ${srcdir}
1565 dir .
1566 source ${srcdir}/.gdbinit
1567 EOF
1568 ;;
1569 esac
1570 fi
1571
1572 # record if we want runtime library stuff installed in libsubdir.
1573 # Blank means no.
1574 if test -z "${enable_version_specific_runtime_libs}"; then
1575 enable_version_specific_runtime_libs=no
1576 fi
1577
1578 # Make sure that the compiler is able to generate an executable. If it
1579 # can't, we are probably in trouble. We don't care whether we can run the
1580 # executable--we might be using a cross compiler--we only care whether it
1581 # can be created. At this point the main configure script has set CC.
1582 we_are_ok=no
1583 echo "int main () { return 0; }" > conftest.c
1584 ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1585 if test $? = 0 ; then
1586 if test -s conftest || test -s conftest.exe ; then
1587 we_are_ok=yes
1588 fi
1589 fi
1590 case $we_are_ok in
1591 no)
1592 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1593 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1594 rm -f conftest*
1595 exit 1
1596 ;;
1597 esac
1598 rm -f conftest*
1599
1600 # The Solaris /usr/ucb/cc compiler does not appear to work.
1601 case "${host}" in
1602 sparc-sun-solaris2*)
1603 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1604 if test "`type $CCBASE | sed 's/^[[^/]]*//'`" = "/usr/ucb/cc" ; then
1605 could_use=
1606 test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
1607 if test -d /opt/cygnus/bin ; then
1608 if test "$could_use" = "" ; then
1609 could_use="/opt/cygnus/bin"
1610 else
1611 could_use="$could_use or /opt/cygnus/bin"
1612 fi
1613 fi
1614 if test "$could_use" = "" ; then
1615 echo "Warning: compilation may fail because you're using"
1616 echo "/usr/ucb/cc. You should change your PATH or CC "
1617 echo "variable and rerun configure."
1618 else
1619 echo "Warning: compilation may fail because you're using"
1620 echo "/usr/ucb/cc, when you should use the C compiler from"
1621 echo "$could_use. You should change your"
1622 echo "PATH or CC variable and rerun configure."
1623 fi
1624 fi
1625 ;;
1626 esac
1627
1628 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1629 # binutils tools will find libbfd.so.
1630 if test "${shared}" = "yes" ; then
1631 SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
1632 else
1633 SET_LIB_PATH=
1634 fi
1635
1636
1637 case "${host}" in
1638 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
1639 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
1640 esac
1641
1642 # Record target_configdirs and the configure arguments for target and
1643 # build configuration in Makefile.
1644 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1645
1646 # This is the final value for target_configdirs. configdirs already
1647 # has its final value. It's time to create some lists of valid targets.
1648
1649 all_build_modules=
1650 configure_build_modules=
1651 # Only make build modules if build != host.
1652 # This should be done more generally, but at the moment it doesn't matter.
1653 if test ${host_alias} != ${build_alias} ; then
1654 all_build_modules=all-build-libiberty
1655 configure_build_modules=configure-build-libiberty
1656 fi
1657
1658 all_host_modules=
1659 check_host_modules=
1660 install_host_modules=
1661 configure_host_modules=
1662 for module in ${configdirs} ; do
1663 all_host_modules="${all_host_modules} all-${module}"
1664 check_host_modules="${check_host_modules} check-${module}"
1665 install_host_modules="${install_host_modules} install-${module}"
1666 configure_host_modules="${configure_host_modules} configure-${module}"
1667 done
1668 install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
1669
1670 all_target_modules=
1671 check_target_modules=
1672 install_target_modules=
1673 configure_target_modules=
1674 for module in ${target_configdirs} ; do
1675 all_target_modules="${all_target_modules} all-target-${module}"
1676 check_target_modules="${check_target_modules} check-target-${module}"
1677 install_target_modules="${install_target_modules} install-target-${module}"
1678 configure_target_modules="${configure_target_modules} configure-target-${module}"
1679 done
1680
1681 # Determine whether gdb needs tk/tcl or not.
1682 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
1683 # and in that case we want gdb to be built without tk. Ugh!
1684 # In fact I believe gdb is the *only* package directly dependent on tk,
1685 # so we should be able to put the 'maybe's in unconditionally and
1686 # leave out the maybe dependencies when enable_gdbtk is false. I'm not
1687 # 100% sure that that's safe though.
1688 case "$enable_gdbtk" in
1689 no)
1690 GDB_TK="" ;;
1691 *)
1692 GDB_TK="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" ;;
1693 esac
1694
1695 # Create the 'maybe dependencies'. This uses a temporary file.
1696 rm -f maybedep.tmp
1697 for item in ${all_build_modules} ${all_host_modules} ${all_target_modules} \
1698 ${install_host_modules} ${install_target_modules} \
1699 ${configure_build_modules} ${configure_host_modules} ${configure_target_modules} \
1700 ; do
1701 echo "maybe-${item}: ${item}" >> maybedep.tmp
1702 done
1703 maybe_dependencies=maybedep.tmp
1704 AC_SUBST_FILE(maybe_dependencies)
1705
1706 # Create the serialization dependencies. This uses a temporary file.
1707
1708 # These force 'configure's to be done one at a time, to avoid problems
1709 # with contention over a shared config.cache.
1710 rm -f serdep.tmp
1711 olditem=
1712 for item in ${build_configdirs} ; do
1713 case ${olditem} in
1714 "") ;;
1715 *) echo "\$(BUILD_SUBDIR)/${item}/Makefile: \$(BUILD_SUBDIR)/${olditem}/Makefile" >> serdep.tmp ;;
1716 esac
1717 olditem=${item}
1718 done
1719 olditem=
1720 for item in ${configdirs} ; do
1721 case ${olditem} in
1722 "") ;;
1723 *) echo "${item}/Makefile: ${olditem}/Makefile" >> serdep.tmp ;;
1724 esac
1725 olditem=${item}
1726 done
1727 olditem=
1728 for item in ${target_configdirs} ; do
1729 case ${olditem} in
1730 "") ;;
1731 *) echo "\$(TARGET_SUBDIR)/${item}/Makefile: \$(TARGET_SUBDIR)/${olditem}/Makefile" >> serdep.tmp ;;
1732 esac
1733 olditem=${item}
1734 done
1735 serialization_dependencies=serdep.tmp
1736 AC_SUBST_FILE(serialization_dependencies)
1737
1738 # Base args. Strip norecursion, cache-file, srcdir, host, build, target.
1739 # These are the ones we might not want to pass down to subconfigures.
1740 baseargs=`echo "${ac_configure_args}" | \
1741 sed -e 's/--no[[^ ]]*//' \
1742 -e 's/--cache[[a-z-]]*=[[^ ]]*//' \
1743 -e 's/--sr[[a-z-]]*=[[^ ]]*//' \
1744 -e 's/--ho[[a-z-]]*=[[^ ]]*//' \
1745 -e 's/--bu[[a-z-]]*=[[^ ]]*//' \
1746 -e 's/--ta[[a-z-]]*=[[^ ]]*//'`
1747
1748 # For the build-side libraries, we just need to pretend we're native,
1749 # and not use the same cache file. Multilibs are neither needed nor
1750 # desired.
1751 build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
1752
1753 # For host modules, accept cache file option, or specification as blank.
1754 case "${cache_file}" in
1755 "") # empty
1756 cache_file_option="" ;;
1757 /* | [[A-Za-z]]:[[\\/]]* ) # absolute path
1758 cache_file_option="--cache-file=${cache_file}" ;;
1759 *) # relative path
1760 cache_file_option="--cache-file=../${cache_file}" ;;
1761 esac
1762
1763 host_configargs="${cache_file_option} ${buildopt} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
1764
1765 target_configargs=${baseargs}
1766
1767 # Passing a --with-cross-host argument lets the target libraries know
1768 # whether they are being built with a cross-compiler or being built
1769 # native. However, it would be better to use other mechanisms to make the
1770 # sorts of decisions they want to make on this basis. Please consider
1771 # this option to be deprecated. FIXME.
1772 if test x${is_cross_compiler} = xyes ; then
1773 target_configargs="--with-cross-host=${host_alias} ${target_configargs}"
1774 fi
1775
1776 # Default to --enable-multilib.
1777 if test x${enable_multilib} = x ; then
1778 target_configargs="--enable-multilib ${target_configargs}"
1779 fi
1780
1781 # Pass --with-newlib if appropriate. Note that target_configdirs has
1782 # changed from the earlier setting of with_newlib.
1783 if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
1784 target_configargs="--with-newlib ${target_configargs}"
1785 fi
1786
1787 # Pass the appropriate --host, --build, and --cache-file arguments.
1788 target_configargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}"
1789
1790 # provide a proper gxx_include_dir.
1791 # Note, if you change the default, make sure to fix both here and in
1792 # the gcc and libstdc++-v3 subdirectories.
1793 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1794 gxx_include_dir=
1795 if test -n "${with_gxx_include_dir}"; then
1796 case "${with_gxx_include_dir}" in
1797 yes )
1798 echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
1799 exit 1
1800 ;;
1801 no )
1802 ;;
1803 * )
1804 gxx_include_dir=${with_gxx_include_dir}
1805 ;;
1806 esac
1807 fi
1808 if test x${gxx_include_dir} = x; then
1809 if test x${enable_version_specific_runtime_libs} = xyes; then
1810 gxx_include_dir='${libsubdir}/include/c++'
1811 else
1812 . ${srcdir}/config.if
1813 gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
1814 fi
1815 else
1816 gxx_include_dir=${gxx_include_dir}
1817 fi
1818
1819 FLAGS_FOR_TARGET=
1820 case " $target_configdirs " in
1821 *" newlib "*)
1822 case " $target_configargs " in
1823 *" --with-newlib "*)
1824 case "$target" in
1825 *-cygwin*)
1826 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' ;;
1827 esac
1828
1829 # If we're not building GCC, don't discard standard headers.
1830 if test -d ${srcdir}/gcc; then
1831 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
1832
1833 if test "${build}" != "${host}"; then
1834 # On Canadian crosses, CC_FOR_TARGET will have already been set
1835 # by `configure', so we won't have an opportunity to add -Bgcc/
1836 # to it. This is right: we don't want to search that directory
1837 # for binaries, but we want the header files in there, so add
1838 # them explicitly.
1839 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
1840
1841 # Someone might think of using the pre-installed headers on
1842 # Canadian crosses, in case the installed compiler is not fully
1843 # compatible with the compiler being built. In this case, it
1844 # would be better to flag an error than risking having
1845 # incompatible object files being constructed. We can't
1846 # guarantee that an error will be flagged, but let's hope the
1847 # compiler will do it, when presented with incompatible header
1848 # files.
1849 fi
1850 fi
1851
1852 case "${target}-${is_cross_compiler}" in
1853 i[[3456]]86-*-linux*-no)
1854 # Here host == target, so we don't need to build gcc,
1855 # so we don't want to discard standard headers.
1856 FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
1857 ;;
1858 *)
1859 # If we're building newlib, use its generic headers last, but search
1860 # for any libc-related directories first (so make it the last -B
1861 # switch).
1862 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
1863 ;;
1864 esac
1865 ;;
1866 esac
1867 ;;
1868 esac
1869
1870 # On Canadian crosses, we'll be searching the right directories for
1871 # the previously-installed cross compiler, so don't bother to add
1872 # flags for directories within the install tree of the compiler
1873 # being built; programs in there won't even run.
1874 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
1875 # Search for pre-installed headers if nothing else fits.
1876 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
1877 fi
1878
1879 if test "x${use_gnu_ld}" = x &&
1880 echo " ${configdirs} " | grep " ld " > /dev/null ; then
1881 # Arrange for us to find uninstalled linker scripts.
1882 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1883 fi
1884
1885 if test "x${CC_FOR_TARGET+set}" = xset; then
1886 :
1887 elif test -d ${srcdir}/gcc; then
1888 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
1889 elif test "$host" = "$target"; then
1890 CC_FOR_TARGET='$(CC)'
1891 else
1892 CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1893 fi
1894 CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1895
1896 if test "x${GCJ_FOR_TARGET+set}" = xset; then
1897 :
1898 elif test -d ${srcdir}/gcc; then
1899 GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
1900 elif test "$host" = "$target"; then
1901 GCJ_FOR_TARGET='gcj'
1902 else
1903 GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
1904 fi
1905 GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1906
1907 # Don't use libstdc++-v3's flags to configure/build itself.
1908 libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
1909 raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
1910
1911 if test "x${CXX_FOR_TARGET+set}" = xset; then
1912 :
1913 elif test -d ${srcdir}/gcc; then
1914 # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
1915 # of g++ for linking C++ or Java, because g++ has -shared-libgcc by
1916 # default whereas gcc does not.
1917 # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for
1918 # all other cases.
1919 CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
1920 RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags
1921 elif test "$host" = "$target"; then
1922 CXX_FOR_TARGET='$(CXX)'
1923 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
1924 else
1925 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
1926 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
1927 fi
1928 CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1929 RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1930
1931 qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'`
1932 qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'`
1933
1934 # We want to defer the evaluation of `cmd`s and shell variables in
1935 # CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
1936 # bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
1937 # quotes, but we still have to duplicate `$'s so that shell variables
1938 # can be expanded by the nested make as shell variables, not as make
1939 # macros.
1940 qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'`
1941 qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'`
1942
1943 # Wrap CC_FOR_TARGET and friends, for certain types of builds.
1944 CC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}"
1945 GCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}"
1946 CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}"
1947 RAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}"
1948 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}"
1949 RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}"
1950
1951 # Makefile fragments.
1952 host_makefile_frag=${srcdir}/${host_makefile_frag}
1953 target_makefile_frag=${srcdir}/${target_makefile_frag}
1954 alphaieee_frag=${srcdir}/${alphaieee_frag}
1955 ospace_frag=${srcdir}/${ospace_frag}
1956 AC_SUBST_FILE(host_makefile_frag)
1957 AC_SUBST_FILE(target_makefile_frag)
1958 AC_SUBST_FILE(alphaieee_frag)
1959 AC_SUBST_FILE(ospace_frag)
1960
1961 # Miscellanea: directories, flags, etc.
1962 AC_SUBST(SET_LIB_PATH)
1963 AC_SUBST(RPATH_ENVVAR)
1964 AC_SUBST(BUILD_PREFIX)
1965 AC_SUBST(BUILD_PREFIX_1)
1966 AC_SUBST(configlinks)
1967 AC_SUBST(enable_shared)
1968 AC_SUBST(enable_threads)
1969 AC_SUBST(enable_version_specific_runtime_libs)
1970 AC_SUBST(gcc_version_trigger)
1971 AC_SUBST(gcc_version)
1972 AC_SUBST(tooldir)
1973 AC_SUBST(build_tooldir)
1974 AC_SUBST(GDB_TK)
1975 AC_SUBST(gxx_include_dir)
1976 AC_SUBST(libstdcxx_incdir)
1977
1978 # Build module lists & subconfigure args.
1979 AC_SUBST(build_subdir)
1980 AC_SUBST(build_configargs)
1981 AC_SUBST(configure_build_modules)
1982 AC_SUBST(all_build_modules)
1983
1984 # Host module lists & subconfigure args.
1985 AC_SUBST(host_configargs)
1986 AC_SUBST(configdirs)
1987 AC_SUBST(configure_host_modules)
1988 AC_SUBST(all_host_modules)
1989 AC_SUBST(check_host_modules)
1990 AC_SUBST(install_host_modules)
1991 AC_SUBST(install_host_modules_nogcc)
1992
1993 # Target module lists & subconfigure args.
1994 AC_SUBST(target_subdir)
1995 AC_SUBST(target_configargs)
1996 AC_SUBST(target_configdirs)
1997 AC_SUBST(configure_target_modules)
1998 AC_SUBST(all_target_modules)
1999 AC_SUBST(check_target_modules)
2000 AC_SUBST(install_target_modules)
2001
2002 # Build tools.
2003 AC_SUBST(BISON)
2004 AC_SUBST(CC_FOR_BUILD)
2005 AC_SUBST(LEX)
2006 AC_SUBST(MAKEINFO)
2007 AC_SUBST(YACC)
2008 AC_SUBST(config_shell)
2009
2010 # Host tools.
2011 AC_CHECK_TOOL(AR, ar)
2012 AC_CHECK_TOOL(AS, as)
2013 AC_CHECK_TOOL(DLLTOOL, dlltool)
2014 AC_CHECK_TOOL(LD, ld)
2015 AC_CHECK_TOOL(NM, nm)
2016 AC_CHECK_TOOL(RANLIB, ranlib, :)
2017 AC_CHECK_TOOL(WINDRES, windres)
2018 AC_CHECK_TOOL(OBJCOPY, objcopy)
2019 AC_CHECK_TOOL(OBJDUMP, objdump)
2020 AC_SUBST(CC)
2021 AC_SUBST(CXX)
2022 AC_SUBST(CFLAGS)
2023 AC_SUBST(CXXFLAGS)
2024 AC_SUBST(DEFAULT_YACC)
2025 AC_SUBST(DEFAULT_LEX)
2026 AC_SUBST(DEFAULT_M4)
2027
2028 # Target tools.
2029 NCN_CHECK_TARGET_TOOL(AR_FOR_TARGET, ar)
2030 NCN_CHECK_TARGET_TOOL(AS_FOR_TARGET, as)
2031 NCN_CHECK_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
2032 NCN_CHECK_TARGET_TOOL(LD_FOR_TARGET, ld)
2033 NCN_CHECK_TARGET_TOOL(NM_FOR_TARGET, nm)
2034 NCN_CHECK_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :)
2035 NCN_CHECK_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
2036
2037 AC_SUBST(GCC_FOR_TARGET)
2038 AC_SUBST(FLAGS_FOR_TARGET)
2039 AC_SUBST(CC_FOR_TARGET)
2040 AC_SUBST(GCJ_FOR_TARGET)
2041 AC_SUBST(CXX_FOR_TARGET)
2042 AC_SUBST(RAW_CXX_FOR_TARGET)
2043 AC_SUBST(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
2044 AC_SUBST(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
2045
2046 # Fix up target tools.
2047 if test "x${build}" = "x${host}" ; then
2048 # In this case, the newly built tools can and should be used,
2049 # so we override the results of the autoconf tests.
2050 # This should really only happen when the tools are actually being built,
2051 # but that's a further refinement. The new build scheme, where
2052 # tools are built into a structure paralleling where they're installed,
2053 # should also eliminate all of this cleanly.
2054 AR_FOR_TARGET="\$(USUAL_AR_FOR_TARGET)"
2055 AS_FOR_TARGET="\$(USUAL_AS_FOR_TARGET)"
2056 DLLTOOL_FOR_TARGET="\$(USUAL_DLLTOOL_FOR_TARGET)"
2057 LD_FOR_TARGET="\$(USUAL_LD_FOR_TARGET)"
2058 NM_FOR_TARGET="\$(USUAL_NM_FOR_TARGET)"
2059 RANLIB_FOR_TARGET="\$(USUAL_RANLIB_FOR_TARGET)"
2060 WINDRES_FOR_TARGET="\$(USUAL_WINDRES_FOR_TARGET)"
2061 fi
2062 # Certain tools may need extra flags.
2063 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
2064 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
2065 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
2066
2067 AC_OUTPUT(Makefile)
This page took 0.072659 seconds and 4 git commands to generate.