diff -c -b gnuplot.old/command.c gnuplot/command.c
*** gnuplot.old/command.c	Thu Sep 16 00:59:44 1993
--- gnuplot/command.c	Wed Dec  6 22:30:46 1995
***************
*** 489,495 ****
                   longjmp(env, TRUE); /* bail out to command line */
           }
  #else
! #ifdef OS2
          if( strcmp(term_tbl[term].name, "pm" )==0 && stime < 0 )
          {
              int rc ;
--- 489,495 ----
  		 longjmp(env, TRUE); /* bail out to command line */
  	 }
  #else
! #ifdef OS2PM
  	if( strcmp(term_tbl[term].name, "pm" )==0 && stime < 0 )
  	{
  	    int rc ;
***************
*** 503,509 ****
  #else
  	    (void) fgets(buf, MAX_LINE_LEN, stdin);
  	/* Hold until CR hit. */
! #endif /*OS2*/
  #endif
  #ifdef __ZTC__
  	if (stime > 0)
--- 503,509 ----
  #else
  	    (void) fgets(buf, MAX_LINE_LEN, stdin);
  	/* Hold until CR hit. */
! #endif /*OS2PM*/
  #endif
  #ifdef __ZTC__
  	if (stime > 0)
diff -c -b gnuplot.old/makefile.os2 gnuplot/makefile.os2
*** gnuplot.old/makefile.os2	Thu Sep 16 00:59:48 1993
--- gnuplot/makefile.os2	Wed Dec  6 23:56:31 1995
***************
*** 6,11 ****
--- 6,14 ----
  # usage: nmake  OR dmake -r  -B
  # (file has blanks instead of real tabs, doesn't use dmake.ini)
  #
+ # Modified by David J. Liu (liudj0@minerva.cis.yale.edu)
+ # to be used for compiling a version works for both OS/2 and DOS.
+ #
  
  # where to place gnuplot.gih helpfile
  HELPFILE = gnuplot.gih
***************
*** 19,25 ****
  OBJS = 	bitmap.o command.o contour.o eval.o graphics.o graph3d.o \
  	help.o internal.o misc.o parse.o plot.o readline.o specfun.o \
  	scanner.o setshow.o standard.o term.o util.o version.o \
!         binary.o gnubin.o
  
  CSOURCE5 = term\aed.trm term\cgi.trm term/dumb.trm term/dxf.trm term\dxy.trm \
  	term\eepic.trm term\epson.trm term\fig.trm term\hp26.trm \
--- 22,28 ----
  OBJS = 	bitmap.o command.o contour.o eval.o graphics.o graph3d.o \
  	help.o internal.o misc.o parse.o plot.o readline.o specfun.o \
  	scanner.o setshow.o standard.o term.o util.o version.o \
!         binary.o gnubin.o gstring.o
  
  CSOURCE5 = term\aed.trm term\cgi.trm term/dumb.trm term/dxf.trm term\dxy.trm \
  	term\eepic.trm term\epson.trm term\fig.trm term\hp26.trm \
***************
*** 36,43 ****
  	gcc $(CFLAGS) -o $*.o $*.c
  
  gnuplot.exe: $(OBJS)
!         gcc -o gnuplot.exe $(OBJS) -los2
! 
  
  bitmap.o: bitmap.c bitmap.h plot.h
  
--- 39,46 ----
  	gcc $(CFLAGS) -o $*.o $*.c
  
  gnuplot.exe: $(OBJS)
! 	gcc -o gnuplot.exe *.o -lgraph -lvesa -los2 -s
! 	emxbind -a gnuplot.exe -acim -p
  
  bitmap.o: bitmap.c bitmap.h plot.h
  
diff -c -b gnuplot.old/term.c gnuplot/term.c
*** gnuplot.old/term.c	Thu Sep 16 00:59:54 1993
--- gnuplot/term.c	Wed Dec  6 21:50:14 1995
***************
*** 1466,1480 ****
  #endif
  
  #ifdef EMXVGA
! #ifdef EMXVESA
!     ,{"vesa", "IBM PC/Clone with VESA SVGA graphics board [vesa mode]",
! 	   EMXVGA_XMAX, EMXVGA_YMAX, EMXVGA_VCHAR, EMXVGA_HCHAR,
! 	   EMXVGA_VTIC, EMXVGA_HTIC, EMXVESA_options, EMXVESA_init, EMXVESA_reset,
! 	   EMXVESA_text, null_scale, EMXVESA_graphics, EMXVGA_move, EMXVGA_vector,
! 	   EMXVGA_linetype, EMXVGA_put_text, EMXVGA_text_angle, 
! 	   null_justify_text, do_point, do_arrow}
! #endif
!     ,{"vgal", "IBM PC/Clone with VGA graphics board",
  	   EMXVGA_XMAX, EMXVGA_YMAX, EMXVGA_VCHAR, EMXVGA_HCHAR,
  	   EMXVGA_VTIC, EMXVGA_HTIC, options_null, EMXVGA_init, EMXVGA_reset,
  	   EMXVGA_text, null_scale, EMXVGA_graphics, EMXVGA_move, EMXVGA_vector,
--- 1466,1472 ----
  #endif
  
  #ifdef EMXVGA
!     ,{"emxvga", "PC with SuperVGA running DOS or OS/2",
  	   EMXVGA_XMAX, EMXVGA_YMAX, EMXVGA_VCHAR, EMXVGA_HCHAR,
  	   EMXVGA_VTIC, EMXVGA_HTIC, options_null, EMXVGA_init, EMXVGA_reset,
  	   EMXVGA_text, null_scale, EMXVGA_graphics, EMXVGA_move, EMXVGA_vector,
***************
*** 1719,1732 ****
  	     term_name = "cgi";
  #endif /*CGI */
  
- #if defined(MSDOS) && defined(__EMX__)
- #ifdef EMXVESA
- 	   term_name = "vesa";
- #else
- 	   term_name = "vgal";
- #endif
- #endif
- 
  #ifdef DJGPP
  		term_name = "svga";
  #endif
--- 1711,1716 ----
***************
*** 1735,1745 ****
          term_name = "grass";
  #endif
  
! #ifdef OS2
!            term_name = "pm" ;
              /* EMX compiler has getcwd that can return drive */
             if( PM_path[0]=='\0' ) _getcwd2( PM_path, 256 ) ;
! #endif /*OS2 */           
      }
  
      /* We have a name, try to set term type */
--- 1719,1728 ----
  	term_name = "grass";
  #endif
  
! #ifdef OS2PM
  	    /* EMX compiler has getcwd that can return drive */
  	   if( PM_path[0]=='\0' ) _getcwd2( PM_path, 256 ) ;
! #endif /* OS2PM */           
      }
  
      /* We have a name, try to set term type */
diff -c -b gnuplot.old/term.h gnuplot/term.h
*** gnuplot.old/term.h	Thu Sep 16 00:59:54 1993
--- gnuplot/term.h	Wed Dec  6 21:59:14 1995
***************
*** 156,162 ****
  #endif /* MSDOS */
  
  #ifdef OS2
! #define OS2PM
  #endif /*OS2 */
  
  #ifdef GISBASE
--- 156,164 ----
  #endif /* MSDOS */
  
  #ifdef OS2
! #define DEFAULTTERM "emxvga" /* "pm" */
! /*#define OS2PM		/* OS/2 pm graphics window */
! #define EMXVGA		/* works with DOS and OS/2 (windowed/full screen) */
  #endif /*OS2 */
  
  #ifdef GISBASE
