Re: Creating an app with optional GTK support



> Hi.
>
>
>>>
>>> As for optional GTK+ support, wouldn't be better to check for GTK+ at
>>> configure phase and compile/link your application accordingly?
>>
>> Not possible because my app is currently not open source.
>
> Which probably means that you'll be distributing binaries. So you can
> compile two versions of your app: one that links against GTK+ and the
> one that doesn't. Your clients can then decide which one to use.

Not possible either because my app also has optional support Xrender,
Xfixes, Xcursor, and ALSA. The only lib I'm linking against is -lX11. The
rest is entirely optional. Now if I'd start building different binaries
for each config, there would be a lot of different combinations. It's
really easier to do this manually using a single binary and some calls to
dlopen().

However, I think I still need to scan /usr/lib and /lib and analyze what
we have because on this Ubuntu live CD here, there are no symlinks like
"libglib-2.0.so" and "libgtk-x11-2.0.so". Instead, they all have a ".0"
version attached. So the following call will fail on my Ubuntu live CD:

dlopen("libglib-2.0.so")
dlopen("libgtk-x11-2.0.so")

This doesn't work. I need to append a ".0" first. But of course I can't
hardcode the ".0" either because of new versions that could appear. So I
still need to scan /usr/lib and /lib and do some pattern matching and then
make an educated guess what .so I should open :)

Greets,

Andreas


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