So, libgphoto2 has ugly pile of macros to check for libs. It first tries pkg-config search for libgd that fails because we don't ship any libgd.pc. Then 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.
Possible hack-around: LIBGD_CFLAGS=" " LIBGD_LIBS="-lgd" to econf. Still worth reporting upstream though.
+*libgphoto2-2.5.4 (21 May 2014) + + 21 May 2014; Pacho Ramos <pacho@gentoo.org> +libgphoto2-2.5.4.ebuild, + -files/libgphoto2-2.4.7-no-test-build.patch, + -files/libgphoto2-2.4.8-increase_max_entries.patch, + -files/libgphoto2-2.4.9-dnl.patch, -files/libgphoto2-2.5.2-canon-s100.patch, + -files/libgphoto2-2.5.2-libxml2-detection.patch, + -files/libgphoto2-2.5.2-libxml2-detection2.patch, + -libgphoto2-2.4.14-r1.ebuild, -libgphoto2-2.5.2-r1.ebuild, + -libgphoto2-2.5.2-r3.ebuild: + Version bump, fix gd detection (#510934 by mgorny), drop old +
(In reply to Michał Górny from comment #0) we follow what upstream does. gd-2.0.x didn't ship a .pc file. the new gd-2.1 includes it, but that isn't yet in the tree.