$NetBSD: patch-ab,v 1.5 2000/08/31 12:37:02 dmcmahill Exp $

--- Makefile.orig	Thu Aug 31 08:09:46 2000
+++ Makefile	Thu Aug 31 08:10:24 2000
@@ -35,5 +35,5 @@
 # Installation sites (GNU conventions):
 #
-prefix   = /usr/local
+prefix   = ${PREFIX}
 bindir   = $(prefix)/bin
 includedir = $(prefix)/include
@@ -45,10 +45,10 @@
 # For non-gcc compilers, simply set CFLAGS = -O (to start with)
 #
-CC       = gcc
-CFLAGS   = -O2 -Wall -ansi -fstrength-reduce -finline-functions
+#CC       = gcc
+CFLAGS+=  -Wall -ansi -fstrength-reduce -finline-functions
 
-LFLAGS   =                # only sometimes needed; see below for examples
-CPPFLAGS = -I.            # only sometimes needed; see below for examples
-BINDCMD  =                # only needed for EMX and DJGPP DOS extenders
+LFLAGS   = -Wl,-R${X11BASE}/lib -L${X11BASE}/lib  -Wl,-R${LOCALBASE}/lib -L${LOCALBASE}/lib # only sometimes needed; see below for examples
+CPPFLAGS = -I. -I${X11BASE}/include  -I${LOCALBASE}/include # only sometimes needed; see below for examples
+BINDCMD  = echo               # only needed for EMX and DJGPP DOS extenders
 
 
@@ -63,5 +63,5 @@
 DEFINES   = -DUNIX -DHAS_UNIX_X11
 PREVIEWER = to_x11
-ALL_LIBS  = -lX11 -lm     #  Maybe -lX instead of -lX11 is needed?
+ALL_LIBS  = -lX11 -lm -lz -lpng -ltiff -ljpeg
 #
 # Generic UNIX, no previewer
@@ -183,12 +183,12 @@
 #
 # PNG support (requires -lpng and -lz on the ALL_LIBS line)
-#EX_SRC	= png.c to_png.c
-#EX_OBJ	= png.o to_png.o 
-#EX_DEFS= -DPNG
+EX_SRC+= png.c to_png.c
+EX_OBJ+= png.o to_png.o 
+EX_DEFS+= -DPNG
 #
 # TIFF support (requires -ltiff and possibly -lz on the ALL_LIBS line)
-#EX_SRC	= to_tif.c
-#EX_OBJ	= to_tif.o
-#EX_DEFS	= -DTIF
+EX_SRC+= to_tif.c
+EX_OBJ+= to_tif.o
+EX_DEFS+= -DTIF
 #
 # Include extras:
@@ -304,14 +304,10 @@
 
 install-bin:	$(PROGRAM)
-		-$(STRIP) $(PROGRAM)
-		$(CP) $(PROGRAM) $(bindir)
-		$(CHMOD) 755 $(bindir)/$(PROGRAM)
+		${BSD_INSTALL_PROGRAM} $(PROGRAM) $(bindir)
 
 install-info:	hp2xx.info
-		$(CP) hp2xx.info $(infodir)
-		$(CHMOD) 644 $(infodir)/hp2xx.info
+		${BSD_INSTALL_MAN} hp2xx.info $(infodir)
 
 install-man:	../doc/hp2xx.1
-		$(CP) ../doc/hp2xx.1 $(man1dir)
-		$(CHMOD) 644 $(man1dir)/hp2xx.1
+		${BSD_INSTALL_MAN} ../doc/hp2xx.1 $(man1dir)