endif
### 3.2 General compiler settings
-CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
+CXXFLAGS = -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
ifeq ($(comp),gcc)
CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow
### 3.3 General linker settings
LDFLAGS = $(EXTRALDFLAGS)
+ifeq ($(comp),mingw)
+ LDFLAGS += -static-libstdc++ -static-libgcc
+endif
+
### On mingw use Windows threads, otherwise POSIX
ifneq ($(comp),mingw)
# Haiku has pthreads in its libroot, so only link it in on other platforms
### 3.4 Debugging
ifeq ($(debug),no)
CXXFLAGS += -DNDEBUG
+else
+ CXXFLAGS += -g
endif
### 3.5 Optimization
### needs access to the optimization flags.
ifeq ($(comp),gcc)
ifeq ($(optimize),yes)
+ ifeq ($(debug),no)
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
LDFLAGS += $(CXXFLAGS)
endif
endif
+ endif
endif
### ==========================================================================