--- Nukefile.orig	2011-02-11 14:53:39.000000000 -0600
+++ Nukefile	2011-02-11 15:04:28.000000000 -0600
@@ -52,14 +52,6 @@
 (if (NSFileManager directoryExistsNamed:"#{@prefix}/include") (@inc_dirs addObject:"#{@prefix}/include"))
 (if (NSFileManager directoryExistsNamed:"#{@prefix}/lib") (@lib_dirs addObject:"#{@prefix}/lib"))
 
-(ifDarwin
-         (then (if (NSFileManager fileExistsNamed:"/usr/lib/libffi.dylib")
-                   (then ;; Use the libffi that ships with OS X.
-                         (@inc_dirs addObject:"/usr/include/ffi"))
-                   (else ;; Use the libffi that is distributed with Nu.
-                         (@inc_dirs addObject:"./libffi/include")
-                         (@lib_dirs addObject:"./libffi")))))
-
 (set @pcre_prefix "")
 (let ((pcre_config ((NSString stringWithShellCommand:"which pcre-config 2>/dev/null") chomp)))
      (if pcre_config
@@ -78,18 +70,11 @@
 (set @dylib "libNu")
 
 ;; build configuration
-(set @cc "gcc")
-(set @leopard "")
-(set @sdk
-     (cond ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.6.sdk")
-            (set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__")
-            ("-isysroot /Developer/SDKs/MacOSX10.6.sdk"))
-           ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.5.sdk")
-            (set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__")
-            ("-isysroot /Developer/SDKs/MacOSX10.5.sdk"))
-           ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.4u.sdk")
-            ("-isysroot /Developer/SDKs/MacOSX10.4u.sdk"))
-           (else "")))
+(set @cc "@CC@")
+(if (NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.5.sdk")
+    (then (set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__"))
+    (else (set @leopard "")))
+(set @sdk "@SDKROOT@")
 
 (ifDarwin
          (then (set @cflags "-Wall -g -O2 -DDARWIN -DMACOSX #{@sdk} #{@leopard} -std=gnu99")
@@ -99,7 +84,7 @@
                (set @mflags ((NSString stringWithShellCommand:"gnustep-config --objc-flags") chomp))))
 
 (ifDarwin
-         (then (set @arch '("ppc" "i386")))) ;; build a universal binary
+         (then (set @arch '("@ARCHS@")))) ;; build a universal binary
 ;; or set this to just build for your chosen platform
 ;;(set @arch '("i386"))
 
@@ -107,12 +92,7 @@
      ((@inc_dirs map: (do (inc) " -I#{inc}")) join))
 (set @ldflags
      ((list
-           (cond  ;; statically link in pcre since most people won't have it..
-(t nil)
-                  ((NSFileManager fileExistsNamed:"#{@pcre_prefix}/lib/libpcre.a") "#{@pcre_prefix}/lib/libpcre.a")
-                  ((NSFileManager fileExistsNamed:"/usr/lib/libpcre.a") "/usr/lib/libpcre.a")
-                  ((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") "#{@prefix}/lib/libpcre.a")
-                  (else (NSException raise:"NukeBuildError" format:"Can't find static pcre library (libpcre.a).")))
+           ("#{@pcre_prefix}/lib/libpcre.dylib")
            ((@frameworks map: (do (framework) " -framework #{framework}")) join)
            ((@libs map: (do (lib) " -l#{lib}")) join)
            (ifDarwin
