OSDN Git Service

2002-03-07 H.J. Lu (hjl@gnu.org)
[pf3gnuchains/gcc-fork.git] / configure.in
index 0ccd7ad..9b8488c 100644 (file)
@@ -50,7 +50,7 @@ fi
 
 libstdcxx_version="target-libstdc++-v3"
 # Don't use libstdc++-v3's flags to configure/build itself.
-libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+libstdcxx_flags='`case $$dir in libstdc++-v3 | libjava) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -445,6 +445,18 @@ if [ ! -d ${target_subdir} ] ; then
   fi
 fi
 
+build_subdir=${build_alias}
+
+if [ x"${build_alias}" != x"${host}" ] ; then
+  if [ ! -d ${build_subdir} ] ; then
+    if mkdir ${build_subdir} ; then true
+    else
+      echo "'*** could not make ${PWD=`pwd`}/${build_subdir}" 1>&2
+      exit 1
+    fi
+  fi
+fi
+
 copy_dirs=
 
 # Handle --with-headers=XXX.  The contents of the named directory are
@@ -605,6 +617,17 @@ case "${target}" in
   *-*-chorusos)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
+  *-*-netbsd*)
+    # Skip some stuff on all NetBSD configurations.
+    skipdirs="$skipdirs target-newlib target-libiberty target-libgloss"
+
+    # Skip some stuff that's unsupported on some NetBSD configurations.
+    case "${target}" in
+      *)
+       noconfigdirs="$noconfigdirs ${libgcj}"
+       ;;
+    esac
+    ;;
   *-*-netware)
     noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss ${libgcj}"
     ;;
@@ -719,6 +742,9 @@ case "${target}" in
   arm-*-riscix*)
     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
     ;;
+  cris-*-*)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
   d10v-*-*)
     noconfigdirs="$noconfigdirs target-librx ${libstdcxx_version} target-libgloss ${libgcj}"
     ;;
@@ -733,7 +759,7 @@ case "${target}" in
     ;;
   h8300*-*-* | \
   h8500-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj} target-libf2c"
     ;;
   hppa*64*-*-linux* | parisc*64*-*-linux*)
     # In this case, it's because the hppa64-linux target is for
@@ -771,6 +797,7 @@ case "${target}" in
     fi
     ;;
   *-*-linux*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     # linux has rx in libc
     skipdirs="$skipdirs target-librx"
     ;;
@@ -839,6 +866,9 @@ case "${target}" in
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
     fi
     ;;
+  mmix-*-*)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
   mn10200-*-*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     if [ x${is_cross_compiler} != xno ] ; then
@@ -921,6 +951,9 @@ case "${target}" in
     noconfigdirs="$noconfigdirs gprof ${libgcj}"   # same as generic mips
     target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
    ;;
+  mips*-*-linux*)
+    noconfigdirs="$noconfigdirs target-libffi"
+    ;;
   mips*-*-*)
     noconfigdirs="$noconfigdirs gprof ${libgcj}"
     ;;
@@ -936,6 +969,9 @@ case "${target}" in
     esac
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
+  sh64-*-*)
+    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+    ;;
   sparc-*-elf*)
     if [ x${is_cross_compiler} != xno ] ; then
           target_configdirs="${target_configdirs} target-libstub target-cygmon"
@@ -1026,18 +1062,23 @@ fi
 # 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="`echo ${LANGUAGES} | tr ' ' ','`"
+               enable_languages="${LANGUAGES}"
+               echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
        else
                enable_languages=all
        fi
 else
-       if test x"${enable_languages}" = x; then
-               echo configure.in: --enable-languages needs at least one argument 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
                exit 1
        fi
 fi
+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
@@ -1337,7 +1378,8 @@ if [ "${shared}" = "yes" ]; then
   esac
 fi
 
-# Record target_configdirs and the configure arguments in Makefile.
+# 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=`echo "${arguments}" | \
        sed -e 's/--no[^        ]*//' \
@@ -1346,6 +1388,11 @@ targargs=`echo "${arguments}" | \
            -e 's/--bu[a-z-]*=[^        ]*//' \
            -e 's/--ta[a-z-]*=[^        ]*//'`
 
+# 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} ${targargs}"
+
 # 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
@@ -1366,6 +1413,9 @@ if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib "
   targargs="--with-newlib ${targargs}"
 fi
 
+# 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.
@@ -1501,7 +1551,10 @@ fi
 if test "x${CXX_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${topsrcdir}/gcc; then
-  CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3) echo xgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+  # 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
@@ -1521,19 +1574,23 @@ qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
 # macros.
 qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
 
-targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
-sed -e "s:^TARGET_CONFIGDIRS[  ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
-    -e "s%^CONFIG_ARGUMENTS[   ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
-    -e "s%^FLAGS_FOR_TARGET[   ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \
-    -e "s%^CC_FOR_TARGET[      ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
-    -e "s%^CHILL_FOR_TARGET[   ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
-    -e "s%^GCJ_FOR_TARGET[      ]*=.*$%GCJ_FOR_TARGET = ${GCJ_FOR_TARGET}%" \
-    -e "s%^CXX_FOR_TARGET[     ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
-    -e "s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[  ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%" \
-    -e "s%^TARGET_SUBDIR[      ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
-    -e "s%^gxx_include_dir[    ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
-       Makefile > Makefile.tem
-rm -f Makefile
+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%^CHILL_FOR_TARGET[   ]*=.*$%CHILL_FOR_TARGET = ${CHILL_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
 mv -f Makefile.tem Makefile
 
 #