As I mentioned earlier on this list, I thought it would be nice to eliminate
the need for a Makefile, and let asdf handle the compilation of C files as
necessary, so the resulting .so files wind up in, and get loaded from, the
same place as all the .fasl files, even under systems such as
asdf-binary-locations and common-lisp-controller.

The attached patch does just that.

This patch also integrates my two previous patches, mostly because I forgot
to start from a clean tree. <g>

Some notes, because it's a sizeable patch and notes are good:
* All variables in config.lisp can be set between loading the elephant and
  ele-bdb systems. In my case, that means:
    (defmethod perform :after ((o load-op)
                               (c (eql (find-system :elephant))))
      (flet ((fs (s) (find-symbol (symbol-name s) :elephant)))
        (eval `(setf ,(fs :*sleepycat-foreign-library-path*)
                      "/usr/lib/libdb-4.4.so"
                     ,(fs :*sleepycat-pthreads-path*)
                      nil))))
  in the .asd file for the system which depends on elephant. Interactive use
  might be more along the lines of:
    (asdf:operate 'asdf:load-op :elephant)
    (setf elephant:*sleepycat-foreign-library-path* "/usr/lib/libdb-4.4.so")
    (asdf:operate 'asdf:load-op :ele-bdb)

* Two new special variables are added: *sleepycat-include-dir* and
  *sleepycat-lib-dir*, which take the place of the Makefile's DBINCDIR and
  DBLIBDIR. They're easy to set (see above), but need smarter defaults so
  they don't have to be.

* I took the liberty of moving uffi:load-foreign-library calls out of
  sleepycat.lisp and memutil.lisp and into (asdf:perform load-op), though
  how they wind up there may not be immediately obvious. Hopefully you can
  follow it.

* There's groundwork to support compilers other than gcc. It may or may not
  be useful.

* Much of the C-file groundwork could probably be factored into an asdf
  extension which other projects could benefit from. I've had enough fun for
  one day, so that can wait. :)

-pinterface

Was the code supposed to get shorter doing that?

Attachment: elephant-no-make2.patch
Description: Binary data

_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

Reply via email to