Allow using a system-installed giflib

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


----- Original Message -----
> Hi,
> 
> I have a webrev at:
> http://cr.openjdk.java.net/~omajid/webrevs/system-giflib/00/
> 
> 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 (http://pgp.mit.edu/)
> 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])
  AC_ARG_ENABLE([system-gif],
              [AS_HELP_STRING(--enable-system-gif,use the system giflib [[default=yes]])],
  [
    ENABLE_SYSTEM_GIF="${enableval}"
  ],
  [
    ENABLE_SYSTEM_GIF="yes"
  ])
  AC_MSG_RESULT(${ENABLE_SYSTEM_GIF})
  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_CHECK_HEADER([gif_lib.h],
        , [AC_MSG_ERROR([Could not find GIF header; install GIF or build with --disable-system-gif to use the in-tree copy.])])
    GIF_LIBS="-lgif"
    AC_SUBST(GIF_LIBS)
  fi

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. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07




More information about the build-dev mailing list