On 03/20/2013 10:08 AM, Don Porter wrote:
> On 03/19/2013 08:14 PM, Steve Havelka wrote:
>> I've written a C library with a set of Tcl bindings. Building the
>> library itself on a variety of platforms has been no problem--I'm
>> using CMake for the cross-platform build system.
>>
>> I've used CMake's usual install targets for the library itself,
>> and CMake will put those into the system library path (e.g.
>> /usr/local/lib).
>
> Is that library suitable for passing to Tcl's [load] command?
>
> Is it installed in /usr/local/lib for a reason? That is, is there
> some use of the library other than as a Tcl package which needs it to
> be in that location? Perhaps a runtime loader wants to find it
> there?
>
Hi Don,
Thanks for giving me an opportunity to clarify the situation.
My code comes in two parts: the library itself (an .so file), and then
a separate .so for each language's bindings. Right now, only Tcl and
Lua have .so files for their bindings--the other languages I've written
binding layers for (i.e. Vala and FreePascal) just link directly against
the library itself.
So the build process for making my library usable from Tcl looks
something like this:
1) Build the library (cmake, make, make install). This drops the
library .so into /usr/local/lib, or wherever you want to put it.
2) Go to the /bindings/tcl/ folder and run cmake and make. This gives
you another .so (and this is the .so usable by [load]) and a
pkgIndex.tcl file, which up to now I've just left in the output
directory with a note to the user to put this where they put their other
Tcl libraries.
It's this last part, where the user has to put those files somewhere by
hand, that I'd like to automate, if possible.
Thanks,
Steve