Merge pull request #436 from felixbuenemann/fix-giflib4-detection

Fix configure check for giflib4
This commit is contained in:
John Cupitt 2016-05-08 11:03:30 +01:00
commit bd79a10453
1 changed files with 14 additions and 2 deletions

View File

@ -631,14 +631,26 @@ if test "$GIFLIB_LIBS" = ""; then
INCLUDES="$GIFLIB_INCLUDES $INCLUDES"
# Try the standard search path first
AC_TRY_LINK([#include <gif_lib.h>],[EGifSetGifVersion(0,0)], [
AC_TRY_LINK([#include <gif_lib.h>],[
#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR > 4
EGifSetGifVersion(0,0);
#else
GifLastError();
#endif
], [
GIFLIB_LIBS="-lgif"
], [
# giflib is not in the standard search path, try $prefix
LIBS="-L${prefix}/lib $LIBS"
AC_TRY_LINK([#include <gif_lib.h>],[EGifSetGifVersion(0,0)], [
AC_TRY_LINK([#include <gif_lib.h>],[
#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR > 4
EGifSetGifVersion(0,0);
#else
GifLastError();
#endif
], [
GIFLIB_LIBS="-L${prefix}/lib -lgif"
], [
GIFLIB_LIBS=no