chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] How to compile without chicken-config


From: Thomas Chust
Subject: Re: [Chicken-users] How to compile without chicken-config
Date: Thu, 11 May 2006 19:38:09 +0000 (GMT)

On Thu, 11 May 2006, Matthew David Parker wrote:

[...]
Normally I type:

$ chicken -dynamic xpai.ss
compiling `xpai.ss' ...
generating `xpai.c' ...
$ gcc -o xpai.so xpai.c path/to/c/lib/libxpilot_ai.so `chicken-config
-shared -cflags -libs`

Which makes xpai.so and I can load it in csi.  But in 2.3 since there
is no "chicken-config" as far as I know, what is the proper way to do
this?
[...]

Hello,

as far as I know, the recommended way to do this has always been to use the csc compiler driver. The following should probably work in your example
  csc -s xpai.ss -L/path/to/c/lib -lxpilot_ai -o xpai.so

If for some reason you absolutely must run the linker or C compiler by hand on the output of CHICKEN, I would still recommend to use csc for the first steps of Scheme compilation and specify the -c or -t options to stop after generation of object code or C code respectively. To get the flags usually used for the C compilation or linkage steps you run csc -cflags or csc -ldflags respectively.

Also note the -cc and -ld parameters for csc to select alternative C compilers and linkers as well as the -L -l -C and -I parameters to pass them additional arguments.

Using the chicken program directly from the command line is a bit error prone for my taste as some parameters that affect conditional compilation are passed in automatically by the csc compiler driver. I always forget to specify them if I compile by hand ;-) Apart from that, csc is much more comfortable to use.

cu,
Thomas




reply via email to

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