diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-10-18 21:37:05 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-10-18 21:37:05 +0200 |
commit | 5994df7f048492b234c2827cf9a7e313b356c6b8 (patch) | |
tree | cf3c4d12c01685570b9b8393d51f331698885a01 /configure.ac | |
parent | d8a420c95275117b0efd32b6e3b61847f58ad37c (diff) |
[IconLoader] add optional gif loader.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index f05ee356..bb9ac057 100644 --- a/configure.ac +++ b/configure.ac @@ -165,7 +165,38 @@ dnl Gets the resource compile tool path. dnl --------------------------------------------------------------------- AM_PATH_GLIB_2_0 - +dnl Test for libgif or libungif +AC_ARG_WITH([libgif], + AS_HELP_STRING([--with-libgif=PREFIX], + [Prefix where libgif is installed, or 'no' to disable]), + [libgif_prefix="$withval"], [libgif_prefix="${prefix}"]) + + if test x$with_libgif != xno && test -z "$libgif_LIBS"; then + GIF_CFLAGS="-I${libgif_prefix}/include" + GIF_LIBS="-L${libgif_prefix}/lib" + save_cflags=$CFLAGS; CFLAGS=$GIF_CFLAGS + save_libs=$LIBS; LIBS=$GIF_LIBS + AC_CHECK_LIB(gif, DGifOpenFileName, + [AC_CHECK_HEADER(gif_lib.h, + GIF='gif'; libgif_LIBS='-lgif'; gif_ok=yes, + AC_MSG_WARN(*** GIF loader will not be built (giflibrary not found) ***))], + AC_MSG_WARN(*** GIF loader will not be built (giflibrary not found) ***)) + + AC_CHECK_LIB(ungif, DGifOpenFileName, + [AC_CHECK_HEADER(gif_lib.h, + GIF='ungif'; libgif_LIBS='-lungif'; gif_ok=yes, + AC_MSG_WARN(*** GIF loader will not be built (ungiflibrary not found) ***))], + AC_MSG_WARN(*** GIF loader will not be built (ungiflibrary not found) ***)) + CFLAGS+=$save_cflags + LIBS+=$save_libs + fi + +if test x$GIF != x; then + AC_SUBST(libgif_LIBS) + AC_DEFINE(HAVE_LIBGIF, 1, Define if gif support is available) +else + gif_ok="no (See http://sourceforge.net/projects/libgif)" +fi dnl --------------------------------------------------------------------- dnl Add extra compiler flags dnl --------------------------------------------------------------------- |