afbd840d24
Configure script complains, that unable to build gif loading support,
but it's a lie -- it builds against libgif 5, which have DGifOpenFile as
well.
Cherry-picked by @obadz from
https://github.com/NixOS/nixpkgs/pull/36711/commits/8439304ebca3abcbd989131f77d644ab1e61ff90
(libungif was already dropped by commit b41ede5e3a)