chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Statically compiling with additional eggs in Chicken


From: Peter Bex
Subject: Re: [Chicken-users] Statically compiling with additional eggs in Chicken 5
Date: Wed, 8 May 2019 11:33:20 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, May 07, 2019 at 01:06:09PM -0700, Jeff Moon wrote:
> I'm using chicken 5.0.0.  I've used it to create a handful of apps that I
> have distributed as static binaries, and it seems to be working very well.
> However, when I try to include certain eggs, the static builds do not seem
> to work.  I'm wondering if anybody has gotten static compiles to work with
> any of the following eggs: postgresql, sqlite3, or sql-de-lite?

Hi Jeff,

To get the correct linking options for linking in the libraries you can
use something like:

$ pkg-config --static --libs sqlite3
-lsqlite3 -lm -ldl -lpthread

Then, you can link the program:

$ csc -static -L -lsqlite3 -L -lm -L -ldl -L -lpthread test.scm

You'll note that the libraries are still linked dynamically (with `ldd`).
To make it fully static, use -L -static:

$ csc -static -L -static -L -lsqlite3 -L -lm -L -ldl -L -lpthread test.scm

For PostgreSQL, I used pkg-config --static --libs pq, but this told me
to use -lgssapi_krb5 and there is no static version of that library in
Debian at least.  So I think you can't link it statically on Debian.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature


reply via email to

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