From: clauberg@rrz.uni-koeln.DE (Axel Clauberg)
Subject: Patches for DEC Alpha running OSF/1
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 4 Jan 1993 16:22:34 GMT

Here is a first set of patches to make bash-1.12 compile and run on DEC
Alpha machines running OSF/1 (we are running DEC OSF/1 T1.2-2  (Rev. 5)).
There are still some problems, but at least you can use bash for further
debugging work.
This machine has 64 bit pointers, 64 bit longs and 32 bit ints, which makes 
some ugly parts of bash fail. I didn't clean up the code in make_redirection,
but instead used a long in the redirectee union. Caution: there are for sure 
more of these "bad" parts in bash where either a function returning a pointer 
isn't declared or some bad int/pointer unions are used...
Be sure to use GNU make (which compiled without problems), else you will
be hit by the DEC make internal definition of MACHINE.

diff -cr ./command.h /vol/src/alpha/gnu/bash-1.12/command.h
*** ./command.h	Tue Jan 21 19:08:40 1992
--- /vol/src/alpha/gnu/bash-1.12/command.h	Mon Jan  4 12:28:21 1993
***************
*** 48,54 ****
    int flags;			/* Flag value for `open'. */
    enum r_instruction  instruction; /* What to do with the information. */
    union {
!     int dest;			/* Place to redirect REDIRECTOR to, or ... */
      WORD_DESC *filename;	/* filename to redirect to. */
    } redirectee;
    char *here_doc_eof;		/* The word that appeared in <<foo. */
--- 48,54 ----
    int flags;			/* Flag value for `open'. */
    enum r_instruction  instruction; /* What to do with the information. */
    union {
!     long dest;			/* Place to redirect REDIRECTOR to, or ... */
      WORD_DESC *filename;	/* filename to redirect to. */
    } redirectee;
    char *here_doc_eof;		/* The word that appeared in <<foo. */
diff -cr ./machines.h /vol/src/alpha/gnu/bash-1.12/machines.h
*** ./machines.h	Fri Jan 17 22:42:24 1992
--- /vol/src/alpha/gnu/bash-1.12/machines.h	Mon Jan  4 14:51:53 1993
***************
*** 1121,1126 ****
--- 1121,1138 ----
  #undef HAVE_GETWD
  #endif /* MagicStation */
  
+ #if defined(__alpha) || defined(alpha)
+ #define M_MACHINE "ALPHA"
+ #define M_OS OSF1
+ #define HAVE_SYS_SIGLIST
+ #define HAVE_SETLINEBUF
+ #define HAVE_VFPRINTF
+ #define VOID_SIGHANDLER
+ #define USE_TERMCAP_EMULATION
+ #define HAVE_GETGROUPS
+ #define SYSDEP_CFLAGS -DNLS -D_BSD
+ #undef USE_GNU_MALLOC
+ #endif
  /* **************************************************************** */
  /*								    */
  /*			Generic Entry   			    */
diff -cr ./make_cmd.c /vol/src/alpha/gnu/bash-1.12/make_cmd.c
*** ./make_cmd.c	Tue Jan 28 06:59:22 1992
--- /vol/src/alpha/gnu/bash-1.12/make_cmd.c	Mon Jan  4 12:28:56 1993
***************
*** 411,416 ****
--- 411,417 ----
     and DEST is an INT or a WORD_DESC *. */
  REDIRECT *
  make_redirection (source, instruction, dest)
+      long dest;
       enum r_instruction instruction;
  {
    REDIRECT *temp = (REDIRECT *)xmalloc (sizeof (REDIRECT));
diff -cr ./subst.c /vol/src/alpha/gnu/bash-1.12/subst.c
*** ./subst.c	Tue Nov 26 20:58:59 1991
--- /vol/src/alpha/gnu/bash-1.12/subst.c	Mon Jan  4 14:42:18 1993
***************
*** 32,37 ****
--- 32,39 ----
  #include <readline/history.h>
  #include <glob/fnmatch.h>
  
+ extern GENERIC_LIST *reverse_list();
+ 
  /* The size that strings change by. */
  #define DEFAULT_ARRAY_SIZE 512
  
diff -cr ./support/getcppsyms.c /vol/src/alpha/gnu/bash-1.12/support/getcppsyms.c
*** ./support/getcppsyms.c	Thu Jan  9 09:33:05 1992
--- /vol/src/alpha/gnu/bash-1.12/support/getcppsyms.c	Sun Jan  3 18:57:26 1993
***************
*** 305,310 ****
--- 305,319 ----
  #if defined (vax)
    printf (" -Dvax");
  #endif /* vax */
+ #if defined (alpha)
+   printf (" -Dalpha");
+ #endif
+ #if defined (__alpha)
+   printf (" -D__alpha");
+ #endif
+ #if defined (__osf__)
+   printf (" -D__osf__");
+ #endif
  
    printf ("\n");
    exit (0);

Best regards, Axel

-- 
Axel Clauberg,    Regional Computing Center, University of Cologne
                  Robert-Koch Str. 10, D- 5000 Koeln 41, Germany
                  Phone:+49 (221) 478-5589  FAX:+49 (221) 478-5590
                  Internet: clauberg@rrz.Uni-Koeln.DE
		  X.400: s=clauberg; ou=rrz; p=uni-koeln; a=dbp; c=de

Newsgroups: gnu.bash.bug