"WITH_THUMBS=1" broken with --as-needed in LDFLAGS?

I was having issues enabling the e2p_thumbs.so plugin, every time I added
it via the "Edit plugins.." dialog it would just silently disappear upon
apply or commit, and the same thing even happened if I tried adding it to
the config file manually...

Recompiling with debugging enabled, and I get the following upon trying to
enable it;
[DEBUG ] e2_plugins_open1: /usr/lib/emelfm2/plugins/e2p_thumbs.so
[DEBUG ] failed to open plugin file:
/usr/lib/emelfm2/plugins/e2p_thumbs.so: undefined symbol:
gimp_thumbnail_set_filename
[WARN  ] plugin doesn't exist: e2p_thumbs.so

e2p_thumbs.so _does_ exist.

Anyways, I installed this via portage ebuilds, but remembered it working
fairly recently when compiling it manually, and the main difference
between the two was I never added LDFLAGS when I compiled it myself, so
when I rebuilt via portage without --as-needed in LDFLAGS, the plugin
worked just fine.

Looking closer, I discovered the only real difference between the two
builds was that /usr/bin/emelfm2 _itself_ was linked to
/usr/lib/libgimpthumb-2.0.so.0 without --as-needed, and in either case the
only libs the plugin so's where really linked to were libc.so.6 &
libpthread.so.0.
This would seem to make sense, as the emelfm2 binary itself doesn't seem
to make any use of libgimpthumb-2.0.so.0, so the linker wouldn't link to
it when --as-needed is used...

Playing around a bit, adding $(lLIBS) wherever $(lLIBS_CFLAGS) was used in
the Makefile solved the issue, although now _all_ the plugins are linked
to libgimpthumb-2.0.so.0...

I'm not a programmer or anything, and can make little sense of the
Makefile, but maybe the "optional" plugins each need their own logic
within the Makefile?
I haven't enabled any of the other optional plugins (acl, tracker), so I
have no idea if they are similarly affected.

Also, another (related) issue, portage complains about all the plugins
installed under /usr/lib/emelfm2/plugins ignoring LDFLAGS.
Adding "sed -e 's:$(lLIBS_CFLAGS):$(lLIBS_CFLAGS) $(lLDFLAGS):g' -i
Makefile" to the ebuild seems to satisfy portage at least (and this had
nothing to do with breaking e2p_thumbs.so).

Sorry for being so verbose, and I realize LDFLAGS may simple not be
supported (and with good reason), I just though I should point this out.

There are a few other issues or suggestions I have, but I'm not a
programmer so can't really help with them myself (as much as I'd like to),
and I really don't wish to annoy anyone, so should I list them in a follow
up?

Anyways, thx for emelfm2 in the first place, I seriously don't think I
could manage without it at this point.



-- 
Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: