Imported from libpng-1.4.0beta4.tar
diff --git a/scripts/makefile.ne12bsd b/scripts/makefile.ne12bsd
index cbee1d4..ccacacf 100644
--- a/scripts/makefile.ne12bsd
+++ b/scripts/makefile.ne12bsd
@@ -1,6 +1,7 @@
 # makefile for libpng for NetBSD for the standard
 # make obj && make depend && make && make test
 # make includes && make install
+# Copyright (C) 2006 Glenn Randers-Pehrson
 # Copyright (C) 2002 Patrick R.L. Welche
 # For conditions of distribution and use, see copyright notice in png.h
 
@@ -13,25 +14,41 @@
 
 LIB=	png12
 SHLIB_MAJOR=	0
-SHLIB_MINOR=	1.4.0beta3
+SHLIB_MINOR=	1.4.0beta4
 SRCS=	pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 		pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 		pngwtran.c pngmem.c pngerror.c pngpread.c
 INCS=	png.h pngconf.h
 MAN=	libpng.3 libpngpf.3 png.5
 
-CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD
-
-# something like this for mmx assembler, but it core dumps for me at the moment
-# .if ${MACHINE_ARCH} == "i386"
-#   CPPFLAGS+=-DPNG_THREAD_UNSAFE_OK
-#   MKLINT= no
-# .else
-    CPPFLAGS+=-DPNG_NO_MMX_CODE
-# .endif
+CPPFLAGS+=-I${.CURDIR}
 
 CLEANFILES+=pngtest.o pngtest
 
+pngconf.h.in:
+	cat pngconf.h > pngconf.h.in
+
+pngconf.h:	pngconf.h.in
+	sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h
+
+	/* if you don't want to use the intel MMX code, uncomment this */
+	# echo "#define PNG_NO_MMX_CODE" >> pngconf.h
+
+	/* if you don't need thread safety you can uncomment this */
+	# echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h
+
+# We should be able to do something like this instead of the manual
+# uncommenting, but it core dumps for me at the moment:
+# .if ${MACHINE_ARCH} == "i386"
+#   echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h
+#   MKLINT= no
+# .else
+#   echo "#define PNG_NO_MMX_CODE" >> pngconf.h
+# .endif
+
+	sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h
+
+
 pngtest.o:	pngtest.c
 	${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}