chicken-users
[Top][All Lists]
Advanced

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

Re: Compiling to C w/ eggs


From: felix . winkelmann
Subject: Re: Compiling to C w/ eggs
Date: Tue, 23 Mar 2021 18:20:57 +0100

> I'm trying to compile a small project with some imports (some srfi,
> matchable, and ncurses) to a bunch of *.{c,h} files for easier
> distribution.  Following http://wiki.call-cc.org/man/5/Deployment
> compiling the example to a test.c went smooth.  However, I'm already
> stuck with
>
> ; test.scm
> (import (srfi-1))
> (print "Hello, World!")
>
> > chicken-csc -t test.scm
> > gcc -Os -fomit-frame-pointer -DHAVE_CHICKEN_CONFIG_H test.c \
>  build-version.c eval.c expand.c internal.c library.c modules.c \
>  runtime.c chicken-syntax.c -o main -lm
> > ./main
> Error: (require) cannot load extension: srfi-1
>
> Not very surprising. I tried some of the compiler options -uses srfi-1,
> -emit-all-import-libraries, -unit, …, but to no avail.  I guess I could
> compile chicken-install/srfi-1/* to .c/.h files (after I figure out how
> exactly), and bundle them together.  But with ~15 modules this seems
> quite tedious for something that should be able to be done automatically,
> at least for the modules without FFI. Is there an easier way?

You should use static linking for srfi-1 and add it to the list of C modules.
There may still be some more obstacles, but you should go step by step.
The .c files for eggs you use can be found in the cache directory that
chicken-install uses to build the extension(s). You should also pass -k
when invoking chicken-install to make sure intermediate files are not
deleted.



felix




reply via email to

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