From 136ca30add718d41280b780b74e650a8bc3f4159 Mon Sep 17 00:00:00 2001 From: Debian Multimedia Maintainers Date: Mon, 16 Mar 2020 13:32:21 +0100 Subject: [PATCH] Allow overridable pkg-config in generated Makefiles Origin: Debian Bug: https://github.com/WeAreROLI/JUCE/issues/677 Last-Update: 2020-03-16 E.g. to allow cross-building of juce-packages. See also https://bugs.debian.org/951684 Last-Update: 2020-03-16 Gbp-Pq: Name overridable_pkg-config.patch --- .../Source/ProjectSaving/jucer_ProjectExport_Make.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h index a76c3f25..fc81d9b9 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h @@ -306,8 +306,8 @@ public: if (! packages.isEmpty()) { - out << "\t@command -v pkg-config >/dev/null 2>&1 || { echo >&2 \"pkg-config not installed. Please, install it.\"; exit 1; }" << newLine - << "\t@pkg-config --print-errors"; + out << "\t@command -v $(PKG_CONFIG) >/dev/null 2>&1 || { echo >&2 \"$(PKG_CONFIG) not installed. Please, install it.\"; exit 1; }" << newLine + << "\t@$(PKG_CONFIG) --print-errors"; for (auto& pkg : packages) out << " " << pkg; @@ -562,7 +562,7 @@ private: auto compilePackages = getCompilePackages(); if (compilePackages.size() > 0) - return "$(shell pkg-config --cflags " + compilePackages.joinIntoString (" ") + ")"; + return "$(shell $(PKG_CONFIG) --cflags " + compilePackages.joinIntoString (" ") + ")"; return {}; } @@ -572,7 +572,7 @@ private: auto linkPackages = getLinkPackages(); if (linkPackages.size() > 0) - return "$(shell pkg-config --libs " + linkPackages.joinIntoString (" ") + ")"; + return "$(shell $(PKG_CONFIG) --libs " + linkPackages.joinIntoString (" ") + ")"; return {}; } @@ -943,6 +943,11 @@ private: << "endif" << newLine << newLine; + out << "ifndef PKG_CONFIG" << newLine + << " PKG_CONFIG=pkg-config" << newLine + << "endif" << newLine + << newLine; + out << "ifndef AR" << newLine << " AR=ar" << newLine << "endif" << newLine -- 2.30.2