chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] How do you compile multiple modules into a single ex


From: Josh Barrett
Subject: Re: [Chicken-users] How do you compile multiple modules into a single executable?
Date: Sun, 20 Dec 2015 02:00:37 +0000

Is there any way to use (cond-expand) to decide whether to (use) or (import) depending on if the program's compiled or not?


On Sat, Dec 19, 2015, 20:57 Evan Hanson <address@hidden> wrote:
Hi Josh,

I think the following is what you're after.

     $ cat foo.scm
     (module foo * (import scheme) (define (foo) 1))
     $ cat bar.scm
     (import foo)
     (print (foo))
     $ csc -c -unit foo -emit-import-library foo foo.scm
     $ csc -uses foo bar.scm foo.o
     $ ./bar
     1

Note that when compiling bar.scm with foo as a unit this way, (use foo)
becomes (import foo).

Cheers,

Evan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]