summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2011-07-19 13:40:34 +0200
committerChristian Beier <dontmind@freeshell.org>2011-07-22 17:56:26 +0200
commit896ca2036c35b89a7f63e1adefe5e3724bf4d40d (patch)
treed59dd0310911a14e65f55378897f146a0b1c2184 /configure.ac
parent17ce0c56281f55316685f194b34e5f99f4024a5f (diff)
downloadlibtdevnc-896ca2036c35b89a7f63e1adefe5e3724bf4d40d.tar.gz
libtdevnc-896ca2036c35b89a7f63e1adefe5e3724bf4d40d.zip
tightPng: Add initial tightPng encoding support.
http://wiki.qemu.org/VNC_Tight_PNG Signed-off-by: Joel Martin <github@martintribe.org> Signed-off-by: Christian Beier <dontmind@freeshell.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac55
1 files changed, 55 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3203d7a..280ea58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -578,6 +578,60 @@ ftp://ftp.uu.net/graphics/jpeg/
fi
fi
+AC_ARG_WITH(png,
+[ --without-png disable support for png]
+[ --with-png=DIR use png include/library files in DIR],,)
+
+# At this point:
+# no png on command line with_png=""
+# -with-png with_png="yes"
+# -without-png with_png="no"
+# -with-png=/foo/dir with_png="/foo/dir"
+
+if test "x$with_png" != "xno"; then
+ if test ! -z "$with_png" -a "x$with_png" != "xyes"; then
+ # add user supplied directory to flags:
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$with_png/include"
+ LDFLAGS="$LDFLAGS -L$with_png/lib"
+ if test "x$ld_minus_R" = "xno"; then
+ :
+ elif test "x$GCC" = "xyes"; then
+ # this is not complete... in general a rat's nest.
+ LDFLAGS="$LDFLAGS -Xlinker -R$with_png/lib"
+ else
+ LDFLAGS="$LDFLAGS -R$with_png/lib"
+ fi
+ fi
+ AC_CHECK_HEADER(png.h, HAVE_PNGLIB_H="true")
+ if test "x$HAVE_PNGLIB_H" = "xtrue"; then
+ AC_CHECK_LIB(png, png_create_write_struct, , HAVE_PNGLIB_H="")
+ fi
+ if test ! -z "$with_png" -a "x$with_png" != "xyes"; then
+ if test "x$HAVE_PNGLIB_H" != "xtrue"; then
+ # restore old flags on failure:
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+ fi
+ if test "$build_x11vnc" = "yes"; then
+ if test "x$HAVE_PNGLIB_H" != "xtrue"; then
+ AC_MSG_WARN([
+==========================================================================
+*** The libpng compression library was not found. ***
+This may lead to reduced performance, especially over slow links.
+If libpng is in a non-standard location use --with-png=DIR to
+indicate the header file is in DIR/include/png.h and the library
+in DIR/lib/libpng.a. A copy of libpng may be obtained from:
+http://www.libpng.org/pub/png/libpng.html
+==========================================================================
+])
+ sleep 5
+ fi
+ fi
+fi
+
AC_ARG_WITH(libz,
[ --without-libz disable support for deflate],,)
AC_ARG_WITH(zlib,
@@ -654,6 +708,7 @@ AM_CONDITIONAL(WITH_TIGHTVNC_FILETRANSFER, test "$with_tightvnc_filetransfer" =
AM_CONDITIONAL(HAVE_LIBZ, test ! -z "$HAVE_ZLIB_H")
AM_CONDITIONAL(HAVE_LIBJPEG, test ! -z "$HAVE_JPEGLIB_H")
+AM_CONDITIONAL(HAVE_LIBPNG, test ! -z "$HAVE_PNGLIB_H")
SDLCONFIG="sdl-config"