Contributed-by: Russell Sears <sears@cs.berkeley.edu>
Integrated: Ralf Treinen <treinen@debian.org>
Fixes-bug:  #425465
Description: make examples compile via "make"
Sent-to-upstream: to Jacques Garrigue by Ralf Treinen, Dec 3 2009

Index: lablgl/Togl/examples/Makefile
===================================================================
--- lablgl.orig/Togl/examples/Makefile	2009-12-03 21:44:29.000000000 +0100
+++ lablgl/Togl/examples/Makefile	2009-12-03 21:45:29.000000000 +0100
@@ -1,4 +1,16 @@
 # Makefile for examples subdir
 
+PACKAGES = lablgl.togl,unix
+DERIVEDML = $(patsubst %.ml.gz,%.ml,$(wildcard *.ml.gz))
+
+all: $(patsubst %.ml,%.opt,$(wildcard *.ml) $(DERIVEDML))
+
+%.ml : %.ml.gz
+	gunzip -c $^ > $@
+
+%.opt : %.ml
+	ocamlfind ocamlopt -package $(PACKAGES) -c  $^
+	ocamlfind ocamlopt -package $(PACKAGES) -linkpkg -o $@ $^
+
 clean:
-	rm -f *.cm* *.o *.opt
+	rm -f *.cm* *.o *.opt $(DERIVEDML)
Index: lablgl/Togl/examples/planet.ml
===================================================================
--- lablgl.orig/Togl/examples/planet.ml	2009-12-03 21:44:34.000000000 +0100
+++ lablgl/Togl/examples/planet.ml	2009-12-03 21:44:39.000000000 +0100
@@ -1,6 +1,6 @@
 (* $Id: planet.ml,v 1.17 2001/09/07 06:50:01 garrigue Exp $ *)
 
-#load"unix.cma";;
+open Unix
 
 class planet togl = object (self)
   val togl = togl
