Skip to content
Snippets Groups Projects
configure.in 55.4 KiB
Newer Older
    ;;
  sparc64-*-elf*)
    if test x${is_cross_compiler} != xno ; then
	   target_configdirs="${target_configdirs} target-libstub target-cygmon"
    fi
    noconfigdirs="$noconfigdirs ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
  sparclite-*-*)
    if test x${is_cross_compiler} != xno ; then
Jason Merrill's avatar
Jason Merrill committed
	   target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
Jason Merrill's avatar
Jason Merrill committed
  sparc-*-sunos4*)
    if test x${is_cross_compiler} != xno ; then
Jason Merrill's avatar
Jason Merrill committed
           noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
    else
           use_gnu_ld=no
    fi
    ;;
  sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
Jason Merrill's avatar
Jason Merrill committed
  v810-*-*)
    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  v850-*-*)
    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
  v850e-*-*)
    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  v850ea-*-*)
    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
    ;;
Jason Merrill's avatar
Jason Merrill committed
  vax-*-vms)
    noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  vax-*-*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
    ;;
  *-*-lynxos*)
    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
Jason Merrill's avatar
Jason Merrill committed
    ;; 
  *-*-macos* | \
  *-*-mpw*)
    # Macs want a resource compiler.
    configdirs="$configdirs grez"
Jason Merrill's avatar
Jason Merrill committed
    ;;    
Jason Merrill's avatar
Jason Merrill committed
esac

# If we aren't building newlib, then don't build libgloss, since libgloss
# depends upon some newlib header files.
case "${noconfigdirs}" in
  *target-libgloss*) ;;
  *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
esac

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

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

# Figure out what language subdirectories are present.
# Look if the user specified --enable-languages="..."; if not, use
# the environment variable $LANGUAGES if defined. $LANGUAGES might
# go away some day.
# NB:  embedded tabs in this IF block -- do not untabify
if test x"${enable_languages+set}" != xset; then
	if test x"${LANGUAGES+set}" = xset; then
		enable_languages="${LANGUAGES}"
		echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
	if test x"${enable_languages}" = x ||
	   test x"${enable_languages}" = xyes;
	then
		echo configure.in: --enable-languages needs at least one language argument 1>&2
enable_languages=`echo "${enable_languages}" | sed -e 's/[ 	,][ 	,]*/,/g' -e 's/,$//'`

# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
   case $lang in
    ..)
       ;;
    # The odd quoting in the next line works around
    # an apparent bug in bash 1.12 on linux.
    ${srcdir}/gcc/[*]/config-lang.in)
       ;;
    *)
       lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ 	]*\).*$,\1,p' $lang`
       this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ 	]*\).*$,\1,p' $lang`
       for other in $this_lang_requires
       do
	  case ,${enable_languages}, in
	   *,$other,*)
	      ;;
	   *,all,*)
	      ;;
	      echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
	      enable_languages="$enable_languages,$other"
	      ;;
	  esac
       done
       ;;
   esac
done

subdirs=
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
	case $lang in
	..) ;;
	# The odd quoting in the next line works around
	# an apparent bug in bash 1.12 on linux.
	${srcdir}/gcc/[*]/config-lang.in) ;;
	*)
	  lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ 	]*\).*$,\1,p' $lang`
	  this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ 	]*\).*$,\1,p' $lang`
	  this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ 	]*\).*$,\1,p' $lang`
	  build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ 	]*\).*$,\1,p' $lang`
	  if test "x$lang_alias" = x
	  then
		echo "$lang doesn't set \$language." 1>&2
		exit 1
	  fi
	  case ${build_by_default},${enable_languages}, in
	  *,$lang_alias,*) add_this_lang=yes ;;
	  no,*) add_this_lang=no ;;
	  *,all,*) add_this_lang=yes ;;
	  *) add_this_lang=no ;;
	  esac
	  if test x"${add_this_lang}" = xyes; then
	      eval target_libs='"$target_libs "'\"$this_lang_libs\"
	  else
	      eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
Jason Merrill's avatar
Jason Merrill committed
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
# $target_configdirs.
# If we have the source for $noconfigdirs entries, add them to $notsupp.

notsupp=""
for dir in . $skipdirs $noconfigdirs ; do
  dirname=`echo $dir | sed -e s/target-//g`
  if test $dir != .  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
Jason Merrill's avatar
Jason Merrill committed
    configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
    if test -r $srcdir/$dirname/configure \
	|| test -r $srcdir/$dirname/configure.in ; then
Jason Merrill's avatar
Jason Merrill committed
      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
	true
      else
	notsupp="$notsupp $dir"
      fi
    fi
  fi
  if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
Jason Merrill's avatar
Jason Merrill committed
    target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
    if test -r $srcdir/$dirname/configure \
	|| test -r $srcdir/$dirname/configure.in ; then
Jason Merrill's avatar
Jason Merrill committed
      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
	true
      else
	notsupp="$notsupp $dir"
      fi
    fi
  fi
done

# Sometimes the tools are distributed with libiberty but with no other
# libraries.  In that case, we don't want to build target-libiberty.
if test -n "${target_configdirs}" ; then
Jason Merrill's avatar
Jason Merrill committed
  others=
  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
    if test "$i" != "libiberty" ; then
      if test -r $srcdir/$i/configure || test -r $srcdir/$i/configure.in ; then
Jason Merrill's avatar
Jason Merrill committed
	others=yes;
	break;
      fi
    fi
  done
  if test -z "${others}" ; then
Jason Merrill's avatar
Jason Merrill committed
    target_configdirs=
  fi
fi

# Deconfigure all subdirectories, in case we are changing the
# configuration from one where a subdirectory is supported to one where it
# is not.
if test -z "${norecursion}" && test -n "${configdirs}" ; then
Jason Merrill's avatar
Jason Merrill committed
  for i in `echo ${configdirs} | sed -e s/target-//g` ; do
    rm -f $i/Makefile
  done
fi
if test -z "${norecursion}" && test -n "${target_configdirs}" ; then
Jason Merrill's avatar
Jason Merrill committed
  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
    rm -f ${target_subdir}/$i/Makefile
  done
fi

# Quietly strip out all directories which aren't configurable in this tree.
# This relies on all configurable subdirectories being autoconfiscated, which
# is now the case.
configdirs_all="$configdirs"
configdirs=
for i in ${configdirs_all} ; do
  if test -f ${srcdir}/$i/configure ; then
    configdirs="${configdirs} $i"
  fi
done
target_configdirs_all="$target_configdirs"
target_configdirs=
for i in ${target_configdirs_all} ; do
  j=`echo $i | sed -e s/target-//g` 
  if test -f ${srcdir}/$j/configure ; then
    target_configdirs="${target_configdirs} $i"
  fi
done

Jason Merrill's avatar
Jason Merrill committed
# Produce a warning message for the subdirs we can't configure.
# This isn't especially interesting in the Cygnus tree, but in the individual
# FSF releases, it's important to let people know when their machine isn't
# supported by the one or two programs in a package.

if test -n "${notsupp}" && test -z "${norecursion}" ; then
Jason Merrill's avatar
Jason Merrill committed
  # If $appdirs is non-empty, at least one of those directories must still
  # be configured, or we error out.  (E.g., if the gas release supports a
  # specified target in some subdirs but not the gas subdir, we shouldn't
  # pretend that all is well.)
  if test -n "$appdirs" ; then
Jason Merrill's avatar
Jason Merrill committed
    for dir in $appdirs ; do
      if test -r $dir/Makefile.in ; then
Jason Merrill's avatar
Jason Merrill committed
	if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
	  appdirs=""
	  break
	fi
	if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
	  appdirs=""
	  break
	fi
      fi
    done
    if test -n "$appdirs" ; then
Jason Merrill's avatar
Jason Merrill committed
      echo "*** This configuration is not supported by this package." 1>&2
      exit 1
    fi
  fi
  # Okay, some application will build, or we don't care to check.  Still
  # notify of subdirs not getting built.
  echo "*** This configuration is not supported in the following subdirectories:" 1>&2
  echo "    ${notsupp}" 1>&2
  echo "    (Any other directories should still work fine.)" 1>&2
fi

# Set with_gnu_as and with_gnu_ld as appropriate.
#
# This is done by determining whether or not the appropriate directory
# is available, and by checking whether or not specific configurations
# have requested that this magic not happen.
# 
# The command line options always override the explicit settings in 
# configure.in, and the settings in configure.in override this magic.
#
# If the default for a toolchain is to use GNU as and ld, and you don't 
# want to do that, then you should use the --without-gnu-as and
# --without-gnu-ld options for the configure script.

if test x${use_gnu_as} = x ; then
  if test x${with_gnu_as} != xno && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && test -d ${srcdir}/${gasdir} ; then
Jason Merrill's avatar
Jason Merrill committed
    with_gnu_as=yes
    withoptions="$withoptions --with-gnu-as"
  fi
fi

if test x${use_gnu_ld} = x ; then
  if test x${with_gnu_ld} != xno && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && test -d ${srcdir}/ld ; then
Jason Merrill's avatar
Jason Merrill committed
    with_gnu_ld=yes
    withoptions="$withoptions --with-gnu-ld"
  fi
fi

# If using newlib, add --with-newlib to the withoptions so that gcc/configure
# can detect this case.

if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
Jason Merrill's avatar
Jason Merrill committed
  with_newlib=yes
  withoptions="$withoptions --with-newlib"
fi

if test -n "${target_makefile_frag}" ; then
  for f in ${target_makefile_frag}
  do
    cat ${srcdir}/$f >> mt-frag
  done
  target_makefile_frag=mt-frag
fi

case "$host" in
  *msdosdjgpp*)
    enable_gdbtk=no ;;
esac
# Determine whether gdb needs tk/tcl or not.
case "$enable_gdbtk" in
  no)
    GDB_TK="" ;;
  *)
    GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui" ;;
esac

Jason Merrill's avatar
Jason Merrill committed
# post-target:

# Make sure that the compiler is able to generate an executable.  If it
# can't, we are probably in trouble.  We don't care whether we can run the
# executable--we might be using a cross compiler--we only care whether it
# can be created.  At this point the main configure script has set CC.
Jason Merrill's avatar
Jason Merrill committed
echo "int main () { return 0; }" > conftest.c
${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
if test $? = 0 ; then
  if test -s conftest || test -s conftest.exe ; then
    we_are_ok=yes
  fi
fi 
case $we_are_ok in
  no)
    echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
    echo 1>&2 "*** You must set the environment variable CC to a working compiler."
    rm -f conftest*
    exit 1
    ;;
esac
Jason Merrill's avatar
Jason Merrill committed
rm -f conftest*

# The Solaris /usr/ucb/cc compiler does not appear to work.
case "${host}" in
  sparc-sun-solaris2*)
      CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
      if test "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ; then
Jason Merrill's avatar
Jason Merrill committed
          could_use=
          test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin"
          if test -d /opt/cygnus/bin ; then
              if test "$could_use" = "" ; then
Jason Merrill's avatar
Jason Merrill committed
                  could_use="/opt/cygnus/bin"
              else
                  could_use="$could_use or /opt/cygnus/bin"
              fi
          fi
        if test "$could_use" = "" ; then
Jason Merrill's avatar
Jason Merrill committed
            echo "Warning: compilation may fail because you're using"
            echo "/usr/ucb/cc.  You should change your PATH or CC "
            echo "variable and rerun configure."
        else
            echo "Warning: compilation may fail because you're using"
            echo "/usr/ucb/cc, when you should use the C compiler from"
            echo "$could_use.  You should change your"
            echo "PATH or CC variable and rerun configure."
        fi
      fi
  ;;
esac

# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
# binutils tools will find libbfd.so.
if test "${shared}" = "yes" ; then
Jason Merrill's avatar
Jason Merrill committed
  sed -e 's/^SET_LIB_PATH[ 	]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
      Makefile > Makefile.tem
  rm -f Makefile
  mv -f Makefile.tem Makefile

  case "${host}" in
  *-*-hpux*)
    sed -e 's/^RPATH_ENVVAR[ 	]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
Jason Merrill's avatar
Jason Merrill committed
	Makefile > Makefile.tem
    rm -f Makefile
    mv -f Makefile.tem Makefile
    ;;
  esac
fi

# Base args.  Strip norecursion, cache-file, srcdir, host, build, target.
# These are the ones we might not want to pass down to subconfigures.
baseargs=`echo "${arguments}" | \
	sed -e 's/--no[^ 	]*//' \
Jason Merrill's avatar
Jason Merrill committed
	    -e 's/--cache[a-z-]*=[^ 	]*//' \
Jason Merrill's avatar
Jason Merrill committed
	    -e 's/--ho[a-z-]*=[^ 	]*//' \
	    -e 's/--bu[a-z-]*=[^ 	]*//' \
	    -e 's/--ta[a-z-]*=[^ 	]*//'`

Zack Weinberg's avatar
Zack Weinberg committed
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file.  Multilibs are neither needed nor
# desired.
buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}"

# Record target_configdirs and the configure arguments for target and
# build configuration in Makefile.
target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
targargs=${baseargs}
Zack Weinberg's avatar
Zack Weinberg committed

Jason Merrill's avatar
Jason Merrill committed
# Passing a --with-cross-host argument lets the target libraries know
# whether they are being built with a cross-compiler or being built
# native.  However, it would be better to use other mechanisms to make the
# sorts of decisions they want to make on this basis.  Please consider
# this option to be deprecated.  FIXME.
if test x${is_cross_compiler} = xyes ; then
Jason Merrill's avatar
Jason Merrill committed
  targargs="--with-cross-host=${host_alias} ${targargs}"
fi

# Default to --enable-multilib.
if test x${enable_multilib} = x ; then
Jason Merrill's avatar
Jason Merrill committed
  targargs="--enable-multilib ${targargs}"
fi

# Pass --with-newlib if appropriate.  Note that target_configdirs has
# changed from the earlier setting of with_newlib.
if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
  targargs="--with-newlib ${targargs}"
fi

Zack Weinberg's avatar
Zack Weinberg committed
# Pass the appropriate --host, --build, and --cache-file arguments.
targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"

# provide a proper gxx_include_dir.
# Note, if you change the default, make sure to fix both here and in
# the gcc and libstdc++-v3 subdirectories.
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
gxx_include_dir=
if test -n "${with_gxx_include_dir}"; then
  case "${with_gxx_include_dir}" in
    yes )
      echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
      exit 1
      ;;
    no )
      ;;
    * )
      gxx_include_dir=${with_gxx_include_dir}
      ;;
  esac
fi
if test x${gxx_include_dir} = x; then
  if test x${enable_version_specific_runtime_libs} = xyes; then
    gxx_include_dir='${libsubdir}/include/g++'
  else
    . ${topsrcdir}/config.if
    gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
  fi
else
  gxx_include_dir=${gxx_include_dir}
fi

FLAGS_FOR_TARGET=
case " $skipdirs " in
*" target-newlib "*) ;;
*)
 case " $target_configdirs " in
 *" newlib "*)
  case " $targargs " in
  *" --with-newlib "*)
   case "$target" in
     FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;;
   esac

   # If we're not building GCC, don't discard standard headers.
   if test -d ${topsrcdir}/gcc; then
     FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'

     if test "${build}" != "${host}"; then
       # On Canadian crosses, CC_FOR_TARGET will have already been set
       # by `configure', so we won't have an opportunity to add -Bgcc/
       # to it.  This is right: we don't want to search that directory
       # for binaries, but we want the header files in there, so add
       # them explicitly.
       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'

       # Someone might think of using the pre-installed headers on
       # Canadian crosses, in case the installed compiler is not fully
       # compatible with the compiler being built.  In this case, it
       # would be better to flag an error than risking having
       # incompatible object files being constructed.  We can't
       # guarantee that an error will be flagged, but let's hope the
       # compiler will do it, when presented with incompatible header
       # files.
     fi
   case "${target}-${is_cross_compiler}" in
      # Here host == target, so we don't need to build gcc,
      # so we don't want to discard standard headers.
      FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
      ;;
   *)
      # If we're building newlib, use its generic headers last, but search
      # for any libc-related directories first (so make it the last -B
      # switch).
      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
      ;;
   esac

# On Canadian crosses, we'll be searching the right directories for
# the previously-installed cross compiler, so don't bother to add
# flags for directories within the install tree of the compiler
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${topsrcdir}/gcc; then
  # Search for pre-installed headers if nothing else fits.
  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
fi
if test "x${use_gnu_ld}" = x && test "x${with_gnu_ld}" != xno &&
   echo " ${configdirs} " | grep " ld " > /dev/null &&
   test -d ${srcdir}/ld; then
  # Arrange for us to find uninstalled linker scripts.
  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
fi

if test "x${CC_FOR_TARGET+set}" = xset; then
  :
elif test -d ${topsrcdir}/gcc; then
  CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
elif test "$host" = "$target"; then
  CC_FOR_TARGET='$(CC)'
else
  CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
fi
# On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
# if Makefile exists.  Prevent $(FLAGS_FOR_TARGET) from being duplicated.
case $CC_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
if test "x${GCJ_FOR_TARGET+set}" = xset; then
  :
elif test -d ${topsrcdir}/gcc; then
  GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
elif test "$host" = "$target"; then
  GCJ_FOR_TARGET='gcj'
else
  GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
fi
case $GCJ_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
if test "x${CXX_FOR_TARGET+set}" = xset; then
  :
elif test -d ${topsrcdir}/gcc; then
  # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
  # of g++ for linking C++ or Java, because g++ has -shared-libgcc by
  # default whereas gcc does not.
  CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3 | libjava) echo xgcc -shared-libgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
elif test "$host" = "$target"; then
  CXX_FOR_TARGET='$(CXX)'
else
  CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
fi
case $CXX_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`

# We want to defer the evaluation of `cmd`s and shell variables in
# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
# bootstrap.  We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
# quotes, but we still have to duplicate `$'s so that shell variables
# can be expanded by the nested make as shell variables, not as make
# macros.
qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
sedtemp=sed.$$
cat >$sedtemp <<EOF
s:^TARGET_CONFIGDIRS[ 	]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:
s%^TARGET_CONFIGARGS[ 	]*=.*$%TARGET_CONFIGARGS = ${targargs}%
s%^FLAGS_FOR_TARGET[ 	]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%
s%^CC_FOR_TARGET[ 	]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%
s%^GCJ_FOR_TARGET[      ]*=.*$%GCJ_FOR_TARGET = ${GCJ_FOR_TARGET}%
s%^CXX_FOR_TARGET[ 	]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%
s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ 	]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%
s%^TARGET_SUBDIR[ 	]*=.*$%TARGET_SUBDIR = ${target_subdir}%
s%^BUILD_SUBDIR[ 	]*=.*$%BUILD_SUBDIR = ${build_subdir}%
s%^BUILD_CONFIGARGS[ 	]*=.*$%BUILD_CONFIGARGS = ${buildargs}%
s%^gxx_include_dir[ 	]*=.*$%gxx_include_dir=${gxx_include_dir}%
EOF
sed -f $sedtemp Makefile > Makefile.tem
rm -f Makefile $sedtemp
Jason Merrill's avatar
Jason Merrill committed
mv -f Makefile.tem Makefile

#
# Local Variables:
# fill-column: 131
# End:
#