r3546: *** empty log message ***
[uffi.git] / examples / compress.lisp
index 75d79c4d02ed95ee3c73341f2671db9254bd1743..e5140aea57b6d4b60988d5dd2cb670b7175142cc 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: compress.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $
+;;;; $Id: compress.lisp,v 1.2 2002/12/03 06:58:39 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 
 (in-package :cl-user)
 
-(unless (uffi:load-foreign-library
-        (uffi:find-foreign-library
-         "libz"
-         '("/usr/local/lib/" "/usr/lib/" "/zlib/")
-         :types '("so" "a" "dylib"))
-        :module "zlib" 
-        :supporting-libraries '("c"))
-  (warn "Unable to load zlib"))
-
+(eval-when (:load-toplevel :execute)
+  (unless (uffi:load-foreign-library
+          #-(or macosx darwin)
+          (uffi:find-foreign-library
+           "libz"
+           '("/usr/local/lib/" "/usr/lib/" "/zlib/")
+           :types '("so" "a"))
+          #+(or macosx darwin)
+          (uffi:find-foreign-library "z"
+                                     `(,(pathname-directory *load-pathname*)))
+          :module "zlib" 
+          :supporting-libraries '("c"))
+    (warn "Unable to load zlib")))
+  
 (uffi:def-function ("compress" c-compress)
     ((dest (* :unsigned-char))
      (destlen (* :long))