From: "Michael R. Crusoe" <crusoe@debian.org>
Date: Sat, 1 Feb 2020 16:13:23 +0100
Subject: Enable cross building

Forwarded: https://github.com/benedictpaten/sonLib/pull/41
Forwarded: https://github.com/yoheirosen/sublinear-Li-Stephens/pull/7
Forwarded: https://github.com/benedictpaten/sonLib/pull/42
Forwarded: https://github.com/vgteam/cpp_progress_bar/pull/2
Forwarded: https://github.com/vgteam/gfakluge/pull/6
Assisted-By: scaleway/deepseek-v4-flash-0731
---
 deps/progress_bar/makefile | 11 ++++-------
 deps/sonLib/include.mk     |  3 ++-
 source_me.sh               |  4 ++--
 3 files changed, 8 insertions(+), 10 deletions(-)

--- a/deps/progress_bar/makefile
+++ b/deps/progress_bar/makefile
@@ -1,4 +1,4 @@
-CC = g++
+CXX ?= g++
 CPPFLAGS += -std=c++11
 TARGET = progress_bar
 OBJ = main.o progress_bar.o
@@ -6,16 +6,13 @@ OBJ = main.o progress_bar.o
 all : progress_bar
 
 progress_bar : $(OBJ)
-	@echo "<***Linking***> $@"
-	@$(CC) $(CPPFLAGS) $(OBJ) -o $(TARGET)
+	$(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) -o $(TARGET) $(LOADLIBES) $(LDLIBS)
 
 main.o : main.cpp
-	@echo "<**Compiling**> $@"
-	@$(CC) $(CPPFLAGS) -c $^
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $^
 
 progress_bar.o : progress_bar.cpp
-	@echo "<**Compiling**> $@"
-	@$(CC) $(CPPFLAGS) -c $^
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $^
 
 clean :
 	@rm -rf progress_bar $(OBJ)
--- a/deps/sonLib/include.mk
+++ b/deps/sonLib/include.mk
@@ -3,6 +3,7 @@ HOSTNAME = $(shell hostname)
 MACH = $(shell uname -m)
 SYS =  $(shell uname -s)
 
+CC ?= gcc
 #C compiler. FIXME: for some reason the cxx variable is used, which
 #typically means C++ compiler.
 ifeq (${CC},cc)
@@ -13,7 +14,7 @@ ifeq (${CC},cc)
   else ifeq ($(SYS),Darwin) #This is to deal with the Mavericks replacing gcc with clang fully
 	cxx = clang -std=c99 
   else
-    cxx = gcc -std=c99
+    cxx = ${CC} -std=c99
   endif
 else
   cxx = ${CC} -std=c99
