[PATCH] libgloss: hardcode AC_CONFIG_AUX_DIR path

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
In order to transition to automake, we have to use hardcoded paths in
the AC_CONFIG_AUX_DIR macro call (since automake evaluates the path
itself, and doesn't expand vars), so simplify all the calls here.
---
 libgloss/aarch64/configure             | 16 ++-------
 libgloss/aarch64/configure.ac          | 14 ++------
 libgloss/aarch64/cpu-init/configure    | 16 ++-------
 libgloss/aarch64/cpu-init/configure.ac | 14 ++------
 libgloss/arc/configure                 | 16 ++-------
 libgloss/arc/configure.ac              | 14 ++------
 libgloss/arm/configure                 | 19 +++--------
 libgloss/arm/configure.ac              | 17 ++--------
 libgloss/bfin/configure                | 16 ++-------
 libgloss/bfin/configure.ac             | 14 ++------
 libgloss/configure                     | 16 ++-------
 libgloss/configure.ac                  | 14 ++------
 libgloss/cr16/configure                | 16 ++-------
 libgloss/cr16/configure.ac             | 14 ++------
 libgloss/cris/configure                | 16 ++-------
 libgloss/cris/configure.ac             | 14 ++------
 libgloss/crx/configure                 | 40 ++---------------------
 libgloss/crx/configure.ac              |  8 +----
 libgloss/csky/configure                | 17 ++--------
 libgloss/csky/configure.ac             | 15 ++-------
 libgloss/d30v/configure                | 16 ++-------
 libgloss/d30v/configure.ac             | 14 ++------
 libgloss/doc/configure                 | 40 ++---------------------
 libgloss/doc/configure.ac              |  8 +----
 libgloss/epiphany/configure            | 17 ++--------
 libgloss/epiphany/configure.ac         | 15 ++-------
 libgloss/fr30/configure                | 40 ++---------------------
 libgloss/fr30/configure.ac             |  8 +----
 libgloss/frv/configure                 | 16 ++-------
 libgloss/frv/configure.ac              | 14 ++------
 libgloss/ft32/configure                | 16 ++-------
 libgloss/ft32/configure.ac             | 14 ++------
 libgloss/hp74x/configure.ac            |  8 +----
 libgloss/i386/configure                | 16 ++-------
 libgloss/i386/configure.ac             | 14 ++------
 libgloss/i960/configure                | 40 ++---------------------
 libgloss/i960/configure.ac             |  8 +----
 libgloss/iq2000/configure              | 16 ++-------
 libgloss/iq2000/configure.ac           | 14 ++------
 libgloss/libnosys/configure            | 16 ++-------
 libgloss/libnosys/configure.ac         | 14 ++------
 libgloss/lm32/configure                | 16 ++-------
 libgloss/lm32/configure.ac             | 14 ++------
 libgloss/m32c/configure                | 16 ++-------
 libgloss/m32c/configure.ac             | 14 ++------
 libgloss/m32r/configure                | 41 ++---------------------
 libgloss/m32r/configure.ac             |  9 +-----
 libgloss/m68hc11/configure             | 16 ++-------
 libgloss/m68hc11/configure.ac          | 14 ++------
 libgloss/m68k/configure                | 17 ++--------
 libgloss/m68k/configure.ac             | 15 ++-------
 libgloss/mcore/configure               | 16 ++-------
 libgloss/mcore/configure.ac            | 14 ++------
 libgloss/mep/configure                 | 16 ++-------
 libgloss/mep/configure.ac              | 14 ++------
 libgloss/microblaze/configure          | 16 ++-------
 libgloss/microblaze/configure.ac       | 14 ++------
 libgloss/mips/configure                | 16 ++-------
 libgloss/mips/configure.ac             | 14 ++------
 libgloss/mn10200/configure             | 16 ++-------
 libgloss/mn10200/configure.ac          | 14 ++------
 libgloss/mn10300/configure             | 16 ++-------
 libgloss/mn10300/configure.ac          | 14 ++------
 libgloss/moxie/configure               | 16 ++-------
 libgloss/moxie/configure.ac            | 14 ++------
 libgloss/msp430/configure              | 16 ++-------
 libgloss/msp430/configure.ac           | 14 ++------
 libgloss/mt/configure                  | 16 ++-------
 libgloss/mt/configure.ac               | 14 ++------
 libgloss/nds32/configure               | 41 ++---------------------
 libgloss/nds32/configure.ac            |  9 +-----
 libgloss/nios2/configure               | 16 ++-------
 libgloss/nios2/configure.ac            | 14 ++------
 libgloss/or1k/configure                | 17 +++-------
 libgloss/or1k/configure.ac             | 16 ++-------
 libgloss/pa/configure                  | 16 ++-------
 libgloss/pa/configure.ac               | 14 ++------
 libgloss/pru/configure                 | 16 ++-------
 libgloss/pru/configure.ac              | 14 ++------
 libgloss/riscv/configure               | 45 ++------------------------
 libgloss/riscv/configure.ac            | 15 ++-------
 libgloss/rl78/configure                | 16 ++-------
 libgloss/rl78/configure.ac             | 14 ++------
 libgloss/rs6000/configure              | 16 ++-------
 libgloss/rs6000/configure.ac           | 14 ++------
 libgloss/rx/configure                  | 16 ++-------
 libgloss/rx/configure.ac               | 14 ++------
 libgloss/sparc/configure               | 17 ++--------
 libgloss/sparc/configure.ac            | 15 ++-------
 libgloss/sparc/libsys/configure        | 40 ++---------------------
 libgloss/sparc/libsys/configure.ac     |  8 +----
 libgloss/sparc_leon/configure          | 16 ++-------
 libgloss/sparc_leon/configure.ac       | 14 ++------
 libgloss/spu/configure                 | 16 ++-------
 libgloss/spu/configure.ac              | 14 ++------
 libgloss/tic6x/configure               | 16 ++-------
 libgloss/tic6x/configure.ac            | 14 ++------
 libgloss/v850/configure                | 16 ++-------
 libgloss/v850/configure.ac             | 14 ++------
 libgloss/visium/configure              | 16 ++-------
 libgloss/visium/configure.ac           | 14 ++------
 libgloss/xc16x/configure               | 16 ++-------
 libgloss/xc16x/configure.ac            | 14 ++------
 libgloss/xstormy16/configure           | 40 ++---------------------
 libgloss/xstormy16/configure.ac        |  8 +----
 105 files changed, 257 insertions(+), 1506 deletions(-)

diff --git a/libgloss/aarch64/configure.ac b/libgloss/aarch64/configure.ac
index 88acc0f4d3ad..da932e51a60f 100644
--- a/libgloss/aarch64/configure.ac
+++ b/libgloss/aarch64/configure.ac
@@ -2,16 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.69)dnl
 AC_INIT(crt0.S)
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -54,12 +45,11 @@ if test -d "${srcdir}/cpu-init"; then
 fi
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/aarch64/cpu-init/configure.ac b/libgloss/aarch64/cpu-init/configure.ac
index e93b8234f7ed..40a33c055af1 100644
--- a/libgloss/aarch64/cpu-init/configure.ac
+++ b/libgloss/aarch64/cpu-init/configure.ac
@@ -2,16 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.69)dnl
 AC_INIT(Makefile.in)
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -39,12 +30,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/arc/configure.ac b/libgloss/arc/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/arc/configure.ac
+++ b/libgloss/arc/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/arm/configure.ac b/libgloss/arm/configure.ac
index 59b580d7a422..316889cf756b 100644
--- a/libgloss/arm/configure.ac
+++ b/libgloss/arm/configure.ac
@@ -22,16 +22,7 @@ fi
 AC_SUBST(BUILD_CRT0_TRUE)
 AC_SUBST(BUILD_CRT0_FALSE)
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -73,25 +64,23 @@ AC_SUBST_FILE(host_makefile_frag)
 if test -d "${srcdir}/cpu-init"; then
   subdirs="${subdirs} cpu-init"
   AC_CONFIG_FILES(cpu-init/Makefile,
-  . ${libgloss_topdir}/config-ml.in,
+  . ${srcdir}/../../config-ml.in,
   srcdir=${srcdir}
   target=${target}
   with_multisubdir=${with_multisubdir}
   ac_configure_args="${ac_configure_args} --enable-multilib"
   CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-  libgloss_topdir=${libgloss_topdir}
   )
   AC_SUBST(subdirs)
 fi
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/bfin/configure.ac b/libgloss/bfin/configure.ac
index 2cfb82d0f0b3..562d6a2d60fb 100644
--- a/libgloss/bfin/configure.ac
+++ b/libgloss/bfin/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -43,12 +34,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 0fbe995267e9..ae8a26d3cea2 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -7,16 +7,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "${srcdir}" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}.."
-  fi
-else
-  libgloss_topdir="${srcdir}/.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(..)
 
 AC_PROG_INSTALL
 
@@ -228,7 +219,7 @@ fi
 AC_CONFIG_FILES([Makefile],
 [if test -n "$CONFIG_FILES"; then
   unset ac_file
-  . ${libgloss_topdir}/config-ml.in
+  . ${srcdir}/../config-ml.in
 fi],
 srcdir=${srcdir}
 target=${target}
@@ -236,7 +227,6 @@ host=${host}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="--enable-multilib ${ac_configure_args}"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 CC="${CC}"
 LDFLAGS=${LDFLAGS}
 )
diff --git a/libgloss/cr16/configure.ac b/libgloss/cr16/configure.ac
index da46354ca4d7..28b306594ba6 100644
--- a/libgloss/cr16/configure.ac
+++ b/libgloss/cr16/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/cris/configure.ac b/libgloss/cris/configure.ac
index c35612fdc214..7d323774fc22 100644
--- a/libgloss/cris/configure.ac
+++ b/libgloss/cris/configure.ac
@@ -7,16 +7,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/crx/configure.ac b/libgloss/crx/configure.ac
index 7badc19daae0..eb88aab69aab 100644
--- a/libgloss/crx/configure.ac
+++ b/libgloss/crx/configure.ac
@@ -5,13 +5,7 @@ AC_INIT(intable.c)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
diff --git a/libgloss/csky/configure.ac b/libgloss/csky/configure.ac
index 9b03c68e89d8..88b1110d733f 100644
--- a/libgloss/csky/configure.ac
+++ b/libgloss/csky/configure.ac
@@ -18,17 +18,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
@@ -81,13 +71,12 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/d30v/configure.ac b/libgloss/d30v/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/d30v/configure.ac
+++ b/libgloss/d30v/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/doc/configure.ac b/libgloss/doc/configure.ac
index 99d1d174c71a..a12099b4f79f 100644
--- a/libgloss/doc/configure.ac
+++ b/libgloss/doc/configure.ac
@@ -2,13 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.69)dnl
 AC_INIT(porting.texi)
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
diff --git a/libgloss/epiphany/configure.ac b/libgloss/epiphany/configure.ac
index d1bdcb2a667a..31acdea15b31 100644
--- a/libgloss/epiphany/configure.ac
+++ b/libgloss/epiphany/configure.ac
@@ -39,17 +39,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-# Where are the auxillary tools (confg.sub etc)?
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -116,12 +106,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-ac_file=Makefile . ${libgloss_topdir}/config-ml.in,
+ac_file=Makefile . ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/fr30/configure.ac b/libgloss/fr30/configure.ac
index 8ac12e46a7c3..f76fc6e1208b 100644
--- a/libgloss/fr30/configure.ac
+++ b/libgloss/fr30/configure.ac
@@ -5,13 +5,7 @@ AC_INIT(crt0.s)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
diff --git a/libgloss/frv/configure.ac b/libgloss/frv/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/frv/configure.ac
+++ b/libgloss/frv/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/ft32/configure.ac b/libgloss/ft32/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/ft32/configure.ac
+++ b/libgloss/ft32/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/hp74x/configure.ac b/libgloss/hp74x/configure.ac
index 906640907bbb..27564f967565 100644
--- a/libgloss/hp74x/configure.ac
+++ b/libgloss/hp74x/configure.ac
@@ -2,13 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.69)dnl
 AC_INIT(crt0.s)
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
diff --git a/libgloss/i386/configure.ac b/libgloss/i386/configure.ac
index dcb85a9435ca..3ebf64b08fe5 100644
--- a/libgloss/i386/configure.ac
+++ b/libgloss/i386/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -68,12 +59,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/i960/configure.ac b/libgloss/i960/configure.ac
index 5ea4518239ad..76a5a1ae3762 100644
--- a/libgloss/i960/configure.ac
+++ b/libgloss/i960/configure.ac
@@ -5,13 +5,7 @@ AC_INIT(crt0.c)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
diff --git a/libgloss/iq2000/configure.ac b/libgloss/iq2000/configure.ac
index 8ae56ae3363e..169db65140a4 100644
--- a/libgloss/iq2000/configure.ac
+++ b/libgloss/iq2000/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -68,13 +59,12 @@ AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(part_specific_obj)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/libnosys/configure.ac b/libgloss/libnosys/configure.ac
index 28b4945160ec..0d4830d76271 100644
--- a/libgloss/libnosys/configure.ac
+++ b/libgloss/libnosys/configure.ac
@@ -20,16 +20,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -183,13 +174,12 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-ac_file=Makefile . ${libgloss_topdir}/config-ml.in,
+ac_file=Makefile . ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/lm32/configure.ac b/libgloss/lm32/configure.ac
index a0a2822b9ab8..81e304abc292 100644
--- a/libgloss/lm32/configure.ac
+++ b/libgloss/lm32/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -43,13 +34,12 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/m32c/configure.ac b/libgloss/m32c/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/m32c/configure.ac
+++ b/libgloss/m32c/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/m32r/configure.ac b/libgloss/m32r/configure.ac
index f4ab6dc104b3..c5fd5681f44a 100644
--- a/libgloss/m32r/configure.ac
+++ b/libgloss/m32r/configure.ac
@@ -5,13 +5,7 @@ AC_INIT(crt0.S)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
@@ -42,6 +36,5 @@ target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${srcdir}/../..
 )
 AC_OUTPUT
diff --git a/libgloss/m68hc11/configure.ac b/libgloss/m68hc11/configure.ac
index 227fff62751b..2e2ce36d7add 100644
--- a/libgloss/m68hc11/configure.ac
+++ b/libgloss/m68hc11/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,13 +35,12 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/m68k/configure.ac b/libgloss/m68k/configure.ac
index 62b28bdb18f5..48cc6a5b8589 100644
--- a/libgloss/m68k/configure.ac
+++ b/libgloss/m68k/configure.ac
@@ -18,17 +18,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
@@ -81,13 +71,12 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/mcore/configure.ac b/libgloss/mcore/configure.ac
index df7c86d69dd4..a7cba66fd6c4 100644
--- a/libgloss/mcore/configure.ac
+++ b/libgloss/mcore/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -54,12 +45,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/mep/configure.ac b/libgloss/mep/configure.ac
index dcfb0ad6b6e2..5418a0a8d4c6 100644
--- a/libgloss/mep/configure.ac
+++ b/libgloss/mep/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -55,12 +46,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES([Makefile],
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/microblaze/configure.ac b/libgloss/microblaze/configure.ac
index 5eda42e73876..59ad99ed0792 100644
--- a/libgloss/microblaze/configure.ac
+++ b/libgloss/microblaze/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -49,12 +40,11 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/mips/configure.ac b/libgloss/mips/configure.ac
index 2fc286ca2c07..3e3d08b89ee5 100644
--- a/libgloss/mips/configure.ac
+++ b/libgloss/mips/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -112,12 +103,11 @@ AC_SUBST(crt0)
 AC_SUBST(pcrt0)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/mn10200/configure.ac b/libgloss/mn10200/configure.ac
index af5354531805..8cd0e714a0ad 100644
--- a/libgloss/mn10200/configure.ac
+++ b/libgloss/mn10200/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -67,13 +58,12 @@ AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(part_specific_obj)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/mn10300/configure.ac b/libgloss/mn10300/configure.ac
index aea3383838a1..c170cd098035 100644
--- a/libgloss/mn10300/configure.ac
+++ b/libgloss/mn10300/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -78,14 +69,13 @@ AC_SUBST(bsp_list)
 AC_CONFIG_FILES([Makefile],
 [if test -n "$CONFIG_FILES"; then
   unset ac_file
-  . ${libgloss_topdir}/config-ml.in
+  . ${srcdir}/../../config-ml.in
 fi],
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/moxie/configure.ac b/libgloss/moxie/configure.ac
index fa2940661841..17a4058cea46 100644
--- a/libgloss/moxie/configure.ac
+++ b/libgloss/moxie/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -59,12 +50,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/msp430/configure.ac b/libgloss/msp430/configure.ac
index a90e2b518415..340b39e4559b 100644
--- a/libgloss/msp430/configure.ac
+++ b/libgloss/msp430/configure.ac
@@ -18,16 +18,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -56,12 +47,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/mt/configure.ac b/libgloss/mt/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/mt/configure.ac
+++ b/libgloss/mt/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/nds32/configure.ac b/libgloss/nds32/configure.ac
index f4ab6dc104b3..c5fd5681f44a 100644
--- a/libgloss/nds32/configure.ac
+++ b/libgloss/nds32/configure.ac
@@ -5,13 +5,7 @@ AC_INIT(crt0.S)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
@@ -42,6 +36,5 @@ target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${srcdir}/../..
 )
 AC_OUTPUT
diff --git a/libgloss/nios2/configure.ac b/libgloss/nios2/configure.ac
index 83f30693671f..d43fff6b02a5 100644
--- a/libgloss/nios2/configure.ac
+++ b/libgloss/nios2/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -47,12 +38,11 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/or1k/configure.ac b/libgloss/or1k/configure.ac
index 2a763fae3fa5..f34d5c95c82a 100644
--- a/libgloss/or1k/configure.ac
+++ b/libgloss/or1k/configure.ac
@@ -23,16 +23,7 @@ if test "${enable_shared}" = "yes" ; then
 fi
 
 # Where are the auxillary tools (confg.sub etc)?
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -70,12 +61,11 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
-AC_OUTPUT
\ No newline at end of file
+AC_OUTPUT
diff --git a/libgloss/pa/configure.ac b/libgloss/pa/configure.ac
index d28c55d52bf5..f7c39b5a0072 100644
--- a/libgloss/pa/configure.ac
+++ b/libgloss/pa/configure.ac
@@ -19,16 +19,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -60,12 +51,11 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/pru/configure.ac b/libgloss/pru/configure.ac
index ce9e6b2afee3..880bd9a7b886 100644
--- a/libgloss/pru/configure.ac
+++ b/libgloss/pru/configure.ac
@@ -18,16 +18,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -55,12 +46,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/riscv/configure.ac b/libgloss/riscv/configure.ac
index 5694013d4eb3..a284d4823daf 100644
--- a/libgloss/riscv/configure.ac
+++ b/libgloss/riscv/configure.ac
@@ -8,7 +8,7 @@
 
 AC_INIT([crt0.S])
 AC_CONFIG_SRCDIR([crt0.S])
-AC_CONFIG_AUX_DIR([${srcdir}/../..])
+AC_CONFIG_AUX_DIR(../..)
 
 #-------------------------------------------------------------------------
 # Checks for programs
@@ -23,23 +23,12 @@ AC_PROG_INSTALL
 # Output
 #-------------------------------------------------------------------------
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/rl78/configure.ac b/libgloss/rl78/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/rl78/configure.ac
+++ b/libgloss/rl78/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/rs6000/configure.ac b/libgloss/rs6000/configure.ac
index b896f009c9fc..e15867e565d5 100644
--- a/libgloss/rs6000/configure.ac
+++ b/libgloss/rs6000/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/rx/configure.ac b/libgloss/rx/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/rx/configure.ac
+++ b/libgloss/rx/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/sparc/configure.ac b/libgloss/sparc/configure.ac
index 4e2b177aba07..32b0db8212f7 100644
--- a/libgloss/sparc/configure.ac
+++ b/libgloss/sparc/configure.ac
@@ -17,17 +17,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
@@ -74,12 +64,11 @@ AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(CYGMONLDSCRIPTTEMPL)
 
 AC_OUTPUT(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 
diff --git a/libgloss/sparc/libsys/configure.ac b/libgloss/sparc/libsys/configure.ac
index 2cbd75de0033..0a0be9034378 100644
--- a/libgloss/sparc/libsys/configure.ac
+++ b/libgloss/sparc/libsys/configure.ac
@@ -18,13 +18,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.69)dnl
 AC_INIT(libsys-crt0.S)
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../../..)
-fi
+AC_CONFIG_AUX_DIR(../../..)
 
 AC_PROG_INSTALL
 
diff --git a/libgloss/sparc_leon/configure.ac b/libgloss/sparc_leon/configure.ac
index 498145d664b6..d43fff6b02a5 100644
--- a/libgloss/sparc_leon/configure.ac
+++ b/libgloss/sparc_leon/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -47,12 +38,11 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/spu/configure.ac b/libgloss/spu/configure.ac
index ad16f7c96153..e4fe4a0d914c 100644
--- a/libgloss/spu/configure.ac
+++ b/libgloss/spu/configure.ac
@@ -2,16 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.69)dnl
 AC_INIT(crt0.S)
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -40,12 +31,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/tic6x/configure.ac b/libgloss/tic6x/configure.ac
index 2cfb82d0f0b3..562d6a2d60fb 100644
--- a/libgloss/tic6x/configure.ac
+++ b/libgloss/tic6x/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -43,12 +34,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/v850/configure.ac b/libgloss/v850/configure.ac
index fee6c45c23e9..23d5fb42ac34 100644
--- a/libgloss/v850/configure.ac
+++ b/libgloss/v850/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -44,12 +35,11 @@ AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/visium/configure.ac b/libgloss/visium/configure.ac
index fb294e1ef831..74ed73697b5a 100644
--- a/libgloss/visium/configure.ac
+++ b/libgloss/visium/configure.ac
@@ -6,16 +6,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -48,12 +39,11 @@ AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(part_specific_obj)
 
 AC_CONFIG_FILES(Makefile,
-. ${libgloss_topdir}/config-ml.in,
+. ${srcdir}/../../config-ml.in,
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
diff --git a/libgloss/xc16x/configure.ac b/libgloss/xc16x/configure.ac
index e2200b83bc40..c13c4e233982 100644
--- a/libgloss/xc16x/configure.ac
+++ b/libgloss/xc16x/configure.ac
@@ -20,16 +20,7 @@ if test "${enable_shared}" = "yes" ; then
     echo "Shared libraries not supported for cross compiling, ignored"
 fi
 
-if test "$srcdir" = "." ; then
-  if test "${with_target_subdir}" != "." ; then
-    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
-  else
-    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
-  fi
-else
-  libgloss_topdir="${srcdir}/../.."
-fi
-AC_CONFIG_AUX_DIR($libgloss_topdir)
+AC_CONFIG_AUX_DIR(../..)
 
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
@@ -67,14 +58,13 @@ AC_SUBST(bsp_list)
 AC_CONFIG_FILES([Makefile],
 [if test -n "$CONFIG_FILES"; then
   unset ac_file
-  . ${libgloss_topdir}/config-ml.in
+  . ${srcdir}/../../config-ml.in
 fi],
 srcdir=${srcdir}
 target=${target}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="${ac_configure_args} --enable-multilib"
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-libgloss_topdir=${libgloss_topdir}
 )
 AC_OUTPUT
 
diff --git a/libgloss/xstormy16/configure.ac b/libgloss/xstormy16/configure.ac
index 676318427e37..b2eb43962949 100644
--- a/libgloss/xstormy16/configure.ac
+++ b/libgloss/xstormy16/configure.ac
@@ -5,13 +5,7 @@ AC_INIT(crt0.s)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
-if test "$srcdir" = "." ; then
-  mdir=`echo "${with_multisubdir}/" \
-    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
-  AC_CONFIG_AUX_DIR(${mdir}../../..)
-else
-  AC_CONFIG_AUX_DIR(${srcdir}/../..)
-fi
+AC_CONFIG_AUX_DIR(../..)
 
 AC_PROG_INSTALL
 
-- 
2.33.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.