--- config_darwin.py.orig	2008-03-29 08:45:44.000000000 +1100
+++ config_darwin.py	2008-04-25 20:50:36.000000000 +1000
@@ -4,8 +4,10 @@
 from glob import glob
 from distutils.sysconfig import get_python_inc
 
+localbase = os.environ.get('LOCALBASE', '')
+
 class Dependency:
-    libext = '.a'
+    libext = '.dylib'
     def __init__(self, name, checkhead, checklib, libs):
         self.name = name
         self.inc_dir = None
@@ -86,11 +88,11 @@
             print (self.name + '        '[len(self.name):] + ': not found')
 
 DEPS = [
-    FrameworkDependency('SDL', 'SDL.h', 'libSDL', 'SDL'),
-    FrameworkDependency('FONT', 'SDL_ttf.h', 'libSDL_ttf', 'SDL_ttf'),
-    FrameworkDependency('IMAGE', 'SDL_image.h', 'libSDL_image', 'SDL_image'),
-    FrameworkDependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer', 'SDL_mixer'),
-    FrameworkDependency('SMPEG', 'smpeg.h', 'libsmpeg', 'smpeg'),
+    Dependency('SDL', 'SDL.h', 'libSDL', ['SDL']),
+    Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf', ['SDL_ttf']),
+    Dependency('IMAGE', 'SDL_image.h', 'libSDL_image', ['SDL_image']),
+    Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer', ['SDL_mixer']),
+    Dependency('SMPEG', 'smpeg.h', 'libsmpeg', ['smpeg']),
     Dependency('PNG', 'png.h', 'libpng', ['png']),
     Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
     Dependency('SCRAP', '','',[]),
@@ -103,8 +105,8 @@
     global DEPS
 
     print ('Hunting dependencies...')
-    incdirs = ['/usr/local/include','/opt/local/include']
-    libdirs = ['/usr/local/lib','/opt/local/lib']
+    incdirs = [localbase+'/include', localbase+'/include/SDL', localbase+'/include/smpeg']
+    libdirs = [localbase+'/lib']
     newconfig = []
     for d in DEPS:
         d.configure(incdirs, libdirs)
