--- Makefile.in.orig	2008-12-30 21:04:25 UTC
+++ Makefile.in
@@ -9,7 +9,7 @@ prefix=@prefix@
 eprefix=@exec_prefix@
 #MORE_WARNINGS=-Weffc++
 WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS)
-CFLAGS=-O2 @debug@ -DNDEBUG $(WFLAGS) $(MORECFLAGS)
+CFLAGS=${CXXFLAGS} -DNDEBUG $(WFLAGS) $(MORECFLAGS)
 CXX=@CXX@ $(CFLAGS)
 LINK=@CXX@
 THREAD_LFLAGS=@thread_ldflags@
@@ -52,15 +52,15 @@ generate_randfile: generate_randfile.o
 	$(LINK) generate_randfile.o -o generate_randfile
 
 install-bin: $(EXE) $(EXES)
-	mkdir -p $(eprefix)/bin $(eprefix)/sbin
-	@INSTALL_PROGRAM@ @stripping@ $(EXES) $(eprefix)/sbin
-	@INSTALL_PROGRAM@ @stripping@ $(EXE) $(eprefix)/bin
-	@INSTALL_SCRIPT@ $(SCRIPTS) $(eprefix)/bin
+	mkdir -p $(DESTDIR)$(eprefix)/bin $(DESTDIR)$(eprefix)/sbin
+	@INSTALL_PROGRAM@ @stripping@ $(EXES) $(DESTDIR)$(eprefix)/sbin
+	@INSTALL_PROGRAM@ @stripping@ $(EXE) $(DESTDIR)$(eprefix)/bin
+	@INSTALL_SCRIPT@ $(SCRIPTS) $(DESTDIR)$(eprefix)/bin
 
 install: install-bin
-	mkdir -p @mandir@/man1 @mandir@/man8
-	@INSTALL_DATA@ $(MAN1) @mandir@/man1
-	@INSTALL_DATA@ $(MAN8) @mandir@/man8
+	mkdir -p $(DESTDIR)@mandir@/man1 $(DESTDIR)@mandir@/man8
+	@INSTALL_DATA@ $(MAN1) $(DESTDIR)@mandir@/man1
+	@INSTALL_DATA@ $(MAN8) $(DESTDIR)@mandir@/man8
 
 %.o: %.cpp
 	$(CXX) -c $<
