about summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in24
1 files changed, 14 insertions, 10 deletions
diff --git a/configure.in b/configure.in
index 8b345de08a..2b2faa4ba5 100644
--- a/configure.in
+++ b/configure.in
@@ -1324,16 +1324,20 @@ fi
 
 dnl Check whether we have the gd library available.
 AC_MSG_CHECKING(for libgd)
-old_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $libgd_include"
-old_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS $libgd_ldflags"
-old_LIBS="$LIBS"
-LIBS="$LIBS -lgd -lpng -lz -lm"
-AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
-CFLAGS="$old_CFLAGS"
-LDFLAGS="$old_LDFLAGS"
-LIBS="$old_LIBS"
+if test "$with_gd" != "no"; then
+  old_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $libgd_include"
+  old_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $libgd_ldflags"
+  old_LIBS="$LIBS"
+  LIBS="$LIBS -lgd -lpng -lz -lm"
+  AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
+  CFLAGS="$old_CFLAGS"
+  LDFLAGS="$old_LDFLAGS"
+  LIBS="$old_LIBS"
+else
+  LIBGD=no
+fi
 AC_MSG_RESULT($LIBGD)
 AC_SUBST(LIBGD)