[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] How to use prelude?
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] How to use prelude? |
Date: |
Sun, 28 May 2006 12:31:14 +0200 |
On 5/27/06, Peter Bex <address@hidden> wrote:
Hey all,
I'm trying to conditionally add a prelude to an egg. It checks if X is
available by trying to link against it, and then it does the following:
(if with-x?
(compile -prelude (define with-x #t) -s -O2 -d0 imlib2.scm -C
-I/usr/X11R6/include -L/usr/X11R6/lib -lImlib2 -lX11 -lfreetype)
(compile -prelude (define with-x #t) -s -O2 -d0 imlib2.scm -ffi-define
X_DISPLAY_MISSING))
But this fails on the prelude with:
Syntax error: "(" unexpected
Adding a quote in front of the define doesn't work either as that expands
to (quote (define with-x #t))
Try "'...'" (one pair of double-quotes for scheme, and one pair of single
quotes for the shell).
How does this work, then? (also, can I use cond-expand with this? I'm not
sure how to add features cond-expand can check against)
As Kon replied: register-feature! is the way. But that is at run-time,
of course.
To have it available at compile-time (I'm not 100% sure in what way you
want to use this), things are (as usual) a tiny little bit more complicated.
cheers,
felix