Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Tru64 UNIX 5.1B porting



I tried to compile zsh-4.3.10 on Tru64 UNIX 5.1B(BL28) with OS bundled cc.
Here are some fixes for Tru64 UNIX with "__digital__" and "__unix__" macro.

1. exec.c compile error
  [error message]
  cc -c -I.  -DHAVE_CONFIG_H -O  -o exec.o exec.c
  cc: Error: exec.c, line 259: In this declaration, "dummy_tz" has no linkage and is of an incomplete type. (incompnolink)
      struct timezone dummy_tz;
  --------------------^

  dummy_tz is defined in /usr/include/sys/time.h line 176 - 179 of Tru64 UNIX.
  But that is enabled when _OSF_SOURCE macro is defined.
  add -D_OSF_SOURCE to --enable-cflags when run configure script.

2. init.c compile error patch
  [error message]
  cc -c -I.  -DHAVE_CONFIG_H -D_OSF_SOURCE   -o init.o init.c
  cc: Error: init.c, line 921: In this statement, "NSIG" is not declared. (undeclared)
          for (i=0; i<NSIG; ++i)
  --------------------^

  NSIG macro is defined in /usr/include/signal.h line 471 of Tru64 UNIX.
  But that is disabled because _XOPEN_SOURCE_EXTENDED macro is enabled.
  In signal.h of Tru64 UNIX, they do not recommend to use NSIG but __sys_nsig in the comment.
  Here is a patch for exec.c

*** Src/signals.h.ORG	Tue May  1 18:24:08 2007
--- Src/signals.h	Mon Oct 19 22:41:51 2009
***************
*** 55,60 ****
--- 55,63 ----
  # define sigdelset(s,n)    (*(s) &= ~(1 << ((n) - 1)), 0)
  # define sigismember(s,n)  ((*(s) & (1 << ((n) - 1))) != 0)
  #endif   /* ifndef POSIX_SIGNALS */
+ #if defined (__digital__) && defined (__unix__)
+ # define NSIG __sys_nsig
+ #endif /* if defined (__digital__) && defined (__unix__) */

  #define child_block()      signal_block(sigchld_mask)
  #define child_unblock()    signal_unblock(sigchld_mask)

3. iconv initialize error patch (utils.c)
  [error message]
  ./A03quoting.ztst: starting.
  Test ./A03quoting.ztst failed: bad status 1, expected 0 from:
    print '<\u0041>'
    printf '%s\n' $'<\u0042>'
    print '<\u0043>'
    printf '%s\n' $'<\u0044>'
  Error output:
  (eval):1: cannot do charset conversion (iconv failed)
  Was testing: \u in both print and printf

  Tru64 UNIX does not have UCS-4BE converter, but UCS-4.
  Tru64 UNIX controls byte order with the environment variable ICONV_BYTEORDER.
  Here is a patch for utils.c

*** Src/utils.c.ORG	Tue May 19 20:18:11 2009
--- Src/utils.c	Tue Oct 20 14:42:32 2009
***************
*** 5120,5126 ****
--- 5120,5130 ----
  		    if (!codesetstr || !*codesetstr)
  			codesetstr = "US-ASCII";
  #endif
+ # if defined (__digital__) && defined (__unix__)
+     	    	    cd = iconv_open(codesetstr, "UCS-4");
+ # else /* defined (__digital__) && defined (__unix__) */
      	    	    cd = iconv_open(codesetstr, "UCS-4BE");
+ # endif /* defined (__digital__) && defined (__unix__) */
  #ifdef ICONV_FROM_LIBICONV
  		    if (cd == (iconv_t)-1 &&  !strcmp(codesetstr, "646")) {
  			codesetstr = "US-ASCII";
***************
*** 5128,5133 ****
--- 5132,5139 ----
  		    }
  #endif
  		    if (cd == (iconv_t)-1) {
+ 			perror("iconv_open: ");
+ 			fprintf(stderr, "errno = %d\n", errno);
  			zerr("cannot do charset conversion (iconv failed)");
  			CHARSET_FAILED();
  		    }



Messages sorted by: Reverse Date, Date, Thread, Author