From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,6c39a5edb9bc0d8a,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-04-02 06:21:51 PST Path: gmd.de!newsserver.jvnc.net!darwin.sura.net!gatech!usenet.ufl.edu!eng.ufl.edu!spool.mu.edu!uunet!mcsun!sunic!ugle.unit.no!aun.uninett.no!flipper.pvv.unit.no!imf.unit.no!arnej From: arnej@imf.unit.no (Arne Henrik Juul) Newsgroups: comp.unix.osf.osf1 Subject: Patches for bash on DEC Alpha Date: 2 Apr 93 15:28:33 Organization: Norwegian Institute of Technology Distribution: world Message-ID: NNTP-Posting-Host: chanur.imf.unit.no Starting with the patches available from ftp.ncsa.uiuc.edu in the DEC_Alpha directory (thanks to Rob McCool!), I made some additional patches and got a working version of GNU's Bourne Again SHell, bash. Since this is a very important program (to some people at least :-) I'm posting my patches here. Note that you will probably want to change the default path settings according to your local setup, the patch to config.h below is very site-dependant. With these patches, bash compiles with only some harmless warnings about MAXPATHLEN being redefined (from 1024 to PATH_MAX, which is also 1024) on our Alpha running T1.2-2. Please contact me if you notice any problems with these patches, but as ususal: Use at own risk, keep unavailable for children, etc. Thanks, Arne H. Juul, arnej@lise.unit.no diff -rc ../orig/command.h ./command.h *** ../orig/command.h Tue Jan 21 19:08:40 1992 --- ./command.h Fri Mar 26 15:19:57 1993 *************** *** 40,45 **** --- 40,50 ---- /* */ /* **************************************************************** */ + typedef union { + int dest; /* Place to redirect REDIRECTOR to, or ... */ + WORD_DESC *filename; /* filename to redirect to. */ + } xx_un; + /* What a redirection descriptor looks like. If FLAGS is IS_DESCRIPTOR, then we use REDIRECTEE.DEST, else we use the file specified. */ typedef struct redirect { *************** *** 47,56 **** int redirector; /* Descriptor to be redirected. */ 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 <.machine version.h: newversion.aux if ./newversion.aux -build; then mv -f newversion.h version.h; fi --- 616,626 ---- @echo @echo " ***************************************************" @echo " * *" ! @echo " * Making Bash-`cat .distribution` for a $(XMACHINE) running $(OS)." @echo " * *" @echo " ***************************************************" @echo ! @echo "$(PROGRAM) last made for a $(XMACHINE) running $(OS)" >.machine version.h: newversion.aux if ./newversion.aux -build; then mv -f newversion.h version.h; fi *************** *** 756,762 **** compress -f $(PROGRAM).tar clone: $(THINGS_TO_TAR) ! @$(MKTARFILE) +notar $(MACHINE) $(OS) $(THINGS_TO_TAR) install: .made -if [ -f $(DESTDIR)/$(PROGRAM) ]; \ --- 756,762 ---- compress -f $(PROGRAM).tar clone: $(THINGS_TO_TAR) ! @$(MKTARFILE) +notar $(XMACHINE) $(OS) $(THINGS_TO_TAR) install: .made -if [ -f $(DESTDIR)/$(PROGRAM) ]; \ *************** *** 809,822 **** /**/# Here is a convenient rule when you arrive at a new site and wish to /**/# install bash on several different architectures. It creates a new /**/# directory to hold the results of compilatation. The directory is ! /**/# named MACHINE-OS. ! architecture: $(MACHINE)-$(OS)/$(PROGRAM) ! $(MACHINE)-$(OS): ! -mkdir $(MACHINE)-$(OS) ! $(MACHINE)-$(OS)/$(PROGRAM): $(MACHINE)-$(OS) $(PROGRAM) ! mv $(PROGRAM) $(MACHINE)-$(OS) ! mv sysdefs.h $(MACHINE)-$(OS) ! mv $(SDIR)getcppsyms $(MACHINE)-$(OS) $(MAKE) $(MFLAGS) clean --- 809,822 ---- /**/# Here is a convenient rule when you arrive at a new site and wish to /**/# install bash on several different architectures. It creates a new /**/# directory to hold the results of compilatation. The directory is ! /**/# named XMACHINE-OS. ! architecture: $(XMACHINE)-$(OS)/$(PROGRAM) ! $(XMACHINE)-$(OS): ! -mkdir $(XMACHINE)-$(OS) ! $(XMACHINE)-$(OS)/$(PROGRAM): $(XMACHINE)-$(OS) $(PROGRAM) ! mv $(PROGRAM) $(XMACHINE)-$(OS) ! mv sysdefs.h $(XMACHINE)-$(OS) ! mv $(SDIR)getcppsyms $(XMACHINE)-$(OS) $(MAKE) $(MFLAGS) clean diff -rc ../orig/general.c ./general.c *** ../orig/general.c Tue Jan 21 05:35:27 1992 --- ./general.c Fri Apr 2 14:58:28 1993 *************** *** 806,812 **** return (name); } ! #if defined (USG) || (defined (_POSIX_VERSION) && defined (Ultrix)) int sysv_getc (stream) FILE *stream; --- 806,812 ---- return (name); } ! #if defined (USG) || defined(DIGITAL) int sysv_getc (stream) FILE *stream; diff -rc ../orig/hash.c ./hash.c *** ../orig/hash.c Sun Jul 7 23:53:51 1991 --- ./hash.c Fri Mar 26 14:37:29 1993 *************** *** 28,39 **** #define FILENAME_HASH_BUCKETS 107 - /* Create the hash table for filenames that we use in the shell. */ - initialize_hashed_filenames () - { - hashed_filenames = make_hash_table (FILENAME_HASH_BUCKETS); - } - /* Make a new hash table with BUCKETS number of buckets. Initialize each slot in the table to NULL. */ HASH_TABLE * --- 28,33 ---- diff -rc ../orig/machines.h ./machines.h *** ../orig/machines.h Fri Jan 17 22:42:24 1992 --- ./machines.h Fri Apr 2 14:58:01 1993 *************** *** 196,202 **** #define HAVE_GETGROUPS #endif /* vax && !ultrix */ ! /* **************************************** */ /* */ /* SGI Iris/IRIX */ /* */ --- 196,219 ---- #define HAVE_GETGROUPS #endif /* vax && !ultrix */ ! /* ************************ */ ! /* */ ! /* DEC AXP OSF/1 */ ! /* */ ! /* ************************ */ ! ! #if defined(alpha) && defined(DEC_OSF1) ! #define M_MACHINE "AlphaAXP" ! #define M_OS DecOSF ! #undef USE_GNU_MALLOC ! #define HAVE_SETLINEBUF ! #define HAVE_VFPRINTF ! #define SYSDEP_CFLAGS -DDIGITAL ! #define HAVE_STRERROR ! #define VOID_SIGHANDLER ! #endif ! ! /* **************************************** */ /* */ /* SGI Iris/IRIX */ /* */ diff -rc ../orig/make_cmd.c ./make_cmd.c *** ../orig/make_cmd.c Tue Jan 21 18:41:40 1992 --- ./make_cmd.c Fri Mar 26 17:32:38 1993 *************** *** 22,27 **** --- 22,28 ---- #include #include #include + #include "config.h" #include "general.h" #include "error.h" #include "command.h" *************** *** 405,422 **** } } ! /* Generate a REDIRECT from SOURCE, DEST, and INSTRUCTION. INSTRUCTION is the instruction type, SOURCE is an INT, ! and DEST is an INT or a WORD_DESC *. */ REDIRECT * ! make_redirection (source, instruction, dest) enum r_instruction instruction; { REDIRECT *temp = (REDIRECT *)xmalloc (sizeof (REDIRECT)); /* First do the common cases. */ temp->redirector = source; ! temp->redirectee.dest = dest; temp->instruction = instruction; temp->next = (REDIRECT *)NULL; --- 406,424 ---- } } ! /* Generate a REDIRECT from SOURCE, INSTRUCTION, and REDIRECTEE. INSTRUCTION is the instruction type, SOURCE is an INT, ! and REDIRECTEE is an union (INT, WORD_DESC *) */ REDIRECT * ! make_redirection (source, instruction, redirectee) enum r_instruction instruction; + xx_un redirectee; { REDIRECT *temp = (REDIRECT *)xmalloc (sizeof (REDIRECT)); /* First do the common cases. */ temp->redirector = source; ! temp->redirectee = redirectee; temp->instruction = instruction; temp->next = (REDIRECT *)NULL; diff -rc ../orig/parse.y ./parse.y *** ../orig/parse.y Sat Jan 25 23:52:44 1992 --- ./parse.y Fri Apr 2 14:59:07 1993 *************** *** 751,757 **** yy_stream_get () { if (bash_input.location.file) ! #if defined (USG) || (defined (_POSIX_VERSION) && defined (Ultrix)) return (sysv_getc (bash_input.location.file)); #else return (getc (bash_input.location.file)); --- 751,757 ---- yy_stream_get () { if (bash_input.location.file) ! #if defined (USG) || defined (DIGITAL) return (sysv_getc (bash_input.location.file)); #else return (getc (bash_input.location.file)); diff -rc ../orig/subst.c ./subst.c *** ../orig/subst.c Tue Nov 26 20:58:59 1991 --- ./subst.c Fri Apr 2 15:01:50 1993 *************** *** 51,56 **** --- 51,59 ---- extern WORD_DESC *copy_word (); extern WORD_LIST *copy_word_list(); + /* Fix a bug on the alpha running OSF/1 -Rob McCool */ + extern GENERIC_LIST *reverse_list(); + static WORD_LIST *expand_string_internal (), *expand_words_internal (); static char *quote_string (), *dequote_string (); static int unquoted_substring (); *************** *** 1244,1250 **** /* Read the output of the command through the pipe. */ while (1) { ! #if defined (USG) || (defined (_POSIX_VERSION) && defined (Ultrix)) c = sysv_getc (istream); #else c = getc (istream); --- 1247,1253 ---- /* Read the output of the command through the pipe. */ while (1) { ! #if defined (USG) || defined (DIGITAL) c = sysv_getc (istream); #else c = getc (istream); *************** *** 2815,2822 **** t = copy_word_list (expanded); } new_list = ! (WORD_LIST *)list_append (reverse_list (t), new_list); dispose_words (expanded); --- 2818,2826 ---- t = copy_word_list (expanded); } + /* RMM */ new_list = ! (WORD_LIST *)list_append (reverse_list (t), new_list); dispose_words (expanded); diff -rc ../orig/builtins/hashcom.h ./builtins/hashcom.h *** ../orig/builtins/hashcom.h Mon Jul 8 00:03:38 1991 --- ./builtins/hashcom.h Fri Mar 26 14:37:29 1993 *************** *** 3,9 **** #define FILENAME_HASH_BUCKETS 631 ! HASH_TABLE *hashed_filenames; typedef struct { char *path; /* The full pathname of the file. */ --- 3,9 ---- #define FILENAME_HASH_BUCKETS 631 ! extern HASH_TABLE *hashed_filenames; typedef struct { char *path; /* The full pathname of the file. */ diff -rc ../orig/support/getcppsyms.c ./support/getcppsyms.c *** ../orig/support/getcppsyms.c Thu Jan 9 09:33:05 1992 --- ./support/getcppsyms.c Sat Jan 16 20:29:21 1993 *************** *** 305,310 **** --- 305,313 ---- #if defined (vax) printf (" -Dvax"); #endif /* vax */ + #if defined (__osf__) && defined (__alpha) + printf(" -Dalpha -DDEC_OSF1"); + #endif printf ("\n"); exit (0);