# so that libgcc.a itself remains nonexistent if compilation is aborted.
mv tmplibgcc.a libgcc.a
+# Use the genmultilib shell script to generate the information the gcc
+# driver program needs to select the library directory based on the
+# switches.
+multilib.h: $(srcdir)/genmultilib config.status
+ $(SHELL) $(srcdir)/genmultilib "$(MULTILIB_OPTIONS)" \
+ "$(MULTILIB_DIRNAMES)" "$(MULTILIB_MATCHES)" > multilib.h
+
+# Build multiple copies of libgcc.a, one for each target switch.
+stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
+ $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
+ for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
+ dir=`echo $$i | sed -e 's/;.*$$//'`; \
+ flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
+ rm -f $${dir}/libgcc.a $(LIBGCC2); \
+ $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
+ AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
+ HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
+ LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" $(LIBGCC2); \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
+ then true; \
+ else (rm -f $(LIBGCC1); \
+ $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
+ AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
+ HOST_PREFIX="$(HOST_PREFIX)" \
+ HOST_PREFIX_1="$(HOST_PREFIX_1)" \
+ LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" $(LIBGCC1) ) \
+ fi; \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ rm -rf tmpcopy; \
+ mkdir tmpcopy; \
+ if [ x$(LIBGCC1) != x ]; \
+ then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
+ else true; \
+ fi; \
+ (cd tmpcopy; $(AR) x ../$(LIBGCC2)); \
+ (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o); \
+ rm -rf libgcc2.a tmpcopy; \
+ if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi; \
+ if [ -d $${dir} ]; then true; else mkdir $${dir}; fi; \
+ mv tmplibgcc.a $${dir}/libgcc.a; \
+ done
+ touch stmp-multilib
+
objc-runtime: libobjc.a
# Build the Objective C runtime library.
# Language-independent files.
-gcc.o: gcc.c $(CONFIG_H) config.status
+gcc.o: gcc.c $(CONFIG_H) multilib.h config.status
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
-DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
# Delete the include directory.
-rm -rf stmp-* include objc-headers
-rm -f */stmp-*
+ -rm -f multilib.h tmpmultilib*
# Delete all files that users would normally create
# while building and installing GCC.
chmod a-x $(libsubdir)/libgcc.a; \
else true; fi
+# Install multiple versions of libgcc.a.
+install-multilib: stmp-multilib install-dir
+ for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
+ dir=`echo $$i | sed -e 's/;.*$$//'`; \
+ if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \
+ rm -f $(libsubdir)/$${dir}/libgcc.a; \
+ $(INSTALL_DATA) $${dir}/libgcc.a $(libsubdir)/$${dir}/libgcc.a; \
+ if $(RANLIB_TEST); then \
+ (cd $(libsubdir)/$${dir}; $(RANLIB) libgcc.a); else true; fi; \
+ chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
+ done
+
# Install the objc run time library.
install-libobjc: libobjc.a install-dir
-if [ -f libobjc.a ] ; then \