--- OMakefile.orig	2011-06-22 18:04:32 UTC
+++ OMakefile
@@ -22,13 +22,13 @@ if $(defined WithOMyApt)
 
 # Specify non standard include directories
 INCLUDES[]=
-  /usr/include/X11
-  /usr/local/include
+  %%INCLUDESPORTS%%
+  %%INCLUDESX11%%
+  %%INCLUDESPNG%%
 
 # Specify non standard library directories
 LDFLAGS[]+= 
-# for example, 
-# LDFLAGS[]+= -L/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/
+  %%LDFLAGSPORTS%%
 
 # Specify directories where X's rgb.txt can be found
 PATH_RGB_TXT[]=
@@ -95,6 +95,8 @@ print_configured() =
      exit 1
 
   CFLAGS = $(addprefix -I , $(INCLUDES))
+  OCAMLCFLAGS = -unsafe-string
+  OCAMLOPTFLAGS = -unsafe-string
 
   WORD_SIZE = $(Word_size)
 
@@ -175,13 +177,13 @@ print_configured() =
     OCAMLPACKS+=graphics
     export
 
-  SUPPORT_FREETYPE = $(Check_prog_in_path freetype-config)
+  SUPPORT_FREETYPE = $(Check_prog_in_path pkg-config)
   PATH_FREETYPE_CONFIG = $(WHERE)
   LDFLAGS_freetype=
   if $(SUPPORT_FREETYPE)
     println(SUPPORT_FREETYPE=$(SUPPORT_FREETYPE)!)
-    CFLAGS= $(CFLAGS) $(shell freetype-config --cflags)
-    LDFLAGS_freetype= $(shell freetype-config --libs)
+    CFLAGS= $(CFLAGS) $(shell pkg-config freetype2 --cflags)
+    LDFLAGS_freetype= $(shell pkg-config freetype2 --libs)
     export
   if $(SUPPORT_FREETYPE)
     SUPPORTED_NON_FORMATS+=freetype
