How to compile shared core/plugin libraries

Asked by dmr

I want to try to use the synapse backend in a separate program. Eventually, I'm thinking synapse, but looking like dmenu. To do this, I wanted to try to load the synapse libraries into ruby with the ruby ffi. To do this, I'd need to generate and The problem is that I know next to nothing about vala, automake, and libtool. I tried using the following sets of directions:

but have been unable to generate a .so (I checked .libs). I've tried passing --enable-shared and --with-pic (which seems redundant), but to no avail. I note that always has dlname='', which seems like a sign that something is wrong.

I know I could build the .so's the hacky way (ignore the automake stuff and just gcc -shared), but I suspect I'm going to end up messing around with the source a bit, and I'd prefer not to go down this road if possible. If somebody could help me build some .so files the "right" way, it'd be a big help.

Question information

English Edit question
Synapse Edit question
No assignee Edit question
Solved by:
Michal Hruby
Last query:
Last reply:
Revision history for this message
Jeremy Munsch (jeremy-munsch) said :

I don't know how to do this but maybe you could find some info on this branch
which is using synapse as backend.

Revision history for this message
Jeremy Munsch (jeremy-munsch) said :

So according this
the branch on above comment can build libsynapse, but synapse itself can't.
So you may look on the other project.
Please tell me if you succeed to have build of last synapse version.

Revision history for this message
Jeremy Munsch (jeremy-munsch) said :

Here are the changes i talked about made by Rico.

Revision history for this message
Jeremy Munsch (jeremy-munsch) said :

I just got the mentioned branch
In indicator-search/src/indicator/ are the files you are looking for

So they contain instructions to build c lib.

Maybe you could make a PR to add these to the main synapse branch so other people could have t easily.
I just can't make it myself as i'm still a noob and you seems to know the things more than me.

Revision history for this message
Best Michal Hruby (mhr3) said :

If I recall correctly, the automake setup is done in a way where it builds libraries for core and plugins, but they are explicitely marked as "noinst" which ultimately means that a .so won't be build out of them and instead the synapse binary (built in the ui subdir) just links statically with them.

What I'd suggest is to create another src directory which will be pretty much the same thing as the automake in ui subdirectory but instead of building a binary, it will build an actual .so from the two libraries (because .so based plugin loading isn't implemented, so you'll save yourself some headache by having all the plugins compiled in there). Basically you need a _LTLIBRARIES target there without the noinst definition.

Hope that helps.

Revision history for this message
Rico Tzschichholz (ricotz) said :

It is pretty straight forward to enable this.

I would object proposals to enable it since imo it is *not* wanted for synapse trunk branch (yet).

Revision history for this message
dmr (dradetsky) said :

Thanks Michal Hruby, that solved my question.

Revision history for this message
dmr (dradetsky) said :

Was also necessary to define the variable dir and set it to some absolute path (I set dir=/). No idea what this is. The install target? Anyway, managed to build some .so's, although who knows if they work or not.