$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- mrd6-0.9.6.orig/src/Makefile	2007-06-25 01:58:28.000000000 +0200
+++ mrd6-0.9.6/src/Makefile	2009-06-13 13:39:39.000000000 +0200
@@ -26,7 +26,7 @@ ifeq ($(SUPPORT_MODULES),yes)
 	MODULES ?= BGP
 	LDCMD = -rdynamic
 else
-	MODULE_OPTIONS += -DMRD_NO_DYNAMIC_MODULE_LOADING
+	MODULE_OPTIONS += MRD_NO_DYNAMIC_MODULE_LOADING
 endif
 
 INCLUDES = -I../include
@@ -92,7 +92,7 @@ TESTS = tests/address_unittest tests/ptr
 DEST_PREFIX = $(DESTDIR)$(PREFIX)
 
 CXXFLAGS = $(INCLUDES) -ansi -Wall -Wno-multichar -fno-exceptions -fPIC \
-	   -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS))
+	   -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS)) $(EXTRA_FLAGS)
 
 ifeq ($(OPTIMIZE),yes)
 	ifeq ($(SPACE_OPTIMIZE),yes)
@@ -101,22 +101,13 @@ ifeq ($(OPTIMIZE),yes)
 		CXXFLAGS += -O3
 	endif
 else
-	CXXFLAGS += -g
 	ifeq ($(NO_INLINE),yes)
 		CXXFLAGS += -O0 -fno-inline
-	else
-		CXXFLAGS += -O2
 	endif
 endif
 
 LDFLAGS += -lm
 
-ifeq ($(STATIC_STDCXX),no)
-	LDFLAGS += -lstdc++
-else
-	LDFLAGS += `$(CXX) -print-file-name=libstdc++.a`
-endif
-
 TEST_OBJECTS = $(addprefix $(OBJ_DIR)/,$(TEST_SOURCES:.cpp=.o))
 MRD_OBJECTS = $(addprefix $(OBJ_DIR)/,$(MRD_SOURCES:.cpp=.o))
 
@@ -151,23 +142,25 @@ $(foreach test,$(TESTS),$(eval $(call un
 
 $(TARGET): $(MRD_OBJECTS)
 	@echo "Linking $(TARGET)"
-	@$(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS)
+	$(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS)
 
 install: $(TARGET) $(EXTERNAL_MODULES)
-	install -D $(TARGET) $(DEST_PREFIX)/sbin/$(TARGET)
-	install -D ../tools/mrd6sh $(DEST_PREFIX)/bin/mrd6sh
+	install -d $(DEST_PREFIX)/sbin
+	install -d $(DEST_PREFIX)/bin
+	install $(TARGET) $(DEST_PREFIX)/sbin/$(TARGET)
+	install ../tools/mrd6sh $(DEST_PREFIX)/bin/mrd6sh
 ifneq (,$(EXTERNAL_MODULES))
 	mkdir -p $(DEST_PREFIX)/lib/mrd6/
-	install -D $(EXTERNAL_MODULES) $(DEST_PREFIX)/lib/mrd6/
+	install $(EXTERNAL_MODULES) $(DEST_PREFIX)/lib/mrd6/
 endif
 
 $(MRD_VERSION_CPP): $(SOURCES) Makefile Makefile.options
-	@set -e; mkdir -p $(dir $@); \
+	mkdir -p $(dir $@); \
 		echo '/* This file is automatically generated */' > $(MRD_VERSION_CPP); \
 		echo 'const char *BuildDate = "$(NOW)";' >> $(MRD_VERSION_CPP)
 
 $(MODULES_CPP): Makefile Makefile.options
-	@set -e; mkdir -p $(dir $@); \
+	mkdir -p $(dir $@); \
 		echo "Generating modules.cpp"; \
 		scripts/generate-modules-cpp.pl $(STATIC_MODULES) > $(MODULES_CPP)
 
@@ -181,7 +174,7 @@ $(OPTIONS):
 
 $(DEPS_DIR)/%.d: %.cpp $(OPTIONS)
 	@echo "Deps $<"
-	@set -e; mkdir -p $(dir $@); \
+	mkdir -p $(dir $@); \
 		$(CXX) -MM -MT $@ -MT $(addprefix $(OBJ_DIR)/,$(<:.cpp=.o)) \
 		       $(CXXFLAGS) $< > $@
 
@@ -195,7 +188,7 @@ endif
 
 $(OBJ_DIR)/%.o: %.cpp $(OPTIONS)
 	@echo "C++ $<"
-	@set -e; mkdir -p $(dir $@); \
+	mkdir -p $(dir $@); \
 		$(CXX) -c $(CXXFLAGS) $< -o $@
 
 clean:
