--- Makefile.orig	Sun Jul 23 11:00:40 1995
+++ Makefile	Sun Oct 11 23:07:08 1998
@@ -23,17 +23,17 @@
 #
 #                       Mr A S R Ashley B.Eng (Hons)    23rd July 1995
 
-      CC = gcc      
-     CPP = g++
-      RM = rm -f
+CC = gcc -O -I$(X11BASE)/include
+CPP = g++ -O -I$(X11BASE)/include
+RM = rm -f
 
 DEPFILE  = Dependancies
- SUBDIRS = ui MpegCodec editor xuseless
+SUBDIRS = ui MpegCodec editor xuseless
 HEADERS  = 
-SOURCES  = main.C globals/version.c
-OBJS     = main.o globals/version.o
+SOURCES  = main.C globals/version.c 
+OBJS     = main.o globals/version.o 
 ARCHIVES = editor/editor.a ui/ui.a MpegCodec/mpeg.a
-    LIBS = -lXext -lX11 -lpnm -lppm -lpbm -lpgm -lm
+    LIBS = -L$(X11BASE)/lib -lXext -lX11 -lpnm -lppm -lpbm -lpgm -lm
 #
 #  CPPFLAGS     -Wall     all warnings
 #               -pipe     speeds up compilation (remove only if not using g++)
@@ -55,9 +55,9 @@
 # PBMDIR         The location of the pbmplus header files, which is
 #                /usr/include/gr on my Linux machine.
 
-PBMDIR      = /usr/include/X11R5/X11
+PBMDIR      = $(X11BASE)/include
 INCLUDES    = -Iglobals -Iui -IMpegCodec -IMpegCodec/decoder \
-	      -IMpegCodec/encoder -Ieditor 
+	      -IMpegCodec/encoder -Ieditor -I$(X11BASE)/include
 CPPFLAGS    = -Wall -pipe -O4
 CFLAGS      = -Wall -pipe -O4
 SHMEM	    = -DSH_MEM
@@ -70,22 +70,27 @@
 
 all: mpeg_edit
 
-ui.a:
+install:
+	install -cs mpeg_edit $(PREFIX)/bin
+	mkdir -p $(PREFIX)/share/doc/mpeg_edit
+	install -c -m 644 README manual.ps $(PREFIX)/share/doc/mpeg_edit
+
+ui/ui.a:
 	cd ui && make ui.a EXTRA="$(EXTRA)" CPPFLAGS="$(CPPFLAGS)" \
 	CFLAGS="$(CFLAGS)" && cd ..
-	
-mpeg.a:
+
+MpegCodec/mpeg.a:
 	cd MpegCodec && make mpeg.a EXTRA="$(EXTRA)" CPPFLAGS="$(CPPFLAGS)" \
 	CFLAGS="$(CFLAGS)" CACHE_FLAGS="$(CACHE_FLAGS)" && cd ..
-	
-editor.a:
+
+editor/editor.a:
 	cd editor && make editor.a EXTRA="$(EXTRA)" CPPFLAGS="$(CPPFLAGS)" \
 	CFLAGS="$(CFLAGS)" SHMEM="$(SHMEM)" PBMDIR="$(PBMDIR)" && cd ..
-	
-mpeg_edit: ui.a mpeg.a editor.a $(DEPFILE) $(OBJS)  
+
+mpeg_edit: $(ARCHIVES) $(DEPFILE) $(OBJS)  
 	$(CPP) -o mpeg_edit $(OBJS) $(ARCHIVES) $(LIBS)
 
-ppmtorle: mpeg.a editor.a $(DEPFILE) ppmtorle.o
+ppmtorle: MpegCodec/mpeg.a editor/editor.a $(DEPFILE) ppmtorle.o
 	$(CPP) -o ppmtorle ppmtorle.o MpegCodec/frame.o editor/yuv.o $(LIBS) 
 
 globals/version.o:	$(ARCHIVES) 
@@ -107,10 +112,10 @@
 
 $(DEPFILE):
 	set -e; for i in $(SOURCES) ; do $(CPP) $(INCLUDES) -M $$i >>$(DEPFILE) ; done
-	
+
 #
 # include a dependency file if one exists
 #
 #ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
-include $(DEPFILE)
+#include $(DEPFILE)
 #endif
diff -ru ./MpegCodec/Makefile /src/build/Mpeg/mpegedit_v2.2/MpegCodec/Makefile
--- ./MpegCodec/Makefile	Sun Jul 23 10:03:22 1995
+++ /src/build/Mpeg/mpegedit_v2.2/MpegCodec/Makefile	Mon Mar  4 09:12:06 1996
@@ -30,7 +30,7 @@
 RM       = rm -f
 RANLIB   = ranlib
 
-INCLUDES = -I../ui -I../editor -I../globals -Iencoder -Idecoder
+INCLUDES = -I$(X11BASE)/include -I../ui -I../editor -I../globals -Iencoder -Idecoder
 DEPFILE  = Dependancies
 SUBDIRS  = decoder encoder
 HEADERS  = bstream.H frame.H mpeg.H
@@ -70,10 +70,10 @@
 
 $(DEPFILE):
 	set -e; for i in $(SOURCES) ; do $(CC) $(INCLUDES) -M $$i >>$(DEPFILE) ; done
-	
+
 #
 # include a dependency file if one exists
 #
 #ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
-include $(DEPFILE)
+#include $(DEPFILE)
 #endif
diff -ru ./MpegCodec/decoder/Makefile /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/Makefile
--- ./MpegCodec/decoder/Makefile	Sun Jul 23 10:03:05 1995
+++ /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/Makefile	Mon Mar  4 09:17:58 1996
@@ -27,7 +27,7 @@
 
 AR 		= ar r
 RM 		= rm -f
-CC		= gcc
+CC		= gcc -I$(X11BASE)/include
 CPP 		= g++
 RANLIB          = ranlib
 DEPFILE 	= Dependencies
@@ -62,10 +62,10 @@
 
 $(DEPFILE):
 	set -e; for i in $(SOURCES); do $(CC) -M $$i >>$(DEPFILE); done
-	
+
 #
 # include a dependency file if one exists
 #
 #ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
-include $(DEPFILE)
+#include $(DEPFILE)
 #endif
diff -ru ./MpegCodec/decoder/huffman.c /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/huffman.c
--- ./MpegCodec/decoder/huffman.c	Sun Aug 14 10:08:13 1994
+++ /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/huffman.c	Mon Mar  4 09:18:44 1996
@@ -31,7 +31,7 @@
 #include "huffman.h"
 #include "util.h" 
 #include "dmpeg.h"
-#include "proto.h"
+/* #include "proto.h" */
 
 /* Decoding table for macroblock_address_increment */
 mb_addr_inc_entry     mb_addr_inc[2048];
diff -ru ./MpegCodec/decoder/jrevdct.c /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/jrevdct.c
--- ./MpegCodec/decoder/jrevdct.c	Sun Aug 14 10:13:39 1994
+++ /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/jrevdct.c	Mon Mar  4 09:18:56 1996
@@ -28,7 +28,7 @@
 
 #include <string.h>
 #include "dmpeg.h"
-#include "proto.h"
+/* #include "proto.h" */
 
 #define GLOBAL			/* a function referenced thru EXTERNs */
   
diff -ru ./MpegCodec/decoder/motionvector.c /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/motionvector.c
--- ./MpegCodec/decoder/motionvector.c	Sun Aug 14 10:12:03 1994
+++ /src/build/Mpeg/mpegedit_v2.2/MpegCodec/decoder/motionvector.c	Mon Mar  4 09:18:35 1996
@@ -19,7 +19,7 @@
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  */
 #include "dmpeg.h"
-#include "proto.h"
+/* #include "proto.h" */
 #include "util.h"
 
 
diff -ru ./MpegCodec/encoder/Makefile /src/build/Mpeg/mpegedit_v2.2/MpegCodec/encoder/Makefile
--- ./MpegCodec/encoder/Makefile	Sun Jul 23 10:03:48 1995
+++ /src/build/Mpeg/mpegedit_v2.2/MpegCodec/encoder/Makefile	Mon Mar  4 09:16:50 1996
@@ -73,10 +73,10 @@
 
 $(DEPFILE):
 	set -e; for i in $(SOURCES); do $(CC) -M $$i $(DEFINES) >>$(DEPFILE); done
-	
+
 #
 # include a dependency file if one exists
 #
 #ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
-include $(DEPFILE)
+#include $(DEPFILE)
 #endif
diff -ru ./editor/Makefile /src/build/Mpeg/mpegedit_v2.2/editor/Makefile
--- ./editor/Makefile	Sun Jul 23 10:01:16 1995
+++ /src/build/Mpeg/mpegedit_v2.2/editor/Makefile	Mon Mar  4 09:20:21 1996
@@ -30,7 +30,7 @@
 RANLIB   = ranlib
 RM       = rm -f
 INCLUDES = -I../globals -I../ui -I../MpegCodec -I../MpegCodec/decoder \
-	   -I../MpegCodec/encoder -I$(PBMDIR) 
+	   -I../MpegCodec/encoder -I$(X11BASE)/include
 
 DEPFILE  = Dependancies
 HEADERS  = yuv.H 2x2_window.H mono_window.H bw_window.H effects.H \
@@ -69,10 +69,10 @@
 
 $(DEPFILE):
 	set -e; for i in $(SOURCES) ; do $(CC) $(INCLUDES) -M $$i >>$(DEPFILE) ; done
-	
+
 #
 # include a dependency file if one exists
 #
 #ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
-include $(DEPFILE)
+#include $(DEPFILE)
 #endif
diff -ru ./editor/editor.C /src/build/Mpeg/mpegedit_v2.2/editor/editor.C
--- ./editor/editor.C	Sun Jun 18 06:27:07 1995
+++ /src/build/Mpeg/mpegedit_v2.2/editor/editor.C	Mon Mar  4 13:41:46 1996
@@ -48,8 +48,10 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+extern "C" {
 #include "pbmplus.h"
 #include "pnm.h"
+}
 
 #define del(x) delete x; x = NULL;
 
@@ -3249,17 +3251,17 @@
       wins[0] = play_btn->WinId();
       play_btn->RestrictEvents(wins,1);
 
-      gettimeofday(&target,(timezone *)NULL);         // Time a read, to
+      gettimeofday(&target,(struct timezone *)NULL);         // Time a read, to
       ret_stat = Codec_stream->Read(temp_frame);      // find out how long
-      gettimeofday(&clk,(timezone *)NULL);            // it takes
+      gettimeofday(&clk,(struct timezone *)NULL);            // it takes
 
       decode_delay = clk.tv_usec + 1000000*clk.tv_sec;
       decode_delay -= target.tv_usec + 1000000*target.tv_sec;
 
-      gettimeofday(&target,(timezone *)NULL);         // Time a dither, to
+      gettimeofday(&target,(struct timezone *)NULL);         // Time a dither, to
       MajorWin.win->DisplayFrame(temp_frame,false);   // find out how long
       time_win->SetTime(Codec_stream->GetPos_hms(),false);  // it takes
-      gettimeofday(&clk,(timezone *)NULL);
+      gettimeofday(&clk,(struct timezone *)NULL);
 
       dither_delay = clk.tv_usec + 1000000*clk.tv_sec;
       dither_delay -= target.tv_usec + 1000000*target.tv_sec;
@@ -3268,9 +3270,9 @@
 
       for(int a=0; a<5; a++)
 	{
-	  gettimeofday(&target,(timezone *)NULL);         // Time usleep, to
+	  gettimeofday(&target,(struct timezone *)NULL);         // Time usleep, to
 	  usleep(10000);                                  // find out how long
-	  gettimeofday(&clk,(timezone *)NULL);            // it takes
+	  gettimeofday(&clk,(struct timezone *)NULL);            // it takes
 
 	  usleep_delay += clk.tv_usec + 1000000*clk.tv_sec - 10000;
 	  usleep_delay -= target.tv_usec + 1000000*target.tv_sec;
@@ -3283,7 +3285,7 @@
 
 // Calculate when the frame _should_ finish
 
-	  gettimeofday(&target,(timezone *)NULL);
+	  gettimeofday(&target,(struct timezone *)NULL);
 	  target.tv_usec += usec_per_frame - dither_delay - decode_delay;
 	  if(target.tv_usec >= 1000000)
 	    {
@@ -3299,7 +3301,7 @@
 
 // See if we're ahead by more than a decode delay (for the next frame)
 
-	  gettimeofday(&clk,(timezone *)NULL);
+	  gettimeofday(&clk,(struct timezone *)NULL);
 	  diff = target.tv_usec - clk.tv_usec;
 	  diff += 1000000*(target.tv_sec - clk.tv_sec);
 	  if(diff>usleep_delay)        // If we are ahead, sleep for a while
diff -ru ./ui/Makefile /src/build/Mpeg/mpegedit_v2.2/ui/Makefile
--- ./ui/Makefile	Sun Jul 23 10:01:36 1995
+++ /src/build/Mpeg/mpegedit_v2.2/ui/Makefile	Mon Mar  4 13:47:20 1996
@@ -48,7 +48,7 @@
 .SUFFIXES:	.C $(SUFFIXES) 
 
 .C.o:
-	$(CPP) $(CPPFLAGS) $(EXTRA) -I../globals -c $< 
+	$(CPP) $(CPPFLAGS) $(EXTRA) -I$(X11BASE)/include -I../globals -c $< 
 
 all:	$(ALL) 
 
@@ -68,11 +68,11 @@
 	make $(DEPFILE)
 
 $(DEPFILE):
-	set -e; for i in $(SOURCES) ; do $(CPP) -M $$i  -I../globals >>$(DEPFILE) ; done
-	
+	set -e; for i in $(SOURCES) ; do $(CPP) -M $$i  -I$(X11BASE)/include -I../globals >>$(DEPFILE) ; done
+
 #
 # include a dependency file if one exists
 #
 #ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
-include $(DEPFILE)
+#include $(DEPFILE)
 #endif
diff -ru ./ui/main_win.C /src/build/Mpeg/mpegedit_v2.2/ui/main_win.C
--- ./ui/main_win.C	Mon May  8 09:16:44 1995
+++ /src/build/Mpeg/mpegedit_v2.2/ui/main_win.C	Mon Mar  4 15:25:47 1996
@@ -276,6 +276,7 @@
 
 MainWindow::status MainWindow::event_handler(XEvent *Event)
 {
+#if 0
   switch(Event->type)
     {
     case Expose:
@@ -309,6 +310,7 @@
     default:
       break;
     }
+#endif
   return(okay);
 }
 
diff -ru ./ui/text_win.C /src/build/Mpeg/mpegedit_v2.2/ui/text_win.C
--- ./ui/text_win.C	Sun Jun 18 05:56:57 1995
+++ /src/build/Mpeg/mpegedit_v2.2/ui/text_win.C	Mon Mar  4 09:07:42 1996
@@ -17,6 +17,7 @@
 */
 
 #include "text_win.H"
+#include <sys/time.h>
 #include <assert.h>
 #include <stdlib.h>
 
@@ -407,14 +408,22 @@
 			long time_elapsed;
 			long speed;
 
+#ifdef __FreeBSD__
+			gettimeofday(&clk,(struct timezone *)NULL);
+#else
 			gettimeofday(&clk,(timezone *)NULL);
+#endif
 			time_elapsed = (clk.tv_sec - last_click.tv_sec)*100;
 			time_elapsed+=(clk.tv_usec - last_click.tv_usec)/10000;
 			speed = atol(click_speed);
 			if((time_elapsed<speed) && (callback!=NULL))
 			  retval = (*(callback))(callback_data);
 		      }
+#ifdef __FreeBSD__
+		    gettimeofday(&last_click,(struct timezone *)NULL);
+#else
 		    gettimeofday(&last_click,(timezone *)NULL);
+#endif
 		    text.inverse=true;
 		    TList.Write(text);
 		    if(!SendEventFlag)
--- ui/.depend.orig	Sat Aug 20 10:14:00 1994
+++ ui/.depend	Thu Aug  1 11:43:45 1996
@@ -1,5 +0,0 @@
-main_win.o : main_win.C main_win.H global.H ../typedefs.H 
-sub_win.o : sub_win.C sub_win.H global.H ../typedefs.H 
-menu.o : menu.C menu.H global.H ../typedefs.H 
-button.o : button.C button.H global.H ../typedefs.H 
-global.o : global.C global.H ../typedefs.H 
