OSDN Git Service

merge with /cvs/src
[pf3gnuchains/gcc-fork.git] / config-ml.in
index fbdfb17..60b1d2c 100644 (file)
 # We have to handle being invoked by both Cygnus configure and Autoconf.
 #
 # Cygnus configure incoming variables:
-# srcdir, subdir, target, arguments
+# srcdir, subdir, host, arguments
 #
 # Autoconf incoming variables:
-# srcdir, target, ac_configure_args
+# srcdir, host, ac_configure_args
 #
-# We *could* figure srcdir and target out, but we'd have to do work that
+# We *could* figure srcdir and host out, but we'd have to do work that
 # our caller has already done to figure them out and requiring these two
 # seems reasonable.
+# Note that `host' in this case is GCC's `target'.  Target libraries are
+# configured for a particular host.
 
 if [ -n "${ac_configure_args}" ]; then
   Makefile=${ac_file-Makefile}
@@ -204,7 +206,10 @@ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
   fi
 done
 
-case "${target}" in
+# Target libraries are configured for the host they run on, so we check
+# $host here, not $target.
+
+case "${host}" in
 arc-*-elf*)
        if [ x$enable_biendian != xyes ]
        then
@@ -524,6 +529,8 @@ multi-do:
                flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
                if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
                                CFLAGS="$(CFLAGS) $${flags}" \
+                               prefix="$(prefix)" \
+                               exec_prefix="$(exec_prefix)" \
                                CXXFLAGS="$(CXXFLAGS) $${flags}" \
                                LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
                                LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
@@ -667,7 +674,24 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
       echo "pwd: `pwd`"
     fi
 
-    if [ -d ${ml_dir} ]; then true; else mkdir ${ml_dir}; fi
+    if [ -d ${ml_dir} ]; then true; else
+      # ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
+      pathcomp=""
+      for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
+        pathcomp="$pathcomp$d"
+        case "$pathcomp" in
+          -* ) pathcomp=./$pathcomp ;;
+        esac
+        if test ! -d "$pathcomp"; then
+           echo "mkdir $pathcomp" 1>&2
+           mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+        fi
+        if test ! -d "$pathcomp"; then
+          exit $lasterr
+        fi
+        pathcomp="$pathcomp/"
+      done
+    fi
     if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
 
     # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../