Allow using a system-installed giflib

Andrew Hughes gnu.andrew at
Wed Mar 13 09:08:23 UTC 2013

----- Original Message -----
> Hi,
> I have a webrev at:
> It introduces a configure option --with-giflib that (similar to the
> existing --with-zlib) allows specifying whether the build should use
> the
> system installed giflib or the one bundled with OpenJDK.
> I have not tested it extensively yet (just verified that it builds
> fine
> with both configurations), but I will do that over the coming days if
> the patch looks (somewhat) acceptable for OpenJDK8.
> Thanks,
> Omair
> --
> PGP Key: 66484681 (
> Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681

Given this is essentially a binary option (system giflib or bundled giflib),
why is AC_ARG_ENABLE not being used instead of AC_ARG_WITH?  It would simplify
the logic here and is what we use in the equivalent IcedTea check which has
been in production use for almost two years.

This code also checks for the giflib library even if "bundled" has been selected.

This is the existing IcedTea check:

  AC_MSG_CHECKING([whether to use the system giflib install])
              [AS_HELP_STRING(--enable-system-gif,use the system giflib [[default=yes]])],
  if test x"${ENABLE_SYSTEM_GIF}" = "xyes"; then
    dnl Check for GIF headers and libraries.
    AC_CHECK_LIB([gif], [main],
        , [AC_MSG_ERROR([Could not find GIF library; install GIF or build with --disable-system-gif to use the in-tree copy.])]\
        , [AC_MSG_ERROR([Could not find GIF header; install GIF or build with --disable-system-gif to use the in-tree copy.])])

A few simple changes to this (making the default no, setting USE_EXTERNAL_GIFLIB instead of GIF_LIBS) would make
this equivalent to what you have, yet retain the advantage that this code has been well tested over the last
two years.

Was there a reason to change main to DGifGetCode?  It seems a better choice, assuming that symbol
is available in all versions, but I'm just wondering if a problem with using main was exposed.
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (

PGP Key: 248BDC07 (
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07

More information about the build-dev mailing list