I am trying to build something against libfltk. Its lack of pkg-config support means that I need to parse fltk-config output. ``` $ fltk-config --libs /usr/lib64/fltk/libfltk.a ``` Upstream say it works "Fine" as a shared library.[1] Our ebuild claims[2] that "building only shared libraries is hardly supported" It also claims that test bins link against the static lib, but that's trivially handled with a RESTRICT="test? (static-libs)" Are we doing something wrong? 1: https://www.fltk.org/doc-1.3/intro.html 2: https://gitweb.gentoo.org/repo/gentoo.git/tree/x11-libs/fltk/fltk-1.3.5-r4.ebuild#n183
It looks like the fltk-config script.... always outputs static libs when you use `--libs` ``` if test "$echo_libs" = "yes"; then USELIBS="$libdir/libfltk.a" if test x$use_forms = xyes; then USELIBS="$libdir/libfltk_forms.a $USELIBS" fi if test x$use_gl = xyes; then USELIBS="$libdir/libfltk_gl.a $USELIBS" fi if test x$use_cairo = xyes; then USELIBS="$libdir/libfltk_cairo.a $USELIBS" fi if test x$use_images = xyes; then USELIBS="$libdir/libfltk_images.a $USELIBS" for lib in fltk_jpeg fltk_png fltk_z; do if test -f $libdir/lib$lib.a; then USELIBS="$libdir/lib$lib.a $USELIBS" fi done fi echo $USELIBS ```
Most packages use `fltk-config --ldflags` (does -lfltk + other libs) + `fltk-config --c(xx)flags` and ignore --libs really. Not sure what --libs is even useful for given it'd be lacking other libraries, e.g. libfltk.a also needs -lpng and such given it's not linked with anything and your package would have to figure this out. As such, I don't think there's a point in doing anything here -- could always check upstream if want to improve fltk-config. --libs still does this in the 1.4.1 bump I'm about to do soon'ish (w/ wayland support and stuff) which builds with cmake instead and, on that note, that installs a FLTKConfig.cmake for cmake, meson, & friends to use instead of fltk-config (simpler build systems are still stuck with fltk-config though).
(In reply to Ionen Wolkens from comment #2) > e.g. libfltk.a also needs -lpng and such given Or well, that'd be fltk_images rather ;p But fltk-config --use-images --libs doesn't doesn't add -lpng and such still. $ fltk-config --use-images --libs /usr/lib64/libfltk_images.a /usr/lib64/libfltk.a $ fltk-config --use-images --ldflags -L/usr/lib64 -lfltk_images /usr/lib64/libjpeg.so /usr/lib64/libpng.so /usr/lib64/libz.so -lfltk -lm -lpthread -lXinerama -lXfixes -lXcursor -lpangoxft-1.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lXft -lpangocairo-1.0 -lcairo -lX11 -lXrender -lwayland-cursor -lwayland-client -lxkbcommon -ldbus-1 -ldecor-0 -ldl ... does add a bit too many -l by expecting a static lib though, it's all things libfltk*.so is already linked with, but it's not a major problem.