-# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# <http://www.gnu.org/licenses/>.
MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
-ifneq ($(filter MIPS_ABI_DEFAULT=ABI_32,$(tm_defines)),)
-MULTILIB_DIRNAMES = n32 . 64
-else
MULTILIB_DIRNAMES = n32 32 64
-endif
-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
-TPBIT = tp-bit.c
-
-tp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#ifdef __MIPSEL__' > tp-bit.c
- echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c
- echo '#endif' >> tp-bit.c
- echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c
- echo '#define QUIET_NAN_NEGATED' >> tp-bit.c
- echo '# define TFLOAT' >> tp-bit.c
- cat $(srcdir)/config/fp-bit.c >> tp-bit.c
- echo '#endif' >> tp-bit.c
+MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+MULTILIB_OSDIRNAMES = \
+ ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+ ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+ ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))