Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: Handle -m64 and -msse2 flags better
--- bowtie2.orig/Makefile
+++ bowtie2/Makefile
@@ -198,30 +198,17 @@
 VERSION := $(shell cat VERSION)
 
 BITS := 32
-ifeq (x86_64,$(shell uname -m))
+ifeq (64,$(shell dpkg-architecture -q DEB_TARGET_ARCH_BITS))
 	BITS := 64
-endif
-ifeq (amd64,$(shell uname -m))
-	BITS := 64
-endif
-ifeq (aarch64,$(shell uname -m))
-	BITS := 64
-endif
-# msys will always be 32 bit so look at the cpu arch instead.
-ifneq (,$(findstring AMD64,$(PROCESSOR_ARCHITEW6432)))
-	ifeq (1,$(MINGW))
-		BITS := 64
-	endif
-endif
-ifeq (32,$(BITS))
-  $(error bowtie2 compilation requires a 64-bit platform )
+	M64_FLAG := -m64
+else
+	M64_FLAG :=
 endif
 
-SSE_FLAG := -msse2
-M64_FLAG := -m64
-ifeq (aarch64,$(shell uname -m))
+ifeq (amd64,$(dpkg-architecture -q DEB_TARGET_ARCH))
+	SSE_FLAG := -msse2
+else
 	SSE_FLAG =
-	M64_FLAG =
 endif
 
 DEBUG_FLAGS    := -O0 -g3 $(M64_FLAG) $(SSE_FLAG)
