Skip to content
Snippets Groups Projects
configure.ac 105 KiB
Newer Older
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
Douglas Rupp's avatar
Douglas Rupp committed
#   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Jason Merrill's avatar
Jason Merrill committed
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
Jason Merrill's avatar
Jason Merrill committed
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.
Jason Merrill's avatar
Jason Merrill committed

##############################################################################
### WARNING: this file contains embedded tabs.  Do not run untabify on this file.

m4_include(config/acx.m4)
m4_include(config/override.m4)
m4_include(config/proginstall.m4)
m4_include([libtool.m4])
m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
m4_include([config/isl.m4])
m4_include([config/cloog.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi

# Export original configure arguments for use by sub-configures.
# Quote arguments with shell meta charatcers.
TOPLEVEL_CONFIGURE_ARGUMENTS=
set -- "$progname" "$@"
for ac_arg
do
  case "$ac_arg" in
  *" "*|*"	"*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
    # if the argument is of the form -foo=baz, quote the baz part only
    ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;;
  *) ;;
  esac
  # Add the quoted argument to the list.
  TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
done
if test "$silent" = yes; then
  TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent"
fi
# Remove the initial space we just introduced and, as these will be
# expanded by make, quote '$'.
TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)

# Find the build, host, and target systems.
ACX_NONCANONICAL_BUILD
ACX_NONCANONICAL_HOST
ACX_NONCANONICAL_TARGET

dnl Autoconf 2.5x and later will set a default program prefix if
dnl --target was used, even if it was the same as --host.  Disable
dnl that behavior.  This must be done before AC_CANONICAL_SYSTEM
dnl to take effect.
test "$host_noncanonical" = "$target_noncanonical" &&
  test "$program_prefix$program_suffix$program_transform_name" = \
    NONENONEs,x,x, &&
  program_transform_name=s,y,y,

AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM

m4_pattern_allow([^AS_FOR_TARGET$])dnl
m4_pattern_allow([^AS_FOR_BUILD$])dnl
# Get 'install' or 'install-sh' and its variants.
AC_PROG_INSTALL
ACX_PROG_LN
AC_PROG_SED
AC_PROG_AWK
srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`

# We pass INSTALL explicitly to sub-makes.  Make sure that it is not
# a relative path.
if test "$INSTALL" = "${srcdir}/install-sh -c"; then
  INSTALL="${srcpwd}/install-sh -c"
fi

# Set srcdir to "." if that's what it is.
# This is important for multilib support.
pwd=`${PWDCMD-pwd}`
if test "${pwd}" = "${srcpwd}" ; then
  srcdir=.
fi

topsrcdir=$srcpwd
Jason Merrill's avatar
Jason Merrill committed

extra_host_args=
Jason Merrill's avatar
Jason Merrill committed
### To add a new directory to the tree, first choose whether it is a target
### or a host dependent tool.  Then put it into the appropriate list
### (library or tools, host or target), doing a dependency sort.

# Subdirs will be configured in the order listed in build_configdirs, 
# configdirs, or target_configdirs; see the serialization section below.

# Dependency sorting is only needed when *configuration* must be done in 
# a particular order.  In all cases a dependency should be specified in 
# the Makefile, whether or not it's implicitly specified here.
Jason Merrill's avatar
Jason Merrill committed

# Double entries in build_configdirs, configdirs, or target_configdirs may
# cause circular dependencies and break everything horribly.
Jason Merrill's avatar
Jason Merrill committed

# these library is used by various programs built for the build
# environment
#
build_libs="build-libiberty"

# these tools are built for the build environment
build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
Jason Merrill's avatar
Jason Merrill committed
# these libraries are used by various programs built for the host environment
Ian Lance Taylor's avatar
Ian Lance Taylor committed
host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv"
Jason Merrill's avatar
Jason Merrill committed

# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools"
# libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \
	target-zlib \
	target-libjava"

Jason Merrill's avatar
Jason Merrill committed
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
target_libraries="target-libgcc \
Ian Lance Taylor's avatar
Ian Lance Taylor committed
		target-libbacktrace \
		target-libgloss \
		target-newlib \
		target-libatomic \
		target-libitm \
		target-libsanitizer \
		target-libvtv \
		target-libssp \
		target-libgfortran \
		${libgcj} \
Arnaud Charlet's avatar
Arnaud Charlet committed
		target-libobjc \
		target-libada \
		target-libgo"
Jason Merrill's avatar
Jason Merrill committed

# these tools are built using the target libraries, and are intended to
# run only in the target environment
Jason Merrill's avatar
Jason Merrill committed
#
# note: any program that *uses* libraries that are in the "target_libraries"
# list belongs in this list.
Jason Merrill's avatar
Jason Merrill committed
#
target_tools="target-rda"
Jason Merrill's avatar
Jason Merrill committed

################################################################################

## All tools belong in one of the four categories, and are assigned above
## We assign ${configdirs} this way to remove all embedded newlines.  This
## is important because configure will choke if they ever get through.
## ${configdirs} is directories we build using the host tools.
## ${target_configdirs} is directories we build using the target tools.
configdirs=`echo ${host_libs} ${host_tools}`
target_configdirs=`echo ${target_libraries} ${target_tools}`
build_configdirs=`echo ${build_libs} ${build_tools}`
Nathanael Nerode's avatar
Nathanael Nerode committed

[case $srcdir in
  *" "*)
m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
    AC_MSG_ERROR([path to source, $srcdir, contains spaces])
m4_popdef([AS_MESSAGE_LOG_FD])dnl
    ;;
esac
ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
Jason Merrill's avatar
Jason Merrill committed
################################################################################

srcname="gnu development package"

# This gets set non-empty for some net releases of packages.
appdirs=""

# Define is_cross_compiler to save on calls to 'test'.
is_cross_compiler=
if test x"${host}" = x"${target}" ; then
  is_cross_compiler=no
else
  is_cross_compiler=yes
fi	

# Find the build and target subdir names.
Nathanael Nerode's avatar
Nathanael Nerode committed
GCC_TOPLEV_SUBDIRS
# Be sure to cover against remnants of an in-tree build.
if test $srcdir != .  && test -d $srcdir/host-${host_noncanonical}; then
  AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
Use a pristine source tree when building in a separate tree])
fi
# Skipdirs are removed silently.
skipdirs=
# Noconfigdirs are removed loudly.
noconfigdirs=""
Jason Merrill's avatar
Jason Merrill committed

use_gnu_ld=
# Make sure we don't let GNU ld be added if we didn't want it.
if test x$with_gnu_ld = xno ; then
  use_gnu_ld=no
  noconfigdirs="$noconfigdirs ld gold"
Jason Merrill's avatar
Jason Merrill committed
fi

use_gnu_as=
# Make sure we don't let GNU as be added if we didn't want it.
if test x$with_gnu_as = xno ; then
  use_gnu_as=no
  noconfigdirs="$noconfigdirs gas"
Jason Merrill's avatar
Jason Merrill committed
fi

use_included_zlib=
# Make sure we don't let ZLIB be added if we didn't want it.
if test x$with_system_zlib = xyes ; then
  use_included_zlib=no
  noconfigdirs="$noconfigdirs zlib"
fi

# some tools are so dependent upon X11 that if we're not building with X, 
# it's not even worth trying to configure, much less build, that tool.
Jason Merrill's avatar
Jason Merrill committed

case ${with_x} in
  yes | "") ;; # the default value for this tree is that X11 is available
    skipdirs="${skipdirs} tk itcl libgui"
    # We won't be able to build gdbtk without X.
    enable_gdbtk=no 
    ;;
  *)  echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
esac
Jason Merrill's avatar
Jason Merrill committed

# Some are only suitable for cross toolchains.
# Remove these if host=target.
cross_only="target-libgloss target-newlib target-opcodes"
Jason Merrill's avatar
Jason Merrill committed

case $is_cross_compiler in
  no) skipdirs="${skipdirs} ${cross_only}" ;;
esac
Jason Merrill's avatar
Jason Merrill committed

# If both --with-headers and --with-libs are specified, default to
# --without-newlib.
if test x"${with_headers}" != x && test x"${with_headers}" != xno \
   && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
  if test x"${with_newlib}" = x ; then
    with_newlib=no
  fi
fi

# Recognize --with-newlib/--without-newlib.
case ${with_newlib} in
  no) skipdirs="${skipdirs} target-newlib" ;;
  yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
esac

# Handle --enable-gold, --enable-ld.
# --disable-gold [--enable-ld]
#     Build only ld.  Default option.
H.J. Lu's avatar
H.J. Lu committed
# --enable-gold [--enable-ld]
#     Build both gold and ld.  Install gold as "ld.gold", install ld
#     as "ld.bfd" and "ld".
# --enable-gold=default [--enable-ld]
#     Build both gold and ld.  Install gold as "ld.gold" and "ld",
#     install ld as "ld.bfd".
# --enable-gold[=default] --disable-ld
#     Build only gold, which is then installed as both "ld.gold" and "ld".
# --enable-gold --enable-ld=default
H.J. Lu's avatar
H.J. Lu committed
#     Build both gold (installed as "ld.gold") and ld (installed as "ld"
#     and ld.bfd).
#     In other words, ld is default
# --enable-gold=default --enable-ld=default
#     Error.

default_ld=
AC_ARG_ENABLE(gold,
[AS_HELP_STRING([[--enable-gold[=ARG]]],
		[build gold @<:@ARG={default,yes,no}@:>@])],
ENABLE_GOLD=$enableval,
ENABLE_GOLD=no)
    # Check for ELF target.
    is_elf=no
    case "${target}" in
      *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
      | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
      | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
      | *-*-solaris2* | *-*-nto* | *-*-nacl*)
        case "${target}" in
          *-*-linux*aout* | *-*-linux*oldld*)
            ;;
          *)
            is_elf=yes
            ;;
        esac
    esac

    if test "$is_elf" = "yes"; then
      # Check for target supported by gold.
      case "${target}" in
        i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* | tilegx*-*-*)
	  configdirs="$configdirs gold"
	  if test x${ENABLE_GOLD} = xdefault; then
	    default_ld=gold
	  fi
[AS_HELP_STRING([[--enable-ld[=ARG]]],
		[build ld @<:@ARG={default,yes,no}@:>@])],
ENABLE_LD=$enableval,
ENABLE_LD=yes)

case "${ENABLE_LD}" in
  default)
H.J. Lu's avatar
H.J. Lu committed
    if test x${default_ld} != x; then
      AC_MSG_ERROR([either gold or ld can be the default ld])
    fi
    ;;
  yes)
    ;;
  no)
    if test x${ENABLE_GOLD} != xyes; then
      AC_MSG_WARN([neither ld nor gold are enabled])
    fi
    configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
    ;;
  *)
    AC_MSG_ERROR([invalid --enable-ld argument])
    ;;
esac
Jason Merrill's avatar
Jason Merrill committed
# Configure extra directories which are host specific

case "${host}" in
    configdirs="$configdirs libtermcap" ;;
Jason Merrill's avatar
Jason Merrill committed
esac

# A target can indicate whether a language isn't supported for some reason.
# Only spaces may be used in this macro; not newlines or tabs.
unsupported_languages=

Jason Merrill's avatar
Jason Merrill committed
# Remove more programs from consideration, based on the host or 
# target this usually means that a port of the program doesn't
# exist yet.

case "${host}" in
  i[[3456789]]86-*-msdosdjgpp*)
    noconfigdirs="$noconfigdirs tcl tk itcl"
Jason Merrill's avatar
Jason Merrill committed
esac

AC_ARG_ENABLE(libquadmath,
AS_HELP_STRING([--disable-libquadmath],
  [do not build libquadmath directory]),
ENABLE_LIBQUADMATH=$enableval,
ENABLE_LIBQUADMATH=yes)
if test "${ENABLE_LIBQUADMATH}" = "no" ; then
  noconfigdirs="$noconfigdirs target-libquadmath"
fi


AC_ARG_ENABLE(libquadmath-support,
AS_HELP_STRING([--disable-libquadmath-support],
  [disable libquadmath support for Fortran]),
ENABLE_LIBQUADMATH_SUPPORT=$enableval,
ENABLE_LIBQUADMATH_SUPPORT=yes)
enable_libquadmath_support=
if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
  enable_libquadmath_support=no
fi


Arnaud Charlet's avatar
Arnaud Charlet committed
AC_ARG_ENABLE(libada,
[AS_HELP_STRING([--enable-libada], [build libada directory])],
Arnaud Charlet's avatar
Arnaud Charlet committed
ENABLE_LIBADA=$enableval,
ENABLE_LIBADA=yes)
if test "${ENABLE_LIBADA}" != "yes" ; then
Nathanael Nerode's avatar
Nathanael Nerode committed
  noconfigdirs="$noconfigdirs gnattools"
[AS_HELP_STRING([--enable-libssp], [build libssp directory])],
ENABLE_LIBSSP=$enableval,
ENABLE_LIBSSP=yes)

AC_ARG_ENABLE(libstdcxx,
AS_HELP_STRING([--disable-libstdcxx],
  [do not build libstdc++-v3 directory]),
ENABLE_LIBSTDCXX=$enableval,
ENABLE_LIBSTDCXX=default)
[if test "${ENABLE_LIBSTDCXX}" = "no" ; then
  noconfigdirs="$noconfigdirs target-libstdc++-v3"
# Save it here so that, even in case of --enable-libgcj, if the Java
# front-end isn't enabled, we still get libgcj disabled.
libgcj_saved=$libgcj
case $enable_libgcj in
yes)
  # If we reset it here, it won't get added to noconfigdirs in the
  # target-specific build rules, so it will be forcibly enabled
  # (unless the Java language itself isn't enabled).
  libgcj=
  ;;
no)
  # Make sure we get it printed in the list of not supported target libs.
  # Don't disable libffi, though, other languages use it.
  noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
  # Clear libgcj_saved so that even if java is enabled libffi won't be
  # built.
  libgcj_saved=
AC_ARG_ENABLE(static-libjava,
[AS_HELP_STRING([[--enable-static-libjava[=ARG]]],
		[build static libjava @<:@default=no@:>@])],
ENABLE_STATIC_LIBJAVA=$enableval,
ENABLE_STATIC_LIBJAVA=no)
enable_static_libjava=
if test "${ENABLE_STATIC_LIBJAVA}" = "yes" ; then
  enable_static_libjava=yes
fi

if test x$enable_static_libjava != xyes ; then
  EXTRA_CONFIGARGS_LIBJAVA=--disable-static
fi
AC_SUBST(EXTRA_CONFIGARGS_LIBJAVA)
# Disable libgomp on non POSIX hosted systems.
if test x$enable_libgomp = x ; then
Diego Novillo's avatar
Diego Novillo committed
    # Enable libgomp by default on hosted POSIX systems.
    case "${target}" in
    *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
Diego Novillo's avatar
Diego Novillo committed
	;;
    *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
Diego Novillo's avatar
Diego Novillo committed
	;;
    *-*-solaris2* | *-*-hpux11*)
Diego Novillo's avatar
Diego Novillo committed
	;;
    *-*-darwin* | *-*-aix*)
Diego Novillo's avatar
Diego Novillo committed
	;;
    *)
	noconfigdirs="$noconfigdirs target-libgomp"
	;;
    esac
Diego Novillo's avatar
Diego Novillo committed

# Disable libatomic on unsupported systems.
if test -d ${srcdir}/libatomic; then
    if test x$enable_libatomic = x; then
	AC_MSG_CHECKING([for libatomic support])
	if (srcdir=${srcdir}/libatomic; \
		. ${srcdir}/configure.tgt; \
		test -n "$UNSUPPORTED")
	then
	    AC_MSG_RESULT([no])
	    noconfigdirs="$noconfigdirs target-libatomic"
	else
	    AC_MSG_RESULT([yes])
	fi
    fi
fi

# Disable libcilkrts on unsupported systems.
if test -d ${srcdir}/libcilkrts; then
    if test x$enable_libcilkrts = x; then
	AC_MSG_CHECKING([for libcilkrts support])
	if (srcdir=${srcdir}/libcilkrts; \
		. ${srcdir}/configure.tgt; \
		test -n "$UNSUPPORTED")
	then
	    AC_MSG_RESULT([no])
	    noconfigdirs="$noconfigdirs target-libcilkrts"
	else
	    AC_MSG_RESULT([yes])
	fi
    fi
fi

# Disable libitm on unsupported systems.
if test -d ${srcdir}/libitm; then
    if test x$enable_libitm = x; then
	AC_MSG_CHECKING([for libitm support])
	if (srcdir=${srcdir}/libitm; \
		. ${srcdir}/configure.tgt; \
		test -n "$UNSUPPORTED")
	then
	    AC_MSG_RESULT([no])
	    noconfigdirs="$noconfigdirs target-libitm"
	else
	    AC_MSG_RESULT([yes])
	fi
    fi
# Disable libsanitizer on unsupported systems.
if test -d ${srcdir}/libsanitizer; then
    if test x$enable_libsanitizer = x; then
	AC_MSG_CHECKING([for libsanitizer support])
	if (srcdir=${srcdir}/libsanitizer; \
		. ${srcdir}/configure.tgt; \
		test -n "$UNSUPPORTED")
	then
	    AC_MSG_RESULT([no])
	    noconfigdirs="$noconfigdirs target-libsanitizer"
	else
	    AC_MSG_RESULT([yes])
	fi
    fi
fi

# Disable libvtv on unsupported systems.
if test -d ${srcdir}/libvtv; then
    if test x$enable_libvtv = x; then
	AC_MSG_CHECKING([for libvtv support])
	if (srcdir=${srcdir}/libvtv; \
		. ${srcdir}/configure.tgt; \
		test "$VTV_SUPPORTED" != "yes")
	then
	    AC_MSG_RESULT([no])
	    noconfigdirs="$noconfigdirs target-libvtv"
	else
	    AC_MSG_RESULT([yes])
	fi
    fi
fi

# Disable libquadmath for some systems.
case "${target}" in
  avr-*-*)
    noconfigdirs="$noconfigdirs target-libquadmath"
    ;;
  # libquadmath is unused on AIX and libquadmath build process use of
  # LD_LIBRARY_PATH can break AIX bootstrap.
  powerpc-*-aix* | rs6000-*-aix*)
    noconfigdirs="$noconfigdirs target-libquadmath"
    ;;
esac

# Disable libssp for some systems.
case "${target}" in
  avr-*-*)
    noconfigdirs="$noconfigdirs target-libssp"
    ;;
  powerpc-*-aix* | rs6000-*-aix*)
    noconfigdirs="$noconfigdirs target-libssp"
    ;;
DJ Delorie's avatar
.  
DJ Delorie committed
  rl78-*-*)
    # libssp uses a misaligned load to trigger a fault, but the RL78
    # doesn't fault for those - instead, it gives a build-time error
    # for explicit misaligned loads.
    noconfigdirs="$noconfigdirs target-libssp"
    ;;
esac

# Disable libstdc++-v3 for some systems.
# Allow user to override this if they pass --enable-libstdc++-v3
if test "${ENABLE_LIBSTDCXX}" = "default" ; then
  case "${target}" in
    *-*-vxworks*)
      # VxWorks uses the Dinkumware C++ library.
      noconfigdirs="$noconfigdirs target-libstdc++-v3"
      ;;
    arm*-wince-pe*)
      # the C++ libraries don't build on top of CE's C libraries
      noconfigdirs="$noconfigdirs target-libstdc++-v3"
      ;;
    avr-*-*)
      noconfigdirs="$noconfigdirs target-libstdc++-v3"
      ;;
  esac
fi

# Disable Fortran for some systems.
case "${target}" in
  mmix-*-*)
    # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
    unsupported_languages="$unsupported_languages fortran"
    ;;
esac

# Disable Java if libffi is not supported.
Andreas Schwab's avatar
Andreas Schwab committed
  aarch64-*-*)
    ;;
  alpha*-*-*)
    ;;
  arm*-*-*)
    ;;
  cris-*-*)
    ;;
  frv-*-*)
    ;;
  hppa*-*-linux*)
    ;;
  hppa*-*-hpux*)
    ;;
  i?86-*-*)
    ;;
  ia64*-*-*)
    ;;
  m32r*-*-*)
    ;;
  m68k-*-*)
    ;;
  mips*-*-rtems*)
    ;;
  mips*-*-linux*)
    ;;
  powerpc*-*-linux*)
    ;;
  powerpc-*-darwin*)
    ;;
  powerpc-*-aix* | rs6000-*-aix*)
    ;;
  powerpc-*-freebsd*)
    ;;
  powerpc64-*-freebsd*)
    ;;
  powerpc*-*-rtems*)
  s390-*-* | s390x-*-*)
    ;;
  sh-*-* | sh[[34]]*-*-*)
    ;;
  sh64-*-* | sh5*-*-*)
    ;;
  sparc*-*-*)
    ;;
  x86_64-*-*)
    ;;
  *-*-*)
    unsupported_languages="$unsupported_languages java"
    ;;
esac

# Disable Java, libgcj or related libraries for some systems.
case "${target}" in
  powerpc-*-darwin*)
    ;;
  i[[3456789]]86-*-darwin*)
    ;;
  x86_64-*-darwin[[912]]*)
    ;;
  *-*-darwin*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  *-*-netware*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  *-*-rtems*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  *-*-tpf*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  *-*-uclinux*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  *-*-vxworks*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  alpha*-*-*vms*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  arm*-*-symbianelf*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  bfin-*-*)
    noconfigdirs="$noconfigdirs target-boehm-gc"
    ;;
  cris-*-* | crisv32-*-*)
    unsupported_languages="$unsupported_languages java"
    case "${target}" in
      *-*-linux*)
	;;
      *) # See PR46792 regarding target-libffi.
	noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
    esac
    ;;
  hppa*64*-*-linux*)
    # In this case, it's because the hppa64-linux target is for
    # the kernel only at this point and has no libc, and thus no
    # headers, crt*.o, etc., all of which are needed by these.
    unsupported_languages="$unsupported_languages java"
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  hppa*-hp-hpux11*)
    ;;
    # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
    # build on HP-UX 10.20.
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  ia64*-*-*vms*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  i[[3456789]]86-w64-mingw*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  i[[3456789]]86-*-mingw*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  x86_64-*-mingw*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  mmix-*-*)
    noconfigdirs="$noconfigdirs target-libffi target-boehm-gc"
    ;;
  powerpc-*-aix*)
    # copied from rs6000-*-* entry
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  rs6000-*-aix*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;;
  *-*-lynxos*)
    noconfigdirs="$noconfigdirs ${libgcj}"
    ;; 
esac

# Disable libgo for some systems where it is known to not work.
# For testing, you can easily override this with --enable-libgo.
if test x$enable_libgo = x; then
    case "${target}" in
    *-*-darwin*)
	# PR 46986
	noconfigdirs="$noconfigdirs target-libgo"
	;;
    *-*-cygwin* | *-*-mingw*)
	noconfigdirs="$noconfigdirs target-libgo"
	;;
    *-*-aix*)
	noconfigdirs="$noconfigdirs target-libgo"
	;;
    esac
fi

# Default libgloss CPU subdirectory.
libgloss_dir="$target_cpu"
case "${target}" in
  sh*-*-pe|mips*-*-pe|*arm-wince-pe)
    libgloss_dir=wince
    ;;
  aarch64*-*-* )
    libgloss_dir=aarch64
    ;;
  arm*-*-*)
    libgloss_dir=arm
    ;;
  cris-*-* | crisv32-*-*)
    libgloss_dir=cris
    ;;
  hppa*-*-*)
    libgloss_dir=pa
    ;;
  i[[3456789]]86-*-*)
    libgloss_dir=i386
    ;;
  m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
    libgloss_dir=m68hc11
    ;;
  m68*-*-* | fido-*-*)
    libgloss_dir=m68k
    ;;
  mips*-*-*)
    libgloss_dir=mips
    ;;
  powerpc*-*-*)
    libgloss_dir=rs6000
    ;;
  sparc*-*-*)
    libgloss_dir=sparc
    ;;
esac

# Disable newlib and libgloss for various target OSes.
Jason Merrill's avatar
Jason Merrill committed
case "${target}" in
  alpha*-dec-osf*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  i[[3456789]]86-*-linux*)
    # This section makes it possible to build newlib natively on linux.
    # If we are using a cross compiler then don't configure newlib.
    if test x${is_cross_compiler} != xno ; then
      noconfigdirs="$noconfigdirs target-newlib"
    fi
    noconfigdirs="$noconfigdirs target-libgloss"
    # If we are not using a cross compiler, do configure newlib.
    # Note however, that newlib will only be configured in this situation
    # if the --with-newlib option has been given, because otherwise
    # 'target-newlib' will appear in skipdirs.
    ;;
  i[[3456789]]86-*-rdos*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  sh*-*-pe|mips*-*-pe|arm-wince-pe)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  sparc-*-sunos4*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-aix*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-beos*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  *-*-dragonfly*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-freebsd*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-lynxos*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;; 
  *-*-mingw*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-netbsd*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-netware*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-tpf*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-uclinux*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
  *-*-vxworks*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    ;;
esac

case "${target}" in
  *-*-chorusos)
    ;;
    noconfigdirs="$noconfigdirs ld gas gdb gprof"
    noconfigdirs="$noconfigdirs sim target-rda"
  i[[3456789]]86-*-darwin*)
    noconfigdirs="$noconfigdirs ld gprof"
    noconfigdirs="$noconfigdirs sim target-rda"
    ;;
  x86_64-*-darwin[[912]]*)
    noconfigdirs="$noconfigdirs ld gas gprof"
    noconfigdirs="$noconfigdirs sim target-rda"
    ;;
  *-*-darwin*)
    noconfigdirs="$noconfigdirs ld gas gdb gprof"
    noconfigdirs="$noconfigdirs sim target-rda"
    ;;
    if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
	&& test -f /usr/local/include/gmp.h; then
      with_gmp=/usr/local
    fi
    ;;
  *-*-kaos*)
    # Remove unsupported stuff on all kaOS configurations.
    noconfigdirs="$noconfigdirs target-libgloss"
    ;;
  *-*-netbsd*)
    ;;
Jason Merrill's avatar
Jason Merrill committed
    ;;
    # The tpf target doesn't support gdb yet.
  *-*-tpf*)
    noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
    noconfigdirs="$noconfigdirs target-rda"
Jason Merrill's avatar
Jason Merrill committed
  *-*-vxworks*)
    ;;
Richard Henderson's avatar
Richard Henderson committed
  alpha*-dec-osf*)
    # ld works, but does not support shared libraries.
Jason Merrill's avatar
Jason Merrill committed
    # gas doesn't generate exception information.
    noconfigdirs="$noconfigdirs gas ld"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  alpha*-*-*vms*)
    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  alpha*-*-*)
    # newlib is not 64 bit ready
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  sh*-*-pe|mips*-*-pe|*arm-wince-pe)
    noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
  arc-*-*|arceb-*-*)
    noconfigdirs="$noconfigdirs target-libgloss"
Jason Merrill's avatar
Jason Merrill committed
    ;;
Jason Merrill's avatar
Jason Merrill committed
  arm-*-pe*)
Jason Merrill's avatar
Jason Merrill committed
    ;;
  arm-*-riscix*)
    noconfigdirs="$noconfigdirs ld target-libgloss"
  avr-*-rtems*)
    ;;
  avr-*-*)
    if test x${with_avrlibc} != xno; then
      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
    fi
    ;;
  c4x-*-* | tic4x-*-*)
    noconfigdirs="$noconfigdirs target-libgloss"
  tic54x-*-*)
    noconfigdirs="$noconfigdirs target-libgloss gdb"
Jason Merrill's avatar
Jason Merrill committed
  d10v-*-*)
    noconfigdirs="$noconfigdirs target-libgloss"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  d30v-*-*)
    noconfigdirs="$noconfigdirs gdb"
Jason Merrill's avatar
Jason Merrill committed
    ;;
Nick Clifton's avatar
Nick Clifton committed
  fr30-*-elf*)
Nick Clifton's avatar
Nick Clifton committed
    ;;
  moxie-*-*)
    noconfigdirs="$noconfigdirs gprof"
    ;;
  h8300*-*-*)
Jason Merrill's avatar
Jason Merrill committed
  h8500-*-*)
    noconfigdirs="$noconfigdirs target-libgloss"
Jason Merrill's avatar
Jason Merrill committed
    ;;