#
# if [ "${srcdir}" = "." ] ; then
# if [ "${with_target_subdir}" != "." ] ; then
-# . ${srcdir}/${with_multisrctop}../../config-ml.in
+# . ${with_multisrctop}../../config-ml.in
# else
-# . ${srcdir}/${with_multisrctop}../config-ml.in
+# . ${with_multisrctop}../config-ml.in
# fi
# else
# . ${srcdir}/../config-ml.in
# inter-library references also work in the source tree because symlink trees
# are built when srcdir=.
#
+# Unfortunately, trying to access the libraries in the build tree requires
+# the user to manually choose which library to use as GCC won't be able to
+# find the right one. This is viewed as the lesser of two evils.
+#
# Configure variables:
# ${with_target_subdir} = "." for native, or ${target_alias} for cross.
# Set by top level Makefile.
#
# Makefile variables:
# MULTISRCTOP = number of multilib levels in source tree (+1 if cross)
-# MULITBUILDTOP = number of multilib levels in build tree
+# (FIXME: note that this is different than ${with_multisrctop}. Check out.).
+# MULTIBUILDTOP = number of multilib levels in build tree
# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...)
# (only defined in each library's main Makefile).
# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000)
# libraries as desired.
# We have to handle being invoked by both Cygnus configure and Autoconf.
-# We except both to define `srcdir' and `target' (we *could* figure them
-# out, but we'd have to do work that they're already done to figure them out).
-# We expect Cygnus configure to define `arguments' and Autoconf to define
-# `ac_configure_args'.
+#
+# Cygnus configure incoming variables:
+# srcdir, subdir, target, arguments
+#
+# Autoconf incoming variables:
+# srcdir, target, ac_configure_args
+#
+# We *could* figure srcdir and target out, but we'd have to do work that
+# our caller has already done to figure them out and requiring these two
+# seems reasonable.
if [ -n "${ac_configure_args}" ]; then
Makefile=${ac_file-Makefile}
ml_config_shell=${CONFIG_SHELL-/bin/sh}
ml_arguments="${ac_configure_args}"
+ ml_realsrcdir=${srcdir}
else
Makefile=${Makefile-Makefile}
ml_config_shell=${config_shell-/bin/sh}
ml_arguments="${arguments}"
+ if [ -n "${subdir}" -a "${subdir}" != "." ] ; then
+ ml_realsrcdir=${srcdir}/${subdir}
+ else
+ ml_realsrcdir=${srcdir}
+ fi
fi
# Scan all the arguments and set all the ones we need.
ml_toplevel_p=no
if [ -z "${with_multisubdir}" ]; then
if [ "${srcdir}" = "." ]; then
+ # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
# ${with_target_subdir} = "." for native, otherwise target alias.
if [ "${with_target_subdir}" = "." ]; then
- if [ -f ../config-ml.in ]; then
+ if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
ml_toplevel_p=yes
fi
else
- if [ -f ../../config-ml.in ]; then
+ if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then
ml_toplevel_p=yes
fi
fi
else
- if [ -f ${srcdir}/../config-ml.in ]; then
+ # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
+ if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
ml_toplevel_p=yes
fi
fi
done
case "${target}" in
-# start-sanitize-arc
-arc-sbp-elf*)
+arc-*-elf*)
if [ x$enable_biendian != xyes ]
then
old_multidirs=${multidirs}
- multidirs=
+ multidirs=""
for x in ${old_multidirs}; do
case "${x}" in
- *be*) ;;
- *) if [ x"$multidirs" = x ]; then
- multidirs="$x";
- else
- multidirs="${multidirs} ${x}";
- fi
- ;;
+ *be*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
-# end-sanitize-arc
-mips*-*-*)
- if [ x$enable_single_float = xno ]
+m32r-*-*)
+ if [ x$enable_m32rx = xno ]
+ then
+ old_multidirs=${multidirs}
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "${x}" in
+ *m32rx*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ ;;
+m68*-*-*)
+ if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *single* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *soft-float* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_biendian = xno ]
+ if [ x$enable_m68881 = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *el* ) : ;;
- *eb* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *m68881* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_softfloat = xno ]
+ if [ x$enable_m68000 = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *soft-float* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *m68000* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x$enable_m68020 = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *m68020* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
-powerpc*-*-* | rs6000*-*-*)
- if [ x$enable_softfloat = xno ]
+mips*-*-*)
+ if [ x$enable_single_float = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *soft-float* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *single* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_commoncpu = xno ]
+ if [ x$enable_biendian = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *common* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *el* ) : ;;
+ *eb* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_powercpu = xno ]
+ if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- power | */power | */power/* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *soft-float* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_power2cpu = xno ]
+ ;;
+powerpc*-*-* | rs6000*-*-*)
+ if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *power2* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *soft-float* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_powerpccpu = xno ]
+ if [ x$enable_powercpu = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *powerpc* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ power | */power | */power/* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_601cpu = xno ]
+ if [ x$enable_powerpccpu = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *601* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *powerpc* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_biendian = xno ]
+ if [ x$enable_powerpcos = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *endian* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *mcall-linux* | *mcall-solaris* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
- if [ x$enable_relocatable = xno ]
+ if [ x$enable_biendian = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *relocatable* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *mlittle* | *mbig* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *sysv* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *mcall-sysv* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *aix* ) : ;;
- *) if [ x"$multidirs" = x ]; then multidirs="$x"; else multidirs="${multidirs} ${x}"; fi ;;
+ *mcall-aix* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
esac
+# Remove extraneous blanks from multidirs.
+# Tests like `if [ -n "$multidirs" ]' require it.
+multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
+
# Add code to library's top level makefile to handle building the multilib
# subdirs.
fi # ${ml_toplevel_p} = yes
if [ "${ml_verbose}" = --verbose ]; then
- echo "Adding multilib support to Makefile in `pwd`"
+ echo "Adding multilib support to Makefile in ${ml_realsrcdir}"
if [ "${ml_toplevel_p}" = yes ]; then
echo "multidirs=${multidirs}"
fi