Description: Fix cross-build issues
Author: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/919490
Forwarded: no
Reviewed-By: Rafael Laboissière <rafael@debian.org>
Last-Update: 2020-05-06

--- praat-6.1.14.orig/makefiles/makefile.defs.chrome64
+++ praat-6.1.14/makefiles/makefile.defs.chrome64
@@ -7,17 +7,19 @@ CC = gcc
 
 CXX = g++
 
-COMMONFLAGS = -DUNIX -Dlinux -Dchrome -DALSA -DHAVE_PULSEAUDIO -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0` -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O3 -g1 -pthread
+PKG_CONFIG ?= pkg-config
+
+COMMONFLAGS = -DUNIX -Dlinux -Dchrome -DALSA -DHAVE_PULSEAUDIO -D_FILE_OFFSET_BITS=64 `$(PKG_CONFIG) --cflags gtk+-2.0` -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O3 -g1 -pthread
 
 CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werror=missing-prototypes -Werror=implicit
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat
 
-LIBS = `pkg-config --libs gtk+-2.0` -lm -lpulse -lasound -static-libgcc -static-libstdc++ -lpthread
+LIBS = `$(PKG_CONFIG) --libs gtk+-2.0` -lm -lpulse -lasound -lpthread
 
 AR = ar
 RANLIB = ls
--- praat-6.1.14.orig/makefiles/makefile.defs.cygwin64
+++ praat-6.1.14/makefiles/makefile.defs.cygwin64
@@ -14,7 +14,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS)
 
 CXXFLAGS = -std=gnu++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = Praat.exe
 
--- praat-6.1.14.orig/makefiles/makefile.defs.linux.alsa
+++ praat-6.1.14/makefiles/makefile.defs.linux.alsa
@@ -15,7 +15,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werr
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat
 
--- praat-6.1.14.orig/makefiles/makefile.defs.linux.barren
+++ praat-6.1.14/makefiles/makefile.defs.linux.barren
@@ -13,7 +13,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werr
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat_barren
 
--- praat-6.1.14.orig/makefiles/makefile.defs.linux.jack
+++ praat-6.1.14/makefiles/makefile.defs.linux.jack
@@ -15,7 +15,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werr
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat
 
--- praat-6.1.14.orig/makefiles/makefile.defs.linux.nogui
+++ praat-6.1.14/makefiles/makefile.defs.linux.nogui
@@ -15,7 +15,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werr
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat_nogui
 
--- praat-6.1.14.orig/makefiles/makefile.defs.linux.rpi
+++ praat-6.1.14/makefiles/makefile.defs.linux.rpi
@@ -15,7 +15,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werr
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat
 
--- praat-6.1.14.orig/makefiles/makefile.defs.linux.silent
+++ praat-6.1.14/makefiles/makefile.defs.linux.silent
@@ -15,7 +15,7 @@ CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werr
 
 CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow
 
-LINK = g++
+LINK = $(CXX)
 
 EXECUTABLE = praat
 
