Fix configure check for giflib4

This uses a combination of the old giflib4 and the new giflib5 checks.
This commit is contained in:
Felix Bünemann 2016-05-08 03:23:00 +02:00
parent 948d1103d4
commit a342fdbeeb
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