]> sourceware.org Git - newlib-cygwin.git/blame - configure.in
remove from trunk
[newlib-cygwin.git] / configure.in
CommitLineData
f3d61cc7
DD
1# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
a3acbf46
RH
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##############################################################################
bafecfd6
NN
19### WARNING: this file contains embedded tabs. Do not run untabify on this file.
20
21AC_INIT(move-if-change)
22AC_CANONICAL_SYSTEM
23AC_ARG_PROGRAM
24
25sinclude(config/acx.m4)
26
27# clear some things potentially inherited from environment.
28
29enable_threads=no
30enable_shared=no
31enable_libstdcxx_v3=yes
32floating_point=default
33gas=default
34x11=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.
41case "${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 ;;
66esac
67
68config_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
79progname=$0
80# if PWD already has a value, it is probably wrong.
81if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
82
83case "${progname}" in
84/* | [[A-Za-z]]:[[\\/]]* ) ;;
85*/*) ;;
86*)
87 PATH=$PATH:${PWD=`${PWDCMD-pwd}`} ; export PATH
88 ;;
89esac
90
91# Export original configure arguments for use by sub-configures.
92TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
93export TOPLEVEL_CONFIGURE_ARGUMENTS
94
95moveifchange=${srcdir}/move-if-change
96
97# Set srcdir to "." if that's what it is.
98# This is important for multilib support.
99pwd=`${PWDCMD-pwd}`
100srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
101if test "${pwd}" = "${srcpwd}" ; then
102 srcdir=.
103fi
104
105topsrcdir=$srcpwd
a3acbf46 106
c5ab3a90
NN
107extra_host_args=
108# Define the trigger file to make sure configure will re-run whenever
109# the gcc version number changes.
bafecfd6
NN
110if 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/'`
c5ab3a90 113else
bafecfd6
NN
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
c5ab3a90
NN
127fi
128
a3acbf46
RH
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
d8e6f006 131### (library or tools, host or target), doing a dependency sort.
a3acbf46 132
d8e6f006
NN
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.
a3acbf46
RH
142
143# these libraries are used by various programs built for the host environment
144#
ec085641 145host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk itcl tix libgui zlib"
a3acbf46 146
06e2f4c3 147libstdcxx_version="target-libstdc++-v3"
2ff6d12f 148
a3acbf46
RH
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.
358f7e4b
NN
152# binutils, gas and ld appear in that order because it makes sense to run
153# "make check" in that particular order.
154host_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"
f3d61cc7
DD
155
156# libgcj represents the runtime libraries only used by gcj.
157libgcj="target-libffi \
158 target-boehm-gc \
159 target-zlib \
160 target-qthreads \
161 target-libjava"
a3acbf46
RH
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#
166target_libs="target-libiberty \
167 target-libgloss \
168 target-newlib \
2ff6d12f
JM
169 ${libstdcxx_version} \
170 target-libf2c \
f3d61cc7 171 ${libgcj}
2ff6d12f 172 target-libobjc"
a3acbf46
RH
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#
6f37a0a1 181target_tools="target-examples target-groff target-gperf target-rda"
a3acbf46
RH
182
183################################################################################
184
a3acbf46
RH
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#
191configdirs=`echo ${host_libs} ${host_tools}`
192target_configdirs=`echo ${target_libs} ${target_tools}`
193
194################################################################################
195
a3acbf46
RH
196srcname="gnu development package"
197
198# This gets set non-empty for some net releases of packages.
199appdirs=""
200
79188d5f
DD
201# Define is_cross_compiler to save on calls to 'test'.
202is_cross_compiler=
203if test x"${host}" = x"${target}" ; then
204 is_cross_compiler=no
205else
206 is_cross_compiler=yes
207fi
208
a3acbf46
RH
209# We always want to use the same name for this directory, so that dejagnu
210# can reliably find it.
211target_subdir=${target_alias}
212
c9a28049 213if test ! -d ${target_subdir} ; then
a3acbf46
RH
214 if mkdir ${target_subdir} ; then true
215 else
6acce4b8 216 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
a3acbf46
RH
217 exit 1
218 fi
219fi
220
93a1293b
NN
221build_prefix=build-
222build_subdir=${build_prefix}${build_alias}
f66d1936 223
c9a28049
DD
224if test x"${build_alias}" != x"${host}" ; then
225 if test ! -d ${build_subdir} ; then
f66d1936
DD
226 if mkdir ${build_subdir} ; then true
227 else
6acce4b8 228 echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
f66d1936
DD
229 exit 1
230 fi
231 fi
232fi
233
bae61225
DD
234# Skipdirs are removed silently.
235skipdirs=
236# Noconfigdirs are removed loudly.
237noconfigdirs=""
a3acbf46 238
bae61225
DD
239use_gnu_ld=
240# Make sure we don't let GNU ld be added if we didn't want it.
241if test x$with_gnu_ld = xno ; then
242 use_gnu_ld=no
243 noconfigdirs="$noconfigdirs ld"
a3acbf46
RH
244fi
245
bae61225
DD
246use_gnu_as=
247# Make sure we don't let GNU as be added if we didn't want it.
248if test x$with_gnu_as = xno ; then
249 use_gnu_as=no
250 noconfigdirs="$noconfigdirs gas"
a3acbf46
RH
251fi
252
bae61225
DD
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.
a3acbf46 255
bae61225
DD
256case ${with_x} in
257 yes | "") ;; # the default value for this tree is that X11 is available
1f52cb5d
DD
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 ;;
bae61225
DD
263 *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
264esac
a3acbf46 265
bae61225 266# Some tools are only suitable for building in a "native" situation.
bba02726 267# Remove these if host!=target.
20eb48d4 268native_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"
bba02726
NN
269
270# Similarly, some are only suitable for cross toolchains.
271# Remove these if host=target.
272cross_only="target-libgloss target-newlib target-opcodes"
a3acbf46 273
bae61225
DD
274case $is_cross_compiler in
275 no) skipdirs="${skipdirs} ${cross_only}" ;;
276 yes) skipdirs="${skipdirs} ${native_only}" ;;
277esac
a3acbf46 278
18c85e1a
DD
279# If both --with-headers and --with-libs are specified, default to
280# --without-newlib.
281if 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
285fi
286
287# Recognize --with-newlib/--without-newlib.
288case ${with_newlib} in
289 no) skipdirs="${skipdirs} target-newlib" ;;
290 yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
291esac
292
a3acbf46
RH
293# Configure extra directories which are host specific
294
295case "${host}" in
bae61225 296 *-cygwin*)
8ecc6504 297 configdirs="$configdirs libtermcap" ;;
a3acbf46
RH
298esac
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
a3acbf46 304case "${host}" in
f3d61cc7
DD
305 hppa*64*-*-*)
306 noconfigdirs="$noconfigdirs byacc"
307 ;;
bafecfd6 308 i[[3456]]86-*-vsta)
0bf10df1 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"
a3acbf46 310 ;;
bafecfd6 311 i[[3456]]86-*-go32* | i[[3456]]86-*-msdosdjgpp*)
0bf10df1 312 noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi"
a3acbf46 313 ;;
bafecfd6 314 i[[3456]]86-*-mingw32*)
0bf10df1
DD
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"
a3acbf46 317 ;;
bafecfd6 318 i[[3456]]86-*-beos*)
a3acbf46
RH
319 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
320 ;;
321 *-*-cygwin*)
0bf10df1 322 noconfigdirs="autoconf automake send-pr rcs guile perl"
a3acbf46
RH
323 ;;
324 *-*-netbsd*)
325 noconfigdirs="rcs"
326 ;;
327 ppc*-*-pe)
0bf10df1 328 noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv"
a3acbf46 329 ;;
2ff6d12f
JM
330 powerpc-*-beos*)
331 noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
332 ;;
171eed0b
NN
333 *-*-darwin*)
334 noconfigdirs="$noconfigdirs tk itcl tix libgui"
335 ;;
a3acbf46
RH
336esac
337
71bb5ea4
AO
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.
340libgcj_saved=$libgcj
341case $enable_libgcj in
342yes)
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 ;;
348no)
349 # Make sure we get it printed in the list of not supported target libs.
350 noconfigdirs="$noconfigdirs ${libgcj}"
351 ;;
352esac
353
a3acbf46 354case "${target}" in
f3d61cc7
DD
355 *-*-chorusos)
356 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
357 ;;
bafecfd6 358 *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
57311c33
DD
359 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
360 ;;
0dbef4a1
JT
361 *-*-netbsd*)
362 # Skip some stuff on all NetBSD configurations.
8b21c487 363 noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
0dbef4a1
JT
364
365 # Skip some stuff that's unsupported on some NetBSD configurations.
366 case "${target}" in
f3d61cc7 367 i*86-*-netbsdelf*) ;;
0dbef4a1 368 *)
f3d61cc7 369 noconfigdirs="$noconfigdirs ${libgcj}"
0dbef4a1
JT
370 ;;
371 esac
372 ;;
a3acbf46 373 *-*-netware)
78125538 374 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
a3acbf46
RH
375 ;;
376 *-*-rtems*)
f3d61cc7 377 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
ac1361c4
DD
378 case ${target} in
379 h8300*-*-* | h8500-*-*)
380 noconfigdirs="$noconfigdirs target-libf2c"
381 ;;
382 *) ;;
383 esac
a3acbf46
RH
384 ;;
385 *-*-vxworks*)
f3d61cc7 386 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
a3acbf46
RH
387 ;;
388 alpha*-dec-osf*)
859eb630
DD
389 # ld works, but does not support shared libraries.
390 # newlib is not 64 bit ready. I'm not sure about fileutils.
a3acbf46 391 # gas doesn't generate exception information.
859eb630 392 noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
a3acbf46
RH
393 ;;
394 alpha*-*-*vms*)
f3d61cc7
DD
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"
a3acbf46 400 ;;
57311c33
DD
401 alpha*-*-freebsd*)
402 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
403 ;;
a3acbf46
RH
404 alpha*-*-*)
405 # newlib is not 64 bit ready
f3d61cc7 406 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
a3acbf46 407 ;;
f3d61cc7
DD
408 sh-*-linux*)
409 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
f3d61cc7 410 ;;
237e6cfa 411 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
f3d61cc7
DD
412 noconfigdirs="$noconfigdirs ${libgcj}"
413 noconfigdirs="$noconfigdirs target-examples"
2ff6d12f 414 noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
237e6cfa
NC
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
2ff6d12f 418 noconfigdirs="$noconfigdirs ${libstdcxx_version}"
8b21c487 419 noconfigdirs="$noconfigdirs target-newlib"
237e6cfa
NC
420 case "${host}" in
421 *-*-cygwin*) ;; # keep gdb and readline
2ff6d12f 422 *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
237e6cfa
NC
423 ;;
424 esac
425 ;;
a3acbf46 426 arc-*-*)
f3d61cc7 427 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 428 ;;
1a575bb3
NN
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 ;;
a3acbf46 435 arm-*-pe*)
f3d61cc7 436 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 437 ;;
a3acbf46 438 arm-*-oabi*)
f3d61cc7 439 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 440 ;;
a3acbf46 441 thumb-*-coff)
f3d61cc7 442 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 443 ;;
a3acbf46 444 thumb-*-elf)
f3d61cc7 445 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46
RH
446 ;;
447 thumb-*-oabi)
f3d61cc7 448 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 449 ;;
b5314dab 450 thumb-*-pe)
f3d61cc7 451 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46
RH
452 ;;
453 arm-*-riscix*)
f3d61cc7 454 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
a3acbf46 455 ;;
ab72c934
MM
456 avr-*-*)
457 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
458 ;;
0709b9ba 459 c4x-*-* | tic4x-*-*)
78125538 460 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
a76857b2
NC
461 ;;
462 c54x*-*-* | tic54x-*-*)
f3d61cc7
DD
463 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
464 ;;
465 cris-*-*)
466 noconfigdirs="$noconfigdirs ${libgcj}"
a76857b2 467 ;;
a3acbf46 468 d10v-*-*)
78125538 469 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
a3acbf46 470 ;;
a3acbf46 471 d30v-*-*)
f3d61cc7 472 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46 473 ;;
a3acbf46 474 fr30-*-elf*)
f3d61cc7 475 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46 476 ;;
685f52ef
DB
477 frv-*-*)
478 noconfigdirs="$noconfigdirs ${libgcj}"
685f52ef 479 ;;
a8505a71
JH
480 h8300*-*-*)
481 noconfigdirs="$noconfigdirs target-libgloss"
482 ;;
a3acbf46 483 h8500-*-*)
78125538 484 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
f3d61cc7
DD
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"
a3acbf46
RH
491 ;;
492 hppa*-*-*elf* | \
f3d61cc7 493 parisc*-*-linux* | hppa*-*-linux* | \
52a3d413 494 hppa*-*-lites* | \
32438c51 495 hppa*-*-openbsd* | \
52a3d413 496 hppa*64*-*-*)
f3d61cc7 497 noconfigdirs="$noconfigdirs ${libgcj}"
2ff6d12f 498 # Do configure ld/binutils/gas for this case.
a3acbf46
RH
499 ;;
500 hppa*-*-*)
5e6f1ab2
AO
501 # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
502 # build on HP-UX 10.20.
503 noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
a3acbf46 504 ;;
9fb0ab09
JW
505 ia64*-*-elf*)
506 # No gdb support yet.
507 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
508 ;;
d3ea25cb
NC
509 ia64*-**-hpux*)
510 # No gdb or ld support yet.
511 noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld"
512 ;;
bafecfd6 513 i[[3456]]86-*-coff | i[[3456]]86-*-elf)
f3d61cc7 514 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46 515 ;;
bafecfd6 516 i[[34567]]86-*-freebsd*)
57311c33
DD
517 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
518 ;;
bafecfd6 519 i[[3456]]86-*-linux*)
fcaf8368
HPN
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
d9a0f9d8
TF
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.
dc60c22e 529 if test x${is_cross_compiler} != xno ; then
d9a0f9d8
TF
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.
d9a0f9d8 537 ;;
bafecfd6 538 i[[3456]]86-*-mingw32*)
a3acbf46 539 target_configdirs="$target_configdirs target-mingw"
13c45b30 540 noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
a3acbf46
RH
541
542 # Can't build gdb for mingw32 if not native.
543 case "${host}" in
bafecfd6 544 i[[3456]]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
a3acbf46
RH
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"
13c45b30 551 noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
a3acbf46
RH
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 ;;
bafecfd6 562 i[[3456]]86-*-pe)
78125538 563 noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
a3acbf46 564 ;;
bafecfd6 565 i[[3456]]86-*-sco3.2v5*)
a3acbf46
RH
566 # The linker does not yet know about weak symbols in COFF,
567 # and is not configured to handle mixed ELF and COFF.
f3d61cc7 568 noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
a3acbf46 569 ;;
bafecfd6 570 i[[3456]]86-*-sco*)
f3d61cc7 571 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
a3acbf46 572 ;;
bafecfd6 573 i[[3456]]86-*-solaris2*)
a3acbf46
RH
574 noconfigdirs="$noconfigdirs target-libgloss"
575 ;;
bafecfd6 576 i[[3456]]86-*-sysv4*)
859eb630 577 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 578 ;;
bafecfd6 579 i[[3456]]86-*-beos*)
13c45b30 580 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
a3acbf46 581 ;;
f3d61cc7
DD
582 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
583 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
6b8ce74c 584 ;;
f3d61cc7
DD
585 m68k-*-elf*)
586 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46
RH
587 ;;
588 m68k-*-coff*)
f3d61cc7 589 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46 590 ;;
f3d61cc7
DD
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-*-*)
1c6b0134 597 noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss"
f3d61cc7 598 ;;
a3acbf46 599 mn10200-*-*)
f3d61cc7 600 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46
RH
601 ;;
602 mn10300-*-*)
f3d61cc7 603 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46
RH
604 ;;
605 powerpc-*-aix*)
606 # copied from rs6000-*-* entry
0bf10df1 607 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
a3acbf46
RH
608 ;;
609 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
610 target_configdirs="$target_configdirs target-winsup"
f3d61cc7 611 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
a3acbf46
RH
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*)
f3d61cc7 617 noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
2ff6d12f
JM
618 ;;
619 powerpc-*-beos*)
f3d61cc7 620 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
a3acbf46 621 ;;
4c67ff15 622 powerpc-*-darwin*)
171eed0b 623 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
4c67ff15 624 ;;
a3acbf46 625 powerpc-*-eabi)
f3d61cc7 626 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46 627 ;;
ba90cf00
DD
628 powerpc64*-*-linux*)
629 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
630 # not yet ported.
631 noconfigdirs="$noconfigdirs target-libffi"
632 ;;
a3acbf46 633 rs6000-*-lynxos*)
0bf10df1 634 noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
a3acbf46
RH
635 ;;
636 rs6000-*-aix*)
f3d61cc7 637 noconfigdirs="$noconfigdirs gprof ${libgcj}"
a3acbf46
RH
638 ;;
639 rs6000-*-*)
f3d61cc7 640 noconfigdirs="$noconfigdirs gprof ${libgcj}"
a3acbf46
RH
641 ;;
642 m68k-apollo-*)
f3d61cc7 643 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
a3acbf46
RH
644 ;;
645 mips*-*-irix5*)
646 # The GNU linker does not support shared libraries.
859eb630 647 noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
a3acbf46
RH
648 ;;
649 mips*-*-irix6*)
ccc329f0 650 # The GNU assembler does not support IRIX 6.
5e6f1ab2
AO
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>
859eb630 655 noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
a3acbf46
RH
656 ;;
657 mips*-dec-bsd*)
f3d61cc7 658 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
a3acbf46
RH
659 ;;
660 mips*-*-bsd*)
f3d61cc7 661 noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
a3acbf46
RH
662 ;;
663 mipstx39-*-*)
f3d61cc7 664 noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
a3acbf46 665 ;;
63acbade 666 mips*-*-linux*)
ba90cf00 667 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
63acbade 668 ;;
a3acbf46 669 mips*-*-*)
f3d61cc7 670 noconfigdirs="$noconfigdirs gprof ${libgcj}"
a3acbf46
RH
671 ;;
672 romp-*-*)
f3d61cc7 673 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
a3acbf46
RH
674 ;;
675 sh-*-*)
676 case "${host}" in
bafecfd6
NN
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
a3acbf46
RH
680 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
681 esac
f3d61cc7 682 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 683 ;;
3e790816
AO
684 sh64-*-*)
685 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
686 ;;
a3acbf46 687 sparc-*-elf*)
ac1361c4 688 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46
RH
689 ;;
690 sparc64-*-elf*)
ac1361c4 691 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46
RH
692 ;;
693 sparclite-*-*)
f3d61cc7 694 noconfigdirs="$noconfigdirs ${libgcj}"
a3acbf46
RH
695 ;;
696 sparc-*-sunos4*)
f3d61cc7 697 noconfigdirs="$noconfigdirs ${libgcj}"
c9a28049 698 if test x${is_cross_compiler} != xno ; then
b66c627d 699 noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
a3acbf46
RH
700 else
701 use_gnu_ld=no
702 fi
703 ;;
3d9bc8a6 704 sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
5e6f1ab2 705 ;;
a3acbf46 706 v810-*-*)
f3d61cc7 707 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
a3acbf46
RH
708 ;;
709 v850-*-*)
f3d61cc7 710 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46 711 ;;
b5314dab 712 v850e-*-*)
f3d61cc7 713 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
a3acbf46
RH
714 ;;
715 v850ea-*-*)
f3d61cc7 716 noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
b5314dab 717 ;;
a3acbf46 718 vax-*-vms)
f3d61cc7 719 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
a3acbf46
RH
720 ;;
721 vax-*-*)
f3d61cc7 722 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
1dc94f73 723 ;;
bae61225
DD
724 ip2k-*-*)
725 noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
726 ;;
ba90cf00
DD
727 *-*-linux*)
728 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
729 ;;
a3acbf46 730 *-*-lynxos*)
f3d61cc7 731 noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
a3acbf46 732 ;;
f3d61cc7
DD
733 *-*-*)
734 noconfigdirs="$noconfigdirs ${libgcj}"
735 ;;
a3acbf46
RH
736esac
737
738# If we aren't building newlib, then don't build libgloss, since libgloss
739# depends upon some newlib header files.
740case "${noconfigdirs}" in
741 *target-libgloss*) ;;
742 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
bae61225 743esac
a3acbf46 744
53324552
AO
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.
42f9fc45 749# NB: embedded tabs in this IF block -- do not untabify
53324552
AO
750if test x"${enable_languages+set}" != xset; then
751 if test x"${LANGUAGES+set}" = xset; then
42f9fc45
DD
752 enable_languages="${LANGUAGES}"
753 echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
53324552
AO
754 else
755 enable_languages=all
756 fi
757else
42f9fc45
DD
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
53324552
AO
762 exit 1
763 fi
764fi
bafecfd6 765enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
42f9fc45 766
f3d61cc7
DD
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.
770for lang in ${srcdir}/gcc/*/config-lang.in ..
771do
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.
bafecfd6 777 ${srcdir}/gcc/[[*]]/config-lang.in)
f3d61cc7
DD
778 ;;
779 *)
bafecfd6
NN
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`
f3d61cc7
DD
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
797done
798
53324552
AO
799subdirs=
800for lang in ${srcdir}/gcc/*/config-lang.in ..
801do
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.
bafecfd6 806 ${srcdir}/gcc/[[*]]/config-lang.in) ;;
53324552 807 *)
bafecfd6
NN
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`
53324552
AO
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
f3d61cc7 826 eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
53324552
AO
827 fi
828 ;;
829 esac
830done
831
a3acbf46
RH
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
836notsupp=""
837for dir in . $skipdirs $noconfigdirs ; do
838 dirname=`echo $dir | sed -e s/target-//g`
c9a28049 839 if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
a3acbf46 840 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
bba02726 841 if test -r $srcdir/$dirname/configure ; then
a3acbf46
RH
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
c9a28049 849 if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
a3acbf46 850 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
bba02726 851 if test -r $srcdir/$dirname/configure ; then
a3acbf46
RH
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
859done
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.
c9a28049 863if test -n "${target_configdirs}" ; then
a3acbf46
RH
864 others=
865 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
c9a28049 866 if test "$i" != "libiberty" ; then
bba02726 867 if test -r $srcdir/$i/configure ; then
a3acbf46
RH
868 others=yes;
869 break;
870 fi
871 fi
872 done
c9a28049 873 if test -z "${others}" ; then
a3acbf46
RH
874 target_configdirs=
875 fi
876fi
877
bae61225
DD
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.
881if 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
885fi
886if 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
890fi
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.
895configdirs_all="$configdirs"
896configdirs=
897for i in ${configdirs_all} ; do
898 if test -f ${srcdir}/$i/configure ; then
899 configdirs="${configdirs} $i"
900 fi
901done
902target_configdirs_all="$target_configdirs"
903target_configdirs=
904for 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
909done
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
916if 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
944fi
945
946case "$host" in
947 *msdosdjgpp*)
948 enable_gdbtk=no ;;
949esac
bae61225
DD
950
951copy_dirs=
952
b14dad68
JT
953# Handle --with-headers=XXX. If the value is not "yes", the contents of
954# the named directory are copied to $(tooldir)/sys-include.
bae61225
DD
955if 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
b14dad68
JT
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
bae61225
DD
967fi
968
b14dad68
JT
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.
bae61225
DD
972if 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
b14dad68
JT
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
bae61225
DD
988fi
989
990# Handle ${copy_dirs}
991set fnord ${copy_dirs}
992shift
993while 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
1019done
1020
1021# Work in distributions that contain no compiler tools, like Autoconf.
1022tentative_cc=""
bafecfd6 1023host_makefile_frag=/dev/null
bae61225
DD
1024if test -d ${srcdir}/config ; then
1025case "${host}" in
1026 m68k-hp-hpux*)
1027 # Avoid "too much defining" errors from HPUX compiler.
1028 tentative_cc="cc -Wp,-H256000"
bafecfd6
NN
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"
bae61225
DD
1032 ;;
1033 m68k-apollo-sysv*)
1034 tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
bae61225
DD
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
bafecfd6 1043 # Used to have BISON=yacc.
bae61225 1044 tentative_cc=gcc
bae61225
DD
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*)
bae61225
DD
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 ;;
bae61225
DD
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 ;;
bae61225
DD
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"
bae61225
DD
1089 ;;
1090 i370-ibm-opened*)
1091 tentative_cc="c89"
bae61225 1092 ;;
bafecfd6 1093 i[[3456]]86-*-sysv5*)
bae61225
DD
1094 host_makefile_frag="config/mh-sysv5"
1095 ;;
bafecfd6 1096 i[[3456]]86-*-dgux*)
bae61225
DD
1097 tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1098 host_makefile_frag="config/mh-dgux386"
1099 ;;
bafecfd6 1100 i[[3456]]86-ncr-sysv4.3*)
bae61225
DD
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"
bae61225 1104 ;;
bafecfd6 1105 i[[3456]]86-ncr-sysv4*)
bae61225
DD
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 ;;
bafecfd6 1114 i[[3456]]86-*-sco3.2v5*)
bae61225 1115 ;;
bafecfd6 1116 i[[3456]]86-*-sco*)
bae61225
DD
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 ;;
bafecfd6 1122 i[[3456]]86-*-udk*)
bae61225
DD
1123 host_makefile_frag="config/mh-sysv5"
1124 ;;
bafecfd6 1125 i[[3456]]86-*-solaris2*)
bae61225
DD
1126 host_makefile_frag="config/mh-sysv4"
1127 ;;
bafecfd6 1128 i[[3456]]86-*-msdosdjgpp*)
bae61225
DD
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 ;;
bae61225
DD
1152 *-hp-hpux*)
1153 tentative_cc="cc -Wp,-H256000"
bae61225
DD
1154 ;;
1155 *-*-hiux*)
1156 tentative_cc="cc -Wp,-H256000"
bae61225
DD
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 ;;
bae61225
DD
1170esac
1171fi
1172
6ec2f0b6
NN
1173extra_arflags_for_target=
1174extra_nmflags_for_target=
6dbec167 1175extra_ranlibflags_for_target=
bafecfd6 1176target_makefile_frag=/dev/null
bae61225 1177case "${target}" in
bafecfd6 1178 i[[3456]]86-*-netware*)
65604bc1 1179 target_makefile_frag="config/mt-netware"
bae61225
DD
1180 ;;
1181 powerpc-*-netware*)
65604bc1 1182 target_makefile_frag="config/mt-netware"
bae61225
DD
1183 ;;
1184 *-*-linux*)
65604bc1 1185 target_makefile_frag="config/mt-linux"
bae61225 1186 ;;
bafecfd6 1187 *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
6ec2f0b6
NN
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"
bae61225 1193 ;;
6dbec167
NN
1194 *-*-darwin*)
1195 # ranlib from Darwin requires the -c flag to look at common symbols.
1196 extra_ranlibflags_for_target=" -c"
1197 ;;
bae61225 1198 mips*-*-pe | sh*-*-pe | *arm-wince-pe)
65604bc1
DD
1199 target_makefile_frag="config/mt-wince"
1200 ;;
1201esac
1202
bafecfd6 1203alphaieee_frag=/dev/null
65604bc1
DD
1204case $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"
bae61225
DD
1209 ;;
1210esac
88054d40 1211
bae61225
DD
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.
bafecfd6 1215ospace_frag=/dev/null
bae61225
DD
1216case "${enable_target_optspace}:${target}" in
1217 yes:*)
65604bc1 1218 ospace_frag="config/mt-ospace"
bae61225
DD
1219 ;;
1220 :d30v-*)
65604bc1 1221 ospace_frag="config/mt-d30v"
bae61225
DD
1222 ;;
1223 :m32r-* | :d10v-* | :fr30-*)
65604bc1 1224 ospace_frag="config/mt-ospace"
bae61225
DD
1225 ;;
1226 no:* | :*)
1227 ;;
1228 *)
1229 echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
1230 ;;
1231esac
a3acbf46 1232
a3acbf46
RH
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
bae61225
DD
1246if test x${use_gnu_as} = x &&
1247 echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
1248 with_gnu_as=yes
c5ab3a90 1249 extra_host_args="$extra_host_args --with-gnu-as"
a3acbf46
RH
1250fi
1251
bae61225
DD
1252if test x${use_gnu_ld} = x &&
1253 echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
1254 with_gnu_ld=yes
c5ab3a90 1255 extra_host_args="$extra_host_args --with-gnu-ld"
a3acbf46
RH
1256fi
1257
c5ab3a90 1258# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
a3acbf46
RH
1259# can detect this case.
1260
bae61225 1261if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
a3acbf46 1262 with_newlib=yes
c5ab3a90 1263 extra_host_args="$extra_host_args --with-newlib"
a3acbf46
RH
1264fi
1265
bae61225
DD
1266# We default to --with-shared on platforms where -fpic is meaningless.
1267# Well, we don't yet, but we will.
1268if 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
a3acbf46
RH
1275fi
1276
bae61225
DD
1277case "${enable_shared}" in
1278 yes) shared=yes ;;
1279 no) shared=no ;;
1280 "") shared=no ;;
1281 *) shared=yes ;;
9a0da7d7 1282esac
bae61225
DD
1283
1284
1285# Default to using --with-stabs for certain targets.
1286if test x${with_stabs} = x ; then
1287 case "${target}" in
8289ddfe
DD
1288 mips*-*-irix6*o32)
1289 with_stabs=yes;
c5ab3a90 1290 extra_host_args="${extra_host_args} --with-stabs"
8289ddfe 1291 ;;
bae61225
DD
1292 mips*-*-irix6*)
1293 ;;
1294 mips*-*-* | alpha*-*-osf*)
1295 with_stabs=yes;
c5ab3a90 1296 extra_host_args="${extra_host_args} --with-stabs"
bae61225
DD
1297 ;;
1298 esac
1299fi
1300
1301# hpux11 in 64bit mode has libraries in a weird place. Arrange to find
1302# them automatically.
1303case "${host}" in
1304 hppa*64*-*-hpux11*)
c5ab3a90 1305 extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
bae61225 1306 ;;
9a0da7d7
DD
1307esac
1308
4ca88d47
NN
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.
1312if 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
1326fi
1327
bafecfd6
NN
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.
1330tooldir='$(exec_prefix)'/${target_alias}
1331build_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
1336for prog in 'bison -y' byacc yacc
1337do
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
1350done
1351
1352# Generate a default definition for M4. This is used if the makefile can't
1353# locate m4 in objdir.
1354
1355for prog in gm4 gnum4 m4
1356do
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
1369done
1370
1371# Generate a default definition for LEX. This is used if the makefile can't
1372# locate flex in objdir.
1373
1374for prog in flex lex
1375do
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
1388done
1389
1390if 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
1448else
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"}
1510fi
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.
1517configlinks="${links}"
1518if test -r ./config.status ; then
1519 mv -f ./config.status ./config.back
1520fi
1521while 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}\"."
1554done
1555
1556# Create a .gdbinit file which runs the one in srcdir
1557# and tells GDB to look there for source files.
1558
1559if test -r ${srcdir}/.gdbinit ; then
1560 case ${srcdir} in
1561 .) ;;
1562 *) cat > ./.gdbinit <<EOF
1563# ${NO_EDIT}
1564dir ${srcdir}
1565dir .
1566source ${srcdir}/.gdbinit
1567EOF
1568 ;;
1569 esac
1570fi
1571
1572# record if we want runtime library stuff installed in libsubdir.
1573# Blank means no.
1574if test -z "${enable_version_specific_runtime_libs}"; then
1575 enable_version_specific_runtime_libs=no
1576fi
a3acbf46
RH
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.
c9a28049 1582we_are_ok=no
a3acbf46
RH
1583echo "int main () { return 0; }" > conftest.c
1584${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
c9a28049
DD
1585if test $? = 0 ; then
1586 if test -s conftest || test -s conftest.exe ; then
1587 we_are_ok=yes
1588 fi
1589fi
1590case $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 ;;
1597esac
a3acbf46
RH
1598rm -f conftest*
1599
1600# The Solaris /usr/ucb/cc compiler does not appear to work.
1601case "${host}" in
1602 sparc-sun-solaris2*)
1603 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
bafecfd6 1604 if test "`type $CCBASE | sed 's/^[[^/]]*//'`" = "/usr/ucb/cc" ; then
a3acbf46 1605 could_use=
c9a28049
DD
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
a3acbf46
RH
1609 could_use="/opt/cygnus/bin"
1610 else
1611 could_use="$could_use or /opt/cygnus/bin"
1612 fi
1613 fi
c9a28049 1614 if test "$could_use" = "" ; then
a3acbf46
RH
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 ;;
1626esac
1627
1628# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1629# binutils tools will find libbfd.so.
c9a28049 1630if test "${shared}" = "yes" ; then
8c8150d4
NN
1631 SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
1632else
1633 SET_LIB_PATH=
a3acbf46 1634fi
8c8150d4
NN
1635
1636
1637case "${host}" in
1638 *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
1639 *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
1640esac
8c8150d4 1641
8ecc6504
NN
1642# Record target_configdirs and the configure arguments for target and
1643# build configuration in Makefile.
1644target_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.
c5e4bb70
NN
1648
1649all_build_modules=
1650configure_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.
1653if test ${host_alias} != ${build_alias} ; then
1654 all_build_modules=all-build-libiberty
1655 configure_build_modules=configure-build-libiberty
1656fi
1657
8ecc6504
NN
1658all_host_modules=
1659check_host_modules=
1660install_host_modules=
c5e4bb70 1661configure_host_modules=
8ecc6504
NN
1662for 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}"
c5e4bb70 1666 configure_host_modules="${configure_host_modules} configure-${module}"
8ecc6504
NN
1667done
1668install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
1669
1670all_target_modules=
1671check_target_modules=
1672install_target_modules=
c5e4bb70 1673configure_target_modules=
8ecc6504
NN
1674for 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}"
c5e4bb70 1678 configure_target_modules="${configure_target_modules} configure-target-${module}"
8ecc6504 1679done
a3acbf46 1680
c5e4bb70
NN
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.
1688case "$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" ;;
1693esac
1694
1695# Create the 'maybe dependencies'. This uses a temporary file.
1696rm -f maybedep.tmp
1697for 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
1702done
bafecfd6
NN
1703maybe_dependencies=maybedep.tmp
1704AC_SUBST_FILE(maybe_dependencies)
c5e4bb70 1705
d8e6f006
NN
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.
1710rm -f serdep.tmp
1711olditem=
1712for 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}
1718done
1719olditem=
1720for item in ${configdirs} ; do
1721 case ${olditem} in
1722 "") ;;
1723 *) echo "${item}/Makefile: ${olditem}/Makefile" >> serdep.tmp ;;
1724 esac
1725 olditem=${item}
1726done
1727olditem=
1728for 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}
1734done
bafecfd6
NN
1735serialization_dependencies=serdep.tmp
1736AC_SUBST_FILE(serialization_dependencies)
d8e6f006 1737
1a2d1748
DD
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.
bafecfd6
NN
1740baseargs=`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-]]*=[[^ ]]*//'`
a3acbf46 1747
f66d1936
DD
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.
bafecfd6 1751build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
1a2d1748 1752
c5ab3a90
NN
1753# For host modules, accept cache file option, or specification as blank.
1754case "${cache_file}" in
1755"") # empty
1756 cache_file_option="" ;;
bafecfd6 1757/* | [[A-Za-z]]:[[\\/]]* ) # absolute path
c5ab3a90
NN
1758 cache_file_option="--cache-file=${cache_file}" ;;
1759*) # relative path
1760 cache_file_option="--cache-file=../${cache_file}" ;;
1761esac
1762
bafecfd6 1763host_configargs="${cache_file_option} ${buildopt} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
c5ab3a90 1764
bafecfd6 1765target_configargs=${baseargs}
f66d1936 1766
a3acbf46
RH
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.
c9a28049 1772if test x${is_cross_compiler} = xyes ; then
bafecfd6 1773 target_configargs="--with-cross-host=${host_alias} ${target_configargs}"
a3acbf46
RH
1774fi
1775
1776# Default to --enable-multilib.
c9a28049 1777if test x${enable_multilib} = x ; then
bafecfd6 1778 target_configargs="--enable-multilib ${target_configargs}"
a3acbf46
RH
1779fi
1780
1781# Pass --with-newlib if appropriate. Note that target_configdirs has
1782# changed from the earlier setting of with_newlib.
c9a28049 1783if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
bafecfd6 1784 target_configargs="--with-newlib ${target_configargs}"
a3acbf46
RH
1785fi
1786
f66d1936 1787# Pass the appropriate --host, --build, and --cache-file arguments.
bafecfd6 1788target_configargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}"
f66d1936 1789
a3acbf46
RH
1790# provide a proper gxx_include_dir.
1791# Note, if you change the default, make sure to fix both here and in
f3d61cc7 1792# the gcc and libstdc++-v3 subdirectories.
a3acbf46
RH
1793# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1794gxx_include_dir=
1795if 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
1807fi
1808if test x${gxx_include_dir} = x; then
1809 if test x${enable_version_specific_runtime_libs} = xyes; then
fcafffa6 1810 gxx_include_dir='${libsubdir}/include/c++'
a3acbf46 1811 else
6311ef85 1812 . ${srcdir}/config.if
f3d61cc7 1813 gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
a3acbf46
RH
1814 fi
1815else
1816 gxx_include_dir=${gxx_include_dir}
1817fi
1818
0ec91c68 1819FLAGS_FOR_TARGET=
3191dc17 1820case " $target_configdirs " in
f3d61cc7 1821 *" newlib "*)
bafecfd6 1822 case " $target_configargs " in
f3d61cc7 1823 *" --with-newlib "*)
0ec91c68 1824 case "$target" in
5a7b5870 1825 *-cygwin*)
0ec91c68
AO
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
bfa303a1 1829 # If we're not building GCC, don't discard standard headers.
6311ef85 1830 if test -d ${srcdir}/gcc; then
5a7b5870 1831 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
bfa303a1
AO
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
5a7b5870
DD
1850 fi
1851
d315f8fc 1852 case "${target}-${is_cross_compiler}" in
bafecfd6 1853 i[[3456]]86-*-linux*-no)
d315f8fc
TF
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 / /'`
d315f8fc
TF
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
0ec91c68 1865 ;;
f3d61cc7
DD
1866 esac
1867 ;;
0ec91c68 1868esac
5a7b5870
DD
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.
6311ef85 1874if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
0ec91c68
AO
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'
1877fi
5a7b5870 1878
3191dc17 1879if test "x${use_gnu_ld}" = x &&
bae61225 1880 echo " ${configdirs} " | grep " ld " > /dev/null ; then
0ec91c68
AO
1881 # Arrange for us to find uninstalled linker scripts.
1882 FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1883fi
1884
5a7b5870
DD
1885if test "x${CC_FOR_TARGET+set}" = xset; then
1886 :
6311ef85 1887elif test -d ${srcdir}/gcc; then
86bf05d5 1888 CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
0ec91c68
AO
1889elif test "$host" = "$target"; then
1890 CC_FOR_TARGET='$(CC)'
1891else
1892 CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
1893fi
bafecfd6 1894CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)'
0ec91c68 1895
f3d61cc7
DD
1896if test "x${GCJ_FOR_TARGET+set}" = xset; then
1897 :
6311ef85 1898elif test -d ${srcdir}/gcc; then
f3d61cc7
DD
1899 GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
1900elif test "$host" = "$target"; then
1901 GCJ_FOR_TARGET='gcj'
1902else
1903 GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
1904fi
bafecfd6 1905GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
f3d61cc7 1906
fa6b252e 1907# Don't use libstdc++-v3's flags to configure/build itself.
c5e4bb70
NN
1908libstdcxx_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'
1909raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
fa6b252e 1910
5a7b5870
DD
1911if test "x${CXX_FOR_TARGET+set}" = xset; then
1912 :
6311ef85 1913elif test -d ${srcdir}/gcc; then
06e2f4c3
AO
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.
c5e4bb70
NN
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
0ec91c68
AO
1921elif test "$host" = "$target"; then
1922 CXX_FOR_TARGET='$(CXX)'
c5e4bb70 1923 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
0ec91c68
AO
1924else
1925 CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
c5e4bb70 1926 RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
0ec91c68 1927fi
bafecfd6
NN
1928CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1929RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
c5e4bb70 1930
bafecfd6
NN
1931qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'`
1932qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'`
68b3c65a
AO
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.
bafecfd6
NN
1940qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'`
1941qqRAW_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.
1944CC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}"
1945GCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}"
1946CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}"
1947RAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}"
1948CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}"
1949RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}"
1950
1951# Makefile fragments.
1952host_makefile_frag=${srcdir}/${host_makefile_frag}
1953target_makefile_frag=${srcdir}/${target_makefile_frag}
1954alphaieee_frag=${srcdir}/${alphaieee_frag}
1955ospace_frag=${srcdir}/${ospace_frag}
1956AC_SUBST_FILE(host_makefile_frag)
1957AC_SUBST_FILE(target_makefile_frag)
1958AC_SUBST_FILE(alphaieee_frag)
1959AC_SUBST_FILE(ospace_frag)
1960
1961# Miscellanea: directories, flags, etc.
1962AC_SUBST(SET_LIB_PATH)
1963AC_SUBST(RPATH_ENVVAR)
1964AC_SUBST(BUILD_PREFIX)
1965AC_SUBST(BUILD_PREFIX_1)
1966AC_SUBST(configlinks)
1967AC_SUBST(enable_shared)
1968AC_SUBST(enable_threads)
1969AC_SUBST(enable_version_specific_runtime_libs)
1970AC_SUBST(gcc_version_trigger)
1971AC_SUBST(gcc_version)
1972AC_SUBST(tooldir)
1973AC_SUBST(build_tooldir)
1974AC_SUBST(GDB_TK)
1975AC_SUBST(gxx_include_dir)
1976AC_SUBST(libstdcxx_incdir)
1977
1978# Build module lists & subconfigure args.
1979AC_SUBST(build_subdir)
1980AC_SUBST(build_configargs)
1981AC_SUBST(configure_build_modules)
1982AC_SUBST(all_build_modules)
1983
1984# Host module lists & subconfigure args.
1985AC_SUBST(host_configargs)
1986AC_SUBST(configdirs)
1987AC_SUBST(configure_host_modules)
1988AC_SUBST(all_host_modules)
1989AC_SUBST(check_host_modules)
1990AC_SUBST(install_host_modules)
1991AC_SUBST(install_host_modules_nogcc)
1992
1993# Target module lists & subconfigure args.
1994AC_SUBST(target_subdir)
1995AC_SUBST(target_configargs)
1996AC_SUBST(target_configdirs)
1997AC_SUBST(configure_target_modules)
1998AC_SUBST(all_target_modules)
1999AC_SUBST(check_target_modules)
2000AC_SUBST(install_target_modules)
2001
2002# Build tools.
2003AC_SUBST(BISON)
2004AC_SUBST(CC_FOR_BUILD)
2005AC_SUBST(LEX)
2006AC_SUBST(MAKEINFO)
2007AC_SUBST(YACC)
2008AC_SUBST(config_shell)
2009
2010# Host tools.
2011AC_CHECK_TOOL(AR, ar)
2012AC_CHECK_TOOL(AS, as)
2013AC_CHECK_TOOL(DLLTOOL, dlltool)
2014AC_CHECK_TOOL(LD, ld)
2015AC_CHECK_TOOL(NM, nm)
2016AC_CHECK_TOOL(RANLIB, ranlib, :)
2017AC_CHECK_TOOL(WINDRES, windres)
2018AC_CHECK_TOOL(OBJCOPY, objcopy)
2019AC_CHECK_TOOL(OBJDUMP, objdump)
2020AC_SUBST(CC)
2021AC_SUBST(CXX)
2022AC_SUBST(CFLAGS)
2023AC_SUBST(CXXFLAGS)
2024AC_SUBST(DEFAULT_YACC)
2025AC_SUBST(DEFAULT_LEX)
2026AC_SUBST(DEFAULT_M4)
2027
2028# Target tools.
2029NCN_CHECK_TARGET_TOOL(AR_FOR_TARGET, ar)
2030NCN_CHECK_TARGET_TOOL(AS_FOR_TARGET, as)
2031NCN_CHECK_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
2032NCN_CHECK_TARGET_TOOL(LD_FOR_TARGET, ld)
2033NCN_CHECK_TARGET_TOOL(NM_FOR_TARGET, nm)
2034NCN_CHECK_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :)
2035NCN_CHECK_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
2036
2037AC_SUBST(GCC_FOR_TARGET)
2038AC_SUBST(FLAGS_FOR_TARGET)
2039AC_SUBST(CC_FOR_TARGET)
2040AC_SUBST(GCJ_FOR_TARGET)
2041AC_SUBST(CXX_FOR_TARGET)
2042AC_SUBST(RAW_CXX_FOR_TARGET)
2043AC_SUBST(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
2044AC_SUBST(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
2045
2046# Fix up target tools.
2047if 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)"
2061fi
2062# Certain tools may need extra flags.
2063AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
2064RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
2065NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
a3acbf46 2066
bafecfd6 2067AC_OUTPUT(Makefile)
This page took 0.333226 seconds and 5 git commands to generate.