diff -Naurb src/Makefile.HAIKU glpng-1.4.5-haiku/src/Makefile.HAIKU
--- src/Makefile.HAIKU	1970-01-01 00:00:00.000000000 +0000
+++ src/Makefile.HAIKU	2010-07-05 02:35:34.000000000 +0000
@@ -0,0 +1,31 @@
+LDFLAGS=-lpng -lGL
+SHAREDLIBFLAGS=-shared -fPIC
+LIBDIR:=$(shell finddir B_COMMON_LIB_DIRECTORY)
+GLINCLUDEDIR:=$(shell finddir B_COMMON_DEVELOP_DIRECTORY)/headers/os/opengl/GL
+INCPATH	=	-I../include
+
+all: libglpng.a libglpng.so.1.45
+
+libglpng.a: glpng.o
+	ar rv $@ $<
+
+libglpng.so.1.45: glpng.o
+	gcc $(CFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname=libglpng.so.1 -Wl $< -Wl $(LDFLAGS) -o $@ -lGL -lpng -lz
+
+glpng.o: glpng.c
+	install -p -m 644 ../include/GL/glpng.h $(DESTDIR)$(GLINCLUDEDIR)
+	gcc $(CFLAGS) -c $<
+
+clean:
+	rm glpng.o libglpng.*
+
+install:
+	for i in include ../include/GL $(LIBDIR); do \
+		install -m 755 -d $(DESTDIR)/$$i; \
+	done
+	mkdir -p $(DESTDIR)$(GLINCLUDEDIR)
+	mkdir -p $(DESTDIR)$(LIBDIR)
+	install -p -m 644 ../include/GL/glpng.h $(DESTDIR)$(GLINCLUDEDIR)
+	install -m 755 libglpng.* $(DESTDIR)$(LIBDIR)
+	ln -s -f libglpng.so.1.45 $(DESTDIR)$(LIBDIR)/libglpng.so.1
+	ln -s -f libglpng.so.1.45 $(DESTDIR)$(LIBDIR)/libglpng.so
diff -Naurb src/glpng.c glpng-1.4.5-haiku/src/glpng.c
--- src/glpng.c	2000-07-10 21:27:10.026738688 +0000
+++ src/glpng.c	2010-07-05 02:47:05.069992448 +0000
@@ -29,7 +29,7 @@
 #include <GL/gl.h>
 #include <stdlib.h>
 #include <math.h>
-#include "png/png.h"
+#include <png.h>
 
 /* Used to decide if GL/gl.h supports the paletted extension */
 #ifdef GL_COLOR_INDEX1_EXT
@@ -269,7 +269,7 @@
 	if (pinfo == NULL) return 0;
 
 	fread(header, 1, 8, fp);
-	if (!png_check_sig(header, 8)) return 0;
+	if (png_sig_cmp(header, 0, 8)) return 0;
 
 	png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
 	info = png_create_info_struct(png);
@@ -373,7 +373,7 @@
 	png_uint_32 i;
 
 	fread(header, 1, 8, fp);
-	if (!png_check_sig(header, 8)) return 0;
+	if (png_sig_cmp(header, 0, 8)) return 0;
 
 	png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
 	info = png_create_info_struct(png);
