From b9981ce54cf2f4d6ce8bfe86492af4b24b694006 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 27527881..2a5aa9fb 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h @@ -246,8 +246,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; @@ -507,7 +507,7 @@ private: auto packages = getPackages(); if (packages.size() > 0) - return "$(shell pkg-config --cflags " + packages.joinIntoString (" ") + ")"; + return "$(shell $(PKG_CONFIG) --cflags " + packages.joinIntoString (" ") + ")"; return {}; } @@ -517,7 +517,7 @@ private: auto packages = getPackages(); if (packages.size() > 0) - return "$(shell pkg-config --libs " + packages.joinIntoString (" ") + ")"; + return "$(shell $(PKG_CONFIG) --libs " + packages.joinIntoString (" ") + ")"; return {}; } @@ -912,6 +912,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