Description: mapsembler2 FTCBFS: multiple reasons
 mapsembler2 fails to cross build from source, because it builds for the
 build architecture. It does not pass any cross flags to cmake nor any
 cross tools to make. In general, these kind of issues can often be
 solved using dh_auto_*. In this case, that mostly does the trick except
 for one aspect. Some makefiles use CC to store a C++ compiler. During
 cross compilation, dh_auto_build passes a C compiler via CC and that
 doesn't go well. I recommend changing the variable name to CXX, which is
 what everyone uses.
Author: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972807
Forwarded: no
Reviewed-by: Étienne Mollier <etienne.mollier@mailoo.org>
Last-Update: 2020-11-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- mapsembler2-2.2.4+dfsg1.orig/mapsembler2_extend/makefile
+++ mapsembler2-2.2.4+dfsg1/mapsembler2_extend/makefile
@@ -1,14 +1,14 @@
-CC=g++
+CXX=g++
 EXEC=mapsembler_extend
 
 #CFLAGS=  -O4 -lz
 #CFLAGS=  -g  -lz
 #CFLAGS=  -g  -lz
 CFLAGS=  -O3  -lz
-ifeq "$(CC)" "g++"
+ifeq "$(CXX)" "g++"
 	empty:=
 	space:= $(empty) $(empty)
-	GCCVERSIONSTRING := $(shell expr `$(CC) -dumpversion`)
+	GCCVERSIONSTRING := $(shell expr `$(CXX) -dumpversion`)
 	#Create version number without "."
 	GCCVERSION := $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f1 -d.)
 	GCCVERSION += $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f2 -d.)
@@ -30,7 +30,7 @@
 else	
 	empty:=
 	space:= $(empty) $(empty)
-	CLANGVERSIONSTRING := $(shell expr `$(CC) -dumpversion`)
+	CLANGVERSIONSTRING := $(shell expr `$(CXX) -dumpversion`)
 	#Create version number without "."
 	CLANGVERSION := $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f1 -d.)
 	CLANGVERSION += $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f2 -d.)
@@ -110,10 +110,10 @@
 
 mapsembler_extend:  $(OBJ) $(OBJ2) mapsembler_extend.cpp
 #mapsembler:  $(OBJ) $(OBJ2) test.cpp
-	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
+	$(CXX) -o $@ $^ $(CFLAGS) $(LDFLAGS)
 
 %.o: %.cpp %.h 
-	$(CC) -o $@ -c $< $(CFLAGS)
+	$(CXX) -o $@ -c $< $(CFLAGS)
 
 
 #%.o: %.c %.h 
--- mapsembler2-2.2.4+dfsg1.orig/kissreads_graph/makefile
+++ mapsembler2-2.2.4+dfsg1/kissreads_graph/makefile
@@ -1,5 +1,5 @@
-#CC=/opt/local/bin/g++-mp-4.7
-CC=g++
+#CXX=/opt/local/bin/g++-mp-4.7
+CXX=g++
 EXEC=kissreads_graph
 #Loader.cpp 
 CFLAGS=  -O3 -L../thirdparty/zlib/build -lz -DMINIA_IS_IN_PARENT_FOLDER
@@ -52,10 +52,10 @@
 all: $(EXEC)
 
 kissreads_graph:  $(OBJ) KissReadsGraph.cpp
-	$(CC) -o $@ $^ $(CFLAGS)  $(LDFLAGS)
+	$(CXX) -o $@ $^ $(CFLAGS)  $(LDFLAGS)
 
 %.o: %.cpp %.h
-	$(CC) -o $@ -c $< $(CFLAGS)
+	$(CXX) -o $@ -c $< $(CFLAGS)
 
 
 
