[Bugfix] Handle conditional jpeg/zlib building through AM_CONDITIONAL to make
    make dist working
[Bugfix] #include <jpeglib.h> (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/rfb/JpegCompressor.h b/common/rfb/JpegCompressor.h
index 93fdc7b..93f6dec 100644
--- a/common/rfb/JpegCompressor.h
+++ b/common/rfb/JpegCompressor.h
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 extern "C" {
-#include <jpeg/jpeglib.h>
+#include <jpeglib.h>
 }
 
 #include <rdr/types.h>
diff --git a/common/rfb/Makefile.am b/common/rfb/Makefile.am
index f2106d1..29ffc95 100644
--- a/common/rfb/Makefile.am
+++ b/common/rfb/Makefile.am
@@ -46,20 +46,19 @@
 	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
-endif
-if IRIX_MEDIA
-librfb_la_SOURCES += IrixDMJpegCompressor.cxx IrixDMIC_RawToJpeg.cxx
-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_SOURCES += IrixDMJpegCompressor.cxx IrixDMIC_RawToJpeg.cxx
 librfb_la_LIBADD += -ldmedia
 endif
+
+if INCLUDED_JPEG
+librfb_la_CPPFLAGS += -I$(top_srcdir)/jpeg
+librfb_la_LIBADD += $(top_srcdir)/jpeg/libjpeg.la
+endif