chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Building shared libraries from multiple units


From: Joel Reymont
Subject: Re: [Chicken-users] Building shared libraries from multiple units
Date: Thu, 16 Dec 2004 18:54:36 +0000

> Joel Reymont wrote:

>I split the wrapper into  multiple SWIG interface files now so that I
>could let make figure out what files to rebuild. It appears, though, that
>I can no longer have one unit for my shared library as multiple
>C_toplevel functions get defined. One is used per cpp/scheme file and
>initializes TinyCLOS, etc. Problem is resolved if I build each scheme
>file as a separate unit but it seems to me that I would have to include
>them separately as well.
>
>Is there a way to do what I'm trying to do with just one unit?

There I go answering meself again...

This is how I build the guichan.so shared library:

%.so: $(OBJ) guichan.scm
        $(CSCLD) -s -o $@ $^ $(WRAP_OBJ)

I build the object files (from cpp files generated by csc) and the swig
wrapper cxx files beforehand. 

guichan.scm used to be an empty file as you cannot just give a bunch of
object files to csc and expect it to link them. It does need a scheme
file apparently. Well, rather than keep the empty file around I put these
lines into it:

(load-library 'sdl "./guichan.so")
(load-library 'guichan "./guichan.so")
(load-library 'color "./guichan.so")
(load-library 'font "./guichan.so")
(load-library 'graphics "./guichan.so")
(load-library 'imageloader "./guichan.so")
(load-library 'input "./guichan.so")
(load-library 'misc "./guichan.so")
(load-library 'rectangle "./guichan.so")
(load-library 'widgets "./guichan.so")

Now I can just do (require 'guichan) and happily move on!

    Joel

-- 
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums
Tenerife: Canary Islands: Spain





reply via email to

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