$NetBSD: patch-ad,v 1.7 1999/04/23 22:16:07 tron Exp $
--- Imakefile.orig	Tue Oct 27 00:45:53 1998
+++ Imakefile	Tue Oct 27 01:13:26 1998
@@ -6,13 +6,15 @@
 /* if, for whatever reason, you're unable to get the JPEG library to compile
  * on your machine, *COMMENT OUT* the following line
  */
-#define HaveJpeg
+/* #define HaveJpeg */
+#define UseInstalledJpeg
 
 
 /* if, for whatever reason, you're unable to get the TIFF library to compile
  * on your machine, *COMMENT OUT* the following line
  */
-#define HaveTiff
+/* #define HaveTiff */
+#define UseInstalledTiff
 
 
 /* if, for whatever reason, you're unable to get the PDS/VICAR support
@@ -119,16 +121,30 @@
 JPEG = -DDOJPEG
 JPEGDIR = jpeg
 LIBJPEG = $(JPEGDIR)/libjpeg.a
+DEPLIBJPEG = $(LIBJPEG)
 JPEGINCLUDE = -I$(JPEGDIR)
 #endif
 
+#ifdef UseInstalledJpeg
+JPEG = -DDOJPEG
+LIBJPEG = $(LDFLAGS) -L$(LOCALBASE)/lib -Wl,-R$(LOCALBASE)/lib -ljpeg
+JPEGINCLUDE = -I$(LOCALBASE)/include
+#endif
+
 #ifdef HaveTiff
 TIFF = -DDOTIFF
 TIFFDIR = tiff
 LIBTIFF = $(TIFFDIR)/libtiff.a
+DEPLIBTIFF = $(LIBTIFF)
 TIFFINCLUDE = -I$(TIFFDIR)
 #endif
 
+#ifdef UseInstalledTiff
+TIFF = -DDOTIFF
+LIBTIFF = -L$(LOCALBASE)/lib -ltiff -ljpeg -lz
+TIFFINCLUDE = -I$(LOCALBASE)/include
+#endif
+
 #ifdef HavePDS
 PDS = -DDOPDS
 #endif
@@ -141,8 +157,8 @@
 #endif
 
 
-DEPLIBS = $(LIBJPEG) $(LIBTIFF)
-LOCAL_LIBRARIES = $(XLIB) $(DEPLIBS)
+DEPLIBS = $(DEPLIBJPEG) $(DEPLIBTIFF)
+LOCAL_LIBRARIES = $(XLIB) $(LIBJPEG) $(LIBTIFF)
 
 DEFINES= $(SCO) $(UNIX) $(NODIRENT) $(VPRINTF) $(TIMERS) \
 	$(HPUX7) $(JPEG) $(TIFF) $(PDS) $(DXWM) $(RAND) \
@@ -182,10 +198,10 @@
 
 PROGRAMS= xv bggen vdcomp xcmap xvpictoppm
 
-all::
-	@echo ""
-	@echo "  Did you remember to 'make depend' first?"
-	@echo ""
+#all::
+#	@echo ""
+#	@echo "  Did you remember to 'make depend' first?"
+#	@echo ""
 
 
 #if defined(HaveJpeg) || defined(HaveTiff)
