$NetBSD: patch-ad,v 1.1 2013/12/20 02:19:53 makoto Exp $

(1.9)
make sure no one sneaks a -O* in on us via one of these variables
set in the environment

--- Makefile.in.orig	2013-08-28 11:55:20.000000000 +0900
+++ Makefile.in	2013-12-20 10:04:54.000000000 +0900
@@ -248,7 +248,16 @@
 
 lexor.o: lexor.cc parse.h
 
+# make sure no one sneaks a -O* in on us via one of these variables
+# set in the environment
+CXX_NOOPT=$(CXX:-O%=)
+CPPFLAGS_NOOPT=$(CPPFLAGS:-O%=)
+CXXFLAGS_NOOPT=$(CXXFLAGS:-O%=)
+
 parse.o: parse.cc
+	@[ -d dep ] || mkdir dep
+	$(CXX_NOOPT) $(CPPFLAGS_NOOPT) $(CXXFLAGS_NOOPT) -MD -c $< -o $*.o
+	mv $*.d dep/$*.d
 
 # Build this in two steps to avoid parallel build issues (see pr3462585)
 parse.cc: $(srcdir)/parse.y
