As reported downstream at:
https://bugs.gentoo.org/show_bug.cgi?id=510934
It tries gdlib-config and treats that as regular *-config script. But...
$ gdlib-config --libs
-lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lz -lm
Notice no '-lgd' there. So 'gdlib-config --libs' outputs only libs needed for static linking. libgphoto2 assumes '-lgd' is supposed to be there and fails to link the test program.
Thanks for fixing it
well, on openSUSE:
$ gdlib-config --libs
-lgd
$ rpm -qf /usr/bin/gdlib-config
gd-devel-2.0.36.RC1-78.1.2.x86_64
the intent of *-config is to supply the required link lines, and not just the required libraries as far as I understand.
Hmm, but it can perhaps be worked around somehow to cover both cases.
This is because openSUSE is patching gdlib-config. We in Gentoo install the original version without modifications to specifically avoid being source of such an issues.
If you look at the .src.rpm of this gd-devel version, you'd notice the following patch:
I now uncondtionaly also add -lgd to the LIBGD_LIBS variable, which should fix this problem.
fixed in 2.5.5 i hope