From 23c94851fb2c98d345d913d35a5a12bbc3a346bd Mon Sep 17 00:00:00 2001
From: simonm <unknown>
Date: Thu, 5 Feb 1998 12:23:54 +0000
Subject: [PATCH] [project @ 1998-02-05 12:23:33 by simonm] alpha-dec-osf1 and
 alpha-dec-osf3 are now separate configurations.

---
 aclocal.m4                   | 12 ++++++++----
 configure.in                 | 11 ++++++++++-
 distrib/configure-bin.in     |  4 +++-
 ghc/compiler/nativeGen/NCG.h |  7 ++++++-
 ghc/includes/COptJumps.lh    |  2 +-
 ghc/includes/COptRegs.lh     |  2 +-
 ghc/includes/StgMacros.lh    |  6 +++---
 ghc/includes/platform.h.in   |  1 +
 8 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 08f69313c4b5..de6b4215fa25 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -62,9 +62,12 @@ AC_CACHE_CHECK([leading underscore in symbol names], ac_cv_lead_uscore,
 # Hack!: nlist() under Digital UNIX insist on there being an _,
 # but symbol table listings show none. What is going on here?!?
 #
-if test $HostPlatform = "alpha-dec-osf1"; then
-   ac_cv_lead_uscore='no'
-else
+changequote(<<, >>)dnl
+<<
+case $HostPlatform in
+alpha-dec-osf*) ac_cv_lead_uscore='no';;
+*) >>
+changequote([, ])dnl
 AC_TRY_RUN([#ifdef HAVE_NLIST_H
 #include <nlist.h>
 changequote(<<, >>)dnl
@@ -83,7 +86,8 @@ changequote([, ])dnl
 #endif
     exit(1);
 }], ac_cv_lead_uscore=yes, ac_cv_lead_uscore=no, ac_cv_lead_uscore=NO)
-fi);
+;;
+esac);
 LeadingUnderscore=`echo $ac_cv_lead_uscore | sed 'y/yesno/YESNO/'`
 AC_SUBST(LeadingUnderscore)
 ])
diff --git a/configure.in b/configure.in
index a9b8941ffce3..75602893468a 100644
--- a/configure.in
+++ b/configure.in
@@ -74,7 +74,7 @@ exeext=''
 # We also record the architecture, vendor, and operating system (OS)
 # separately.
 case $HostPlatform in
-alpha-dec-osf[[1234]]*)
+alpha-dec-osf[[12]]*)
 	HostPlatform=alpha-dec-osf1   # canonicalise for our purposes
 	TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
 	BuildPlatform=alpha-dec-osf1  # hack
@@ -83,6 +83,15 @@ alpha-dec-osf[[1234]]*)
         HostVendor_CPP='dec'
         HostOS_CPP='osf1'
         ;;
+alpha-dec-osf[[34]]*)
+	HostPlatform=alpha-dec-osf3   # canonicalise for our purposes
+	TargetPlatform=alpha-dec-osf3 # this will work for now... (hack)
+	BuildPlatform=alpha-dec-osf3  # hack
+        HostPlatform_CPP='alpha_dec_osf3'
+        HostArch_CPP='alpha'
+        HostVendor_CPP='dec'
+        HostOS_CPP='osf3'
+        ;;
 hppa1.1-hp-hpux*)
 	HostPlatform=hppa1.1-hp-hpux  # canonicalise for our purposes (hack)
 	TargetPlatform=hppa1.1-hp-hpux
diff --git a/distrib/configure-bin.in b/distrib/configure-bin.in
index e83624efefc6..516f12048598 100644
--- a/distrib/configure-bin.in
+++ b/distrib/configure-bin.in
@@ -24,8 +24,10 @@ TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
 # We also record the architecture, vendor, and operating system (OS)
 # separately.
 case $TargetPlatform in
-alpha-dec-osf[[1234]]*)
+alpha-dec-osf[[12]]*)
 	TargetPlatform=alpha-dec-osf1;;
+alpha-dec-osf[[34]]*)
+	TargetPlatform=alpha-dec-osf3;;
 hppa1.1-hp-hpux*)
 	TargetPlatform=hppa1.1-hp-hpux;;
 i[[3456]]86-*-linuxaout*)
diff --git a/ghc/compiler/nativeGen/NCG.h b/ghc/compiler/nativeGen/NCG.h
index 3e4d8c143cca..ac69c2666617 100644
--- a/ghc/compiler/nativeGen/NCG.h
+++ b/ghc/compiler/nativeGen/NCG.h
@@ -55,7 +55,12 @@ you will screw up the layout where they are used in case expressions!
 # define BYTES_PER_WORD 8
 # define BYTES_PER_WORD_STR "8"
 
-# include "../../includes/alpha-dec-osf1.h"
+# if osf1_TARGET_OS
+#  include "../../includes/alpha-dec-osf1.h"
+# endif
+# if osf3_TARGET_OS
+#  include "../../includes/alpha-dec-osf3.h"
+# endif
 #endif
 
 #if i386_TARGET_ARCH
diff --git a/ghc/includes/COptJumps.lh b/ghc/includes/COptJumps.lh
index 9786cd42d8b0..3c10677884b1 100644
--- a/ghc/includes/COptJumps.lh
+++ b/ghc/includes/COptJumps.lh
@@ -60,7 +60,7 @@ It seems that \tr{_procedure} can't be declared within the body of the
 \tr{JMP_} macro...at least, not if we want it to be \$27, which we do!
 
 \begin{code}
-#if alpha_dec_osf1_TARGET
+#if alpha_TARGET_ARCH
     /* ToDo: less specific? */
 
 /*
diff --git a/ghc/includes/COptRegs.lh b/ghc/includes/COptRegs.lh
index eaf46f94aec2..b8e6b53a3530 100644
--- a/ghc/includes/COptRegs.lh
+++ b/ghc/includes/COptRegs.lh
@@ -242,7 +242,7 @@ all available registers, with the normal callee-saves conventions.
 
 This is a HACK here; see comment in COptJumps.lh.
 \begin{code}
-#if alpha_dec_osf1_TARGET && defined(__STG_TAILJUMPS__) && defined(__GNUC__)
+#if alpha_TARGET_ARCH && defined(__STG_TAILJUMPS__) && defined(__GNUC__)
 register void *_procedure __asm__("$27");
 #endif
 #if (mipsel_TARGET_ARCH || mipseb_TARGET_ARCH) && defined(__STG_TAILJUMPS__) && defined(__GNUC__)
diff --git a/ghc/includes/StgMacros.lh b/ghc/includes/StgMacros.lh
index 634d81a5081a..44d9a4d92dd6 100644
--- a/ghc/includes/StgMacros.lh
+++ b/ghc/includes/StgMacros.lh
@@ -885,7 +885,7 @@ Some floating-point format info, made with the \tr{enquire} program
 /* yes, it is IEEE floating point */
 #include "ieee-flpt.h"
 
-#if alpha_dec_osf1_TARGET	\
+#if alpha_TARGET_ARCH	\
  || i386_TARGET_ARCH		\
  || mipsel_TARGET_ARCH
 
@@ -902,7 +902,7 @@ Some floating-point format info, made with the \tr{enquire} program
 \end{code}
 
 \begin{code}
-#if alpha_dec_osf1_TARGET
+#if alpha_TARGET_ARCH
 #define encodeFloatZh(r, hp, aa,sa,da, expon)	encodeDoubleZh(r, hp, aa,sa,da, expon)
 #else
 #define encodeFloatZh(r, hp, aa,sa,da, expon)	\
@@ -928,7 +928,7 @@ Some floating-point format info, made with the \tr{enquire} program
   r = SAFESTGCALL2(StgDouble,(void *, MP_INT *, I_), __encodeDouble,&arg,(expon));\
 }
 
-#if alpha_dec_osf1_TARGET
+#if alpha_TARGET_ARCH
 #define decodeFloatZh(exponr, ar,sr,dr, hp, f)	decodeDoubleZh(exponr, ar,sr,dr, hp, f)
 #else
 #define decodeFloatZh(exponr, ar,sr,dr, hp, f)				\
diff --git a/ghc/includes/platform.h.in b/ghc/includes/platform.h.in
index 87cf5eaa33bf..469bb6a14275 100644
--- a/ghc/includes/platform.h.in
+++ b/ghc/includes/platform.h.in
@@ -3,6 +3,7 @@
 
 #define alpha_dec_osf1		10
 #define alpha_unknown_linux	11
+#define alpha_dec_osf3		12
 #define hppa1_1_hp_hpux		20
 #define i386_next_nextstep3	30
 #define i386_unknown_bsdi	31
-- 
GitLab