A.J.Mechelynck wrote:
mwoehlke wrote:
A.J.Mechelynck wrote:
mwoehlke wrote:
Well, that was exciting... I recently tried to build vim 7 on OSS (Tandem / HP Nonstop S-Series). I finally got it to work by diff'ing the ITUG Floss sources (link below) against vim-6.1 and applying the diffs to vim-7.0 (and by first building/installing ncurses-5.5). I would like to submit my efforts to be included upstream. Are there any objections if I post the .patch here?

If the patch is relatively small, you can also post it on the vim-dev list [snip]

Well, I guess 260 lines is not overly large (at any rate, I see there have been larger things on the list), so here it is. NOTE: the changes to Makefile are broken in that they are not conditional to TANDEM. It seems like -lfloss should be added more nicely (ideally by ./configure) but I am not sure where or how to make such a change.

You still need to compile with -WIEEE_float (including ncurses, if you use it), because libfloss is IEEE_float.

--
Matthew
"We're all mad here. I'm mad. You're mad... You must be, or you wouldn't have come here." -- The Cheshire Cat
file:///faith3/home/mwoehlke/src/other/vim/vim7_oss.patch
diff -cr mine/src/ex_cmds.c oss/src/ex_cmds.c
*** mine/src/ex_cmds.c	2006-04-22 13:56:56.000000000 -0500
--- oss/src/ex_cmds.c	2006-07-18 16:55:59.000000000 -0500
***************
*** 1765,1771 ****
--- 1765,1775 ----
  	 */
  	st_old.st_dev = st_old.st_ino = 0;
  	st_old.st_mode = 0600;
+ #ifdef __TANDEM
+ 	if (mch_stat((char *)fname, &st_old) == 0 && (getuid() != 65535)
+ #else
  	if (mch_stat((char *)fname, &st_old) == 0 && getuid()
+ #endif
  		&& !(st_old.st_uid == getuid()
  			? (st_old.st_mode & 0200)
  			: (st_old.st_gid == getgid()
diff -cr mine/src/fileio.c oss/src/fileio.c
*** mine/src/fileio.c	2006-04-30 10:28:57.000000000 -0500
--- oss/src/fileio.c	2006-07-18 16:56:37.000000000 -0500
***************
*** 25,34 ****
  # include <fcntl.h>
  #endif

- #ifdef __TANDEM
- # include <limits.h>		/* for SSIZE_MAX */
- #endif
-
  #if defined(HAVE_UTIME) && defined(HAVE_UTIME_H)
  # include <utime.h>		/* for struct utimbuf */
  #endif
--- 25,30 ----
***************
*** 1105,1115 ****
  	    if (!skip_read)
  	    {
  #if SIZEOF_INT > 2
- # ifdef __TANDEM
- 		size = SSIZE_MAX;		    /* use max I/O size, 52K */
- # else
  		size = 0x10000L;		    /* use buffer >= 64K */
- # endif
  #else
  		size = 0x7ff0L - linerest;	    /* limit buffer to 32K */
  #endif
--- 1101,1107 ----
diff -cr mine/src/Makefile oss/src/Makefile
*** mine/src/Makefile	2006-05-07 08:25:27.000000000 -0500
--- oss/src/Makefile	2006-07-18 18:24:48.000000000 -0500
***************
*** 1287,1293 ****
  PFLAGS = $(PROTO_FLAGS) -DPROTO $(LINT_CFLAGS)

  ALL_LIB_DIRS = $(GUI_LIBS_DIR) $(X_LIBS_DIR)
! ALL_LIBS = $(GUI_LIBS1) $(GUI_X_LIBS) $(GUI_LIBS2) $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) $(LIBS) $(EXTRA_LIBS) $(MZSCHEME_LIBS) $(PERL_LIBS) $(PYTHON_LIBS) $(TCL_LIBS) $(RUBY_LIBS) $(PROFILE_LIBS)

  # abbreviations
  DEST_BIN = $(DESTDIR)$(BINDIR)
--- 1287,1293 ----
  PFLAGS = $(PROTO_FLAGS) -DPROTO $(LINT_CFLAGS)

  ALL_LIB_DIRS = $(GUI_LIBS_DIR) $(X_LIBS_DIR)
! ALL_LIBS = $(GUI_LIBS1) $(GUI_X_LIBS) $(GUI_LIBS2) $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) $(LIBS) $(EXTRA_LIBS) $(MZSCHEME_LIBS) $(PERL_LIBS) $(PYTHON_LIBS) $(TCL_LIBS) $(RUBY_LIBS) $(PROFILE_LIBS) -lfloss

  # abbreviations
  DEST_BIN = $(DESTDIR)$(BINDIR)
diff -cr mine/src/osdef1.h.in oss/src/osdef1.h.in
*** mine/src/osdef1.h.in	2004-06-07 09:32:26.000000000 -0500
--- oss/src/osdef1.h.in	2006-07-18 17:00:20.000000000 -0500
***************
*** 98,104 ****
--- 98,106 ----

  #ifndef USE_SYSTEM
  extern int	fork __ARGS((void));
+ #ifndef __TANDEM
  extern int	execvp __ARGS((const char *, const char **));
+ #endif
  extern int	wait __ARGS((int *)); /* will this break things ...? */
  extern int	waitpid __ARGS((pid_t, int *, int));
  #endif
***************
*** 123,132 ****

  extern int	kill __ARGS((int, int));

  extern int	access __ARGS((char *, int));
  extern int	fsync __ARGS((int));
  extern int	fchown __ARGS((int, int, int));
! #if defined(HAVE_GETCWD) && !defined(sun)
  extern char	*getcwd __ARGS((char *, int));
  #else
  extern char	*getwd __ARGS((char *));
--- 125,136 ----

  extern int	kill __ARGS((int, int));

+ #ifndef __TANDEM
  extern int	access __ARGS((char *, int));
+ #endif
  extern int	fsync __ARGS((int));
  extern int	fchown __ARGS((int, int, int));
! #if defined(HAVE_GETCWD) && !defined(sun) && !defined(__TANDEM)
  extern char	*getcwd __ARGS((char *, int));
  #else
  extern char	*getwd __ARGS((char *));
diff -cr mine/src/osdef2.h.in oss/src/osdef2.h.in
*** mine/src/osdef2.h.in	2004-06-07 09:32:26.000000000 -0500
--- oss/src/osdef2.h.in	2006-07-18 17:01:31.000000000 -0500
***************
*** 11,23 ****
--- 11,29 ----
  extern int	setenv __ARGS((char *, char *, int));
  extern int	putenv __ARGS((const char *));

+ #ifndef __TANDEM
  extern int	gethostname __ARGS((char *, int));
+ #endif
  extern void	perror __ARGS((char *));

+ #ifndef __TANDEM
  extern int	sleep __ARGS((int));
+ #endif
  extern int	usleep __ARGS((unsigned int));
  extern unsigned int	alarm __ARGS((unsigned int));
+ #ifndef __TANDEM
  extern int	chdir __ARGS((char *));
+ #endif
  extern int	fchdir __ARGS((int));
  #ifndef stat	/* could be redefined to stat64() */
  extern int	stat __ARGS((const char *, struct stat *));
***************
*** 28,35 ****
--- 34,43 ----
  extern int	fstat __ARGS((int, struct stat *));
  extern int	open __ARGS((const char *, int, ...));
  extern int	close __ARGS((int));
+ #ifndef __TANDEM
  extern int	read __ARGS((int, char *, size_t));
  extern int	write __ARGS((int, char *, size_t));
+ #endif
  extern int	pipe __ARGS((int *));
  extern off_t	lseek __ARGS((int, off_t, int));
  extern void	sync __ARGS((void));
diff -cr mine/src/os_unix.c oss/src/os_unix.c
*** mine/src/os_unix.c	2006-05-01 03:13:15.000000000 -0500
--- oss/src/os_unix.c	2006-07-18 17:06:09.000000000 -0500
***************
*** 25,31 ****
   * Don't use it for the Mac, it causes a warning for precompiled headers.
   * TODO: use a configure check for precompiled headers?
   */
! #ifndef __APPLE__
  # define select select_declared_wrong
  #endif

--- 25,31 ----
   * Don't use it for the Mac, it causes a warning for precompiled headers.
   * TODO: use a configure check for precompiled headers?
   */
! #if !defined(__APPLE__) && !defined(__TANDEM)
  # define select select_declared_wrong
  #endif

***************
*** 48,56 ****
  /*
   * Use this prototype for select, some include files have a wrong prototype
   */
! #undef select
! #ifdef __BEOS__
! # define select	beos_select
  #endif

  #if defined(HAVE_SELECT)
--- 48,58 ----
  /*
   * Use this prototype for select, some include files have a wrong prototype
   */
! #ifndef __TANDEM
! # undef select
! # ifdef __BEOS__
! #  define select	beos_select
! # endif
  #endif

  #if defined(HAVE_SELECT)
***************
*** 4742,4747 ****
--- 4744,4757 ----
  # else
  	ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
  # endif
+ # ifdef __TANDEM
+ 	if ((ret == -1) && (errno == ENOTSUP))
+ 	{
+ 	    FD_ZERO(&rfds);
+ 	    FD_ZERO(&efds);
+ 	    ret = 0;
+ 	}
+ #endif
  # ifdef FEAT_MZSCHEME
  	if (ret == 0 && mzquantum_used)
  	    /* loop if MzThreads must be scheduled and timeout occured */
diff -cr mine/src/pty.c oss/src/pty.c
*** mine/src/pty.c	2004-06-13 15:04:27.000000000 -0500
--- oss/src/pty.c	2006-07-18 17:07:27.000000000 -0500
***************
*** 330,336 ****
--- 330,340 ----
      if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
  	return -1;
      strncpy(TtyName, ttyname(f), sizeof(TtyName));
+ #ifdef __TANDEM
+     if (geteuid() != 65535 && mch_access(TtyName, R_OK | W_OK))
+ #else
      if (geteuid() && mch_access(TtyName, R_OK | W_OK))
+ #endif
      {
  	close(f);
  	return -1;
***************
*** 394,400 ****
  	    q[0] = *l;
  	    q[1] = *d;
  #ifndef MACOS
! 	    if (geteuid() && mch_access(TtyName, R_OK | W_OK))
  	    {
  		close(f);
  		continue;
--- 398,408 ----
  	    q[0] = *l;
  	    q[1] = *d;
  #ifndef MACOS
! #ifdef __TANDEM
! 	    if (geteuid() != 65535 && mch_access(TtyName, R_OK | W_OK))
! #else
!  	    if (geteuid() && mch_access(TtyName, R_OK | W_OK))
! #endif
  	    {
  		close(f);
  		continue;
diff -cr mine/src/vim.h oss/src/vim.h
*** mine/src/vim.h	2006-04-30 10:32:38.000000000 -0500
--- oss/src/vim.h	2006-07-18 18:02:37.000000000 -0500
***************
*** 50,55 ****
--- 50,60 ----
  # endif
  #endif

+ #ifdef __TANDEM
+ # define _TANDEM_SOURCE
+ # include <floss.h>
+ #endif
+
  #ifdef __EMX__		/* hand-edited config.h for OS/2 with EMX */
  # include "os_os2_cfg.h"
  #endif

Reply via email to