From: Tamas Papp
Subject: asdf questions: platform specific code, compliling C
Date: 
Message-ID: <87vedt8aib.fsf@pu100877.student.princeton.edu>
Hi,

I have two ASDF and ASDF-Install related questions:

1. One of the Lisp files contains platform-specific code
(specifically, something that uses X11 calls from CFFI).  How can I
make this behave well on non-Unix platforms (eg have this file
silently ignored when ASDF loads it).

2. Functions in this file call some C functions that are compiled into
a shared library and loaded (I am using CFFI).  Is it possible to get
asdf-install to compile the shared library upon installation (I have a
Makefile, it just needs to be run).

Thanks,

Tamas

From: Edi Weitz
Subject: Re: asdf questions: platform specific code, compliling C
Date: 
Message-ID: <uzm35f3om.fsf@agharta.de>
On Tue, 12 Jun 2007 17:20:44 +0200, Tamas Papp <······@gmail.com> wrote:

> 1. One of the Lisp files contains platform-specific code
> (specifically, something that uses X11 calls from CFFI).  How can I
> make this behave well on non-Unix platforms (eg have this file
> silently ignored when ASDF loads it).

Read the part about "*FEATURES* and Read-Time Conditionalization"
here:

  http://www.gigamonkeys.com/book/practical-a-portable-pathname-library.html

On Unix-like platform, something like :UNIX will be very likely in
*FEATURES*.

> 2. Functions in this file call some C functions that are compiled
> into a shared library and loaded (I am using CFFI).  Is it possible
> to get asdf-install to compile the shared library upon installation
> (I have a Makefile, it just needs to be run).

ASDF can do that.  Look at CLSQL for an example:

  http://clsql.b9.com/

HTH,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Richard M Kreuter
Subject: Re: asdf questions: platform specific code, compliling C
Date: 
Message-ID: <87ejkgg19t.fsf@tan-ru.localdomain>
Edi Weitz <········@agharta.de> writes:

> On Tue, 12 Jun 2007 17:20:44 +0200, Tamas Papp <······@gmail.com> wrote:
>
>> 1. One of the Lisp files contains platform-specific code
>> (specifically, something that uses X11 calls from CFFI).  How can I
>> make this behave well on non-Unix platforms (eg have this file
>> silently ignored when ASDF loads it).
>
> Read the part about "*FEATURES* and Read-Time Conditionalization"
> here:
>
>   http://www.gigamonkeys.com/book/practical-a-portable-pathname-library.html
>
> On Unix-like platform, something like :UNIX will be very likely in
> *FEATURES*.

Although I've never seen anybody use this, asdf has support for
flagging some components as feature-dependent for some operations in a
way that doesn't use the reader.  If you add the following keywords to
a component or module, then the component or module won't get compiled
or loaded except when :UNIX iS *FEATURES*:

  :in-order-to ((load-op (feature :unix))
                (compile-op (feature :unix)))

The intent here is that a defsystem facility is supposed to support
various sorts of operations on systems, and some kinds of operations
(e.g., printing a system's source files or marking them up for online
display) ought to be able to operate on all files in the system,
rather than only those that happen to work with the host Lisp
implementation.  Using a read-time conditionalization, rather than a
defsystem-specific mechanism such as above, prevents such operations
from working properly, in general.

--
RmK