Re: [Vala] Static linking




valac will never give you objects. It will give you C sources, the option
is I belieive -C (check with help). Than you'll have to use a build tool
to compile and link them, but personally I'd do that in any case.

Thats not true. valac -c compiles the .vala into C and then uses gcc
to generate the object file.

$ valac -c q.vala
$ ls
q.vala q.vala.o

Maybe we should expect something like q.o instead of q.vala.o...

is this a bug?
However, you don't want to create a library, you want to link against one,
right? So you don't really need that.

(For build tool, I found waf (code.google.com/p/waf) to be simple and
reasonable for compiling vala or you can use autotools, which are much
more complicated, but support more ancient, broken, exotic systems)

I really had serious maintaining problems using waf, I would encourage
to use autotools or just simple Makefile rules.

I dunno how is waf actually but at the time of using it the api
was changing so many times.
If you're wondering why I want to do static linking, I have several
reasons:
� It's less work for the end user to use my program

If you are going to distribute the binary to systems, that don't have
the libraries not a decent package manager *AND* your program is
otherwise a self-contained binary, yes. If it's not, than

For many libraries it is impossible to distribute them statically (because of
hardware-related dependencies like opengl) so I would prefer to link
against some static libraries and let the most common ones as shared
(libc, glib, ...) be careful about these decisions, Gobject based libraries
aims to keep binary compatibility (up to some versions)

Then just distributing your shared libraries with your application and then
using LD_LIBRARY_PATH setit up from a loader script to run your app.


--pancake



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