From: Adam Tkac Date: Wed, 22 Oct 2008 14:47:09 +0000 (+0000) Subject: [Bugfix] Handle conditional jpeg/zlib building through AM_CONDITIONAL to make X-Git-Tag: v0.0.90~371 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a0d5fe3790af8c284be9ddc0ca369ecf21c67195;p=tigervnc.git [Bugfix] Handle conditional jpeg/zlib building through AM_CONDITIONAL to make make dist working [Bugfix] #include (not jpeg/jpeglib.h) in JpegCompressor.h git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3043 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/common/Makefile.am b/common/Makefile.am index ef1cdaa4..905a2b2d 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1 +1,10 @@ -SUBDIRS = @ZLIB_DIR@ @JPEG_DIR@ rdr network Xregion rfb +SUBDIRS = + +if INCLUDED_ZLIB +SUBDIRS += zlib +endif +if INCLUDED_JPEG +SUBDIRS += jpeg +endif + +SUBDIRS += rdr network Xregion rfb diff --git a/common/configure.ac b/common/configure.ac index f0b8a8ab..b895da61 100644 --- a/common/configure.ac +++ b/common/configure.ac @@ -55,50 +55,29 @@ AC_CHECK_LIB(dmedia, dmICCreate, IRIX_MEDIA=yes]) AM_CONDITIONAL([IRIX_MEDIA], [ test "x$IRIX_MEDIA" = xyes ]) +dnl Check for zlib library +INCLUDED_ZLIB=no AC_ARG_WITH([included-zlib], AS_HELP_STRING([--with-included-zlib], [use libz which is distributed with VNC]), - [], [with_included_zlib='no']) - -if test "x$with_included_zlib" = xno; then - AC_SEARCH_LIBS([inflateEnd], [z], [], - [ZLIB_DIR=zlib - ZLIB_INCLUDE='-I$(top_srcdir)/zlib' - ZLIB_LIB='$(top_srcdir)/zlib/libz.la']) -else - ZLIB_DIR=zlib - ZLIB_INCLUDE='-I$(top_srcdir)/zlib' - ZLIB_LIB='$(top_srcdir)/zlib/libz.la' -fi - -AC_SUBST(ZLIB_DIR) -AC_SUBST(ZLIB_INCLUDE) -AC_SUBST(ZLIB_LIB) + [INCLUDED_ZLIB=yes], + [AC_SEARCH_LIBS([inflateEnd], [z], [], [INCLUDED_ZLIB=yes])]) +AM_CONDITIONAL([INCLUDED_ZLIB], [ test "x$INCLUDED_ZLIB" = xyes ]) AC_CONFIG_SUBDIRS([zlib]) +dnl Check for libjpeg library +INCLUDED_JPEG=no AC_ARG_WITH([included-jpeg], AS_HELP_STRING([--with-included-jpeg], [use libjpeg which is distributed with VNC]), - [], [with_included_jpeg='no']) - -if test "x$with_included_jpeg" = xno; then - AC_SEARCH_LIBS([jpeg_destroy_compress], [jpeg], [], - [JPEG_DIR=jpeg - JPEG_INCLUDE='-I$(top_srcdir)/jpeg' - JPEG_LIB='$(top_srcdir)/jpeg/libjpeg.la']) -else - JPEG_DIR=jpeg - JPEG_INCLUDE='-I$(top_srcdir)/jpeg' - JPEG_LIB='$(top_srcdir)/jpeg/libjpeg.la' -fi + [INCLUDED_JPEG=yes], + [AC_SEARCH_LIBS([jpeg_destroy_compress], [jpeg], [], + [INCLUDED_JPEG=yes])]) +AM_CONDITIONAL([INCLUDED_JPEG], [ test "x$INCLUDED_JPEG" = xyes ]) AC_CONFIG_SUBDIRS([jpeg]) -AC_SUBST(JPEG_DIR) -AC_SUBST(JPEG_INCLUDE) -AC_SUBST(JPEG_LIB) - AC_CHECK_FUNCS_ONCE([vsnprintf strcasecmp strncasecmp]) AC_CHECK_TYPES([socklen_t], diff --git a/common/rdr/Makefile.am b/common/rdr/Makefile.am index b1c0be51..e9a01c10 100644 --- a/common/rdr/Makefile.am +++ b/common/rdr/Makefile.am @@ -9,6 +9,10 @@ librdr_la_SOURCES = $(HDRS) Exception.cxx FdInStream.cxx FdOutStream.cxx \ InStream.cxx RandomStream.cxx ZlibInStream.cxx ZlibOutStream.cxx \ HexInStream.cxx HexOutStream.cxx -librdr_la_CPPFLAGS = -I$(top_srcdir) @ZLIB_INCLUDE@ +librdr_la_CPPFLAGS = -I$(top_srcdir) +librdr_la_LIBADD = -librdr_la_LIBADD = @ZLIB_LIB@ +if INCLUDED_ZLIB +librdr_la_CPPFLAGS += -I$(top_srcdir)/zlib +librdr_la_LIBADD += $(top_srcdir)/zlib/libz.la +endif diff --git a/common/rfb/JpegCompressor.h b/common/rfb/JpegCompressor.h index 93fdc7bf..93f6decf 100644 --- a/common/rfb/JpegCompressor.h +++ b/common/rfb/JpegCompressor.h @@ -4,7 +4,7 @@ #include #include extern "C" { -#include +#include } #include diff --git a/common/rfb/Makefile.am b/common/rfb/Makefile.am index f2106d18..29ffc950 100644 --- a/common/rfb/Makefile.am +++ b/common/rfb/Makefile.am @@ -46,20 +46,19 @@ librfb_la_SOURCES = $(HDRS) Blacklist.cxx CConnection.cxx CMsgHandler.cxx \ VNCServerST.cxx ZRLEEncoder.cxx ZRLEDecoder.cxx encodings.cxx \ secTypes.cxx util.cxx +librfb_la_CPPFLAGS = -I$(top_srcdir) +librfb_la_LIBADD = + if IRIX_COMPRESS librfb_la_SOURCES += IrixCLJpegCompressor.cxx +librfb_la_LIBADD += -lcl endif if IRIX_MEDIA librfb_la_SOURCES += IrixDMJpegCompressor.cxx IrixDMIC_RawToJpeg.cxx +librfb_la_LIBADD += -ldmedia endif -librfb_la_CPPFLAGS = -I$(top_srcdir) @JPEG_INCLUDE@ - -librfb_la_LIBADD = @JPEG_LIB@ - -if IRIX_COMPRESS -librfb_la_LIBADD += -lcl -endif -if IRIX_MEDIA -librfb_la_LIBADD += -ldmedia +if INCLUDED_JPEG +librfb_la_CPPFLAGS += -I$(top_srcdir)/jpeg +librfb_la_LIBADD += $(top_srcdir)/jpeg/libjpeg.la endif