OSDN Git Service

* Makefile.in (reload1.o-warn): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / ada / Makefile.in
index a6df24d..aa85f9f 100644 (file)
@@ -1,5 +1,5 @@
 # Makefile for GNU Ada Compiler (GNAT).
-#   Copyright (C) 1994-2005 Free Software Foundation, Inc.
+#   Copyright (C) 1994-2007 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -114,7 +114,7 @@ PWD_COMMAND = $${PWDCMD-pwd}
 INSTALL_DATA_DATE = cp -p
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
-GNATBIND = $(STAGE_PREFIX)gnatbind
+TEXI2PDF = texi2pdf
 GNATBIND_FLAGS = -static -x
 ADA_CFLAGS =
 ADAFLAGS = -W -Wall -gnatpg -gnata
@@ -227,7 +227,8 @@ all.indirect: Makefile ../gnat1$(exeext)
 
 # IN_GCC distinguishes between code compiled into GCC itself and other
 # programs built during a bootstrap.
-# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
+# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
+# compiler which does not use the native libraries and headers.
 INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
 
 # This is the variable actually used when we compile.
@@ -302,12 +303,12 @@ GNATLINK_OBJS = gnatlink.o \
  sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
  types.o validsw.o widechar.o
 
-GNATMAKE_OBJS = a-except.o ctrl_c.o ali.o ali-util.o s-casuti.o \
+GNATMAKE_OBJS = a-except.o ali.o ali-util.o s-casuti.o \
  alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
  erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
  gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
- make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \
- namet.o nlists.o opt.o osint.o osint-m.o output.o \
+ make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o \
mlib-tgt-specific.o mlib-utl.o namet.o nlists.o opt.o osint.o osint-m.o output.o \
  prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \
  prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
  rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
@@ -315,7 +316,7 @@ GNATMAKE_OBJS = a-except.o ctrl_c.o ali.o ali-util.o s-casuti.o \
  sinfo.o sinput.o sinput-c.o sinput-p.o \
  snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \
  table.o targparm.o tempdir.o tree_io.o types.o \
- uintp.o  uname.o urealp.o usage.o widechar.o \
+ uintp.o uname.o urealp.o usage.o widechar.o \
  $(EXTRA_GNATMAKE_OBJS)
 
 # Convert the target variable into a space separated list of architecture,
@@ -399,6 +400,7 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
   s-osinte.ads<s-osinte-vxworks.ads \
   s-osprim.adb<s-osprim-vxworks.adb \
   s-parame.ads<s-parame-vxworks.ads \
+  s-parame.adb<s-parame-vxworks.adb \
   s-stchop.adb<s-stchop-vxworks.adb \
   s-taprop.adb<s-taprop-vxworks.adb \
   s-taspri.ads<s-taspri-vxworks.ads \
@@ -407,9 +409,12 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
   g-soccon.ads<g-soccon-vxworks.ads \
   g-socthi.ads<g-socthi-vxworks.ads \
   g-socthi.adb<g-socthi-vxworks.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads \
   system.ads<system-vxworks-m68k.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
 
   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
@@ -429,21 +434,23 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
   a-intnam.ads<a-intnam-vxworks.ads \
   a-numaux.ads<a-numaux-vxworks.ads \
   s-inmaop.adb<s-inmaop-posix.adb \
-  s-interr.adb<s-interr-vxworks.adb \
   s-intman.ads<s-intman-vxworks.ads \
   s-intman.adb<s-intman-vxworks.adb \
-  s-osinte.ads<s-osinte-vxworks.ads \
   s-osprim.adb<s-osprim-vxworks.adb \
   s-parame.ads<s-parame-vxworks.ads \
+  s-parame.adb<s-parame-vxworks.adb \
   s-stchop.adb<s-stchop-vxworks.adb \
   s-taprop.adb<s-taprop-vxworks.adb \
   s-taspri.ads<s-taspri-vxworks.ads \
   s-vxwork.ads<s-vxwork-ppc.ads \
   g-soccon.ads<g-soccon-vxworks.ads \
   g-socthi.ads<g-socthi-vxworks.ads \
-  g-socthi.adb<g-socthi-vxworks.adb
+  g-socthi.adb<g-socthi-vxworks.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
 
   ifeq ($(strip $(filter-out yes,$(TRACE))),)
     LIBGNAT_TARGET_PAIRS += \
@@ -457,22 +464,84 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
     LIBGNAT_TARGET_PAIRS += \
     s-osinte.adb<s-osinte-vxworks-rtp.adb \
+    s-osinte.ads<s-osinte-vxworks6.ads \
     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
     system.ads<system-vxworks-ppc-rtp.ads
 
     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
   else
     LIBGNAT_TARGET_PAIRS += \
+    s-interr.adb<s-interr-vxworks.adb \
     s-osinte.adb<s-osinte-vxworks.adb \
     s-tpopsp.adb<s-tpopsp-vxworks.adb \
     system.ads<system-vxworks-ppc.ads
 
+    ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
+      LIBGNAT_TARGET_PAIRS += \
+      s-osinte.ads<s-osinte-vxworks6.ads
+    else
+      LIBGNAT_TARGET_PAIRS += \
+      s-osinte.ads<s-osinte-vxworks.ads
+    endif
+
     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
   endif
 
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
 endif
 
+# vxworksae / vxworks 653
+ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
+  # target pairs for kernel + vthreads runtime
+  LIBGNAT_TARGET_PAIRS = \
+  a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
+  a-intnam.ads<a-intnam-vxworks.ads \
+  a-numaux.ads<a-numaux-vxworks.ads \
+  g-io.adb<g-io-vxworks-ppc-cert.adb \
+  g-io.ads<g-io-vxworks-ppc-cert.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-interr.adb<s-interr-vxworks.adb \
+  s-intman.ads<s-intman-vxworks.ads \
+  s-intman.adb<s-intman-vxworks.adb \
+  s-osinte.adb<s-osinte-vxworks.adb \
+  s-osinte.ads<s-osinte-vxworks.ads \
+  s-osprim.adb<s-osprim-vxworks.adb \
+  s-parame.ads<s-parame-ae653.ads \
+  s-parame.adb<s-parame-vxworks.adb \
+  s-taprop.adb<s-taprop-vxworks.adb \
+  s-taspri.ads<s-taspri-vxworks.ads \
+  s-tpopsp.adb<s-tpopsp-vxworks.adb \
+  s-vxwork.ads<s-vxwork-ppc.ads \
+  g-soccon.ads<g-soccon-vxworks.ads \
+  g-socthi.ads<g-socthi-vxworks.ads \
+  g-socthi.adb<g-socthi-vxworks.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads \
+  system.ads<system-vxworks-ppc-vthread.ads
+
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+
+  EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
+  EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+  # Extra pairs for the vthreads runtime
+  ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
+    LIBGNAT_TARGET_PAIRS += \
+    s-thread.adb<s-thread-ae653.adb
+    EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
+  endif
+
+  ifeq ($(strip $(filter-out yes,$(TRACE))),)
+    LIBGNAT_TARGET_PAIRS += \
+    s-traces.adb<s-traces-default.adb \
+    s-trafor.adb<s-trafor-default.adb \
+    s-trafor.ads<s-trafor-default.ads \
+    s-tratas.adb<s-tratas-default.adb \
+    s-tfsetr.adb<s-tfsetr-vxworks.adb
+  endif
+endif
+
 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
   LIBGNAT_TARGET_PAIRS = \
   a-intnam.ads<a-intnam-vxworks.ads \
@@ -485,6 +554,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
   s-osinte.ads<s-osinte-vxworks.ads \
   s-osprim.adb<s-osprim-vxworks.adb \
   s-parame.ads<s-parame-vxworks.ads \
+  s-parame.adb<s-parame-vxworks.adb \
   s-stchop.adb<s-stchop-vxworks.adb \
   s-taprop.adb<s-taprop-vxworks.adb \
   s-taspri.ads<s-taspri-vxworks.ads \
@@ -493,9 +563,12 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
   g-soccon.ads<g-soccon-vxworks.ads \
   g-socthi.ads<g-socthi-vxworks.ads \
   g-socthi.adb<g-socthi-vxworks.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads \
   system.ads<system-vxworks-sparcv9.ads   \
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
 
   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
@@ -506,26 +579,26 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
   a-intnam.ads<a-intnam-vxworks.ads \
   i-vxwork.ads<i-vxwork-x86.ads \
   s-inmaop.adb<s-inmaop-posix.adb \
-  s-interr.adb<s-interr-vxworks.adb \
   s-intman.ads<s-intman-vxworks.ads \
   s-intman.adb<s-intman-vxworks.adb \
   a-numaux.adb<a-numaux-x86.adb \
   a-numaux.ads<a-numaux-x86.ads \
-  s-osinte.adb<s-osinte-vxworks.adb \
-  s-osinte.ads<s-osinte-vxworks.ads \
   s-osprim.adb<s-osprim-vxworks.adb \
   s-parame.ads<s-parame-vxworks.ads \
+  s-parame.adb<s-parame-vxworks.adb \
   s-stchop.adb<s-stchop-vxworks.adb \
   s-taprop.adb<s-taprop-vxworks.adb \
   s-taspri.ads<s-taspri-vxworks.ads \
-  s-tpopsp.adb<s-tpopsp-vxworks.adb \
   s-vxwork.ads<s-vxwork-x86.ads \
+  g-bytswa.adb<g-bytswa-x86.adb \
   g-soccon.ads<g-soccon-vxworks.ads \
   g-socthi.ads<g-socthi-vxworks.ads \
   g-socthi.adb<g-socthi-vxworks.adb \
-  system.ads<system-vxworks-x86.ads
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
 
   ifeq ($(strip $(filter-out yes,$(TRACE))),)
     LIBGNAT_TARGET_PAIRS += \
@@ -536,7 +609,32 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
     s-tfsetr.adb<s-tfsetr-vxworks.adb
   endif
 
-  EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
+  ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
+    LIBGNAT_TARGET_PAIRS += \
+    s-osinte.adb<s-osinte-vxworks-rtp.adb \
+    s-osinte.ads<s-osinte-vxworks6.ads \
+    s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
+    system.ads<system-vxworks-x86-rtp.ads
+
+    EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
+  else
+    LIBGNAT_TARGET_PAIRS += \
+    s-interr.adb<s-interr-vxworks.adb \
+    s-osinte.adb<s-osinte-vxworks.adb \
+    s-tpopsp.adb<s-tpopsp-vxworks.adb \
+    system.ads<system-vxworks-x86.ads
+
+    ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
+      LIBGNAT_TARGET_PAIRS += \
+      s-osinte.ads<s-osinte-vxworks6.ads
+    else
+      LIBGNAT_TARGET_PAIRS += \
+      s-osinte.ads<s-osinte-vxworks.ads
+    endif
+
+    EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
+  endif
+
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
 endif
 
@@ -552,6 +650,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
   s-osinte.ads<s-osinte-vxworks.ads \
   s-osprim.adb<s-osprim-vxworks.adb \
   s-parame.ads<s-parame-vxworks.ads \
+  s-parame.adb<s-parame-vxworks.adb \
   s-stchop.adb<s-stchop-vxworks.adb \
   s-taprop.adb<s-taprop-vxworks.adb \
   s-taspri.ads<s-taspri-vxworks.ads \
@@ -560,9 +659,12 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
   g-soccon.ads<g-soccon-vxworks.ads \
   g-socthi.ads<g-socthi-vxworks.ads \
   g-socthi.adb<g-socthi-vxworks.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads \
   system.ads<system-vxworks-arm.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
 
   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
@@ -580,6 +682,7 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
   s-osinte.ads<s-osinte-vxworks.ads \
   s-osprim.adb<s-osprim-vxworks.adb \
   s-parame.ads<s-parame-vxworks.ads \
+  s-parame.adb<s-parame-vxworks.adb \
   s-stchop.adb<s-stchop-vxworks.adb \
   s-taprop.adb<s-taprop-vxworks.adb \
   s-taspri.ads<s-taspri-vxworks.ads \
@@ -588,73 +691,25 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
   g-soccon.ads<g-soccon-vxworks.ads \
   g-socthi.ads<g-socthi-vxworks.ads \
   g-socthi.adb<g-socthi-vxworks.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-vxworks.adb \
+  g-sttsne.ads<g-sttsne-vxworks.ads \
   system.ads<system-vxworks-mips.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
 
   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
 endif
 
-# vxworksae / vxworks 653
-ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
-  # target pairs for kernel + vthreads runtime
-  LIBGNAT_TARGET_PAIRS = \
-  a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
-  a-intnam.ads<a-intnam-vxworks.ads \
-  a-numaux.ads<a-numaux-vxworks.ads \
-  a-sytaco.ads<1asytaco.ads \
-  a-sytaco.adb<1asytaco.adb \
-  g-io.adb<g-io-vxworks-ppc-cert.adb \
-  g-io.ads<g-io-vxworks-ppc-cert.ads \
-  s-inmaop.adb<s-inmaop-posix.adb \
-  s-interr.adb<s-interr-vxworks.adb \
-  s-intman.ads<s-intman-vxworks.ads \
-  s-intman.adb<s-intman-vxworks.adb \
-  s-osinte.adb<s-osinte-vxworks.adb \
-  s-osinte.ads<s-osinte-vxworks.ads \
-  s-osprim.adb<s-osprim-vxworks.adb \
-  s-parame.ads<s-parame-ae653.ads \
-  s-taprop.adb<s-taprop-vxworks.adb \
-  s-taspri.ads<s-taspri-vxworks.ads \
-  s-tpopsp.adb<s-tpopsp-vxworks.adb \
-  s-vxwork.ads<s-vxwork-ppc.ads \
-  g-soccon.ads<g-soccon-vxworks.ads \
-  g-socthi.ads<g-socthi-vxworks.ads \
-  g-socthi.adb<g-socthi-vxworks.adb \
-  system.ads<system-vxworks-ppc-vthread.ads
-
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
-
-  EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
-  EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
-  # Extra pairs for the vthreads runtime
-  ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
-    LIBGNAT_TARGET_PAIRS += \
-    s-thread.adb<s-thread-ae653.adb
-    EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
-  endif
-
-  ifeq ($(strip $(filter-out yes,$(TRACE))),)
-    LIBGNAT_TARGET_PAIRS += \
-    s-traces.adb<s-traces-default.adb \
-    s-trafor.adb<s-trafor-default.adb \
-    s-trafor.ads<s-trafor-default.ads \
-    s-tratas.adb<s-tratas-default.adb \
-    s-tfsetr.adb<s-tfsetr-vxworks.adb
-  endif
-endif
-
-ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
-  LIBGNAT_TARGET_PAIRS = \
+ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
+  LIBGNAT_TARGET_PAIRS_32 = \
   a-intnam.ads<a-intnam-solaris.ads \
   s-inmaop.adb<s-inmaop-posix.adb \
   s-intman.adb<s-intman-solaris.adb \
   s-osinte.adb<s-osinte-solaris.adb \
   s-osinte.ads<s-osinte-solaris.ads \
   s-osprim.adb<s-osprim-solaris.adb \
-  s-parame.adb<s-parame-solaris.adb \
   s-taprop.adb<s-taprop-solaris.adb \
   s-tasinf.adb<s-tasinf-solaris.adb \
   s-tasinf.ads<s-tasinf-solaris.ads \
@@ -664,7 +719,29 @@ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
   g-soliop.ads<g-soliop-solaris.ads \
   system.ads<system-solaris-sparc.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
+  LIBGNAT_TARGET_PAIRS_64 = \
+  a-intnam.ads<a-intnam-solaris.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-intman.adb<s-intman-solaris.adb \
+  s-osinte.adb<s-osinte-solaris.adb \
+  s-osinte.ads<s-osinte-solaris.ads \
+  s-osprim.adb<s-osprim-solaris.adb \
+  s-taprop.adb<s-taprop-solaris.adb \
+  s-tasinf.adb<s-tasinf-solaris.adb \
+  s-tasinf.ads<s-tasinf-solaris.ads \
+  s-taspri.ads<s-taspri-solaris.ads \
+  s-tpopsp.adb<s-tpopsp-solaris.adb \
+  g-soccon.ads<g-soccon-solaris-64.ads \
+  g-soliop.ads<g-soliop-solaris.ads \
+  system.ads<system-solaris-sparcv9.ads
+
+  ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
+    LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
+  else
+    LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
+  endif
+  
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-solaris.adb
 
   EH_MECHANISM=-gcc
   THREADSLIB = -lposix4 -lthread
@@ -694,22 +771,7 @@ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
   endif
 
   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
-    LIBGNAT_TARGET_PAIRS = \
-    a-intnam.ads<a-intnam-solaris.ads \
-    s-inmaop.adb<s-inmaop-posix.adb \
-    s-intman.adb<s-intman-solaris.adb \
-    s-osinte.adb<s-osinte-solaris.adb \
-    s-osinte.ads<s-osinte-solaris.ads \
-    s-osprim.adb<s-osprim-solaris.adb \
-    s-parame.adb<s-parame-solaris.adb \
-    s-taprop.adb<s-taprop-solaris.adb \
-    s-tasinf.adb<s-tasinf-solaris.adb \
-    s-tasinf.ads<s-tasinf-solaris.ads \
-    s-taspri.ads<s-taspri-solaris.ads \
-    s-tpopsp.adb<s-tpopsp-solaris.adb \
-    g-soccon.ads<g-soccon-solaris-64.ads \
-    g-soliop.ads<g-soliop-solaris.ads \
-    system.ads<system-solaris-sparcv9.ads
+    LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
   endif
 endif
 
@@ -723,17 +785,17 @@ ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
   s-osinte.adb<s-osinte-solaris.adb \
   s-osinte.ads<s-osinte-solaris.ads \
   s-osprim.adb<s-osprim-solaris.adb \
-  s-parame.adb<s-parame-solaris.adb \
   s-taprop.adb<s-taprop-solaris.adb \
   s-tasinf.adb<s-tasinf-solaris.adb \
   s-tasinf.ads<s-tasinf-solaris.ads \
   s-taspri.ads<s-taspri-solaris.ads \
   s-tpopsp.adb<s-tpopsp-solaris.adb \
+  g-bytswa.adb<g-bytswa-x86.adb \
   g-soccon.ads<g-soccon-solaris.ads \
   g-soliop.ads<g-soliop-solaris.ads \
   system.ads<system-solaris-x86.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-solaris.adb
 
   THREADSLIB = -lposix4 -lthread
   MISCLIB = -lposix4 -lnsl -lsocket
@@ -749,23 +811,73 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
   a-intnam.ads<a-intnam-linux.ads \
   a-numaux.adb<a-numaux-x86.adb \
   a-numaux.ads<a-numaux-x86.ads \
-  g-soccon.ads<g-soccon-linux-x86.ads \
+  g-bytswa.adb<g-bytswa-x86.adb \
   s-inmaop.adb<s-inmaop-posix.adb \
   s-intman.adb<s-intman-posix.adb \
+  s-osprim.adb<s-osprim-posix.adb \
+  s-taspri.ads<s-taspri-posix.ads \
+  s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+  system.ads<system-linux-x86.ads
+
+  ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
+    LIBGNAT_TARGET_PAIRS += \
+    a-exetim.adb<a-exetim-linux-marte.adb \
+    a-exetim.ads<a-exetim-linux-marte.ads \
+    a-extiti.adb<a-extiti-linux-marte.adb \
+    a-extiti.ads<a-extiti-linux-marte.ads \
+    a-rttiev.adb<a-rttiev-linux-marte.adb \
+    a-rttiev.ads<a-rttiev-linux-marte.ads \
+    g-soccon.ads<g-soccon-linux-x86-marte.ads \
+    s-osinte.adb<s-osinte-linux-marte.adb \
+    s-osinte.ads<s-osinte-linux-marte.ads \
+    s-taprop.adb<s-taprop-linux-marte.adb
+
+    EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
+
+    EH_MECHANISM=
+    THREADSLIB = -lmarte
+  else
+    LIBGNAT_TARGET_PAIRS += \
+    g-soccon.ads<g-soccon-linux-x86.ads \
+    s-osinte.adb<s-osinte-posix.adb \
+    s-osinte.ads<s-osinte-linux.ads \
+    s-taprop.adb<s-taprop-linux.adb
+
+    EH_MECHANISM=-gcc
+    THREADSLIB = -lpthread
+  endif
+
+  TOOLS_TARGET_PAIRS =  \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+    indepsw.adb<indepsw-gnu.adb
+
+  GNATLIB_SHARED = gnatlib-shared-dual
+  GMEM_LIB = gmemlib
+  PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+  LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
+  LIBGNAT_TARGET_PAIRS = \
+  a-intnam.ads<a-intnam-freebsd.ads \
+  a-numaux.adb<a-numaux-x86.adb \
+  a-numaux.ads<a-numaux-x86.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-intman.adb<s-intman-posix.adb \
+  g-soccon.ads<g-soccon-freebsd.ads \
   s-osinte.adb<s-osinte-posix.adb \
-  s-osinte.ads<s-osinte-linux.ads \
+  s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
   s-osprim.adb<s-osprim-posix.adb \
   s-taprop.adb<s-taprop-linux.adb \
   s-taspri.ads<s-taspri-posix.ads \
   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-  s-parame.adb<s-parame-linux.adb \
-  system.ads<system-linux-x86.ads
+  system.ads<system-freebsd-x86.ads
 
   TOOLS_TARGET_PAIRS =  \
     mlib-tgt.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
-  EH_MECHANISM=-gcc
+  SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
   THREADSLIB = -lpthread
   GNATLIB_SHARED = gnatlib-shared-dual
   GMEM_LIB = gmemlib
@@ -778,6 +890,7 @@ ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
   a-intnam.ads<a-intnam-freebsd.ads \
   a-numaux.adb<a-numaux-x86.adb \
   a-numaux.ads<a-numaux-x86.ads \
+  g-bytswa.adb<g-bytswa-x86.adb \
   g-soccon.ads<g-soccon-freebsd.ads \
   s-inmaop.adb<s-inmaop-posix.adb \
   s-intman.adb<s-intman-posix.adb \
@@ -790,10 +903,11 @@ ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
   system.ads<system-freebsd-x86.ads
 
   TOOLS_TARGET_PAIRS = \
-  mlib-tgt.adb<mlib-tgt-linux.adb
+  mlib-tgt-specific.adb<mlib-tgt-linux.adb
   GNATLIB_SHARED = gnatlib-shared-dual
 
-  THREADSLIB= -lc_r
+  EH_MECHANISM=-gcc
+  THREADSLIB= -lpthread
   GMEM_LIB = gmemlib
   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
   LIBRARY_VERSION := $(LIB_VERSION)
@@ -811,7 +925,6 @@ ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
     s-taprop.adb<s-taprop-linux.adb \
     s-taspri.ads<s-taspri-posix.ads \
     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-    s-parame.adb<s-parame-linux.adb \
     system.ads<system-linux-s390x.ads
   else
     LIBGNAT_TARGET_PAIRS = \
@@ -824,12 +937,11 @@ ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
     s-taprop.adb<s-taprop-linux.adb \
     s-taspri.ads<s-taspri-posix.ads \
     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-    s-parame.adb<s-parame-linux.adb \
     system.ads<system-linux-s390.ads
   endif
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb
 
   EH_MECHANISM=-gcc
   THREADSLIB = -lpthread
@@ -871,7 +983,7 @@ ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
   endif
 
   EH_MECHANISM=-gcc
-  TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-irix.adb
+  TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-irix.adb
   TGT_LIB = -lexc
   MISCLIB = -lexc
   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
@@ -915,7 +1027,7 @@ ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
   g-soccon.ads<g-soccon-hpux.ads \
   system.ads<system-hpux.ads
 
-  TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-hpux.adb
+  TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-hpux.adb
   EH_MECHANISM=-gcc
   TGT_LIB = /usr/lib/libcl.a
   THREADSLIB = -lpthread
@@ -945,7 +1057,7 @@ ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
 
   TOOLS_TARGET_PAIRS = \
-  mlib-tgt.adb<mlib-tgt-aix.adb \
+  mlib-tgt-specific.adb<mlib-tgt-aix.adb \
   indepsw.adb<indepsw-aix.adb
 
   GMEM_LIB = gmemlib
@@ -953,7 +1065,7 @@ endif
 
 ifeq ($(strip $(filter-out lynxos,$(osys))),)
   TOOLS_TARGET_PAIRS = \
-  mlib-tgt.adb<mlib-tgt-lynxos.adb \
+  mlib-tgt-specific.adb<mlib-tgt-lynxos.adb \
   indepsw.adb<indepsw-gnu.adb
 
   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
@@ -961,6 +1073,8 @@ ifeq ($(strip $(filter-out lynxos,$(osys))),)
     a-numaux.adb<a-numaux-x86.adb \
     a-numaux.ads<a-numaux-x86.ads \
     a-intnam.ads<a-intnam-lynxos.ads \
+    g-bytswa.adb<g-bytswa-x86.adb \
+    g-soccon.ads<g-soccon-lynxos.ads \
     s-inmaop.adb<s-inmaop-posix.adb \
     s-intman.adb<s-intman-posix.adb \
     s-osinte.adb<s-osinte-lynxos.adb \
@@ -976,6 +1090,7 @@ ifeq ($(strip $(filter-out lynxos,$(osys))),)
   else
     LIBGNAT_TARGET_PAIRS = \
     a-intnam.ads<a-intnam-lynxos.ads \
+    g-soccon.ads<g-soccon-lynxos.ads \
     s-inmaop.adb<s-inmaop-posix.adb \
     s-intman.adb<s-intman-posix.adb \
     s-osinte.adb<s-osinte-lynxos.adb \
@@ -1021,7 +1136,7 @@ ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
   g-soccon.ads<g-soccon-tru64.ads \
   system.ads<system-tru64.ads
 
-  TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-tru64.adb
+  TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-tru64.adb
 
   EH_MECHANISM=-gcc
   GMEM_LIB=gmemlib
@@ -1055,6 +1170,9 @@ ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
   s-osinte.ads<s-osinte-vms-ia64.ads \
   s-vaflop.adb<s-vaflop-vms-ia64.adb \
   system.ads<system-vms_64.ads
+
+  LIBGNAT_TARGET_PAIRS_AUX2 = \
+  s-parame.ads<s-parame-vms-ia64.ads
 else
 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
   LIBGNAT_TARGET_PAIRS_AUX1 = \
@@ -1067,14 +1185,15 @@ ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
   s-osinte.ads<s-osinte-vms.ads \
   s-vaflop.adb<s-vaflop-vms-alpha.adb \
   system.ads<system-vms_64.ads
-endif
-endif
+
 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
   LIBGNAT_TARGET_PAIRS_AUX2 = \
   s-parame.ads<s-parame-vms-restrict.ads
 else
   LIBGNAT_TARGET_PAIRS_AUX2 = \
-  s-parame.ads<s-parame-vms.ads
+  s-parame.ads<s-parame-vms-alpha.ads
+endif
+endif
 endif
 
   LIBGNAT_TARGET_PAIRS = \
@@ -1089,6 +1208,14 @@ endif
   g-soccon.ads<g-soccon-vms.ads \
   g-socthi.ads<g-socthi-vms.ads \
   g-socthi.adb<g-socthi-vms.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
+  g-sttsne.adb<g-sttsne-locking.adb \
+  g-sttsne.ads<g-sttsne-locking.ads \
+  i-c.ads<i-c-vms_64.ads \
+  i-cstrin.ads<i-cstrin-vms_64.ads \
+  i-cstrin.adb<i-cstrin-vms_64.adb \
+  i-cpoint.ads<i-cpoint-vms_64.ads \
+  i-cpoint.adb<i-cpoint-vms_64.adb \
   i-cstrea.adb<i-cstrea-vms.adb \
   s-inmaop.adb<s-inmaop-vms.adb \
   s-interr.adb<s-interr-vms.adb \
@@ -1108,16 +1235,20 @@ endif
 
 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
   TOOLS_TARGET_PAIRS= \
-  mlib-tgt.adb<mlib-tgt-vms-ia64.adb \
+  mlib-tgt-specific.adb<mlib-tgt-vms-ia64.adb \
   symbols.adb<symbols-vms.adb \
   symbols-processing.adb<symbols-processing-vms-ia64.adb
 else
   TOOLS_TARGET_PAIRS= \
-  mlib-tgt.adb<mlib-tgt-vms-alpha.adb \
+  mlib-tgt-specific.adb<mlib-tgt-vms-alpha.adb \
   symbols.adb<symbols-vms.adb \
   symbols-processing.adb<symbols-processing-vms-alpha.adb
 endif
 
+
+  EXTRA_GNATMAKE_OBJS = mlib-tgt-vms.o
+
+  GMEM_LIB = gmemlib
   EH_MECHANISM=-gcc
   GNATLIB_SHARED=gnatlib-shared-vms
 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
@@ -1138,7 +1269,6 @@ endif
 
 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
   LIBGNAT_TARGET_PAIRS = \
-  a-calend.adb<a-calend-mingw.adb \
   a-dirval.adb<a-dirval-mingw.adb \
   a-excpol.adb<a-excpol-abort.adb \
   a-intnam.ads<a-intnam-mingw.ads \
@@ -1153,15 +1283,16 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
   s-osprim.adb<s-osprim-mingw.adb \
   s-taprop.adb<s-taprop-mingw.adb \
   s-taspri.ads<s-taspri-mingw.ads \
-  s-parame.adb<s-parame-mingw.adb \
+  g-bytswa.adb<g-bytswa-x86.adb \
   g-socthi.ads<g-socthi-mingw.ads \
   g-socthi.adb<g-socthi-mingw.adb \
+  g-stsifd.adb<g-stsifd-sockets.adb \
   g-soccon.ads<g-soccon-mingw.ads \
   g-soliop.ads<g-soliop-mingw.ads \
   system.ads<system-mingw.ads
 
   TOOLS_TARGET_PAIRS= \
-  mlib-tgt.adb<mlib-tgt-mingw.adb \
+  mlib-tgt-specific.adb<mlib-tgt-mingw.adb \
   indepsw.adb<indepsw-mingw.adb
 
   MISCLIB = -lwsock32
@@ -1189,11 +1320,10 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
   s-taprop.adb<s-taprop-linux.adb \
   s-taspri.ads<s-taspri-posix.ads \
   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-  s-parame.adb<s-parame-linux.adb \
   system.ads<system-linux-ppc.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
   EH_MECHANISM=-gcc
@@ -1215,11 +1345,10 @@ ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
   s-taprop.adb<s-taprop-linux.adb \
   s-taspri.ads<s-taspri-posix.ads \
   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-  s-parame.adb<s-parame-linux.adb \
   system.ads<system-linux-sparc.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
   EH_MECHANISM=-gcc
@@ -1241,11 +1370,10 @@ ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
   s-taprop.adb<s-taprop-linux.adb \
   s-taspri.ads<s-taspri-posix.ads \
   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-  s-parame.adb<s-parame-linux.adb \
   system.ads<system-linux-hppa.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
   EH_MECHANISM=-gcc
@@ -1272,7 +1400,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
   system.ads<system-linux-ia64.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
   EH_MECHANISM=-gcc
@@ -1298,7 +1426,7 @@ ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
   system.ads<system-linux-alpha.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
   EH_MECHANISM=-gcc
@@ -1326,7 +1454,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
   system.ads<system-linux-x86_64.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-linux.adb \
+    mlib-tgt-specific.adb<mlib-tgt-linux.adb \
     indepsw.adb<indepsw-gnu.adb
 
   EH_MECHANISM=-gcc
@@ -1340,6 +1468,10 @@ endif
 ifeq ($(strip $(filter-out powerpc darwin%,$(arch) $(osys))),)
   LIBGNAT_TARGET_PAIRS = \
   a-intnam.ads<a-intnam-darwin.ads \
+  a-numaux.ads<a-numaux-darwin.ads \
+  a-numaux.adb<a-numaux-darwin.adb \
+  g-soccon.ads<g-soccon-darwin.ads \
+  i-forbla.adb<i-forbla-darwin.adb \
   s-inmaop.adb<s-inmaop-posix.adb \
   s-intman.adb<s-intman-posix.adb \
   s-osinte.adb<s-osinte-darwin.adb \
@@ -1348,13 +1480,10 @@ ifeq ($(strip $(filter-out powerpc darwin%,$(arch) $(osys))),)
   s-taprop.adb<s-taprop-posix.adb \
   s-taspri.ads<s-taspri-posix.ads \
   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
-  g-soccon.ads<g-soccon-darwin.ads \
-  a-numaux.ads<a-numaux-darwin.ads \
-  a-numaux.adb<a-numaux-darwin.adb \
   system.ads<system-darwin-ppc.ads
 
   TOOLS_TARGET_PAIRS =  \
-    mlib-tgt.adb<mlib-tgt-darwin.adb
+    mlib-tgt-specific.adb<mlib-tgt-darwin.adb
 
   EH_MECHANISM=-gcc
   GNATLIB_SHARED = gnatlib-shared-darwin
@@ -1372,6 +1501,18 @@ ifneq ($(EH_MECHANISM),)
   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
 endif
 
+# Use the Ada 2005 version of Ada.Exceptions by default, unless specified
+# explicitly already. The base files (a-except.ad?) are used only for building
+# the compiler and other basic tools.
+# These base versions lack Ada 2005 additions which would cause bootstrap
+# problems if included in the compiler and other basic tools.
+
+ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
+  LIBGNAT_TARGET_PAIRS += \
+    a-except.ads<a-except-2005.ads \
+    a-except.adb<a-except-2005.adb
+endif
+
 # The runtime library for gnat comprises two directories.  One contains the
 # Ada source files that the compiler (gnat1) needs -- these files are listed
 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
@@ -1382,12 +1523,12 @@ endif
 # go into the directory.  The pthreads emulation is built in the threads
 # subdirectory and copied.
 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
-  errno.c exit.c cal.c ctrl_c.c \
+  errno.c exit.c cal.c ctrl_c.c env.c env.h \
   raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
-  final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c gsocket.h \
-  targext.c $(EXTRA_LIBGNAT_SRCS)
+  final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
+  socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
 
-LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
+LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
   raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o \
   final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
 
@@ -1580,7 +1721,7 @@ install-gnatlib: ../stamp-gnatlib
           fi; \
        done
 # This copy must be done preserving the date on the original file.
-       for file in rts/*.adb rts/*.ads; do \
+       for file in rts/*.ad?; do \
            $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
        done
        cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
@@ -1780,7 +1921,7 @@ gnatlib-shared-vms:
        objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
        $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
        echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
-       ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
+       ../../xgcc -g -B../../ -shared -shared-libgcc \
           -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
           sys\$$library:trace.exe \
           --for-linker=/noinform \
@@ -1790,7 +1931,7 @@ gnatlib-shared-vms:
        objdump --syms $(GNATRTL_TASKING_OBJS) | \
        $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
        echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
-       ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
+       ../../xgcc -g -B../../ -shared -shared-libgcc \
           -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
           libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
           sys\$$library:trace.exe \
@@ -1811,7 +1952,8 @@ gnatlib-sjlj:
        sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
        $(MV) rts/s.ads rts/system.ads
        $(MAKE) $(FLAGS_TO_PASS) \
-             GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+            EH_MECHANISM="" \
+            GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
             THREAD_KIND="$(THREAD_KIND)" \
             TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
@@ -1821,6 +1963,7 @@ gnatlib-zcx:
        sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' rts/system.ads > rts/s.ads
        $(MV) rts/s.ads rts/system.ads
        $(MAKE) $(FLAGS_TO_PASS) \
+            EH_MECHANISM="-gcc" \
             GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
             THREAD_KIND="$(THREAD_KIND)" \
@@ -1852,8 +1995,8 @@ ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
 # force no sibling call optimization on s-traceb.o so the number of stack
 # frames to be skipped when computing a call chain is not modified by
 # optimization. However we can do that only when building the runtime
-# (not the compiler) because the -fno-optimize-sibling-calls exists
-# only in GCC 3.
+# (not the compiler) because the -fno-optimize-sibling-calls option exists
+# only in GCC 3 and above.
 
 ifneq (,$(findstring xgcc,$(CC)))
 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
@@ -1873,13 +2016,32 @@ s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
        $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
              $< $(OUTPUT_OPTION)
 
+# force no function reordering on a-except.o because of the exclusion bounds
+# mechanism (see the source file for more detailed information). However we
+# can do that only when building the runtime (not the compiler) because the
+# -fno-toplevel-reorder option exists only in GCC 4.2 and above.
+
+ifneq (,$(findstring xgcc,$(CC)))
+NO_REORDER_ADAFLAGS=-fno-toplevel-reorder
+else
+NO_REORDER_ADAFLAGS=
+endif
+
 # force debugging information on a-except.o so that it is always
 # possible to set conditional breakpoints on exceptions.
 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
 
 a-except.o  : a-except.adb a-except.ads
        $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
-             $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+             $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+
+# compile s-except.o without optimization and with debug info to let the
+# debugger set breakpoints and inspect subprogram parameters on exception
+# related events.
+
+s-except.o  : s-except.adb s-except.ads
+       $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
+             $< $(OUTPUT_OPTION)
 
 # force debugging information on s-assert.o so that it is always
 # possible to set breakpoint on assert failures.
@@ -1935,7 +2097,7 @@ seh_init.o : seh_init.c raise.h
 
 # Need to keep the frame pointer in this file to pop the stack properly on
 # some targets.
-tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c
+tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
        $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
              -fno-omit-frame-pointer $< $(OUTPUT_OPTION)