|
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?
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
[Prev in Thread] | Current Thread | [Next in Thread] |