$OpenBSD: patch-makefile,v 1.1.1.1 2001/08/09 22:28:00 rohee Exp $

Respects CFLAGS and CC.
Use local zlib, not the supplied one.
Use an external (and more recent) libpng, not the supplied one.

--- makefile.orig	Sat Jun 19 05:52:24 1999
+++ makefile	Sat Jul 28 02:29:59 2001
@@ -51,7 +51,10 @@
 #CFLAGS      = -O6 -finline-functions -ffast-math -c -ansi -m386 -DCPU=586 -DCOMPILER_VER=\".`uname`.$(CC)\" -DPOV_LIB_DIR=\"$(POVLIBDIR)\" $(SRCINC) $(LIBPNGINC) $(ZLIBINC)
 
 # Linux compiler flags, Pentium II optimized
-CFLAGS      = -O6 -finline-functions -ffast-math -c -ansi -m386 -DCPU=686 -DCOMPILER_VER=\".`uname`.$(CC)\" -DPOV_LIB_DIR=\"$(POVLIBDIR)\" $(SRCINC) $(LIBPNGINC) $(ZLIBINC)
+#CFLAGS      = -O6 -finline-functions -ffast-math -c -ansi -m386 -DCPU=686 -DCOMPILER_VER=\".`uname`.$(CC)\" -DPOV_LIB_DIR=\"$(POVLIBDIR)\" $(SRCINC) $(LIBPNGINC) $(ZLIBINC)
+
+# suitable for an OpenBSD port
+CFLAGS       += -c -DCOMPILER_VER=\".`uname`.$(CC)\" -DPOV_LIB_DIR=\"$(POVLIBDIR)\" $(SRCINC) -I$(LOCALBASE)/include
 
 # HPUX compiler flags
 #CFLAGS      = +O2 -finline-functions -c -Aa -D_HPUX_SOURCE -DCOMPILER_VER=\".`uname`.$(CC)\" $(SRCINC) $(LIBPNGINC) $(ZLIBINC)
@@ -60,7 +63,7 @@
 #CFLAGS	     = -O2 -n32 -mips4 -r1000 -ansi -c -DCOMPILER_VER=\".`uname`.$(CC)\" $(SRCINC) $(LIBPNGINC) $(ZLIBINC) $(XLIBINC)	
 
 # Your compiler
-CC          = gcc
+#CC          = gcc # passed by the ports infrastructure
 
 # The X11 variable should point to the top-level directory where the X11
 #   libraries and include files are located.  It should really be set in
@@ -76,7 +79,7 @@
 # for some AIX systems:
 #X11 = /usr/lpp/X11
 
-X11 = /usr/X11R6
+X11 = $(X11BASE)
 
 # You probably won't need to change these if you have the X11 variable
 #   above set properly...
@@ -88,10 +91,9 @@
 # Use libXXX.a if you want to force static linking of the libraries.
 #   Use -Llibdir -lXXX if you want to use shared libraries (if they are
 #   available).  It doesn't matter if you only have libXXX.a libraries.
-PNGDIR = $(SRCDIR)/libpng
-LIBPNGINC = -I$(PNGDIR)
+LIBPNGINC = -I$(LOCALBASE)/include
 #LIBPNGLIB = $(PNGDIR)/libpng.a
-LIBPNGLIB = -L$(PNGDIR) -lpng
+LIBPNGLIB = -L$(LOCALBASE)/lib -lpng
 #LIBPNGLIB = -L/usr/local/lib -lpng
 
 # The following options are added at the suggestion of Axel Hecht
@@ -101,11 +103,7 @@
 # LIBPNGINC = -I$(LIBPNGINCDIR)
 # LIBPNGLIB = -L$(PREFIX)/lib -lpng
 
-ZLIBDIR = $(SRCDIR)/zlib
-ZLIBINC = -I$(ZLIBDIR)
-#ZLIBLIB = $(ZLIBDIR)/libz.a
-ZLIBLIB = -L$(ZLIBDIR) -lz
-#ZLIBLIB = -L/usr/local/lib -lz
+ZLIBLIB = -lz
 
 # The following options are added at the suggestion of Axel Hecht
 # PREFIX = $HOME
@@ -127,12 +125,12 @@
 #default: svga
 
 # Define the default POV-Ray library location
-POVLIBDIR = /usr/local/lib/povray31
+POVLIBDIR = $(PREFIX)/share/povray31
 
 # Define the path under which you want POV-Ray files to be installed,
 # typically /usr/local/bin, though Linux distributions may wish to 
 # alter this to /usr/bin
-POVPATH = /usr/local
+POVPATH = $(PREFIX)
 
 #----------------------------------------------------------------------
 # There should be no compelling reason to customize the makefile beyond
@@ -1011,22 +1009,6 @@
                           $(SRCDIR)/povray.h   \
                           $(SRCDIR)/render.h   \
                           $(SRCDIR)/vector.h   \
-                          $(SRCDIR)/vlbuffer.h \
-                          $(SRCDIR)/warps.h
-
-png_povDEP              = $(SRCDIR)/png_pov.c  \
-                          $(SRCDIR)/atmosph.h  \
-                          $(SRCDIR)/bbox.h     \
-                          $(SRCDIR)/camera.h   \
-                          config.h             \
-                          $(SRCDIR)/frame.h    \
-                          $(SRCDIR)/optout.h   \
-                          $(PNGDIR)/png.h      \
-                          $(SRCDIR)/png_pov.h  \
-                          $(SRCDIR)/point.h    \
-                          $(SRCDIR)/povproto.h \
-                          $(SRCDIR)/povray.h   \
-                          $(SRCDIR)/render.h   \
                           $(SRCDIR)/vlbuffer.h \
                           $(SRCDIR)/warps.h
 
