diff options
author | Christian Beier <dontmind@freeshell.org> | 2012-04-25 12:55:03 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2012-04-25 12:55:03 +0200 |
commit | 413ca0dfef83b98f7b230e0596ac086d42eaad4e (patch) | |
tree | b36ca82ac24402f3f0f5a7085f0561757e7b56f5 /configure.ac | |
parent | 2524573678fbdb195cbc9ba2f92e0f58c205ad10 (diff) | |
parent | 1df6bffd9e7ff5106ffb5f3bc1938a14ea1f72cf (diff) | |
download | libtdevnc-413ca0dfef83b98f7b230e0596ac086d42eaad4e.tar.gz libtdevnc-413ca0dfef83b98f7b230e0596ac086d42eaad4e.zip |
Merge branch 'turbovnc'
Conflicts, resolved manually:
AUTHORS
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index f157c12..4e9c889 100644 --- a/configure.ac +++ b/configure.ac @@ -528,7 +528,11 @@ AC_ARG_WITH(jpeg, # -without-jpeg with_jpeg="no" # -with-jpeg=/foo/dir with_jpeg="/foo/dir" +HAVE_LIBJPEG_TURBO="false" + if test "x$with_jpeg" != "xno"; then + AC_ARG_VAR(JPEG_LDFLAGS, + [Linker flags to use when linking with libjpeg, e.g. -L/foo/dir/lib -Wl,-static -ljpeg -Wl,-shared. This overrides the linker flags set by --with-jpeg.]) if test ! -z "$with_jpeg" -a "x$with_jpeg" != "xyes"; then # add user supplied directory to flags: saved_CPPFLAGS="$CPPFLAGS" @@ -544,9 +548,19 @@ if test "x$with_jpeg" != "xno"; then LDFLAGS="$LDFLAGS -R$with_jpeg/lib" fi fi + if test "x$JPEG_LDFLAGS" != "x"; then + LDFLAGS="$saved_LDFLAGS" + LIBS="$LIBS $JPEG_LDFLAGS" + else + LIBS="-ljpeg" + fi AC_CHECK_HEADER(jpeglib.h, HAVE_JPEGLIB_H="true") + AC_MSG_CHECKING(for jpeg_CreateCompress in libjpeg) if test "x$HAVE_JPEGLIB_H" = "xtrue"; then - AC_CHECK_LIB(jpeg, jpeg_CreateCompress, , HAVE_JPEGLIB_H="") + AC_LINK_IFELSE([AC_LANG_CALL([], [jpeg_CreateCompress])], + [AC_MSG_RESULT(yes); + AC_DEFINE(HAVE_LIBJPEG, 1, libjpeg support enabled)], + [AC_MSG_RESULT(no); HAVE_JPEGLIB_H=""]) fi if test ! -z "$with_jpeg" -a "x$with_jpeg" != "xyes"; then if test "x$HAVE_JPEGLIB_H" != "xtrue"; then @@ -563,13 +577,52 @@ if test "x$with_jpeg" != "xno"; then This may lead to reduced performance, especially over slow links. If libjpeg is in a non-standard location use --with-jpeg=DIR to indicate the header file is in DIR/include/jpeglib.h and the library -in DIR/lib/libjpeg.a. A copy of libjpeg may be obtained from: -ftp://ftp.uu.net/graphics/jpeg/ +in DIR/lib/libjpeg.a. You can also set the JPEG_LDFLAGS variable to +specify more detailed linker flags. A copy of libjpeg-turbo may be +obtained from: https://sourceforge.net/projects/libjpeg-turbo/files/ +A copy of libjpeg may be obtained from: http://ijg.org/files/ ========================================================================== ]) sleep 5 fi fi + + if test "x$HAVE_JPEGLIB_H" = "xtrue"; then + AC_MSG_CHECKING(whether JPEG library is libjpeg-turbo) + m4_define([LJT_TEST], + [AC_LANG_PROGRAM([#include <stdio.h> + #include <jpeglib.h>], + [struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; + cinfo.err=jpeg_std_error(&jerr); + jpeg_create_compress(&cinfo); + cinfo.input_components = 3; + jpeg_set_defaults(&cinfo); + cinfo.in_color_space = JCS_EXT_RGB; + jpeg_default_colorspace(&cinfo); + return 0;])] + ) + if test "x$cross_compiling" != "xyes"; then + AC_RUN_IFELSE([LJT_TEST], + [HAVE_LIBJPEG_TURBO="true"; AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + else + AC_LINK_IFELSE([LJT_TEST], + [HAVE_LIBJPEG_TURBO="true"; AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + fi + fi + + if test "x$HAVE_LIBJPEG_TURBO" != "xtrue"; then + AC_MSG_WARN([ +========================================================================== +*** The libjpeg library you are building against is not libjpeg-turbo. +Performance will be reduced. You can obtain libjpeg-turbo from: +https://sourceforge.net/projects/libjpeg-turbo/files/ *** +========================================================================== +]) + fi + fi AC_ARG_WITH(png, |