On 07.06.2012 16:19, Sanel Zukan wrote:

> Ubuntu/debian and now fedora changed fltk-config, notably --ldflags,
> which I used (inside EDE) to determine options FLTK is compiled with,
> like Xft, fontconfig and etc. Unfortunately, after this change, they
> even left --libs and --ldstaticflags unusable (options I never used).
>
> Let me give you an example on Fedora 17 (on fedora 16 fltk-config
> works as expected):
>
> $ fltk-config --ldflags
> $ -Wl,-z,relro -lfltk
>
> However, fltk-config from fltk.org behaves as always did.
>
> To keep story short, please read discussion on:
> https://bugs.launchpad.net/ubuntu/+source/fltk1.3/+bug/1007429
>
> What happened with that fltk-config patch from 2008?

Didn't Julian Taylor mention 2006? (see link above). I don't know
of such a patch, but this is really a long time. He also suggested
that you should ask the Debian maintainers...

I remember that Aaron Ucko (Debian's FLTK maintainer) posted (a link
to) the Debian patches for FLTK and I took a look at them. We decided
to implement a small subset, but everything else was said to be
Debian-specific and should not be done in FLTK. I can't remember if
there were patches to fltk-config though.

To the discussion mentioned above:

My impression is that Julian put some interesting points that can
be summarized as "if you link dynamically, don't add dependent libs
to your linker command, since they should be resolved by the libs
you link with". In clear text: "fltk-config --ldflags" should *not*
give the X11 libs (and others), since the FLTK *dynamic* lib would
depend on these, and hence the linker would resolve them anyway.
He suggests to use --ldstaticflags to get these additional libs.

So far, so good.

Here are my thoughts about this issue, but I'm not the one to give
an *authoritative* answer.

IMHO fltk-config was NOT designed to do exactly what (Ubuntu) Julian
assumes it should do. They (Ubuntu) obviously seem to use fltk-config
to determine dependencies for their Linux distribution. They further
seem to presume that FLTK will (always?) be configured with dynamic
libs (--enable-shared), so that "fltk-config --ldflags" would give
the linker options for dynamic linking. However, this is not always
true, and I believe the main error is to use fltk-config for this
task. But I could also be wrong with this interpretation!

I believe the FLTK team decided to use fltk-config as a platform
independent tool to be used (among others) in Makefile(s) to output
*all* libs that need to be linked with, dependent on the platform
and FLTK's configuration. This *must* include the X11 libs, at least
if FLTK was configured w/o --enable-shared (and is used for dynamic
linking).

I'm not sure if we could change it if --enable-shared has been used
so that we can assume --ldflags is used for dynamic linking only,
whereas --ldstaticflags is different and would output *ALL* needed
libs (for static linking). Maybe this is what it was designed for?
But what if --enable-shared has not been used? Would --ldflags then
be the same as --ldstaticflags?

These are just some thoughts, and I don't have the time and not
enough experience with other open source tools (and other platforms
like BSD etc.) to decide if I'm right or wrong.

More comments welcome...

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to