diff --git a/Makefile.am b/Makefile.am index f8a8d27e..a30c366d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,7 +57,7 @@ endif man_MANS = make.1 -DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@ +DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" -DMULTIARCH_DIRS="$(MULTIARCH_DIRS)" @DEFS@ AM_CPPFLAGS = $(GLOBINC) # Only process if target is MS-Windows diff --git a/configure.in b/configure.in index 5bbb5e9a..a4e6787f 100644 --- a/configure.in +++ b/configure.in @@ -374,6 +374,24 @@ AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.]) MAKE_HOST="$host" AC_SUBST(MAKE_HOST) +AC_PATH_TOOL([DPKG_ARCH], [dpkg-architecture]) +AC_MSG_CHECKING([for multiarch paths]) +multiarch_triplet="" +if test -n "$DPKG_ARCH"; then + multiarch_triplet=$($DPKG_ARCH -qDEB_HOST_MULTIARCH) + if test -z "$multiarch_triplet"; then + multiarch_triplet=$($DPKG_ARCH -qDEB_HOST_GNU_TYPE) + fi +fi +if test -n "$multiarch_triplet"; then + MULTIARCH_DIRS="\\\"/lib/$multiarch_triplet\\\", \\\"/usr/lib/$multiarch_triplet\\\"," + AC_MSG_RESULT([$MULTIARCH_DIRS]) +else + AC_MSG_RESULT([not found]) +fi + +AC_SUBST(MULTIARCH_DIRS) + w32_target_env=no AM_CONDITIONAL([WINDOWSENV], false) diff --git a/remake.c b/remake.c index ea539304..57982d27 100644 --- a/remake.c +++ b/remake.c @@ -1451,6 +1451,9 @@ library_search (char **lib, FILE_TIMESTAMP *mtime_ptr) { static char *dirs[] = { +#ifdef MULTIARCH_DIRS + MULTIARCH_DIRS +#endif #ifndef _AMIGA "/lib", #endif