--- brutefir-1.0m.orig/Makefile	2013-11-29 14:55:01.000000000 +0100
+++ brutefir-1.0m/Makefile	2015-11-29 10:28:02.031683531 +0100
@@ -1,11 +1,11 @@
 ###################################
 # Where to install
-INSTALL_PREFIX	= $(DESTDIR)/usr/local
+INSTALL_PREFIX	= $(DESTDIR)/usr
 
 ###################################
 # Where to find libraries, and their header files.
-LIBPATHS	= -L/usr/local/lib
-INCLUDE		= -I/usr/local/include
+# LIBPATHS	= -L/usr/local/lib
+# INCLUDE		= -I/usr/local/include
 ifdef FFTW_PATH
 LIBPATHS	+= -L$(FFTW_PATH)/lib
 INCLUDE		+= -I$(FFTW_PATH)/include
@@ -17,17 +17,17 @@ FFTW_LIB	= -lfftw3 -lfftw3f
 
 ###################################
 # Binaries
-FLEX	= flex
-LD	= ld
-CC	= gcc
-AS	= as
+#FLEX	= flex
+#CC	= gcc
+#LD	= ld
+#AS	= as
 
 ###################################
 # Flags
 CC_WARN		= -Wall -Wpointer-arith -Wshadow \
 -Wcast-align -Wwrite-strings -Wstrict-prototypes \
 -Wmissing-prototypes -Wmissing-declarations -Wnested-externs
-CC_FLAGS	= $(DEFINE) -O2
+CC_FLAGS	= $(DEFINE) $(CFLAGS) 
 CC_FPIC		= -fPIC
 LD_SHARED	= -shared
 
@@ -59,15 +59,11 @@ LIB_TARGETS	= cli.bflogic eq.bflogic fil
 
 UNAME		= $(shell uname)
 UNAME_P         = $(shell uname -p)
-UNAME_M         = $(shell uname -m)
+UNAME_M         ?= 
 
 # Linux
 ifeq ($(UNAME),Linux)
-ifeq ($(UNAME_M),i586)
-BRUTEFIR_OBJS	+= $(BRUTEFIR_SSE_OBJS)
-CC_FLAGS	+= -msse
-endif
-ifeq ($(UNAME_M),i686)
+ifeq ($(UNAME_M),x86)
 BRUTEFIR_OBJS	+= $(BRUTEFIR_SSE_OBJS)
 CC_FLAGS	+= -msse
 endif
@@ -127,25 +123,25 @@ bfconf_lexical.o: bfconf_lexical.c
 	$(FLEX) -o$@ $<
 
 brutefir: $(BRUTEFIR_OBJS)
-	$(CC) $(LIBPATHS) $(LDMULTIPLEDEFS) -o $@ $(BRUTEFIR_OBJS) $(BRUTEFIR_LIBS)
+	$(CC) $(LIBPATHS) $(LDMULTIPLEDEFS) -o $@ $(BRUTEFIR_OBJS) $(BRUTEFIR_LIBS) -lgcc
 
 alsa.bfio: $(BFIO_ALSA_OBJS)
-	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_ALSA_OBJS) $(BFIO_ALSA_LIBS) -lc
+	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_ALSA_OBJS) $(BFIO_ALSA_LIBS) -lc -lgcc
 
 oss.bfio: $(BFIO_OSS_OBJS)
-	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_OSS_OBJS) -lc
+	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_OSS_OBJS) -lc -lgcc
 
 jack.bfio: $(BFIO_JACK_OBJS)
-	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_JACK_OBJS) $(BFIO_JACK_LIBS) -lc
+	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_JACK_OBJS) $(BFIO_JACK_LIBS) -lc -lgcc
 
 file.bfio: $(BFIO_FILE_OBJS)
-	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_FILE_OBJS) -lc
+	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFIO_FILE_OBJS) -lc -lgcc
 
 cli.bflogic: $(BFLOGIC_CLI_OBJS)
-	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFLOGIC_CLI_OBJS) -lc
+	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFLOGIC_CLI_OBJS) -lc -lgcc
 
 eq.bflogic: $(BFLOGIC_EQ_OBJS)
-	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFLOGIC_EQ_OBJS) -lc
+	$(LD) $(LD_SHARED) $(CC_FPIC) $(LIBPATHS) -o $@ $(BFLOGIC_EQ_OBJS) -lc -lgcc
 
 install: $(BIN_TARGETS) $(LIB_TARGETS)
 	install -d $(INSTALL_PREFIX)/bin $(INSTALL_PREFIX)/lib/brutefir
