Blame SOURCES/gcc44-hack.patch

f28b6a
--- libada/Makefile.in.jj	2009-01-14 12:07:35.000000000 +0100
f28b6a
+++ libada/Makefile.in	2009-01-15 14:25:33.000000000 +0100
f28b6a
@@ -69,18 +69,40 @@ version := $(shell cat $(srcdir)/../gcc/
f28b6a
 libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
f28b6a
 ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
f28b6a
 
f28b6a
+DEFAULTMULTIFLAGS :=
f28b6a
+ifeq ($(MULTISUBDIR),)
f28b6a
+targ:=$(subst -, ,$(target))
f28b6a
+arch:=$(word 1,$(targ))
f28b6a
+ifeq ($(words $(targ)),2)
f28b6a
+osys:=$(word 2,$(targ))
f28b6a
+else
f28b6a
+osys:=$(word 3,$(targ))
f28b6a
+endif
f28b6a
+ifeq ($(strip $(filter-out i%86 x86_64 powerpc% ppc% s390% sparc% linux%, $(arch) $(osys))),)
f28b6a
+ifeq ($(shell $(CC) $(CFLAGS) -print-multi-os-directory),../lib64)
f28b6a
+DEFAULTMULTIFLAGS := -m64
f28b6a
+else
f28b6a
+ifeq ($(strip $(filter-out s390%, $(arch))),)
f28b6a
+DEFAULTMULTIFLAGS := -m31
f28b6a
+else
f28b6a
+DEFAULTMULTIFLAGS := -m32
f28b6a
+endif
f28b6a
+endif
f28b6a
+endif
f28b6a
+endif
f28b6a
+
f28b6a
 # exeext should not be used because it's the *host* exeext.  We're building
f28b6a
 # a *target* library, aren't we?!?  Likewise for CC.  Still, provide bogus
f28b6a
 # definitions just in case something slips through the safety net provided
f28b6a
 # by recursive make invocations in gcc/ada/Makefile.in
f28b6a
 LIBADA_FLAGS_TO_PASS = \
f28b6a
         "MAKEOVERRIDES=" \
f28b6a
-        "LDFLAGS=$(LDFLAGS)" \
f28b6a
+        "LDFLAGS=$(strip $(LDFLAGS) $(DEFAULTMULTIFLAGS))" \
f28b6a
         "LN_S=$(LN_S)" \
f28b6a
         "SHELL=$(SHELL)" \
f28b6a
-        "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
f28b6a
-        "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
f28b6a
-        "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
f28b6a
+        "GNATLIBFLAGS=$(strip $(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \
f28b6a
+        "GNATLIBCFLAGS=$(strip $(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \
f28b6a
+        "GNATLIBCFLAGS_FOR_C=$(strip $(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \
f28b6a
         "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
f28b6a
         "THREAD_KIND=$(THREAD_KIND)" \
f28b6a
         "TRACE=$(TRACE)" \
f28b6a
@@ -91,7 +113,7 @@ LIBADA_FLAGS_TO_PASS = \
f28b6a
         "exeext=.exeext.should.not.be.used " \
f28b6a
 	'CC=the.host.compiler.should.not.be.needed' \
f28b6a
 	"GCC_FOR_TARGET=$(CC)" \
f28b6a
-        "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
f28b6a
+        "CFLAGS=$(strip $(CFLAGS) $(DEFAULTMULTIFLAGS) $(WARN_CFLAGS))"
f28b6a
 
f28b6a
 # Rules to build gnatlib.
f28b6a
 .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared oscons
f28b6a
--- gcc/ada/make.adb	2008-11-07 23:00:32.000000000 +0100
f28b6a
+++ gcc/ada/make.adb	2009-01-16 17:55:02.000000000 +0100
f28b6a
@@ -8039,6 +8039,7 @@ package body Make is
f28b6a
              or else Argv (2 .. Argv'Last) = "pg"
f28b6a
              or else (Argv (2) = 'm' and then Argv'Last > 2)
f28b6a
              or else (Argv (2) = 'f' and then Argv'Last > 2)
f28b6a
+             or else (Argv'Last >= 8 and then Argv (2 .. 8) = "-param=")
f28b6a
          then
f28b6a
             Add_Switch (Argv, Compiler, And_Save => And_Save);
f28b6a
             Add_Switch (Argv, Linker, And_Save => And_Save);