From ASDF to shared libraries

Michael Goffioul has contributed a wonderful hack that allows one to build a single FASL file, a shared library or a standalone executable out of a ASDF system definition. The transcription below shows how it works for the CL-PPCRE library. As usual this is only available in the CVS version of ECL.

~/src/lisp$ cd cl-ppcre-1.2.11/
~/src/lisp/cl-ppcre-1.2.11$ ecl
ECL (Embeddable Common-Lisp) 0.9g
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. Top level.
> (require 'asdf)
;;; Loading #P"/home/jlr/lib/ecl/asdf.fas"
[...]
("ASDF")
> (load "cl-ppcre.asd")
;;; Loading "cl-ppcre.asd"
"cl-ppcre.asd"
> (use-package "ASDF")
T
> (make-build :cl-ppcre :type :fasl)
;;; Loading #P"/home/jlr/lib/ecl/cmp.fas"
;;; Loading #P"/home/jlr/lib/ecl/sysfun.lsp"
;;; Loading "/home/jlr/src/lisp/cl-ppcre-1.2.11/packages.lisp"
;;; Loading "/home/jlr/src/lisp/cl-ppcre-1.2.11/specials.lisp"
[...]
> (load "cl-ppcre.fas")
;;; Loading "cl-ppcre.fas"
[...]
"cl-ppcre.fas"
> (load "ppcre-tests")
;;; Loading #P"ppcre-tests.lisp"

P"ppcre-tests.lisp"

> (cl-ppcre-test:test)
..........
..........
..........
..........
..........
..........
......
662 ("a" =~ /((a))/):
\2: expected NIL but got "a"
....
.........
790 ("babc" =~ /^(b*|ba){1,2}bc/):
\1: expected "" but got "ba"
.
..........
..........
..........
..........
..........
..........
...
1439 ("dbaacb" =~ /(?<!(c|d))[ab]/):
\1: expected NIL but got "d"
.......
..........
..

The errors are expected, as mentioned in the CL-PPCRE documentation

Posted by Juan Jose Garcia Ripoll 2005-10-20