xref: /openbsd/gnu/usr.bin/binutils/configure.in (revision 6bf90127)
1c074d1c9Sdrahn#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2007c2a45Smiod#   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
3258b3869Sniklas#
4258b3869Sniklas# This file is free software; you can redistribute it and/or modify it
5258b3869Sniklas# under the terms of the GNU General Public License as published by
6258b3869Sniklas# the Free Software Foundation; either version 2 of the License, or
7258b3869Sniklas# (at your option) any later version.
8258b3869Sniklas#
9258b3869Sniklas# This program is distributed in the hope that it will be useful, but
10258b3869Sniklas# WITHOUT ANY WARRANTY; without even the implied warranty of
11258b3869Sniklas# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12258b3869Sniklas# General Public License for more details.
13258b3869Sniklas#
14258b3869Sniklas# You should have received a copy of the GNU General Public License
15258b3869Sniklas# along with this program; if not, write to the Free Software
16258b3869Sniklas# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17258b3869Sniklas
182159047fSniklas##############################################################################
19c074d1c9Sdrahn### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
20c074d1c9Sdrahn
21c074d1c9SdrahnAC_INIT(move-if-change)
22c074d1c9SdrahnAC_PREREQ(2.13)
23c074d1c9SdrahnAC_CANONICAL_SYSTEM
24c074d1c9SdrahnAC_ARG_PROGRAM
25c074d1c9Sdrahn
26007c2a45Smiod# Get 'install' or 'install-sh' and its variants.
27007c2a45SmiodAC_PROG_INSTALL
28007c2a45Smiod
29c074d1c9Sdrahnsinclude(config/acx.m4)
30c074d1c9Sdrahn
31c074d1c9Sdrahn### we might need to use some other shell than /bin/sh for running subshells
32c074d1c9Sdrahn### If we are on Windows, search for the shell.  This will permit people
33c074d1c9Sdrahn### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
34c074d1c9Sdrahn### without also having to set CONFIG_SHELL.  This code will work when
35c074d1c9Sdrahn### using bash, which sets OSTYPE.
36c074d1c9Sdrahncase "${OSTYPE}" in
37c074d1c9Sdrahn*win32*)
38c074d1c9Sdrahn  if test x${CONFIG_SHELL} = x ; then
39c074d1c9Sdrahn    if test ! -f /bin/sh ; then
40c074d1c9Sdrahn      if test x${SHELL} != x && test -f ${SHELL} ; then
41c074d1c9Sdrahn	CONFIG_SHELL=${SHELL}
42c074d1c9Sdrahn	export CONFIG_SHELL
43c074d1c9Sdrahn      else
44c074d1c9Sdrahn	for prog in sh sh.exe bash bash.exe; do
45c074d1c9Sdrahn	  IFS="${IFS=	}"; save_ifs="$IFS"; IFS="${IFS}:"
46c074d1c9Sdrahn	  for dir in $PATH; do
47c074d1c9Sdrahn	    test -z "$dir" && dir=.
48c074d1c9Sdrahn	    if test -f $dir/$prog; then
49c074d1c9Sdrahn	      CONFIG_SHELL=$dir/$prog
50c074d1c9Sdrahn	      export CONFIG_SHELL
51c074d1c9Sdrahn	      break
52c074d1c9Sdrahn	    fi
53c074d1c9Sdrahn	  done
54c074d1c9Sdrahn	  IFS="$save_ifs"
55c074d1c9Sdrahn	  test -n "${CONFIG_SHELL}" && break
56c074d1c9Sdrahn	done
57c074d1c9Sdrahn      fi
58c074d1c9Sdrahn    fi
59c074d1c9Sdrahn  fi
60c074d1c9Sdrahn  ;;
61c074d1c9Sdrahnesac
62c074d1c9Sdrahn
63c074d1c9Sdrahnconfig_shell=${CONFIG_SHELL-/bin/sh}
64c074d1c9Sdrahn
65c074d1c9Sdrahnprogname=$0
66c074d1c9Sdrahn# if PWD already has a value, it is probably wrong.
67c074d1c9Sdrahnif test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
68c074d1c9Sdrahn
69007c2a45Smiod# Export original configure arguments for use by sub-configures.  These
70007c2a45Smiod# will be expanded by make, so quote '$'.
71007c2a45Smiodtmp="$progname $@"
72007c2a45Smiodsed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out
73007c2a45Smiod$tmp
74007c2a45SmiodEOF_SED
75007c2a45SmiodTOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out`
76007c2a45Smiodrm -f conftestsed.out
77c074d1c9SdrahnAC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
78c074d1c9Sdrahn
79c074d1c9Sdrahnmoveifchange=${srcdir}/move-if-change
80c074d1c9Sdrahn
81c074d1c9Sdrahn# Set srcdir to "." if that's what it is.
82c074d1c9Sdrahn# This is important for multilib support.
83c074d1c9Sdrahnpwd=`${PWDCMD-pwd}`
84c074d1c9Sdrahnsrcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
85c074d1c9Sdrahnif test "${pwd}" = "${srcpwd}" ; then
86c074d1c9Sdrahn  srcdir=.
87c074d1c9Sdrahnfi
88c074d1c9Sdrahn
89c074d1c9Sdrahntopsrcdir=$srcpwd
90c074d1c9Sdrahn
91c074d1c9Sdrahnextra_host_args=
92c074d1c9Sdrahn# Define the trigger file to make sure configure will re-run whenever
93c074d1c9Sdrahn# the gcc version number changes.
94c074d1c9Sdrahnif test "${with_gcc_version_trigger+set}" = set ; then
95c074d1c9Sdrahn  gcc_version_trigger="$with_gcc_version_trigger"
96c074d1c9Sdrahn  gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
97c074d1c9Sdrahnelse
98c074d1c9Sdrahn  # If gcc's sources are available, define the trigger file.
99c074d1c9Sdrahn  if test -f ${topsrcdir}/gcc/version.c ; then
100c074d1c9Sdrahn    gcc_version_trigger=${topsrcdir}/gcc/version.c
101c074d1c9Sdrahn    gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
102c074d1c9Sdrahn    case "$ac_configure_args" in
103c074d1c9Sdrahn      *--with-gcc-version-trigger=$gcc_version_trigger* )
104c074d1c9Sdrahn        ;;
105c074d1c9Sdrahn      * )
106c074d1c9Sdrahn        # Add to all subconfigure arguments: build, host, and target.
107c074d1c9Sdrahn        ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger"
108c074d1c9Sdrahn        ;;
109c074d1c9Sdrahn    esac
110c074d1c9Sdrahn  fi
111c074d1c9Sdrahnfi
1122159047fSniklas
1132159047fSniklas### To add a new directory to the tree, first choose whether it is a target
1142159047fSniklas### or a host dependent tool.  Then put it into the appropriate list
115c074d1c9Sdrahn### (library or tools, host or target), doing a dependency sort.
1162159047fSniklas
117c074d1c9Sdrahn# Subdirs will be configured in the order listed in build_configdirs,
118c074d1c9Sdrahn# configdirs, or target_configdirs; see the serialization section below.
119c074d1c9Sdrahn
120c074d1c9Sdrahn# Dependency sorting is only needed when *configuration* must be done in
121c074d1c9Sdrahn# a particular order.  In all cases a dependency should be specified in
122c074d1c9Sdrahn# the Makefile, whether or not it's implicitly specified here.
123c074d1c9Sdrahn
124c074d1c9Sdrahn# Double entries in build_configdirs, configdirs, or target_configdirs may
125c074d1c9Sdrahn# cause circular dependencies and break everything horribly.
1262159047fSniklas
1272159047fSniklas# these libraries are used by various programs built for the host environment
1282159047fSniklas#
129c074d1c9Sdrahnhost_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib"
130b55d4692Sfgsch
1312159047fSniklas# these tools are built for the host environment
132b305b0f1Sespie# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
133b305b0f1Sespie# know that we are building the simulator.
134c074d1c9Sdrahn# binutils, gas and ld appear in that order because it makes sense to run
135c074d1c9Sdrahn# "make check" in that particular order.
136c074d1c9Sdrahnhost_tools="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 diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
137c074d1c9Sdrahn
138c074d1c9Sdrahn# libgcj represents the runtime libraries only used by gcj.
139c074d1c9Sdrahnlibgcj="target-libffi \
140c074d1c9Sdrahn	target-boehm-gc \
141c074d1c9Sdrahn	target-zlib \
142c074d1c9Sdrahn	target-qthreads \
143c074d1c9Sdrahn	target-libjava"
1442159047fSniklas
1452159047fSniklas# these libraries are built for the target environment, and are built after
1462159047fSniklas# the host libraries and the host tools (which may be a cross compiler)
1472159047fSniklas#
148007c2a45Smiodtarget_libraries="target-libgloss \
149b305b0f1Sespie		target-newlib \
150c074d1c9Sdrahn		target-libstdc++-v3 \
151b55d4692Sfgsch		target-libf2c \
152c074d1c9Sdrahn		${libgcj} \
153007c2a45Smiod		target-libobjc \
154007c2a45Smiod		target-libada"
1552159047fSniklas
156007c2a45Smiod# these tools are built using the target libraries, and are intended to
157007c2a45Smiod# run only in the target environment
1582159047fSniklas#
159007c2a45Smiod# note: any program that *uses* libraries that are in the "target_libraries"
1602159047fSniklas# list belongs in this list.  those programs are also very likely
1612159047fSniklas# candidates for the "native_only" list which follows
1622159047fSniklas#
163c074d1c9Sdrahntarget_tools="target-examples target-groff target-gperf target-rda"
1642159047fSniklas
1652159047fSniklas################################################################################
1662159047fSniklas
1672159047fSniklas## All tools belong in one of the four categories, and are assigned above
1682159047fSniklas## We assign ${configdirs} this way to remove all embedded newlines.  This
1692159047fSniklas## is important because configure will choke if they ever get through.
1702159047fSniklas## ${configdirs} is directories we build using the host tools.
1712159047fSniklas## ${target_configdirs} is directories we build using the target tools.
1722159047fSniklas#
1732159047fSniklasconfigdirs=`echo ${host_libs} ${host_tools}`
174007c2a45Smiodtarget_configdirs=`echo ${target_libraries} ${target_tools}`
175007c2a45Smiod
176007c2a45Smiod# Only make build modules if build != host.
177007c2a45Smiod# This should be done more generally, but at the moment it doesn't matter.
178007c2a45Smiodif test ${host_alias} != ${build_alias} ; then
179007c2a45Smiod  # This is the only build module.
180007c2a45Smiod  build_modules=libiberty
181007c2a45Smiodelse
182007c2a45Smiod  build_modules=
183007c2a45Smiodfi
184007c2a45Smiod
1852159047fSniklas
1862159047fSniklas################################################################################
1872159047fSniklas
1882159047fSniklassrcname="gnu development package"
1892159047fSniklas
1902159047fSniklas# This gets set non-empty for some net releases of packages.
1912159047fSniklasappdirs=""
1922159047fSniklas
193c074d1c9Sdrahn# Define is_cross_compiler to save on calls to 'test'.
1942159047fSniklasis_cross_compiler=
195c074d1c9Sdrahnif test x"${host}" = x"${target}" ; then
1962159047fSniklas  is_cross_compiler=no
1972159047fSniklaselse
1982159047fSniklas  is_cross_compiler=yes
199b305b0f1Sespiefi
200b305b0f1Sespie
201007c2a45Smiod# Find the build and target subdir names.
202007c2a45SmiodGCC_TOPLEV_SUBDIRS
203c074d1c9Sdrahn
204c074d1c9Sdrahn# Skipdirs are removed silently.
205c074d1c9Sdrahnskipdirs=
206c074d1c9Sdrahn# Noconfigdirs are removed loudly.
207c074d1c9Sdrahnnoconfigdirs=""
208c074d1c9Sdrahn
209c074d1c9Sdrahnuse_gnu_ld=
210c074d1c9Sdrahn# Make sure we don't let GNU ld be added if we didn't want it.
211c074d1c9Sdrahnif test x$with_gnu_ld = xno ; then
212c074d1c9Sdrahn  use_gnu_ld=no
213c074d1c9Sdrahn  noconfigdirs="$noconfigdirs ld"
214c074d1c9Sdrahnfi
215c074d1c9Sdrahn
216c074d1c9Sdrahnuse_gnu_as=
217c074d1c9Sdrahn# Make sure we don't let GNU as be added if we didn't want it.
218c074d1c9Sdrahnif test x$with_gnu_as = xno ; then
219c074d1c9Sdrahn  use_gnu_as=no
220c074d1c9Sdrahn  noconfigdirs="$noconfigdirs gas"
221c074d1c9Sdrahnfi
222c074d1c9Sdrahn
223c074d1c9Sdrahn# some tools are so dependent upon X11 that if we're not building with X,
224c074d1c9Sdrahn# it's not even worth trying to configure, much less build, that tool.
225c074d1c9Sdrahn
226c074d1c9Sdrahncase ${with_x} in
227c074d1c9Sdrahn  yes | "") ;; # the default value for this tree is that X11 is available
228c074d1c9Sdrahn  no)
229c074d1c9Sdrahn    skipdirs="${skipdirs} tk tix itcl libgui"
230c074d1c9Sdrahn    # We won't be able to build gdbtk without X.
231c074d1c9Sdrahn    enable_gdbtk=no
232c074d1c9Sdrahn    ;;
233c074d1c9Sdrahn  *)  echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
234c074d1c9Sdrahnesac
235c074d1c9Sdrahn
236c074d1c9Sdrahn# Some tools are only suitable for building in a "native" situation.
237c074d1c9Sdrahn# Remove these if host!=target.
238c074d1c9Sdrahnnative_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
239c074d1c9Sdrahn
240c074d1c9Sdrahn# Similarly, some are only suitable for cross toolchains.
241c074d1c9Sdrahn# Remove these if host=target.
242c074d1c9Sdrahncross_only="target-libgloss target-newlib target-opcodes"
243c074d1c9Sdrahn
244c074d1c9Sdrahncase $is_cross_compiler in
245c074d1c9Sdrahn  no) skipdirs="${skipdirs} ${cross_only}" ;;
246c074d1c9Sdrahn  yes) skipdirs="${skipdirs} ${native_only}" ;;
247c074d1c9Sdrahnesac
248c074d1c9Sdrahn
249c074d1c9Sdrahn# If both --with-headers and --with-libs are specified, default to
250c074d1c9Sdrahn# --without-newlib.
251007c2a45Smiodif test x"${with_headers}" != x && test x"${with_headers} != xno \
252007c2a45Smiod   && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
253c074d1c9Sdrahn  if test x"${with_newlib}" = x ; then
254c074d1c9Sdrahn    with_newlib=no
255c074d1c9Sdrahn  fi
256c074d1c9Sdrahnfi
257c074d1c9Sdrahn
258c074d1c9Sdrahn# Recognize --with-newlib/--without-newlib.
259c074d1c9Sdrahncase ${with_newlib} in
260c074d1c9Sdrahn  no) skipdirs="${skipdirs} target-newlib" ;;
261c074d1c9Sdrahn  yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
262c074d1c9Sdrahnesac
263c074d1c9Sdrahn
264c074d1c9Sdrahn# Configure extra directories which are host specific
265c074d1c9Sdrahn
266c074d1c9Sdrahncase "${host}" in
267c074d1c9Sdrahn  *-cygwin*)
268c074d1c9Sdrahn    configdirs="$configdirs libtermcap" ;;
269c074d1c9Sdrahnesac
270c074d1c9Sdrahn
271c074d1c9Sdrahn# Remove more programs from consideration, based on the host or
272c074d1c9Sdrahn# target this usually means that a port of the program doesn't
273c074d1c9Sdrahn# exist yet.
274c074d1c9Sdrahn
275c074d1c9Sdrahncase "${host}" in
276c074d1c9Sdrahn  hppa*64*-*-*)
277c074d1c9Sdrahn    noconfigdirs="$noconfigdirs byacc"
278c074d1c9Sdrahn    ;;
279007c2a45Smiod  i[[3456789]]86-*-vsta)
280007c2a45Smiod    noconfigdirs="$noconfigdirs tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix gnuserv gettext"
281c074d1c9Sdrahn    ;;
282007c2a45Smiod  i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*)
283007c2a45Smiod    noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi"
284c074d1c9Sdrahn    ;;
285007c2a45Smiod  i[[3456789]]86-*-mingw32*)
286c074d1c9Sdrahn    # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv"
287007c2a45Smiod    noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
288c074d1c9Sdrahn    ;;
289007c2a45Smiod  i[[3456789]]86-*-beos*)
290c074d1c9Sdrahn    noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
291c074d1c9Sdrahn    ;;
292c074d1c9Sdrahn  *-*-cygwin*)
293007c2a45Smiod    noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl"
294c074d1c9Sdrahn    ;;
295c074d1c9Sdrahn  *-*-netbsd*)
296007c2a45Smiod    noconfigdirs="$noconfigdirs rcs"
297c074d1c9Sdrahn    ;;
298c074d1c9Sdrahn  ppc*-*-pe)
299007c2a45Smiod    noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv"
300c074d1c9Sdrahn    ;;
301c074d1c9Sdrahn  powerpc-*-beos*)
302c074d1c9Sdrahn    noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
303c074d1c9Sdrahn    ;;
304c074d1c9Sdrahn  *-*-darwin*)
305c074d1c9Sdrahn    noconfigdirs="$noconfigdirs tk itcl tix libgui"
306c074d1c9Sdrahn    ;;
307c074d1c9Sdrahnesac
308c074d1c9Sdrahn
309007c2a45SmiodAC_ARG_ENABLE(libada,
310007c2a45Smiod[  --enable-libada        Builds libada directory],
311007c2a45SmiodENABLE_LIBADA=$enableval,
312007c2a45SmiodENABLE_LIBADA=yes)
313007c2a45Smiodif test "${ENABLE_LIBADA}" != "yes" ; then
314007c2a45Smiod  noconfigdirs="$noconfigdirs target-libada"
315007c2a45Smiodfi
316007c2a45Smiod
317c074d1c9Sdrahn# Save it here so that, even in case of --enable-libgcj, if the Java
318c074d1c9Sdrahn# front-end isn't enabled, we still get libgcj disabled.
319c074d1c9Sdrahnlibgcj_saved=$libgcj
320c074d1c9Sdrahncase $enable_libgcj in
321c074d1c9Sdrahnyes)
322c074d1c9Sdrahn  # If we reset it here, it won't get added to noconfigdirs in the
323c074d1c9Sdrahn  # target-specific build rules, so it will be forcibly enabled
324c074d1c9Sdrahn  # (unless the Java language itself isn't enabled).
325c074d1c9Sdrahn  libgcj=
326c074d1c9Sdrahn  ;;
327c074d1c9Sdrahnno)
328c074d1c9Sdrahn  # Make sure we get it printed in the list of not supported target libs.
329c074d1c9Sdrahn  noconfigdirs="$noconfigdirs ${libgcj}"
330c074d1c9Sdrahn  ;;
331c074d1c9Sdrahnesac
332c074d1c9Sdrahn
333c074d1c9Sdrahncase "${target}" in
334007c2a45Smiod  *-*-openbsd.*)
335007c2a45Smiod    noconfigdirs="$noconfigdirs target-libiberty"
336007c2a45Smiod    noconfigdirs="$noconfigdirs gdb"
337007c2a45Smiod   ;;
338007c2a45Smiodesac
339007c2a45Smiod
340007c2a45Smiodcase "${target}" in
341c074d1c9Sdrahn  *-*-chorusos)
342c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
343c074d1c9Sdrahn    ;;
344007c2a45Smiod  powerpc-*-darwin*)
345007c2a45Smiod    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
346007c2a45Smiod    noconfigdirs="$noconfigdirs target-libobjc"
347007c2a45Smiod    ;;
348c074d1c9Sdrahn  *-*-darwin*)
349c074d1c9Sdrahn    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
350c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
351c074d1c9Sdrahn    ;;
352c074d1c9Sdrahn  *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
353c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
354c074d1c9Sdrahn    ;;
355c074d1c9Sdrahn  *-*-kaos*)
356c074d1c9Sdrahn    # Remove unsupported stuff on all kaOS configurations.
357c074d1c9Sdrahn    skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx"
358c074d1c9Sdrahn    skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
359c074d1c9Sdrahn    skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
360c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss"
361c074d1c9Sdrahn    ;;
362c074d1c9Sdrahn  *-*-netbsd*)
363c074d1c9Sdrahn    # Skip some stuff on all NetBSD configurations.
364c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
365c074d1c9Sdrahn
366c074d1c9Sdrahn    # Skip some stuff that's unsupported on some NetBSD configurations.
367c074d1c9Sdrahn    case "${target}" in
368c074d1c9Sdrahn      i*86-*-netbsdelf*) ;;
369c074d1c9Sdrahn      arm*-*-netbsdelf*) ;;
370c074d1c9Sdrahn      *)
371c074d1c9Sdrahn	noconfigdirs="$noconfigdirs ${libgcj}"
372c074d1c9Sdrahn	;;
373c074d1c9Sdrahn    esac
374c074d1c9Sdrahn    ;;
375c074d1c9Sdrahn  *-*-netware)
376c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}"
377c074d1c9Sdrahn    ;;
378c074d1c9Sdrahn  *-*-rtems*)
379c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
380c074d1c9Sdrahn    case ${target} in
381c074d1c9Sdrahn	h8300*-*-* | h8500-*-*)
382c074d1c9Sdrahn	  noconfigdirs="$noconfigdirs target-libf2c"
383c074d1c9Sdrahn          ;;
384c074d1c9Sdrahn        *) ;;
385c074d1c9Sdrahn    esac
386c074d1c9Sdrahn    ;;
387007c2a45Smiod  *-*-uclinux*)
388007c2a45Smiod    noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
389007c2a45Smiod    ;;
390c074d1c9Sdrahn  *-*-vxworks*)
391007c2a45Smiod    noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}"
392c074d1c9Sdrahn    ;;
393c074d1c9Sdrahn  alpha*-dec-osf*)
394c074d1c9Sdrahn    # ld works, but does not support shared libraries.
395c074d1c9Sdrahn    # newlib is not 64 bit ready.  I'm not sure about fileutils.
396c074d1c9Sdrahn    # gas doesn't generate exception information.
397c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
398c074d1c9Sdrahn    ;;
399c074d1c9Sdrahn  alpha*-*-*vms*)
400c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
401c074d1c9Sdrahn    ;;
402c074d1c9Sdrahn  alpha*-*-linux*)
403c074d1c9Sdrahn    # newlib is not 64 bit ready
404c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
405c074d1c9Sdrahn    ;;
406007c2a45Smiod  alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
407c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
408c074d1c9Sdrahn    ;;
409c074d1c9Sdrahn  alpha*-*-*)
410c074d1c9Sdrahn    # newlib is not 64 bit ready
411c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
412c074d1c9Sdrahn    ;;
413007c2a45Smiod  am33_2.0-*-linux*)
414007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
415007c2a45Smiod    ;;
416c074d1c9Sdrahn  sh-*-linux*)
417c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
418c074d1c9Sdrahn    ;;
419c074d1c9Sdrahn  sh*-*-pe|mips*-*-pe|*arm-wince-pe)
420c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
421c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-examples"
422c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
423c074d1c9Sdrahn    noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
424c074d1c9Sdrahn    noconfigdirs="$noconfigdirs expect dejagnu"
425c074d1c9Sdrahn    # the C++ libraries don't build on top of CE's C libraries
426c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3"
427c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib"
428c074d1c9Sdrahn    case "${host}" in
429c074d1c9Sdrahn      *-*-cygwin*) ;; # keep gdb and readline
430c074d1c9Sdrahn      *) noconfigdirs="$noconfigdirs gdb readline"
431c074d1c9Sdrahn	 ;;
432c074d1c9Sdrahn    esac
433c074d1c9Sdrahn    ;;
434c074d1c9Sdrahn  arc-*-*)
435c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
436c074d1c9Sdrahn    ;;
437c074d1c9Sdrahn  arm-*-coff | strongarm-*-coff | xscale-*-coff)
438c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
439c074d1c9Sdrahn    ;;
440c074d1c9Sdrahn  arm-*-elf* | strongarm-*-elf* | xscale-*-elf*)
441c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
442c074d1c9Sdrahn    ;;
443c074d1c9Sdrahn  arm-*-pe*)
444c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
445c074d1c9Sdrahn    ;;
446c074d1c9Sdrahn  arm-*-oabi*)
447c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
448c074d1c9Sdrahn    ;;
449c074d1c9Sdrahn  thumb-*-coff)
450c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
451c074d1c9Sdrahn    ;;
452c074d1c9Sdrahn  thumb-*-elf)
453c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
454c074d1c9Sdrahn    ;;
455c074d1c9Sdrahn  thumb-*-oabi)
456c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
457c074d1c9Sdrahn    ;;
458c074d1c9Sdrahn  thumb-*-pe)
459c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
460c074d1c9Sdrahn    ;;
461c074d1c9Sdrahn  arm-*-riscix*)
462c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
463c074d1c9Sdrahn    ;;
464c074d1c9Sdrahn  avr-*-*)
465c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
466c074d1c9Sdrahn    ;;
467c074d1c9Sdrahn  c4x-*-* | tic4x-*-*)
468c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
469c074d1c9Sdrahn    ;;
470c074d1c9Sdrahn  c54x*-*-* | tic54x-*-*)
471c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
472c074d1c9Sdrahn    ;;
473c074d1c9Sdrahn  cris-*-*)
474007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
475c074d1c9Sdrahn    ;;
476c074d1c9Sdrahn  d10v-*-*)
477c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
478c074d1c9Sdrahn    ;;
479c074d1c9Sdrahn  d30v-*-*)
480007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj} gdb"
481c074d1c9Sdrahn    ;;
482c074d1c9Sdrahn  fr30-*-elf*)
483007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj} gdb"
484c074d1c9Sdrahn    ;;
485c074d1c9Sdrahn  frv-*-*)
486c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
487c074d1c9Sdrahn    ;;
488c074d1c9Sdrahn  h8300*-*-*)
489007c2a45Smiod    noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c"
490c074d1c9Sdrahn    ;;
491c074d1c9Sdrahn  h8500-*-*)
492c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
493c074d1c9Sdrahn    ;;
494c074d1c9Sdrahn  hppa*64*-*-linux* | parisc*64*-*-linux*)
495c074d1c9Sdrahn    # In this case, it's because the hppa64-linux target is for
496c074d1c9Sdrahn    # the kernel only at this point and has no libc, and thus no
497c074d1c9Sdrahn    # headers, crt*.o, etc., all of which are needed by these.
498c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-zlib"
499c074d1c9Sdrahn    ;;
500c074d1c9Sdrahn  hppa*-*-*elf* | \
501c074d1c9Sdrahn  parisc*-*-linux* | hppa*-*-linux* | \
502c074d1c9Sdrahn  hppa*-*-lites* | \
503c074d1c9Sdrahn  hppa*-*-openbsd* | \
504c074d1c9Sdrahn  hppa*64*-*-*)
505c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
506c074d1c9Sdrahn    # Do configure ld/binutils/gas for this case.
507c074d1c9Sdrahn    ;;
508c074d1c9Sdrahn  hppa*-*-*)
509c074d1c9Sdrahn    # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
510c074d1c9Sdrahn    # build on HP-UX 10.20.
511c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
512c074d1c9Sdrahn    ;;
513007c2a45Smiod  i960-*-*)
514007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj} gdb"
515007c2a45Smiod    ;;
516c074d1c9Sdrahn  ia64*-*-elf*)
517c074d1c9Sdrahn    # No gdb support yet.
518c074d1c9Sdrahn    noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
519c074d1c9Sdrahn    ;;
520c074d1c9Sdrahn  ia64*-**-hpux*)
521c074d1c9Sdrahn    # No gdb or ld support yet.
522007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj} tix readline mmalloc libgui itcl gdb ld"
523c074d1c9Sdrahn    ;;
524007c2a45Smiod  i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
525c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
526c074d1c9Sdrahn    ;;
527007c2a45Smiod  i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
528c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
529c074d1c9Sdrahn    ;;
530007c2a45Smiod  i[[3456789]]86-*-linux*)
531c074d1c9Sdrahn    # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
532c074d1c9Sdrahn    # not build java stuff by default.
533c074d1c9Sdrahn    case "${target}" in
534c074d1c9Sdrahn      *-*-*libc1*)
535c074d1c9Sdrahn	noconfigdirs="$noconfigdirs ${libgcj}";;
536c074d1c9Sdrahn    esac
537c074d1c9Sdrahn
538c074d1c9Sdrahn    # This section makes it possible to build newlib natively on linux.
539c074d1c9Sdrahn    # If we are using a cross compiler then don't configure newlib.
540c074d1c9Sdrahn    if test x${is_cross_compiler} != xno ; then
541c074d1c9Sdrahn      noconfigdirs="$noconfigdirs target-newlib"
542c074d1c9Sdrahn    fi
543c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss"
544c074d1c9Sdrahn    # If we are not using a cross compiler, do configure newlib.
545c074d1c9Sdrahn    # Note however, that newlib will only be configured in this situation
546c074d1c9Sdrahn    # if the --with-newlib option has been given, because otherwise
547c074d1c9Sdrahn    # 'target-newlib' will appear in skipdirs.
548c074d1c9Sdrahn    ;;
549007c2a45Smiod  i[[3456789]]86-*-mingw32*)
550c074d1c9Sdrahn    target_configdirs="$target_configdirs target-mingw"
551c074d1c9Sdrahn    noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
552c074d1c9Sdrahn
553c074d1c9Sdrahn    # Can't build gdb for mingw32 if not native.
554c074d1c9Sdrahn    case "${host}" in
555007c2a45Smiod      i[[3456789]]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
556c074d1c9Sdrahn      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix gnuserv"
557c074d1c9Sdrahn         ;;
558c074d1c9Sdrahn    esac
559c074d1c9Sdrahn    ;;
560c074d1c9Sdrahn  *-*-cygwin*)
561c074d1c9Sdrahn    target_configdirs="$target_configdirs target-libtermcap target-winsup"
562c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
563c074d1c9Sdrahn    # always build newlib.
564c074d1c9Sdrahn    skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
565c074d1c9Sdrahn
566c074d1c9Sdrahn    # Can't build gdb for Cygwin if not native.
567c074d1c9Sdrahn    case "${host}" in
568c074d1c9Sdrahn      *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
569c074d1c9Sdrahn      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui gnuserv"
570c074d1c9Sdrahn         ;;
571c074d1c9Sdrahn    esac
572c074d1c9Sdrahn    ;;
573007c2a45Smiod  i[[3456789]]86-*-pe)
574c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
575c074d1c9Sdrahn    ;;
576007c2a45Smiod  i[[3456789]]86-*-sco3.2v5*)
577c074d1c9Sdrahn    # The linker does not yet know about weak symbols in COFF,
578c074d1c9Sdrahn    # and is not configured to handle mixed ELF and COFF.
579c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
580c074d1c9Sdrahn    ;;
581007c2a45Smiod  i[[3456789]]86-*-sco*)
582c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
583c074d1c9Sdrahn    ;;
584007c2a45Smiod  i[[3456789]]86-*-solaris2*)
585c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss"
586c074d1c9Sdrahn    ;;
587007c2a45Smiod  i[[3456789]]86-*-sysv4*)
588c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
589c074d1c9Sdrahn    ;;
590007c2a45Smiod  i[[3456789]]86-*-beos*)
591c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
592c074d1c9Sdrahn    ;;
593007c2a45Smiod  m32r-*-*)
594007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj}"
595007c2a45Smiod    ;;
596c074d1c9Sdrahn  m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
597c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
598c074d1c9Sdrahn    ;;
599c074d1c9Sdrahn  m68k-*-elf*)
600c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
601c074d1c9Sdrahn    ;;
602c074d1c9Sdrahn  m68k-*-coff*)
603c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
604c074d1c9Sdrahn    ;;
605c074d1c9Sdrahn  mcore-*-pe*)
606c074d1c9Sdrahn  # The EPOC C++ environment does not support exceptions or rtti,
607c074d1c9Sdrahn  # and so building libstdc++-v3 tends not to always work.
608c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libstdc++-v3"
609c074d1c9Sdrahn    ;;
610c074d1c9Sdrahn  mmix-*-*)
611c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss"
612c074d1c9Sdrahn    ;;
613c074d1c9Sdrahn  mn10200-*-*)
614c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
615c074d1c9Sdrahn    ;;
616c074d1c9Sdrahn  mn10300-*-*)
617c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
618c074d1c9Sdrahn    ;;
619c074d1c9Sdrahn  powerpc-*-aix*)
620c074d1c9Sdrahn    # copied from rs6000-*-* entry
621007c2a45Smiod    noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}"
622c074d1c9Sdrahn    ;;
623c074d1c9Sdrahn  powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
624c074d1c9Sdrahn    target_configdirs="$target_configdirs target-winsup"
625c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix gnuserv ${libgcj}"
626c074d1c9Sdrahn    # always build newlib.
627c074d1c9Sdrahn    skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
628c074d1c9Sdrahn    ;;
629c074d1c9Sdrahn    # This is temporary until we can link against shared libraries
630c074d1c9Sdrahn  powerpcle-*-solaris*)
631c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix gnuserv ${libgcj}"
632c074d1c9Sdrahn    ;;
633c074d1c9Sdrahn  powerpc-*-beos*)
634c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
635c074d1c9Sdrahn    ;;
636c074d1c9Sdrahn  powerpc-*-eabi)
637c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
638c074d1c9Sdrahn    ;;
639c074d1c9Sdrahn  rs6000-*-lynxos*)
640c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
641c074d1c9Sdrahn    ;;
642c074d1c9Sdrahn  rs6000-*-aix*)
643007c2a45Smiod    noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}"
644c074d1c9Sdrahn    ;;
645c074d1c9Sdrahn  rs6000-*-*)
646c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof ${libgcj}"
647c074d1c9Sdrahn    ;;
648c074d1c9Sdrahn  m68k-apollo-*)
649c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
650c074d1c9Sdrahn    ;;
651c074d1c9Sdrahn  mips*-*-irix5*)
652007c2a45Smiod    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
653c074d1c9Sdrahn    ;;
654c074d1c9Sdrahn  mips*-*-irix6*)
655c074d1c9Sdrahn    # Linking libjava exceeds command-line length limits on at least
656c074d1c9Sdrahn    # IRIX 6.2, but not on IRIX 6.5.
657c074d1c9Sdrahn    # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
658c074d1c9Sdrahn    # <oldham@codesourcery.com>
659c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
660c074d1c9Sdrahn    ;;
661c074d1c9Sdrahn  mips*-dec-bsd*)
662c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
663c074d1c9Sdrahn    ;;
664c074d1c9Sdrahn  mips*-*-openbsd*)
665007c2a45Smiod    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
666c074d1c9Sdrahn    ;;
667c074d1c9Sdrahn  mips*-*-bsd*)
668c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
669c074d1c9Sdrahn    ;;
670c074d1c9Sdrahn  mipstx39-*-*)
671c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof ${libgcj}"   # same as generic mips
672c074d1c9Sdrahn    ;;
673c074d1c9Sdrahn  mips*-*-linux*)
674c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
675c074d1c9Sdrahn    ;;
676c074d1c9Sdrahn  mips*-*-*)
677c074d1c9Sdrahn    noconfigdirs="$noconfigdirs gprof ${libgcj}"
678c074d1c9Sdrahn    ;;
679c074d1c9Sdrahn  romp-*-*)
680c074d1c9Sdrahn    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
681c074d1c9Sdrahn    ;;
682c074d1c9Sdrahn  sh-*-*)
683c074d1c9Sdrahn    case "${host}" in
684007c2a45Smiod      i[[3456789]]86-*-vsta) ;; # don't add gprof back in
685007c2a45Smiod      i[[3456789]]86-*-go32*) ;; # don't add gprof back in
686007c2a45Smiod      i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in
687c074d1c9Sdrahn      *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
688c074d1c9Sdrahn    esac
689c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
690c074d1c9Sdrahn    ;;
691c074d1c9Sdrahn  sh64-*-*)
692c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
693c074d1c9Sdrahn    ;;
694c074d1c9Sdrahn  sparc-*-elf*)
695c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
696c074d1c9Sdrahn    ;;
697c074d1c9Sdrahn  sparc64-*-elf*)
698c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
699c074d1c9Sdrahn    ;;
700c074d1c9Sdrahn  sparclite-*-*)
701c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
702c074d1c9Sdrahn    ;;
703c074d1c9Sdrahn  sparc-*-sunos4*)
704c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
705c074d1c9Sdrahn    if test x${is_cross_compiler} != xno ; then
706c074d1c9Sdrahn           noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
707c074d1c9Sdrahn    else
708c074d1c9Sdrahn           use_gnu_ld=no
709c074d1c9Sdrahn    fi
710c074d1c9Sdrahn    ;;
711c074d1c9Sdrahn  sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
712c074d1c9Sdrahn    ;;
713c074d1c9Sdrahn  v810-*-*)
714c074d1c9Sdrahn    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
715c074d1c9Sdrahn    ;;
716c074d1c9Sdrahn  v850-*-*)
717c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
718c074d1c9Sdrahn    ;;
719c074d1c9Sdrahn  v850e-*-*)
720c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
721c074d1c9Sdrahn    ;;
722c074d1c9Sdrahn  v850ea-*-*)
723c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
724c074d1c9Sdrahn    ;;
725c074d1c9Sdrahn  vax-*-openbsd*)
726*6bf90127Smiod    noconfigdirs="$noconfigdirs ${libgcj}"
727c074d1c9Sdrahn    ;;
728c074d1c9Sdrahn  vax-*-vms)
729c074d1c9Sdrahn    noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
730c074d1c9Sdrahn    ;;
731c074d1c9Sdrahn  vax-*-*)
732c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
733c074d1c9Sdrahn    ;;
734007c2a45Smiod  xtensa-*-*)
735007c2a45Smiod    noconfigdirs="$noconfigdirs ${libgcj}"
736007c2a45Smiod    ;;
737c074d1c9Sdrahn  ip2k-*-*)
738c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
739c074d1c9Sdrahn    ;;
740c074d1c9Sdrahn  *-*-linux*)
741c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
742c074d1c9Sdrahn    ;;
743c074d1c9Sdrahn  *-*-lynxos*)
744c074d1c9Sdrahn    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
745c074d1c9Sdrahn    ;;
746c074d1c9Sdrahn  *-*-*)
747c074d1c9Sdrahn    noconfigdirs="$noconfigdirs ${libgcj}"
748c074d1c9Sdrahn    ;;
749c074d1c9Sdrahnesac
750c074d1c9Sdrahn
751c074d1c9Sdrahn# If we aren't building newlib, then don't build libgloss, since libgloss
752c074d1c9Sdrahn# depends upon some newlib header files.
753c074d1c9Sdrahncase "${noconfigdirs}" in
754c074d1c9Sdrahn  *target-libgloss*) ;;
755c074d1c9Sdrahn  *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
756c074d1c9Sdrahnesac
757c074d1c9Sdrahn
758c074d1c9Sdrahn# Figure out what language subdirectories are present.
759c074d1c9Sdrahn# Look if the user specified --enable-languages="..."; if not, use
760c074d1c9Sdrahn# the environment variable $LANGUAGES if defined. $LANGUAGES might
761c074d1c9Sdrahn# go away some day.
762c074d1c9Sdrahn# NB:  embedded tabs in this IF block -- do not untabify
763c074d1c9Sdrahnif test x"${enable_languages+set}" != xset; then
764c074d1c9Sdrahn  if test x"${LANGUAGES+set}" = xset; then
765c074d1c9Sdrahn    enable_languages="${LANGUAGES}"
766c074d1c9Sdrahn      echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
767c074d1c9Sdrahn  else
768c074d1c9Sdrahn    enable_languages=all
769c074d1c9Sdrahn  fi
770c074d1c9Sdrahnelse
771c074d1c9Sdrahn  if test x"${enable_languages}" = x ||
772c074d1c9Sdrahn     test x"${enable_languages}" = xyes;
773c074d1c9Sdrahn     then
774c074d1c9Sdrahn    echo configure.in: --enable-languages needs at least one language argument 1>&2
775c074d1c9Sdrahn    exit 1
776c074d1c9Sdrahn  fi
777c074d1c9Sdrahnfi
778c074d1c9Sdrahnenable_languages=`echo "${enable_languages}" | sed -e 's/[[ 	,]][[ 	,]]*/,/g' -e 's/,$//'`
779c074d1c9Sdrahn
780c074d1c9Sdrahn# First scan to see if an enabled language requires some other language.
781c074d1c9Sdrahn# We assume that a given config-lang.in will list all the language
782c074d1c9Sdrahn# front ends it requires, even if some are required indirectly.
783007c2a45Smiodfor lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
784007c2a45Smiod  case ${lang_frag} in
785c074d1c9Sdrahn    ..) ;;
786c074d1c9Sdrahn    # The odd quoting in the next line works around
787c074d1c9Sdrahn    # an apparent bug in bash 1.12 on linux.
788c074d1c9Sdrahn    ${srcdir}/gcc/[[*]]/config-lang.in) ;;
789c074d1c9Sdrahn    *)
790007c2a45Smiod      # From the config-lang.in, get $language, $lang_requires
791007c2a45Smiod      language=
792007c2a45Smiod      lang_requires=
793007c2a45Smiod      . ${lang_frag}
794007c2a45Smiod      for other in ${lang_requires} ; do
795c074d1c9Sdrahn        case ,${enable_languages}, in
796c074d1c9Sdrahn	  *,$other,*) ;;
797c074d1c9Sdrahn	  *,all,*) ;;
798007c2a45Smiod	  *,$language,*)
799007c2a45Smiod	    echo " \`$other' language required by \`$language'; enabling" 1>&2
800007c2a45Smiod	    enable_languages="${enable_languages},${other}"
801c074d1c9Sdrahn	    ;;
802c074d1c9Sdrahn	esac
803c074d1c9Sdrahn      done
804c074d1c9Sdrahn      ;;
805c074d1c9Sdrahn  esac
806c074d1c9Sdrahndone
807c074d1c9Sdrahn
808007c2a45Smiodfor lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
809007c2a45Smiod  case ${lang_frag} in
810c074d1c9Sdrahn    ..) ;;
811c074d1c9Sdrahn    # The odd quoting in the next line works around
812c074d1c9Sdrahn    # an apparent bug in bash 1.12 on linux.
813c074d1c9Sdrahn    ${srcdir}/gcc/[[*]]/config-lang.in) ;;
814c074d1c9Sdrahn    *)
815007c2a45Smiod      # From the config-lang.in, get $language, $target_libs,
816007c2a45Smiod      # $lang_dirs, and $build_by_default
817007c2a45Smiod      language=
818007c2a45Smiod      target_libs=
819007c2a45Smiod      lang_dirs=
820007c2a45Smiod      build_by_default=
821007c2a45Smiod      . ${lang_frag}
822007c2a45Smiod      if test "x$language" = x ; then
823007c2a45Smiod        echo "${lang_frag} doesn't set \$language." 1>&2
824c074d1c9Sdrahn        exit 1
825c074d1c9Sdrahn      fi
826007c2a45Smiod      case ,${enable_languages}, in
827007c2a45Smiod        *,${language},*)
828007c2a45Smiod          # Language was explicitly selected; include it.
829007c2a45Smiod          add_this_lang=yes
830007c2a45Smiod          ;;
831007c2a45Smiod        *,all,*)
832007c2a45Smiod          # 'all' was selected; include 'default' languages.
833007c2a45Smiod          case ${build_by_default} in
834007c2a45Smiod            no) add_this_lang=no ;;
835007c2a45Smiod            *) add_this_lang=yes ;;
836007c2a45Smiod          esac
837007c2a45Smiod          ;;
838c074d1c9Sdrahn        *) add_this_lang=no ;;
839c074d1c9Sdrahn      esac
840007c2a45Smiod      case ${add_this_lang} in
841007c2a45Smiod        no)
842007c2a45Smiod          # Remove language-dependent dirs.
843007c2a45Smiod          eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
844007c2a45Smiod          ;;
845007c2a45Smiod      esac
846c074d1c9Sdrahn      ;;
847c074d1c9Sdrahn  esac
848c074d1c9Sdrahndone
849c074d1c9Sdrahn
850c074d1c9Sdrahn# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
851c074d1c9Sdrahn# $target_configdirs.
852c074d1c9Sdrahn# If we have the source for $noconfigdirs entries, add them to $notsupp.
853c074d1c9Sdrahn
854c074d1c9Sdrahnnotsupp=""
855c074d1c9Sdrahnfor dir in . $skipdirs $noconfigdirs ; do
856c074d1c9Sdrahn  dirname=`echo $dir | sed -e s/target-//g`
857c074d1c9Sdrahn  if test $dir != .  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
858c074d1c9Sdrahn    configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
859c074d1c9Sdrahn    if test -r $srcdir/$dirname/configure ; then
860c074d1c9Sdrahn      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
861c074d1c9Sdrahn	true
862c074d1c9Sdrahn      else
863c074d1c9Sdrahn	notsupp="$notsupp $dir"
864c074d1c9Sdrahn      fi
865c074d1c9Sdrahn    fi
866c074d1c9Sdrahn  fi
867c074d1c9Sdrahn  if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
868c074d1c9Sdrahn    target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
869c074d1c9Sdrahn    if test -r $srcdir/$dirname/configure ; then
870c074d1c9Sdrahn      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
871c074d1c9Sdrahn	true
872c074d1c9Sdrahn      else
873c074d1c9Sdrahn	notsupp="$notsupp $dir"
874c074d1c9Sdrahn      fi
875c074d1c9Sdrahn    fi
876c074d1c9Sdrahn  fi
877c074d1c9Sdrahndone
878c074d1c9Sdrahn
879c074d1c9Sdrahn# Sometimes the tools are distributed with libiberty but with no other
880c074d1c9Sdrahn# libraries.  In that case, we don't want to build target-libiberty.
881c074d1c9Sdrahnif test -n "${target_configdirs}" ; then
882c074d1c9Sdrahn  others=
883c074d1c9Sdrahn  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
884c074d1c9Sdrahn    if test "$i" != "libiberty" ; then
885c074d1c9Sdrahn      if test -r $srcdir/$i/configure ; then
886c074d1c9Sdrahn	others=yes;
887c074d1c9Sdrahn	break;
888c074d1c9Sdrahn      fi
889c074d1c9Sdrahn    fi
890c074d1c9Sdrahn  done
891c074d1c9Sdrahn  if test -z "${others}" ; then
892c074d1c9Sdrahn    target_configdirs=
893c074d1c9Sdrahn  fi
894c074d1c9Sdrahnfi
895c074d1c9Sdrahn
896c074d1c9Sdrahn# Quietly strip out all directories which aren't configurable in this tree.
897c074d1c9Sdrahn# This relies on all configurable subdirectories being autoconfiscated, which
898c074d1c9Sdrahn# is now the case.
899c074d1c9Sdrahnconfigdirs_all="$configdirs"
900c074d1c9Sdrahnconfigdirs=
901c074d1c9Sdrahnfor i in ${configdirs_all} ; do
902c074d1c9Sdrahn  if test -f ${srcdir}/$i/configure ; then
903c074d1c9Sdrahn    configdirs="${configdirs} $i"
904c074d1c9Sdrahn  fi
905c074d1c9Sdrahndone
906c074d1c9Sdrahntarget_configdirs_all="$target_configdirs"
907c074d1c9Sdrahntarget_configdirs=
908c074d1c9Sdrahnfor i in ${target_configdirs_all} ; do
909c074d1c9Sdrahn  j=`echo $i | sed -e s/target-//g`
910c074d1c9Sdrahn  if test -f ${srcdir}/$j/configure ; then
911c074d1c9Sdrahn    target_configdirs="${target_configdirs} $i"
912c074d1c9Sdrahn  fi
913c074d1c9Sdrahndone
914c074d1c9Sdrahn
915c074d1c9Sdrahn# Produce a warning message for the subdirs we can't configure.
916c074d1c9Sdrahn# This isn't especially interesting in the Cygnus tree, but in the individual
917c074d1c9Sdrahn# FSF releases, it's important to let people know when their machine isn't
918c074d1c9Sdrahn# supported by the one or two programs in a package.
919c074d1c9Sdrahn
920c074d1c9Sdrahnif test -n "${notsupp}" && test -z "${norecursion}" ; then
921c074d1c9Sdrahn  # If $appdirs is non-empty, at least one of those directories must still
922c074d1c9Sdrahn  # be configured, or we error out.  (E.g., if the gas release supports a
923c074d1c9Sdrahn  # specified target in some subdirs but not the gas subdir, we shouldn't
924c074d1c9Sdrahn  # pretend that all is well.)
925c074d1c9Sdrahn  if test -n "$appdirs" ; then
926c074d1c9Sdrahn    for dir in $appdirs ; do
927c074d1c9Sdrahn      if test -r $dir/Makefile.in ; then
928c074d1c9Sdrahn	if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
929c074d1c9Sdrahn	  appdirs=""
930c074d1c9Sdrahn	  break
931c074d1c9Sdrahn	fi
932c074d1c9Sdrahn	if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
933c074d1c9Sdrahn	  appdirs=""
934c074d1c9Sdrahn	  break
935c074d1c9Sdrahn	fi
936c074d1c9Sdrahn      fi
937c074d1c9Sdrahn    done
938c074d1c9Sdrahn    if test -n "$appdirs" ; then
939c074d1c9Sdrahn      echo "*** This configuration is not supported by this package." 1>&2
940c074d1c9Sdrahn      exit 1
941c074d1c9Sdrahn    fi
942c074d1c9Sdrahn  fi
943c074d1c9Sdrahn  # Okay, some application will build, or we don't care to check.  Still
944c074d1c9Sdrahn  # notify of subdirs not getting built.
945c074d1c9Sdrahn  echo "*** This configuration is not supported in the following subdirectories:" 1>&2
946c074d1c9Sdrahn  echo "    ${notsupp}" 1>&2
947c074d1c9Sdrahn  echo "    (Any other directories should still work fine.)" 1>&2
948c074d1c9Sdrahnfi
949c074d1c9Sdrahn
950c074d1c9Sdrahncase "$host" in
951c074d1c9Sdrahn  *msdosdjgpp*)
952c074d1c9Sdrahn    enable_gdbtk=no ;;
953c074d1c9Sdrahnesac
954c074d1c9Sdrahn
9552159047fSniklascopy_dirs=
9562159047fSniklas
957c074d1c9Sdrahn# Handle --with-headers=XXX.  If the value is not "yes", the contents of
958c074d1c9Sdrahn# the named directory are copied to $(tooldir)/sys-include.
959007c2a45Smiodif test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
960c074d1c9Sdrahn  if test x${is_cross_compiler} = xno ; then
9612159047fSniklas    echo 1>&2 '***' --with-headers is only supported when cross compiling
9622159047fSniklas    exit 1
9632159047fSniklas  fi
964c074d1c9Sdrahn  if test x"${with_headers}" != xyes ; then
9652159047fSniklas    case "${exec_prefixoption}" in
9662159047fSniklas    "") x=${prefix} ;;
9672159047fSniklas    *) x=${exec_prefix} ;;
9682159047fSniklas    esac
9692159047fSniklas    copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
9702159047fSniklas  fi
971c074d1c9Sdrahnfi
9722159047fSniklas
973c074d1c9Sdrahn# Handle --with-libs=XXX.  If the value is not "yes", the contents of
974c074d1c9Sdrahn# the name directories are copied to $(tooldir)/lib.  Multiple directories
975c074d1c9Sdrahn# are permitted.
976007c2a45Smiodif test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
977c074d1c9Sdrahn  if test x${is_cross_compiler} = xno ; then
9782159047fSniklas    echo 1>&2 '***' --with-libs is only supported when cross compiling
9792159047fSniklas    exit 1
9802159047fSniklas  fi
981c074d1c9Sdrahn  if test x"${with_libs}" != xyes ; then
9822159047fSniklas    # Copy the libraries in reverse order, so that files in the first named
9832159047fSniklas    # library override files in subsequent libraries.
9842159047fSniklas    case "${exec_prefixoption}" in
9852159047fSniklas    "") x=${prefix} ;;
9862159047fSniklas    *) x=${exec_prefix} ;;
9872159047fSniklas    esac
9882159047fSniklas    for l in ${with_libs}; do
9892159047fSniklas      copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
9902159047fSniklas    done
9912159047fSniklas  fi
992092d8970Sniklasfi
993092d8970Sniklas
9942159047fSniklas# Handle ${copy_dirs}
9952159047fSniklasset fnord ${copy_dirs}
9962159047fSniklasshift
997c074d1c9Sdrahnwhile test $# != 0 ; do
998c074d1c9Sdrahn  if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
9992159047fSniklas    :
10002159047fSniklas  else
10012159047fSniklas    echo Copying $1 to $2
10022159047fSniklas
10032159047fSniklas    # Use the install script to create the directory and all required
10042159047fSniklas    # parent directories.
1005c074d1c9Sdrahn    if test -d $2 ; then
10062159047fSniklas      :
10072159047fSniklas    else
10082159047fSniklas      echo >config.temp
1009b305b0f1Sespie      ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
10102159047fSniklas    fi
10112159047fSniklas
10122159047fSniklas    # Copy the directory, assuming we have tar.
10132159047fSniklas    # FIXME: Should we use B in the second tar?  Not all systems support it.
10142159047fSniklas    (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
10152159047fSniklas
10162159047fSniklas    # It is the responsibility of the user to correctly adjust all
10172159047fSniklas    # symlinks.  If somebody can figure out how to handle them correctly
10182159047fSniklas    # here, feel free to add the code.
10192159047fSniklas
10202159047fSniklas    echo $1 > $2/COPIED
10212159047fSniklas  fi
10222159047fSniklas  shift; shift
10232159047fSniklasdone
10242159047fSniklas
1025c074d1c9Sdrahn# Work in distributions that contain no compiler tools, like Autoconf.
1026c074d1c9Sdrahntentative_cc=""
1027c074d1c9Sdrahnhost_makefile_frag=/dev/null
1028c074d1c9Sdrahnif test -d ${srcdir}/config ; then
10292159047fSniklascase "${host}" in
1030c074d1c9Sdrahn  m68k-hp-hpux*)
1031c074d1c9Sdrahn    # Avoid "too much defining" errors from HPUX compiler.
1032c074d1c9Sdrahn    tentative_cc="cc -Wp,-H256000"
1033c074d1c9Sdrahn    # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding.
1034c074d1c9Sdrahn    # If it's HP/UX ar, this should be harmless.
1035c074d1c9Sdrahn    RANLIB="ar ts"
1036c074d1c9Sdrahn    ;;
1037c074d1c9Sdrahn  m68k-apollo-sysv*)
1038c074d1c9Sdrahn    tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG"
1039c074d1c9Sdrahn    ;;
1040c074d1c9Sdrahn  m68k-apollo-bsd*)
1041c074d1c9Sdrahn    #None of the Apollo compilers can compile gas or binutils.  The preprocessor
1042c074d1c9Sdrahn    # chokes on bfd, the compiler won't let you assign integers to enums, and
1043c074d1c9Sdrahn    # other problems.  Defining CC to gcc is a questionable way to say "don't use
1044c074d1c9Sdrahn    # the apollo compiler" (the preferred version of GCC could be called cc,
1045c074d1c9Sdrahn    # or whatever), but I'm not sure leaving CC as cc is any better...
1046c074d1c9Sdrahn    #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
1047c074d1c9Sdrahn    # Used to have BISON=yacc.
1048c074d1c9Sdrahn    tentative_cc=gcc
1049c074d1c9Sdrahn    ;;
1050c074d1c9Sdrahn  m88k-dg-dgux*)
1051c074d1c9Sdrahn    tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1052c074d1c9Sdrahn    ;;
1053c074d1c9Sdrahn  m88k-harris-cxux*)
1054c074d1c9Sdrahn    # Under CX/UX, we want to tell the compiler to use ANSI mode.
1055c074d1c9Sdrahn    tentative_cc="cc -Xa"
1056c074d1c9Sdrahn    host_makefile_frag="config/mh-cxux"
1057c074d1c9Sdrahn    ;;
1058c074d1c9Sdrahn  m88k-motorola-sysv*)
1059c074d1c9Sdrahn    ;;
1060c074d1c9Sdrahn  mips*-dec-ultrix*)
1061c074d1c9Sdrahn    tentative_cc="cc -Wf,-XNg1000"
1062c074d1c9Sdrahn    host_makefile_frag="config/mh-decstation"
1063c074d1c9Sdrahn    ;;
1064c074d1c9Sdrahn  mips*-nec-sysv4*)
1065c074d1c9Sdrahn    # The C compiler on NEC MIPS SVR4 needs bigger tables.
1066c074d1c9Sdrahn    tentative_cc="cc -ZXNd=5000 -ZXNg=1000"
1067c074d1c9Sdrahn    host_makefile_frag="config/mh-necv4"
1068c074d1c9Sdrahn    ;;
1069c074d1c9Sdrahn  mips*-sgi-irix4*)
1070c074d1c9Sdrahn    # Tell compiler to use K&R C.  We can't compile under the SGI Ansi
1071c074d1c9Sdrahn    # environment.  Also bump switch table size so that cp-parse will
1072c074d1c9Sdrahn    # compile.  Bump string length limit so linker builds.
1073c074d1c9Sdrahn    tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192"
1074c074d1c9Sdrahn    ;;
1075c074d1c9Sdrahn  mips*-*-sysv4*)
1076c074d1c9Sdrahn    host_makefile_frag="config/mh-sysv4"
1077c074d1c9Sdrahn    ;;
1078c074d1c9Sdrahn  mips*-*-sysv*)
1079c074d1c9Sdrahn    # This is for a MIPS running RISC/os 4.52C.
1080c074d1c9Sdrahn
1081c074d1c9Sdrahn    # This is needed for GDB, but needs to be in the top-level make because
1082c074d1c9Sdrahn    # if a library is compiled with the bsd headers and gets linked with the
1083c074d1c9Sdrahn    # sysv system libraries all hell can break loose (e.g. a jmp_buf might be
1084c074d1c9Sdrahn    # a different size).
1085c074d1c9Sdrahn    # ptrace(2) apparently has problems in the BSD environment.  No workaround is
1086c074d1c9Sdrahn    # known except to select the sysv environment.  Could we use /proc instead?
1087c074d1c9Sdrahn    # These "sysv environments" and "bsd environments" often end up being a pain.
1088c074d1c9Sdrahn    #
1089c074d1c9Sdrahn    # This is not part of CFLAGS because perhaps not all C compilers have this
1090c074d1c9Sdrahn    # option.
1091c074d1c9Sdrahn    tentative_cc="cc -systype sysv"
1092c074d1c9Sdrahn    ;;
1093c074d1c9Sdrahn  i370-ibm-opened*)
1094c074d1c9Sdrahn    tentative_cc="c89"
1095c074d1c9Sdrahn    ;;
1096007c2a45Smiod  i[[3456789]]86-*-sysv5*)
1097c074d1c9Sdrahn    host_makefile_frag="config/mh-sysv5"
1098c074d1c9Sdrahn    ;;
1099007c2a45Smiod  i[[3456789]]86-*-dgux*)
1100c074d1c9Sdrahn    tentative_cc="gcc -Wall -ansi -D__using_DGUX"
1101c074d1c9Sdrahn    host_makefile_frag="config/mh-dgux386"
1102c074d1c9Sdrahn    ;;
1103007c2a45Smiod  i[[3456789]]86-ncr-sysv4.3*)
1104c074d1c9Sdrahn    # The MetaWare compiler will generate a copyright message unless you
1105c074d1c9Sdrahn    # turn it off by adding the -Hnocopyr flag.
1106c074d1c9Sdrahn    tentative_cc="cc -Hnocopyr"
1107c074d1c9Sdrahn    ;;
1108007c2a45Smiod  i[[3456789]]86-ncr-sysv4*)
1109c074d1c9Sdrahn    # for an NCR 3000 (i486/SVR4) system.
1110c074d1c9Sdrahn    # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
1111c074d1c9Sdrahn    # This compiler not only emits obnoxious copyright messages every time
1112c074d1c9Sdrahn    # you run it, but it chokes and dies on a whole bunch of GNU source
1113c074d1c9Sdrahn    # files.  Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
1114c074d1c9Sdrahn    tentative_cc="/usr/ccs/ATT/cc"
1115c074d1c9Sdrahn    host_makefile_frag="config/mh-ncr3000"
1116c074d1c9Sdrahn    ;;
1117007c2a45Smiod  i[[3456789]]86-*-sco3.2v5*)
1118c074d1c9Sdrahn    ;;
1119007c2a45Smiod  i[[3456789]]86-*-sco*)
1120c074d1c9Sdrahn    # The native C compiler botches some simple uses of const.  Unfortunately,
1121c074d1c9Sdrahn    # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
1122c074d1c9Sdrahn    tentative_cc="cc -Dconst="
1123c074d1c9Sdrahn    host_makefile_frag="config/mh-sco"
1124c074d1c9Sdrahn    ;;
1125007c2a45Smiod  i[[3456789]]86-*-udk*)
1126c074d1c9Sdrahn    host_makefile_frag="config/mh-sysv5"
1127c074d1c9Sdrahn    ;;
1128007c2a45Smiod  i[[3456789]]86-*-solaris2*)
1129c074d1c9Sdrahn    host_makefile_frag="config/mh-sysv4"
1130c074d1c9Sdrahn    ;;
1131007c2a45Smiod  i[[3456789]]86-*-msdosdjgpp*)
1132c074d1c9Sdrahn    host_makefile_frag="config/mh-djgpp"
1133c074d1c9Sdrahn    ;;
1134b305b0f1Sespie  *-cygwin*)
1135c074d1c9Sdrahn    host_makefile_frag="config/mh-cygwin"
11362159047fSniklas    ;;
1137c074d1c9Sdrahn  *-mingw32*)
1138c074d1c9Sdrahn    host_makefile_frag="config/mh-mingw32"
11392159047fSniklas    ;;
1140c074d1c9Sdrahn  *-interix*)
1141c074d1c9Sdrahn    host_makefile_frag="config/mh-interix"
1142092d8970Sniklas    ;;
1143c074d1c9Sdrahn  vax-*-ultrix2*)
1144c074d1c9Sdrahn    # The old BSD pcc isn't up to compiling parts of gdb so use gcc
1145c074d1c9Sdrahn    tentative_cc=gcc
1146b305b0f1Sespie    ;;
1147c074d1c9Sdrahn  *-*-solaris2*)
1148c074d1c9Sdrahn    host_makefile_frag="config/mh-solaris"
1149b305b0f1Sespie    ;;
1150c074d1c9Sdrahn  m68k-sun-sunos*)
1151c074d1c9Sdrahn    # Sun's C compiler needs the -J flag to be able to compile cp-parse.c
1152c074d1c9Sdrahn    # without overflowing the jump tables (-J says to use a 32 bit table)
1153c074d1c9Sdrahn    tentative_cc="cc -J"
1154e93f7393Sniklas    ;;
1155c074d1c9Sdrahn  *-hp-hpux*)
1156c074d1c9Sdrahn    tentative_cc="cc -Wp,-H256000"
11572159047fSniklas    ;;
1158c074d1c9Sdrahn  *-*-hiux*)
1159c074d1c9Sdrahn    tentative_cc="cc -Wp,-H256000"
11602deff676Srahnds    ;;
11612159047fSniklas  rs6000-*-lynxos*)
1162c074d1c9Sdrahn    # /bin/cc is less than useful for our purposes.  Always use GCC
1163c074d1c9Sdrahn    tentative_cc="/usr/cygnus/progressive/bin/gcc"
1164c074d1c9Sdrahn    host_makefile_frag="config/mh-lynxrs6k"
1165d6825d6bSmickey    ;;
11662159047fSniklas  *-*-lynxos*)
1167c074d1c9Sdrahn    # /bin/cc is less than useful for our purposes.  Always use GCC
1168c074d1c9Sdrahn    tentative_cc="/bin/gcc"
11692159047fSniklas    ;;
1170c074d1c9Sdrahn  *-*-sysv4*)
1171c074d1c9Sdrahn    host_makefile_frag="config/mh-sysv4"
1172c074d1c9Sdrahn    ;;
1173c074d1c9Sdrahnesac
1174c074d1c9Sdrahnfi
1175c074d1c9Sdrahn
1176c074d1c9Sdrahnextra_arflags_for_target=
1177c074d1c9Sdrahnextra_nmflags_for_target=
1178c074d1c9Sdrahnextra_ranlibflags_for_target=
1179c074d1c9Sdrahntarget_makefile_frag=/dev/null
1180c074d1c9Sdrahncase "${target}" in
1181007c2a45Smiod  i[[3456789]]86-*-netware*)
1182c074d1c9Sdrahn    target_makefile_frag="config/mt-netware"
1183c074d1c9Sdrahn    ;;
1184c074d1c9Sdrahn  powerpc-*-netware*)
1185c074d1c9Sdrahn    target_makefile_frag="config/mt-netware"
1186c074d1c9Sdrahn    ;;
1187c074d1c9Sdrahn  *-*-linux*)
1188c074d1c9Sdrahn    target_makefile_frag="config/mt-linux"
1189c074d1c9Sdrahn    ;;
1190c074d1c9Sdrahn  *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
1191c074d1c9Sdrahn    # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
1192c074d1c9Sdrahn    # commands to handle both 32-bit and 64-bit objects.  These flags are
1193c074d1c9Sdrahn    # harmless if we're using GNU nm or ar.
1194c074d1c9Sdrahn    extra_arflags_for_target=" -X32_64"
1195c074d1c9Sdrahn    extra_nmflags_for_target=" -B -X32_64"
1196c074d1c9Sdrahn    ;;
1197c074d1c9Sdrahn  *-*-darwin*)
1198c074d1c9Sdrahn    # ranlib from Darwin requires the -c flag to look at common symbols.
1199c074d1c9Sdrahn    extra_ranlibflags_for_target=" -c"
1200c074d1c9Sdrahn    ;;
1201c074d1c9Sdrahn  mips*-*-pe | sh*-*-pe | *arm-wince-pe)
1202c074d1c9Sdrahn    target_makefile_frag="config/mt-wince"
12032159047fSniklas    ;;
12042159047fSniklasesac
12052159047fSniklas
1206c074d1c9Sdrahnalphaieee_frag=/dev/null
1207c074d1c9Sdrahncase $target in
1208c074d1c9Sdrahn  alpha*-*-*)
1209c074d1c9Sdrahn    # This just makes sure to use the -mieee option to build target libs.
1210c074d1c9Sdrahn    # This should probably be set individually by each library.
1211c074d1c9Sdrahn    alphaieee_frag="config/mt-alphaieee"
1212c074d1c9Sdrahn    ;;
1213092d8970Sniklasesac
1214092d8970Sniklas
1215c074d1c9Sdrahn# If --enable-target-optspace always use -Os instead of -O2 to build
1216c074d1c9Sdrahn# the target libraries, similarly if it is not specified, use -Os
1217c074d1c9Sdrahn# on selected platforms.
1218c074d1c9Sdrahnospace_frag=/dev/null
1219c074d1c9Sdrahncase "${enable_target_optspace}:${target}" in
1220c074d1c9Sdrahn  yes:*)
1221c074d1c9Sdrahn    ospace_frag="config/mt-ospace"
1222c074d1c9Sdrahn    ;;
1223c074d1c9Sdrahn  :d30v-*)
1224c074d1c9Sdrahn    ospace_frag="config/mt-d30v"
1225c074d1c9Sdrahn    ;;
1226c074d1c9Sdrahn  :m32r-* | :d10v-* | :fr30-*)
1227c074d1c9Sdrahn    ospace_frag="config/mt-ospace"
1228c074d1c9Sdrahn    ;;
1229c074d1c9Sdrahn  no:* | :*)
1230c074d1c9Sdrahn    ;;
1231b55d4692Sfgsch  *)
1232c074d1c9Sdrahn    echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
1233b55d4692Sfgsch    ;;
1234b55d4692Sfgschesac
12352159047fSniklas
12362159047fSniklas# Set with_gnu_as and with_gnu_ld as appropriate.
12372159047fSniklas#
12382159047fSniklas# This is done by determining whether or not the appropriate directory
12392159047fSniklas# is available, and by checking whether or not specific configurations
12402159047fSniklas# have requested that this magic not happen.
12412159047fSniklas#
12422159047fSniklas# The command line options always override the explicit settings in
12432159047fSniklas# configure.in, and the settings in configure.in override this magic.
12442159047fSniklas#
12452159047fSniklas# If the default for a toolchain is to use GNU as and ld, and you don't
12462159047fSniklas# want to do that, then you should use the --without-gnu-as and
12472159047fSniklas# --without-gnu-ld options for the configure script.
12482159047fSniklas
1249c074d1c9Sdrahnif test x${use_gnu_as} = x &&
1250c074d1c9Sdrahn   echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
12512159047fSniklas  with_gnu_as=yes
1252c074d1c9Sdrahn  extra_host_args="$extra_host_args --with-gnu-as"
12532159047fSniklasfi
12542159047fSniklas
1255c074d1c9Sdrahnif test x${use_gnu_ld} = x &&
1256c074d1c9Sdrahn   echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
12572159047fSniklas  with_gnu_ld=yes
1258c074d1c9Sdrahn  extra_host_args="$extra_host_args --with-gnu-ld"
12592159047fSniklasfi
12602159047fSniklas
1261c074d1c9Sdrahn# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
1262e93f7393Sniklas# can detect this case.
1263e93f7393Sniklas
1264c074d1c9Sdrahnif test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
1265e93f7393Sniklas  with_newlib=yes
1266c074d1c9Sdrahn  extra_host_args="$extra_host_args --with-newlib"
1267e93f7393Sniklasfi
1268e93f7393Sniklas
1269c074d1c9Sdrahn
1270c074d1c9Sdrahn# Default to using --with-stabs for certain targets.
1271c074d1c9Sdrahnif test x${with_stabs} = x ; then
12722159047fSniklas  case "${target}" in
1273007c2a45Smiod  mips*-*-irix[[56]]*)
1274b305b0f1Sespie    ;;
1275c074d1c9Sdrahn  mips*-*-* | alpha*-*-osf*)
1276c074d1c9Sdrahn    with_stabs=yes;
1277c074d1c9Sdrahn    extra_host_args="${extra_host_args} --with-stabs"
1278b305b0f1Sespie    ;;
12792159047fSniklas  esac
12802159047fSniklasfi
12812159047fSniklas
1282c074d1c9Sdrahn# hpux11 in 64bit mode has libraries in a weird place.  Arrange to find
1283c074d1c9Sdrahn# them automatically.
1284c074d1c9Sdrahncase "${host}" in
1285c074d1c9Sdrahn  hppa*64*-*-hpux11*)
1286c074d1c9Sdrahn    extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include"
1287c074d1c9Sdrahn    ;;
1288c074d1c9Sdrahnesac
1289c074d1c9Sdrahn
1290c074d1c9Sdrahn# If we aren't going to be using gcc, see if we can extract a definition
1291c074d1c9Sdrahn# of CC from the fragment.
1292c074d1c9Sdrahn# Actually, use the 'pre-extracted' version above.
1293c074d1c9Sdrahnif test -z "${CC}" && test "${build}" = "${host}" ; then
1294c074d1c9Sdrahn  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
1295c074d1c9Sdrahn  found=
1296c074d1c9Sdrahn  for dir in $PATH; do
1297c074d1c9Sdrahn    test -z "$dir" && dir=.
1298c074d1c9Sdrahn    if test -f $dir/gcc; then
1299c074d1c9Sdrahn      found=yes
1300c074d1c9Sdrahn      break
1301c074d1c9Sdrahn    fi
1302b305b0f1Sespie  done
1303c074d1c9Sdrahn  IFS="$save_ifs"
1304c074d1c9Sdrahn  if test -z "${found}" && test -n "${tentative_cc}" ; then
1305c074d1c9Sdrahn    CC=$tentative_cc
1306c074d1c9Sdrahn  fi
1307b305b0f1Sespiefi
1308b305b0f1Sespie
1309c074d1c9Sdrahn# Some systems (e.g., one of the i386-aix systems the gas testers are
1310c074d1c9Sdrahn# using) don't handle "\$" correctly, so don't use it here.
1311007c2a45Smiodtooldir='${exec_prefix}'/${target_alias}
1312c074d1c9Sdrahnbuild_tooldir=${tooldir}
1313c074d1c9Sdrahn
1314c074d1c9Sdrahn# Generate a default definition for YACC.  This is used if the makefile can't
1315c074d1c9Sdrahn# locate bison or byacc in objdir.
1316c074d1c9Sdrahn
1317c074d1c9Sdrahnfor prog in 'bison -y' byacc yacc
1318c074d1c9Sdrahndo
1319c074d1c9Sdrahn  set dummy $prog; tmp=$2
1320c074d1c9Sdrahn  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
1321c074d1c9Sdrahn  for dir in $PATH; do
1322c074d1c9Sdrahn    test -z "$dir" && dir=.
1323c074d1c9Sdrahn    if test -f $dir/$tmp; then
1324c074d1c9Sdrahn      DEFAULT_YACC="$prog"
1325c074d1c9Sdrahn      break
1326c074d1c9Sdrahn    fi
1327c074d1c9Sdrahn  done
1328c074d1c9Sdrahn  IFS="$save_ifs"
1329c074d1c9Sdrahn
1330c074d1c9Sdrahn  test -n "$DEFAULT_YACC" && break
1331c074d1c9Sdrahndone
1332c074d1c9Sdrahn
1333c074d1c9Sdrahn# Generate a default definition for M4.  This is used if the makefile can't
1334c074d1c9Sdrahn# locate m4 in objdir.
1335c074d1c9Sdrahn
1336c074d1c9Sdrahnfor prog in gm4 gnum4 m4
1337c074d1c9Sdrahndo
1338c074d1c9Sdrahn  set dummy $prog; tmp=$2
1339c074d1c9Sdrahn  IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
1340c074d1c9Sdrahn  for dir in $PATH; do
1341c074d1c9Sdrahn    test -z "$dir" && dir=.
1342c074d1c9Sdrahn    if test -f $dir/$tmp; then
1343c074d1c9Sdrahn      DEFAULT_M4="$prog"
1344c074d1c9Sdrahn      break
1345c074d1c9Sdrahn    fi
1346c074d1c9Sdrahn  done
1347c074d1c9Sdrahn  IFS="$save_ifs"
1348c074d1c9Sdrahn
1349c074d1c9Sdrahn  test -n "$DEFAULT_M4" && break
1350c074d1c9Sdrahndone
1351c074d1c9Sdrahn
1352c074d1c9Sdrahn# Generate a default definition for LEX.  This is used if the makefile can't
1353c074d1c9Sdrahn# locate flex in objdir.
1354c074d1c9Sdrahn
1355c074d1c9Sdrahnfor prog in flex lex
1356c074d1c9Sdrahndo
1357c074d1c9Sdrahn  set dummy $prog; tmp=$2
1358c074d1c9Sdrahn  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
1359c074d1c9Sdrahn  for dir in $PATH; do
1360c074d1c9Sdrahn    test -z "$dir" && dir=.
1361c074d1c9Sdrahn    if test -f $dir/$tmp; then
1362c074d1c9Sdrahn      DEFAULT_LEX="$prog"
1363c074d1c9Sdrahn      break
1364c074d1c9Sdrahn    fi
1365c074d1c9Sdrahn  done
1366c074d1c9Sdrahn  IFS="$save_ifs"
1367c074d1c9Sdrahn
1368c074d1c9Sdrahn  test -n "$DEFAULT_LEX" && break
1369c074d1c9Sdrahndone
1370c074d1c9Sdrahn
1371c074d1c9Sdrahnif test "${build}" != "${host}" ; then
1372c074d1c9Sdrahn  # If we are doing a Canadian Cross, in which the host and build systems
1373c074d1c9Sdrahn  # are not the same, we set reasonable default values for the tools.
1374c074d1c9Sdrahn
1375c074d1c9Sdrahn  BISON=${BISON-bison}
1376c074d1c9Sdrahn  CC=${CC-${host_alias}-gcc}
1377c074d1c9Sdrahn  CFLAGS=${CFLAGS-"-g -O2"}
1378c074d1c9Sdrahn  CXX=${CXX-${host_alias}-c++}
1379c074d1c9Sdrahn  CXXFLAGS=${CXXFLAGS-"-g -O2"}
1380c074d1c9Sdrahn  CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
1381c074d1c9Sdrahn  CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
1382c074d1c9Sdrahn  CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
1383c074d1c9Sdrahn  GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
1384c074d1c9Sdrahn  GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
1385c074d1c9Sdrahn  BUILD_PREFIX=${build_alias}-
1386c074d1c9Sdrahn  BUILD_PREFIX_1=${build_alias}-
1387c074d1c9Sdrahn  MAKEINFO=${MAKEINFO-makeinfo}
1388c074d1c9Sdrahn
1389c074d1c9Sdrahn  if test -z "${YACC}" ; then
1390c074d1c9Sdrahn    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
1391c074d1c9Sdrahn    for dir in $PATH; do
1392c074d1c9Sdrahn      test -z "$dir" && dir=.
1393c074d1c9Sdrahn      if test -f $dir/bison; then
1394c074d1c9Sdrahn	YACC="bison -y"
1395c074d1c9Sdrahn	break
1396c074d1c9Sdrahn      fi
1397c074d1c9Sdrahn      if test -f $dir/byacc; then
1398c074d1c9Sdrahn	YACC=byacc
1399c074d1c9Sdrahn	break
1400c074d1c9Sdrahn      fi
1401c074d1c9Sdrahn      if test -f $dir/yacc; then
1402c074d1c9Sdrahn	YACC=yacc
1403c074d1c9Sdrahn	break
1404c074d1c9Sdrahn      fi
1405c074d1c9Sdrahn    done
1406c074d1c9Sdrahn    IFS="$save_ifs"
1407c074d1c9Sdrahn    if test -z "${YACC}" ; then
1408c074d1c9Sdrahn      YACC="bison -y"
1409c074d1c9Sdrahn    fi
1410c074d1c9Sdrahn  fi
1411c074d1c9Sdrahn
1412c074d1c9Sdrahn  if test -z "${LEX}" ; then
1413c074d1c9Sdrahn    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
1414c074d1c9Sdrahn    for dir in $PATH; do
1415c074d1c9Sdrahn      test -z "$dir" && dir=.
1416c074d1c9Sdrahn      if test -f $dir/flex; then
1417c074d1c9Sdrahn	LEX=flex
1418c074d1c9Sdrahn	break
1419c074d1c9Sdrahn      fi
1420c074d1c9Sdrahn      if test -f $dir/lex; then
1421c074d1c9Sdrahn	LEX=lex
1422c074d1c9Sdrahn	break
1423c074d1c9Sdrahn      fi
1424c074d1c9Sdrahn    done
1425c074d1c9Sdrahn    IFS="$save_ifs"
1426c074d1c9Sdrahn    LEX=${LEX-flex}
1427c074d1c9Sdrahn  fi
1428c074d1c9Sdrahn
1429c074d1c9Sdrahnelse
1430c074d1c9Sdrahn  # Set reasonable default values for some tools even if not Canadian.
1431c074d1c9Sdrahn  # Of course, these are different reasonable default values, originally
1432c074d1c9Sdrahn  # specified directly in the Makefile.
1433c074d1c9Sdrahn  # We don't export, so that autoconf can do its job.
1434c074d1c9Sdrahn  # Note that all these settings are above the fragment inclusion point
1435c074d1c9Sdrahn  # in Makefile.in, so can still be overridden by fragments.
1436c074d1c9Sdrahn  # This is all going to change when we autoconfiscate...
1437c074d1c9Sdrahn
1438c074d1c9Sdrahn  BISON="\$(USUAL_BISON)"
1439c074d1c9Sdrahn  CC_FOR_BUILD="\$(CC)"
1440c074d1c9Sdrahn  GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
1441c074d1c9Sdrahn  BUILD_PREFIX=
1442c074d1c9Sdrahn  BUILD_PREFIX_1=loser-
1443c074d1c9Sdrahn  MAKEINFO="\$(USUAL_MAKEINFO)"
1444c074d1c9Sdrahn  LEX="\$(USUAL_LEX)"
1445c074d1c9Sdrahn  YACC="\$(USUAL_YACC)"
1446c074d1c9Sdrahn
1447c074d1c9Sdrahn  # If CC is still not set, try to get gcc.
1448c074d1c9Sdrahn  cc_prog_is_gcc=
1449c074d1c9Sdrahn  if test -z "${CC}" ; then
1450c074d1c9Sdrahn    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
1451c074d1c9Sdrahn    for dir in $PATH; do
1452c074d1c9Sdrahn      test -z "$dir" && dir=.
1453c074d1c9Sdrahn      if test -f $dir/gcc; then
1454c074d1c9Sdrahn	CC="gcc"
1455c074d1c9Sdrahn	cc_prog_is_gcc=yes
1456c074d1c9Sdrahn	echo 'void f(){}' > conftest.c
1457c074d1c9Sdrahn	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
1458c074d1c9Sdrahn	  CFLAGS=${CFLAGS-"-g -O2"}
1459c074d1c9Sdrahn	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
1460c074d1c9Sdrahn	else
1461c074d1c9Sdrahn	  CFLAGS=${CFLAGS-"-O2"}
1462c074d1c9Sdrahn	  CXXFLAGS=${CXXFLAGS-"-O2"}
1463c074d1c9Sdrahn	fi
1464c074d1c9Sdrahn	rm -f conftest*
1465c074d1c9Sdrahn	break
1466c074d1c9Sdrahn      fi
1467c074d1c9Sdrahn    done
1468c074d1c9Sdrahn    IFS="$save_ifs"
1469c074d1c9Sdrahn    CC=${CC-cc}
1470c074d1c9Sdrahn  else
1471c074d1c9Sdrahn    # Determine if we are using gcc.
1472c074d1c9Sdrahn    cat > conftest.c <<EOF
1473c074d1c9Sdrahn#ifdef __GNUC__
1474c074d1c9Sdrahn  yes;
1475c074d1c9Sdrahn#endif
1476c074d1c9SdrahnEOF
1477c074d1c9Sdrahn    if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
1478c074d1c9Sdrahn      cc_prog_is_gcc=yes
1479c074d1c9Sdrahn    fi
1480c074d1c9Sdrahn    rm -f conftest.c
1481c074d1c9Sdrahn    if test -z "${CFLAGS}"; then
1482c074d1c9Sdrahn      # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
1483c074d1c9Sdrahn      # is set to a version of gcc.
1484c074d1c9Sdrahn      if test "$cc_prog_is_gcc" = yes; then
1485c074d1c9Sdrahn	echo 'void f(){}' > conftest.c
1486c074d1c9Sdrahn	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
1487c074d1c9Sdrahn	  CFLAGS=${CFLAGS-"-g -O2"}
1488c074d1c9Sdrahn	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
1489c074d1c9Sdrahn	else
1490c074d1c9Sdrahn	  CFLAGS=${CFLAGS-"-O2"}
1491c074d1c9Sdrahn	  CXXFLAGS=${CXXFLAGS-"-O2"}
1492c074d1c9Sdrahn	fi
1493c074d1c9Sdrahn	rm -f conftest*
1494c074d1c9Sdrahn      fi
1495c074d1c9Sdrahn    fi
1496c074d1c9Sdrahn  fi
1497c074d1c9Sdrahn
1498c074d1c9Sdrahn  # We must set the default linker to the linker used by gcc for the correct
1499c074d1c9Sdrahn  # operation of libtool.  If LD is not defined and we are using gcc, try to
1500c074d1c9Sdrahn  # set the LD default to the ld used by gcc.
1501c074d1c9Sdrahn  if test -z "$LD"; then
1502c074d1c9Sdrahn    if test "$cc_prog_is_gcc" = yes; then
1503c074d1c9Sdrahn      case $build in
1504c074d1c9Sdrahn      *-*-mingw*)
1505c074d1c9Sdrahn	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
1506c074d1c9Sdrahn      *)
1507c074d1c9Sdrahn	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
1508c074d1c9Sdrahn      esac
1509c074d1c9Sdrahn      case $gcc_prog_ld in
1510c074d1c9Sdrahn      # Accept absolute paths.
1511c074d1c9Sdrahn      [[\\/]* | [A-Za-z]:[\\/]*)]
1512c074d1c9Sdrahn        LD="$gcc_prog_ld" ;;
1513c074d1c9Sdrahn      esac
1514c074d1c9Sdrahn    fi
1515c074d1c9Sdrahn  fi
1516c074d1c9Sdrahn
1517c074d1c9Sdrahn  CXX=${CXX-"c++"}
1518c074d1c9Sdrahn  CFLAGS=${CFLAGS-"-g"}
1519c074d1c9Sdrahn  CXXFLAGS=${CXXFLAGS-"-g -O2"}
1520c074d1c9Sdrahnfi
1521c074d1c9Sdrahn
1522c074d1c9Sdrahn# FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
1523c074d1c9Sdrahn# Set up the list of links to be made.
1524c074d1c9Sdrahn# ${links} is the list of link names, and ${files} is the list of names to link to.
1525c074d1c9Sdrahn
1526c074d1c9Sdrahn# Make the links.
1527c074d1c9Sdrahnconfiglinks="${links}"
1528c074d1c9Sdrahnif test -r ./config.status  ; then
1529c074d1c9Sdrahn  mv -f ./config.status ./config.back
1530c074d1c9Sdrahnfi
1531c074d1c9Sdrahnwhile test -n "${files}" ; do
1532c074d1c9Sdrahn  # set file to car of files, files to cdr of files
1533c074d1c9Sdrahn  set ${files}; file=$1; shift; files=$*
1534c074d1c9Sdrahn  set ${links}; link=$1; shift; links=$*
1535c074d1c9Sdrahn
1536c074d1c9Sdrahn  if test ! -r ${srcdir}/${file} ; then
1537c074d1c9Sdrahn    if test ! -r ${file} ; then
1538c074d1c9Sdrahn      echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
1539c074d1c9Sdrahn      echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
1540c074d1c9Sdrahn      exit 1
1541c074d1c9Sdrahn    else
1542c074d1c9Sdrahn      srcfile=${file}
1543c074d1c9Sdrahn    fi
1544c074d1c9Sdrahn  else
1545c074d1c9Sdrahn    srcfile=${srcdir}/${file}
1546c074d1c9Sdrahn  fi
1547c074d1c9Sdrahn
1548c074d1c9Sdrahn  ${remove} -f ${link}
1549c074d1c9Sdrahn  # Make a symlink if possible, otherwise try a hard link
1550c074d1c9Sdrahn  if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then
1551c074d1c9Sdrahn    true
1552c074d1c9Sdrahn  else
1553c074d1c9Sdrahn    # We need to re-remove the file because Lynx leaves a
1554c074d1c9Sdrahn    # very strange directory there when it fails an NFS symlink.
1555c074d1c9Sdrahn    ${remove} -r -f ${link}
1556c074d1c9Sdrahn    ${hard_link} ${srcfile} ${link}
1557c074d1c9Sdrahn  fi
1558c074d1c9Sdrahn  if test ! -r ${link} ; then
1559c074d1c9Sdrahn    echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2
1560c074d1c9Sdrahn    exit 1
1561c074d1c9Sdrahn  fi
1562c074d1c9Sdrahn
1563c074d1c9Sdrahn  echo "Linked \"${link}\" to \"${srcfile}\"."
1564c074d1c9Sdrahndone
1565c074d1c9Sdrahn
1566c074d1c9Sdrahn# Create a .gdbinit file which runs the one in srcdir
1567c074d1c9Sdrahn# and tells GDB to look there for source files.
1568c074d1c9Sdrahn
1569c074d1c9Sdrahnif test -r ${srcdir}/.gdbinit ; then
1570c074d1c9Sdrahn  case ${srcdir} in
1571c074d1c9Sdrahn    .) ;;
1572c074d1c9Sdrahn    *) cat > ./.gdbinit <<EOF
1573c074d1c9Sdrahn# ${NO_EDIT}
1574c074d1c9Sdrahndir ${srcdir}
1575c074d1c9Sdrahndir .
1576c074d1c9Sdrahnsource ${srcdir}/.gdbinit
1577c074d1c9SdrahnEOF
1578c074d1c9Sdrahn    ;;
1579c074d1c9Sdrahn  esac
1580c074d1c9Sdrahnfi
15812159047fSniklas
1582092d8970Sniklas# Make sure that the compiler is able to generate an executable.  If it
1583092d8970Sniklas# can't, we are probably in trouble.  We don't care whether we can run the
1584092d8970Sniklas# executable--we might be using a cross compiler--we only care whether it
1585092d8970Sniklas# can be created.  At this point the main configure script has set CC.
1586c074d1c9Sdrahnwe_are_ok=no
1587092d8970Sniklasecho "int main () { return 0; }" > conftest.c
1588092d8970Sniklas${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1589c074d1c9Sdrahnif test $? = 0 ; then
1590c074d1c9Sdrahn  if test -s conftest || test -s conftest.exe ; then
1591c074d1c9Sdrahn    we_are_ok=yes
1592c074d1c9Sdrahn  fi
1593c074d1c9Sdrahnfi
1594c074d1c9Sdrahncase $we_are_ok in
1595c074d1c9Sdrahn  no)
1596092d8970Sniklas    echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1597092d8970Sniklas    echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1598092d8970Sniklas    rm -f conftest*
1599092d8970Sniklas    exit 1
1600c074d1c9Sdrahn    ;;
1601c074d1c9Sdrahnesac
1602092d8970Sniklasrm -f conftest*
1603092d8970Sniklas
1604092d8970Sniklas# The Solaris /usr/ucb/cc compiler does not appear to work.
1605092d8970Sniklascase "${host}" in
1606092d8970Sniklas  sparc-sun-solaris2*)
1607092d8970Sniklas      CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1608c074d1c9Sdrahn      if test "`type $CCBASE | sed 's/^[[^/]]*//'`" = "/usr/ucb/cc" ; then
1609092d8970Sniklas          could_use=
1610c074d1c9Sdrahn          test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
1611c074d1c9Sdrahn          if test -d /opt/cygnus/bin ; then
1612c074d1c9Sdrahn              if test "$could_use" = "" ; then
1613092d8970Sniklas                  could_use="/opt/cygnus/bin"
1614092d8970Sniklas              else
1615092d8970Sniklas                  could_use="$could_use or /opt/cygnus/bin"
1616092d8970Sniklas              fi
1617092d8970Sniklas          fi
1618c074d1c9Sdrahn        if test "$could_use" = "" ; then
1619092d8970Sniklas            echo "Warning: compilation may fail because you're using"
1620092d8970Sniklas            echo "/usr/ucb/cc.  You should change your PATH or CC "
1621092d8970Sniklas            echo "variable and rerun configure."
1622092d8970Sniklas        else
1623092d8970Sniklas            echo "Warning: compilation may fail because you're using"
1624092d8970Sniklas            echo "/usr/ucb/cc, when you should use the C compiler from"
1625092d8970Sniklas            echo "$could_use.  You should change your"
1626092d8970Sniklas            echo "PATH or CC variable and rerun configure."
1627092d8970Sniklas        fi
1628092d8970Sniklas      fi
1629092d8970Sniklas  ;;
1630092d8970Sniklasesac
1631092d8970Sniklas
1632092d8970Sniklas# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1633092d8970Sniklas# binutils tools will find libbfd.so.
1634c074d1c9Sdrahncase "${enable_shared}" in
1635c074d1c9Sdrahn  no | "") SET_LIB_PATH= ;;
1636c074d1c9Sdrahn  *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
1637c074d1c9Sdrahnesac
1638092d8970Sniklas
1639092d8970Sniklascase "${host}" in
1640c074d1c9Sdrahn  *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
1641c074d1c9Sdrahn  *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
1642092d8970Sniklasesac
1643c074d1c9Sdrahn
1644c074d1c9Sdrahn# Record target_configdirs and the configure arguments for target and
1645c074d1c9Sdrahn# build configuration in Makefile.
1646c074d1c9Sdrahntarget_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1647c074d1c9Sdrahn
1648c074d1c9Sdrahn# This is the final value for target_configdirs.  configdirs already
1649007c2a45Smiod# has its final value, as does build_modules.  It's time to create some
1650007c2a45Smiod# lists of valid targets.
1651c074d1c9Sdrahn
1652c074d1c9Sdrahnall_build_modules=
1653c074d1c9Sdrahnconfigure_build_modules=
1654007c2a45Smiodfor module in ${build_modules} ; do
1655c074d1c9Sdrahn  all_build_modules=all-build-${module}
1656c074d1c9Sdrahn  configure_build_modules=configure-build-${module}
1657c074d1c9Sdrahndone
1658c074d1c9Sdrahn
1659c074d1c9Sdrahn# Determine whether gdb needs tk/tcl or not.
1660c074d1c9Sdrahn# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
1661c074d1c9Sdrahn# and in that case we want gdb to be built without tk.  Ugh!
1662c074d1c9Sdrahn# In fact I believe gdb is the *only* package directly dependent on tk,
1663c074d1c9Sdrahn# so we should be able to put the 'maybe's in unconditionally and
1664c074d1c9Sdrahn# leave out the maybe dependencies when enable_gdbtk is false.  I'm not
1665c074d1c9Sdrahn# 100% sure that that's safe though.
1666c074d1c9Sdrahn
1667c074d1c9Sdrahngdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui"
1668c074d1c9Sdrahncase "$enable_gdbtk" in
1669c074d1c9Sdrahn  no)
1670c074d1c9Sdrahn    GDB_TK="" ;;
1671c074d1c9Sdrahn  yes)
1672c074d1c9Sdrahn    GDB_TK="${gdb_tk}" ;;
1673c074d1c9Sdrahn  *)
1674c074d1c9Sdrahn    # Only add the dependency on gdbtk when GDBtk is part of the gdb
1675c074d1c9Sdrahn    # distro.  Eventually someone will fix this and move Insight, nee
1676c074d1c9Sdrahn    # gdbtk to a separate directory.
1677c074d1c9Sdrahn    if test -d ${srcdir}/gdb/gdbtk ; then
1678c074d1c9Sdrahn      GDB_TK="${gdb_tk}"
1679c074d1c9Sdrahn    else
1680c074d1c9Sdrahn      GDB_TK=""
1681c074d1c9Sdrahn    fi
1682c074d1c9Sdrahn    ;;
1683c074d1c9Sdrahnesac
1684c074d1c9Sdrahn
1685c074d1c9Sdrahn# Create the 'maybe dependencies'.  This uses a temporary file.
1686007c2a45Smiod
1687007c2a45Smiod# While at that, we remove Makefiles if we were started for recursive
1688007c2a45Smiod# configuration, so that the top-level Makefile reconfigures them,
1689007c2a45Smiod# like we used to do when configure itself was recursive.
1690c074d1c9Sdrahnrm -f maybedep.tmp
1691c074d1c9Sdrahnecho '# maybedep.tmp' > maybedep.tmp
1692007c2a45Smiod
1693007c2a45Smiod# Make-targets which may need maybe dependencies.
1694007c2a45Smiodmts="configure all install check clean distclean dvi info install-info"
1695007c2a45Smiodmts="${mts} installcheck mostlyclean maintainer-clean TAGS"
1696007c2a45Smiod
1697007c2a45Smiod# Loop over modules and make-targets.
1698007c2a45Smiodfor module in ${build_modules} ; do
1699007c2a45Smiod  if test -z "${no_recursion}" \
1700007c2a45Smiod     && test -f ${build_subdir}/${module}/Makefile; then
1701007c2a45Smiod    echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
1702007c2a45Smiod    rm -f ${build_subdir}/${module}/Makefile
1703007c2a45Smiod  fi
1704007c2a45Smiod  for mt in ${mts} ; do
1705007c2a45Smiod    case ${mt} in
1706007c2a45Smiod      install) ;; # No installing build modules.
1707007c2a45Smiod      *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;;
1708007c2a45Smiod    esac
1709007c2a45Smiod  done
1710007c2a45Smioddone
1711007c2a45Smiodfor module in ${configdirs} ; do
1712007c2a45Smiod  if test -z "${no_recursion}" \
1713007c2a45Smiod     && test -f ${module}/Makefile; then
1714007c2a45Smiod    echo 1>&2 "*** removing ${module}/Makefile to force reconfigure"
1715007c2a45Smiod    rm -f ${module}/Makefile
1716007c2a45Smiod  fi
1717007c2a45Smiod  for mt in ${mts} ; do
1718007c2a45Smiod    echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp
1719007c2a45Smiod  done
1720007c2a45Smioddone
1721007c2a45Smiodfor module in ${target_configdirs} ; do
1722007c2a45Smiod  if test -z "${no_recursion}" \
1723007c2a45Smiod     && test -f ${target_subdir}/${module}/Makefile; then
1724007c2a45Smiod    echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
1725007c2a45Smiod    rm -f ${target_subdir}/${module}/Makefile
1726007c2a45Smiod  fi
1727007c2a45Smiod  for mt in ${mts} ; do
1728007c2a45Smiod    echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp
1729007c2a45Smiod  done
1730c074d1c9Sdrahndone
1731c074d1c9Sdrahnmaybe_dependencies=maybedep.tmp
1732c074d1c9SdrahnAC_SUBST_FILE(maybe_dependencies)
1733c074d1c9Sdrahn
1734c074d1c9Sdrahn# Create the serialization dependencies.  This uses a temporary file.
1735c074d1c9Sdrahn
1736c074d1c9SdrahnAC_ARG_ENABLE([serial-configure],
1737007c2a45Smiod[  --enable-serial-[{host,target,build}-]configure
1738007c2a45Smiod                          Force sequential configuration of
1739c074d1c9Sdrahn                          sub-packages for the host, target or build
1740007c2a45Smiod			  machine, or all sub-packages])
1741007c2a45Smiod
1742007c2a45Smiodcase ${enable_serial_configure} in
1743007c2a45Smiod  yes)
1744007c2a45Smiod    enable_serial_build_configure=yes
1745007c2a45Smiod    enable_serial_host_configure=yes
1746007c2a45Smiod    enable_serial_target_configure=yes
1747007c2a45Smiod    ;;
1748007c2a45Smiodesac
1749c074d1c9Sdrahn
1750c074d1c9Sdrahn# These force 'configure's to be done one at a time, to avoid problems
1751c074d1c9Sdrahn# with contention over a shared config.cache.
1752c074d1c9Sdrahnrm -f serdep.tmp
1753c074d1c9Sdrahnecho '# serdep.tmp' > serdep.tmp
1754c074d1c9Sdrahnolditem=
1755007c2a45Smiodtest "x${enable_serial_build_configure}" = xyes &&
1756c074d1c9Sdrahnfor item in ${build_configdirs} ; do
1757c074d1c9Sdrahn  case ${olditem} in
1758c074d1c9Sdrahn    "") ;;
1759c074d1c9Sdrahn    *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
1760c074d1c9Sdrahn  esac
1761c074d1c9Sdrahn  olditem=${item}
1762c074d1c9Sdrahndone
1763c074d1c9Sdrahnolditem=
1764007c2a45Smiodtest "x${enable_serial_host_configure}" = xyes &&
1765c074d1c9Sdrahnfor item in ${configdirs} ; do
1766c074d1c9Sdrahn  case ${olditem} in
1767c074d1c9Sdrahn    "") ;;
1768c074d1c9Sdrahn    *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
1769c074d1c9Sdrahn  esac
1770c074d1c9Sdrahn  olditem=${item}
1771c074d1c9Sdrahndone
1772c074d1c9Sdrahnolditem=
1773007c2a45Smiodtest "x${enable_serial_target_configure}" = xyes &&
1774c074d1c9Sdrahnfor item in ${target_configdirs} ; do
1775c074d1c9Sdrahn  case ${olditem} in
1776c074d1c9Sdrahn    "") ;;
1777c074d1c9Sdrahn    *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
1778c074d1c9Sdrahn  esac
1779c074d1c9Sdrahn  olditem=${item}
1780c074d1c9Sdrahndone
1781c074d1c9Sdrahnserialization_dependencies=serdep.tmp
1782c074d1c9Sdrahn# override on OpenBSD
1783c074d1c9Sdrahnserialization_dependencies=/dev/null
1784c074d1c9SdrahnAC_SUBST_FILE(serialization_dependencies)
1785c074d1c9Sdrahn
1786c074d1c9Sdrahn# Base args.  Strip norecursion, cache-file, srcdir, host, build,
1787c074d1c9Sdrahn# target and nonopt.  These are the ones we might not want to pass
1788007c2a45Smiod# down to subconfigures.  Also strip program-prefix, program-suffix,
1789007c2a45Smiod# and program-transform-name, so that we can pass down a consistent
1790007c2a45Smiod# program-transform-name.  If autoconf has put single quotes around
1791007c2a45Smiod# any of these arguments (because they contain shell metacharacters)
1792007c2a45Smiod# then this will fail; in practice this only happens for
1793007c2a45Smiod# --program-transform-name, so be sure to override --program-transform-name
1794007c2a45Smiod# at the end of the argument list.
1795007c2a45Smiod# These will be expanded by make, so quote '$'.
1796007c2a45Smiodcat <<\EOF_SED > conftestsed
1797007c2a45Smiods/ --no[[^ ]]* / /
1798007c2a45Smiods/ --c[[a-z-]]*[[= ]][[^ ]]* / /
1799007c2a45Smiods/ --sr[[a-z-]]*[[= ]][[^ ]]* / /
1800007c2a45Smiods/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
1801007c2a45Smiods/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
1802007c2a45Smiods/ --t[[a-z-]]*[[= ]][[^ ]]* / /
1803007c2a45Smiods/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /
1804007c2a45Smiods/ -cache-file[[= ]][[^ ]]* / /
1805007c2a45Smiods/ -srcdir[[= ]][[^ ]]* / /
1806007c2a45Smiods/ -host[[= ]][[^ ]]* / /
1807007c2a45Smiods/ -build[[= ]][[^ ]]* / /
1808007c2a45Smiods/ -target[[= ]][[^ ]]* / /
1809007c2a45Smiods/ -program-prefix[[= ]][[^ ]]* / /
1810007c2a45Smiods/ -program-suffix[[= ]][[^ ]]* / /
1811007c2a45Smiods/ -program-transform-name[[= ]][[^ ]]* / /
1812007c2a45Smiods/ [[^' -][^ ]*] / /
1813007c2a45Smiods/^ *//;s/ *$//
1814007c2a45Smiods,\$,$$,g
1815007c2a45SmiodEOF_SED
1816007c2a45Smiodsed -f conftestsed <<EOF_SED > conftestsed.out
1817007c2a45Smiod ${ac_configure_args}
1818007c2a45SmiodEOF_SED
1819007c2a45Smiodbaseargs=`cat conftestsed.out`
1820007c2a45Smiodrm -f conftestsed conftestsed.out
1821007c2a45Smiod
1822007c2a45Smiod# Add in --program-transform-name, after --program-prefix and
1823007c2a45Smiod# --program-suffix have been applied to it.  Autoconf has already
1824007c2a45Smiod# doubled dollar signs and backslashes in program_transform_name; we want
1825007c2a45Smiod# the backslashes un-doubled, and then the entire thing wrapped in single
1826007c2a45Smiod# quotes, because this will be expanded first by make and then by the shell.
1827007c2a45Smiod# Also, because we want to override the logic in subdir configure scripts to
1828007c2a45Smiod# choose program_transform_name, replace any s,x,x, with s,y,y,.
1829007c2a45Smiodsed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
1830007c2a45Smiod${program_transform_name}
1831007c2a45SmiodEOF_SED
1832007c2a45Smiodgcc_transform_name=`cat conftestsed.out`
1833007c2a45Smiodrm -f conftestsed.out
1834007c2a45Smiodbaseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
1835c074d1c9Sdrahn
1836c074d1c9Sdrahn# For the build-side libraries, we just need to pretend we're native,
1837c074d1c9Sdrahn# and not use the same cache file.  Multilibs are neither needed nor
1838c074d1c9Sdrahn# desired.
1839c074d1c9Sdrahnbuild_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"
1840c074d1c9Sdrahn
1841c074d1c9Sdrahn# For host modules, accept cache file option, or specification as blank.
1842c074d1c9Sdrahncase "${cache_file}" in
1843c074d1c9Sdrahn"") # empty
1844c074d1c9Sdrahn  cache_file_option="" ;;
1845c074d1c9Sdrahn/* | [[A-Za-z]]:[[\\/]]* ) # absolute path
1846c074d1c9Sdrahn  cache_file_option="--cache-file=${cache_file}" ;;
1847c074d1c9Sdrahn*) # relative path
1848c074d1c9Sdrahn  cache_file_option="--cache-file=../${cache_file}" ;;
1849c074d1c9Sdrahnesac
1850c074d1c9Sdrahn
1851007c2a45Smiod# Host dirs don't like to share a cache file either, horribly enough.
1852007c2a45Smiod# This seems to be due to autoconf 2.5x stupidity.
1853007c2a45Smiodhost_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
1854c074d1c9Sdrahn
1855c074d1c9Sdrahntarget_configargs=${baseargs}
1856092d8970Sniklas
1857092d8970Sniklas# Passing a --with-cross-host argument lets the target libraries know
1858092d8970Sniklas# whether they are being built with a cross-compiler or being built
1859092d8970Sniklas# native.  However, it would be better to use other mechanisms to make the
1860092d8970Sniklas# sorts of decisions they want to make on this basis.  Please consider
1861092d8970Sniklas# this option to be deprecated.  FIXME.
1862c074d1c9Sdrahnif test x${is_cross_compiler} = xyes ; then
1863c074d1c9Sdrahn  target_configargs="--with-cross-host=${host_alias} ${target_configargs}"
1864092d8970Sniklasfi
1865092d8970Sniklas
1866b305b0f1Sespie# Default to --enable-multilib.
1867c074d1c9Sdrahnif test x${enable_multilib} = x ; then
1868c074d1c9Sdrahn  target_configargs="--enable-multilib ${target_configargs}"
1869b305b0f1Sespiefi
1870b305b0f1Sespie
1871b305b0f1Sespie# Pass --with-newlib if appropriate.  Note that target_configdirs has
1872b305b0f1Sespie# changed from the earlier setting of with_newlib.
1873c074d1c9Sdrahnif test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
1874c074d1c9Sdrahn  target_configargs="--with-newlib ${target_configargs}"
1875b305b0f1Sespiefi
1876b305b0f1Sespie
1877007c2a45Smiod# Different target subdirs use different values of certain variables
1878007c2a45Smiod# (notably CXX).  Worse, multilibs use *lots* of different values.
1879007c2a45Smiod# Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
1880007c2a45Smiod# it doesn't automatically accept command-line overrides of them.
1881007c2a45Smiod# This means it's not safe for target subdirs to share a cache file,
1882007c2a45Smiod# which is disgusting, but there you have it.  Hopefully this can be
1883007c2a45Smiod# fixed in future.  It's still worthwhile to use a cache file for each
1884007c2a45Smiod# directory.  I think.
1885007c2a45Smiod
1886c074d1c9Sdrahn# Pass the appropriate --host, --build, and --cache-file arguments.
1887007c2a45Smiodtarget_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}"
1888c074d1c9Sdrahn
1889b305b0f1Sespie# provide a proper gxx_include_dir.
1890b305b0f1Sespie# Note, if you change the default, make sure to fix both here and in
1891c074d1c9Sdrahn# the gcc and libstdc++-v3 subdirectories.
1892b305b0f1Sespie# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1893b305b0f1Sespiecase "${with_gxx_include_dir}" in
1894b305b0f1Sespie  yes)
1895c074d1c9Sdrahn    AC_MSG_ERROR([--with-gxx-include-dir=[[dir]] requires a directory])
1896b305b0f1Sespie    ;;
1897c074d1c9Sdrahn  no | "")
1898c074d1c9Sdrahn    case "${enable_version_specific_runtime_libs}" in
1899c074d1c9Sdrahn      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
1900b305b0f1Sespie      *)
1901c074d1c9Sdrahn        . ${srcdir}/config.if
1902c074d1c9Sdrahn        gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
1903c074d1c9Sdrahn    esac ;;
1904c074d1c9Sdrahn  *) gxx_include_dir=${with_gxx_include_dir} ;;
1905b305b0f1Sespieesac
1906b305b0f1Sespie
1907b55d4692SfgschFLAGS_FOR_TARGET=
1908c074d1c9Sdrahncase " $target_configdirs " in
1909c074d1c9Sdrahn *" newlib "*)
1910c074d1c9Sdrahn  case " $target_configargs " in
1911c074d1c9Sdrahn  *" --with-newlib "*)
1912b55d4692Sfgsch   case "$target" in
1913b55d4692Sfgsch   *-cygwin*)
1914007c2a45Smiod     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' ;;
1915b55d4692Sfgsch   esac
1916b55d4692Sfgsch
1917b55d4692Sfgsch   # If we're not building GCC, don't discard standard headers.
1918c074d1c9Sdrahn   if test -d ${srcdir}/gcc; then
1919b55d4692Sfgsch     FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
1920b55d4692Sfgsch
1921b55d4692Sfgsch     if test "${build}" != "${host}"; then
1922b55d4692Sfgsch       # On Canadian crosses, CC_FOR_TARGET will have already been set
1923b55d4692Sfgsch       # by `configure', so we won't have an opportunity to add -Bgcc/
1924b55d4692Sfgsch       # to it.  This is right: we don't want to search that directory
1925b55d4692Sfgsch       # for binaries, but we want the header files in there, so add
1926b55d4692Sfgsch       # them explicitly.
1927b55d4692Sfgsch       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
1928b55d4692Sfgsch
1929b55d4692Sfgsch       # Someone might think of using the pre-installed headers on
1930b55d4692Sfgsch       # Canadian crosses, in case the installed compiler is not fully
1931b55d4692Sfgsch       # compatible with the compiler being built.  In this case, it
1932b55d4692Sfgsch       # would be better to flag an error than risking having
1933b55d4692Sfgsch       # incompatible object files being constructed.  We can't
1934b55d4692Sfgsch       # guarantee that an error will be flagged, but let's hope the
1935b55d4692Sfgsch       # compiler will do it, when presented with incompatible header
1936b55d4692Sfgsch       # files.
1937b55d4692Sfgsch     fi
1938b55d4692Sfgsch   fi
1939b55d4692Sfgsch
1940c074d1c9Sdrahn   case "${target}-${is_cross_compiler}" in
1941007c2a45Smiod   i[[3456789]]86-*-linux*-no)
1942c074d1c9Sdrahn      # Here host == target, so we don't need to build gcc,
1943c074d1c9Sdrahn      # so we don't want to discard standard headers.
1944c074d1c9Sdrahn      FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
1945c074d1c9Sdrahn      ;;
1946c074d1c9Sdrahn   *)
1947b55d4692Sfgsch      # If we're building newlib, use its generic headers last, but search
1948b55d4692Sfgsch      # for any libc-related directories first (so make it the last -B
1949b55d4692Sfgsch      # switch).
1950b55d4692Sfgsch      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
1951b55d4692Sfgsch      ;;
1952b55d4692Sfgsch   esac
1953c074d1c9Sdrahn   ;;
1954c074d1c9Sdrahn  esac
1955c074d1c9Sdrahn  ;;
1956c074d1c9Sdrahnesac
1957b55d4692Sfgsch
1958007c2a45Smiod# Allow the user to override the flags for
1959007c2a45Smiod# our build compiler if desired.
1960007c2a45SmiodCFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
1961007c2a45Smiod
1962b55d4692Sfgsch# On Canadian crosses, we'll be searching the right directories for
1963b55d4692Sfgsch# the previously-installed cross compiler, so don't bother to add
1964b55d4692Sfgsch# flags for directories within the install tree of the compiler
1965b55d4692Sfgsch# being built; programs in there won't even run.
1966c074d1c9Sdrahnif test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
1967b55d4692Sfgsch  # Search for pre-installed headers if nothing else fits.
1968c074d1c9Sdrahn  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
1969b55d4692Sfgschfi
1970b55d4692Sfgsch
1971c074d1c9Sdrahnif test "x${use_gnu_ld}" = x &&
1972c074d1c9Sdrahn   echo " ${configdirs} " | grep " ld " > /dev/null ; then
1973b55d4692Sfgsch  # Arrange for us to find uninstalled linker scripts.
1974b55d4692Sfgsch  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
1975b55d4692Sfgschfi
1976b55d4692Sfgsch
1977b55d4692Sfgschif test "x${CC_FOR_TARGET+set}" = xset; then
1978b55d4692Sfgsch  :
1979c074d1c9Sdrahnelif test -d ${srcdir}/gcc; then
1980b55d4692Sfgsch  CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
1981b55d4692Sfgschelif test "$host" = "$target"; then
1982b55d4692Sfgsch  CC_FOR_TARGET='$(CC)'
1983b55d4692Sfgschelse
1984c074d1c9Sdrahn  CC_FOR_TARGET=`echo gcc | sed "${program_transform_name}"`
1985b55d4692Sfgschfi
1986c074d1c9SdrahnCC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1987b55d4692Sfgsch
1988c074d1c9Sdrahnif test "x${GCJ_FOR_TARGET+set}" = xset; then
1989b55d4692Sfgsch  :
1990c074d1c9Sdrahnelif test -d ${srcdir}/gcc; then
1991c074d1c9Sdrahn  GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
1992b55d4692Sfgschelif test "$host" = "$target"; then
1993c074d1c9Sdrahn  GCJ_FOR_TARGET='gcj'
1994b55d4692Sfgschelse
1995c074d1c9Sdrahn  GCJ_FOR_TARGET=`echo gcj | sed "${program_transform_name}"`
1996b55d4692Sfgschfi
1997c074d1c9SdrahnGCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
1998c074d1c9Sdrahn
1999c074d1c9Sdrahn# Don't use libstdc++-v3's flags to configure/build itself.
2000007c2a45Smiodlibstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
2001c074d1c9Sdrahnraw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
2002b55d4692Sfgsch
2003b55d4692Sfgschif test "x${CXX_FOR_TARGET+set}" = xset; then
2004007c2a45Smiod  if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then
2005007c2a45Smiod    RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
2006007c2a45Smiod  fi
2007c074d1c9Sdrahnelif test -d ${srcdir}/gcc; then
2008c074d1c9Sdrahn  # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
2009c074d1c9Sdrahn  # of g++ for linking C++ or Java, because g++ has -shared-libgcc by
2010c074d1c9Sdrahn  # default whereas gcc does not.
2011c074d1c9Sdrahn  # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for
2012c074d1c9Sdrahn  # all other cases.
2013b55d4692Sfgsch  CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
2014c074d1c9Sdrahn  RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags
2015b55d4692Sfgschelif test "$host" = "$target"; then
2016b55d4692Sfgsch  CXX_FOR_TARGET='$(CXX)'
2017c074d1c9Sdrahn  RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
2018b55d4692Sfgschelse
2019c074d1c9Sdrahn  CXX_FOR_TARGET=`echo c++ | sed "${program_transform_name}"`
2020c074d1c9Sdrahn  RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
2021b55d4692Sfgschfi
2022c074d1c9SdrahnCXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
2023c074d1c9SdrahnRAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
2024b55d4692Sfgsch
2025c074d1c9SdrahnqCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'`
2026c074d1c9SdrahnqRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'`
20272159047fSniklas
2028c074d1c9Sdrahn# We want to defer the evaluation of `cmd`s and shell variables in
2029c074d1c9Sdrahn# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
2030c074d1c9Sdrahn# bootstrap.  We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
2031c074d1c9Sdrahn# quotes, but we still have to duplicate `$'s so that shell variables
2032c074d1c9Sdrahn# can be expanded by the nested make as shell variables, not as make
2033c074d1c9Sdrahn# macros.
2034c074d1c9SdrahnqqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'`
2035c074d1c9SdrahnqqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'`
2036c074d1c9Sdrahn
2037c074d1c9Sdrahn# Wrap CC_FOR_TARGET and friends, for certain types of builds.
2038c074d1c9SdrahnCC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}"
2039c074d1c9SdrahnGCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}"
2040c074d1c9SdrahnCXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}"
2041c074d1c9SdrahnRAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}"
2042c074d1c9SdrahnCXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}"
2043c074d1c9SdrahnRAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}"
2044c074d1c9Sdrahn
2045c074d1c9Sdrahn# Makefile fragments.
2046c074d1c9Sdrahnhost_makefile_frag=${srcdir}/${host_makefile_frag}
2047c074d1c9Sdrahntarget_makefile_frag=${srcdir}/${target_makefile_frag}
2048c074d1c9Sdrahnalphaieee_frag=${srcdir}/${alphaieee_frag}
2049c074d1c9Sdrahnospace_frag=${srcdir}/${ospace_frag}
2050c074d1c9SdrahnAC_SUBST_FILE(host_makefile_frag)
2051c074d1c9SdrahnAC_SUBST_FILE(target_makefile_frag)
2052c074d1c9SdrahnAC_SUBST_FILE(alphaieee_frag)
2053c074d1c9SdrahnAC_SUBST_FILE(ospace_frag)
2054c074d1c9Sdrahn
2055c074d1c9Sdrahn# Miscellanea: directories, flags, etc.
2056c074d1c9SdrahnAC_SUBST(SET_LIB_PATH)
2057c074d1c9SdrahnAC_SUBST(RPATH_ENVVAR)
2058c074d1c9SdrahnAC_SUBST(BUILD_PREFIX)
2059c074d1c9SdrahnAC_SUBST(BUILD_PREFIX_1)
2060c074d1c9SdrahnAC_SUBST(configlinks)
2061c074d1c9SdrahnAC_SUBST(gcc_version_trigger)
2062c074d1c9SdrahnAC_SUBST(gcc_version)
2063c074d1c9SdrahnAC_SUBST(tooldir)
2064c074d1c9SdrahnAC_SUBST(build_tooldir)
2065c074d1c9SdrahnAC_SUBST(GDB_TK)
2066c074d1c9SdrahnAC_SUBST(gxx_include_dir)
2067c074d1c9SdrahnAC_SUBST(libstdcxx_incdir)
2068c074d1c9Sdrahn
2069c074d1c9Sdrahn# Build module lists & subconfigure args.
2070c074d1c9SdrahnAC_SUBST(build_configargs)
2071c074d1c9SdrahnAC_SUBST(configure_build_modules)
2072c074d1c9SdrahnAC_SUBST(all_build_modules)
2073c074d1c9Sdrahn
2074c074d1c9Sdrahn# Host module lists & subconfigure args.
2075c074d1c9SdrahnAC_SUBST(host_configargs)
2076c074d1c9SdrahnAC_SUBST(configdirs)
2077c074d1c9Sdrahn
2078c074d1c9Sdrahn# Target module lists & subconfigure args.
2079c074d1c9SdrahnAC_SUBST(target_configargs)
2080c074d1c9SdrahnAC_SUBST(target_configdirs)
2081c074d1c9Sdrahn
2082c074d1c9Sdrahn# Build tools.
2083c074d1c9SdrahnAC_SUBST(BISON)
2084c074d1c9SdrahnAC_SUBST(CC_FOR_BUILD)
2085c074d1c9SdrahnAC_SUBST(LEX)
2086c074d1c9SdrahnAC_SUBST(MAKEINFO)
2087c074d1c9SdrahnAC_SUBST(YACC)
2088c074d1c9SdrahnAC_SUBST(config_shell)
2089c074d1c9Sdrahn
2090c074d1c9Sdrahn# Host tools.
2091c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(AR, ar)
2092c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(AS, as)
2093c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(DLLTOOL, dlltool)
2094c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(LD, ld)
2095c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(NM, nm)
2096c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(RANLIB, ranlib, :)
2097c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(WINDRES, windres)
2098c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(OBJCOPY, objcopy)
2099c074d1c9SdrahnNCN_STRICT_CHECK_TOOL(OBJDUMP, objdump)
2100c074d1c9SdrahnAC_SUBST(CC)
2101c074d1c9SdrahnAC_SUBST(CXX)
2102c074d1c9SdrahnAC_SUBST(CFLAGS)
2103007c2a45SmiodAC_SUBST(CFLAGS_FOR_BUILD)
2104c074d1c9SdrahnAC_SUBST(CXXFLAGS)
2105c074d1c9SdrahnAC_SUBST(DEFAULT_YACC)
2106c074d1c9SdrahnAC_SUBST(DEFAULT_LEX)
2107c074d1c9SdrahnAC_SUBST(DEFAULT_M4)
2108c074d1c9Sdrahn
2109c074d1c9Sdrahn# Target tools.
2110c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(AR_FOR_TARGET, ar)
2111c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(AS_FOR_TARGET, as)
2112c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
2113c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(LD_FOR_TARGET, ld)
2114c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(NM_FOR_TARGET, nm)
2115c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :)
2116c074d1c9SdrahnNCN_STRICT_CHECK_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
2117c074d1c9Sdrahn
2118c074d1c9SdrahnAC_SUBST(GCC_FOR_TARGET)
2119c074d1c9SdrahnAC_SUBST(FLAGS_FOR_TARGET)
2120c074d1c9SdrahnAC_SUBST(CC_FOR_TARGET)
2121c074d1c9SdrahnAC_SUBST(GCJ_FOR_TARGET)
2122c074d1c9SdrahnAC_SUBST(CXX_FOR_TARGET)
2123c074d1c9SdrahnAC_SUBST(RAW_CXX_FOR_TARGET)
2124c074d1c9SdrahnAC_SUBST(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
2125c074d1c9SdrahnAC_SUBST(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
2126c074d1c9Sdrahn
2127c074d1c9Sdrahn# Fix up target tools.
2128c074d1c9Sdrahnif test "x${build}" = "x${host}" ; then
2129c074d1c9Sdrahn  # In this case, the newly built tools can and should be used,
2130c074d1c9Sdrahn  # so we override the results of the autoconf tests.
2131c074d1c9Sdrahn  # This should really only happen when the tools are actually being built,
2132c074d1c9Sdrahn  # but that's a further refinement.  The new build scheme, where
2133c074d1c9Sdrahn  # tools are built into a structure paralleling where they're installed,
2134c074d1c9Sdrahn  # should also eliminate all of this cleanly.
2135c074d1c9Sdrahn  AR_FOR_TARGET="\$(USUAL_AR_FOR_TARGET)"
2136c074d1c9Sdrahn  AS_FOR_TARGET="\$(USUAL_AS_FOR_TARGET)"
2137c074d1c9Sdrahn  DLLTOOL_FOR_TARGET="\$(USUAL_DLLTOOL_FOR_TARGET)"
2138c074d1c9Sdrahn  LD_FOR_TARGET="\$(USUAL_LD_FOR_TARGET)"
2139c074d1c9Sdrahn  NM_FOR_TARGET="\$(USUAL_NM_FOR_TARGET)"
2140c074d1c9Sdrahn  RANLIB_FOR_TARGET="\$(USUAL_RANLIB_FOR_TARGET)"
2141c074d1c9Sdrahn  WINDRES_FOR_TARGET="\$(USUAL_WINDRES_FOR_TARGET)"
2142c074d1c9Sdrahnfi
2143c074d1c9Sdrahn# Certain tools may need extra flags.
2144c074d1c9SdrahnAR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
2145c074d1c9SdrahnRANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
2146c074d1c9SdrahnNM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
2147c074d1c9Sdrahn
2148c074d1c9SdrahnAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2149c074d1c9SdrahnAC_ARG_ENABLE(maintainer-mode,
2150c074d1c9Sdrahn[  --enable-maintainer-mode enable make rules and dependencies not useful
2151c074d1c9Sdrahn                          (and sometimes confusing) to the casual installer],
2152c074d1c9Sdrahn      USE_MAINTAINER_MODE=$enableval,
2153c074d1c9Sdrahn      USE_MAINTAINER_MODE=no)
2154c074d1c9SdrahnAC_MSG_RESULT($USE_MAINTAINER_MODE)
2155c074d1c9SdrahnAC_SUBST(MAINTAINER_MODE_TRUE)
2156c074d1c9SdrahnAC_SUBST(MAINTAINER_MODE_FALSE)
2157c074d1c9Sdrahnif test "$USE_MAINTAINER_MODE" = yes; then
2158c074d1c9Sdrahn  MAINTAINER_MODE_TRUE=
2159c074d1c9Sdrahn  MAINTAINER_MODE_FALSE='#'
2160c074d1c9Sdrahnelse
2161c074d1c9Sdrahn  MAINTAINER_MODE_TRUE='#'
2162c074d1c9Sdrahn  MAINTAINER_MODE_FALSE=
2163c074d1c9Sdrahnfi
2164c074d1c9SdrahnMAINT=$MAINTAINER_MODE_TRUE
2165c074d1c9SdrahnAC_SUBST(MAINT)dnl
2166c074d1c9Sdrahn
2167c074d1c9SdrahnAC_OUTPUT(Makefile)
2168