head	1.5;
access;
symbols
	RELEASE_6_0_0:1.4
	RELEASE_5_4_0:1.4
	RELEASE_4_11_0:1.4
	RELEASE_5_3_0:1.4
	RELEASE_4_10_0:1.4
	RELEASE_5_2_1:1.4
	RELEASE_5_2_0:1.4
	RELEASE_4_9_0:1.4
	RELEASE_5_1_0:1.4
	RELEASE_4_8_0:1.4
	RELEASE_5_0_0:1.4
	RELEASE_4_7_0:1.3
	RELEASE_4_6_2:1.3
	RELEASE_4_6_1:1.3
	RELEASE_4_6_0:1.3
	RELEASE_5_0_DP1:1.3
	RELEASE_4_5_0:1.3
	RELEASE_4_4_0:1.3
	RELEASE_4_3_0:1.3
	RELEASE_4_2_0:1.3
	RELEASE_4_1_1:1.2
	RELEASE_4_1_0:1.2
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1
	RELEASE_3_4_0:1.1;
locks; strict;
comment	@# @;


1.5
date	2005.11.29.00.01.24;	author deischen;	state dead;
branches;
next	1.4;

1.4
date	2002.12.01.19.10.48;	author deischen;	state Exp;
branches;
next	1.3;

1.3
date	2000.11.01.18.57.03;	author deischen;	state Exp;
branches;
next	1.2;

1.2
date	2000.06.27.11.27.25;	author deischen;	state Exp;
branches;
next	1.1;

1.1
date	99.11.09.12.33.34;	author deischen;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Update the antiquated version of the GNAT compiler to the GPL-2005
version.

Note that this version now produces executables that are
covered by the GPL as opposed to the previous version which was
covered by the modified GPL.

Also note that the GNAT sources in the stock GCC-4 tree are
not under this restriction.  A new port based on the sources
in GCC-4 will come when I get the time.
@
text
@*** ada/a-init.c.orig	Wed Jul 19 15:09:57 2000
--- ada/a-init.c	Fri Oct 13 11:25:52 2000
***************
*** 1441,1446 ****
--- 1441,1528 ----
  }
  
  
+ /*************************************************/
+ /* __gnat_initialize (FreeBSD version) */
+ /*************************************************/
+ 
+ #elif defined (__FreeBSD__)
+ 
+ #include <signal.h>
+ #include <unistd.h>
+ 
+ static void
+ __gnat_error_handler (sig, code, sc)
+      int sig;
+      int code;
+      struct sigcontext *sc;
+ {
+   struct Exception_Data *exception;
+   char *msg;
+ 
+   switch (sig)
+     {
+     case SIGFPE:
+       exception = &constraint_error;
+       msg = "SIGFPE";
+       break;
+ 
+     case SIGILL:
+       exception = &constraint_error;
+       msg = "SIGILL";
+       break;
+ 
+     case SIGSEGV:
+       exception = &storage_error;
+       msg = "stack overflow or erroneous memory access";
+       break;
+ 
+     case SIGBUS:
+       exception = &constraint_error;
+       msg = "SIGBUS";
+       break;
+ 
+     default:
+       exception = &program_error;
+       msg = "unhandled signal";
+     }
+ 
+   Raise_From_Signal_Handler (exception, msg);
+ }
+ 
+ void
+ __gnat_install_handler ()
+ {
+   struct sigaction act;
+ 
+   /* Set up signal handler to map synchronous signals to appropriate
+      exceptions.  Make sure that the handler isn't interrupted by another
+      signal that might cause a scheduling event! */
+ 
+   act.sa_handler = __gnat_error_handler;
+   act.sa_flags = SA_NODEFER | SA_RESTART;
+   (void) sigemptyset (&act.sa_mask);
+ 
+   (void) sigaction (SIGILL,  &act, NULL);
+   (void) sigaction (SIGFPE,  &act, NULL);
+   (void) sigaction (SIGSEGV, &act, NULL);
+   (void) sigaction (SIGBUS,  &act, NULL);
+ }
+ 
+ void __gnat_init_float ();
+ 
+ void
+ __gnat_initialize ()
+ {
+    __gnat_install_handler ();
+ 
+    /* XXX - Initialize floating-point coprocessor. This call is
+       needed because FreeBSD defaults to 64-bit precision instead
+       of 80-bit precision?  We require the full precision for
+       proper operation, given that we have set Max_Digits etc
+       with this in mind */
+    __gnat_init_float ();
+ }
+ 
  /***************************************/
  /* __gnat_initialize (default version) */
  /***************************************/
***************
*** 1466,1472 ****
     WIN32 and could be used under OS/2 */
  
  #if defined (_WIN32) || defined (__INTERIX) || defined (__EMX__) \
!   || defined (__Lynx__)
  
  #define HAVE_GNAT_INIT_FLOAT
  
--- 1548,1554 ----
     WIN32 and could be used under OS/2 */
  
  #if defined (_WIN32) || defined (__INTERIX) || defined (__EMX__) \
!   || defined (__Lynx__) || defined (__FreeBSD__)
  
  #define HAVE_GNAT_INIT_FLOAT
  
@


1.4
log
@Update to the latest released version of GNAT (3.15p).  Also use a
new bootstrap compiler and fix so that it builds under -current.

Approved by:	portmgr
@
text
@@


1.3
log
@Update to the latest public release 3.13p.

Thanks to Samuel Tardieu <sam@@inf.enst.fr> for instigating this
update and providing some of the changes.
@
text
@d57 1
a57 1
+ static void
@


1.2
log
@When initializing the GNAT (i386) run-time, initialize the floating point
control word to use 64-bit (extended) precision instead of FreeBSDs
default 53-bit (double) precision.

Submitted by:	Sune Falck <sunef@@hem.passagen.se>
@
text
@d1 2
a2 2
*** ./ada/a-init.c.orig	Fri Sep 24 08:42:43 1999
--- ./ada/a-init.c	Mon Jun 26 21:43:54 2000
d4 2
a5 2
*** 1445,1450 ****
--- 1445,1532 ----
d83 3
a85 3
+    /* XXX - Initialize floating-point coprocessor.  This call is
+       needed because FreeBSD defaults to 53-bit precision instead
+       of 64-bit precision.   We require the full precision for
d87 1
a87 1
+       with this in mind. */
d95 16
a110 16
*** 1470,1476 ****
     defined in all Win32 versions, but only actually does something on
     the i386 version, where it properly initializes the FPU for GNAT use.  */
  
! #if defined (_WIN32) || defined (__INTERIX)
  void
  __gnat_init_float ()
  {
--- 1552,1558 ----
     defined in all Win32 versions, but only actually does something on
     the i386 version, where it properly initializes the FPU for GNAT use.  */
  
! #if defined (_WIN32) || defined (__INTERIX) || defined (__FreeBSD__)
  void
  __gnat_init_float ()
  {
@


1.1
log
@Upgrade GNAT to GNAT-3.12p, the latest public release from Ada Core
Technologies.
@
text
@d2 1
a2 1
--- ./ada/a-init.c	Sat Nov  6 16:22:51 1999
d5 1
a5 1
--- 1445,1523 ----
d76 2
d82 7
d94 17
@

