Description: put pkg-config and wx-config into variables
 When cross-compiling on debian, the build system dh set the name of the
 pkg-config command name to use into PKG_CONFIG variable.
 For armhf, it is PKG_CONFIG=arm-linux-gnueabihf-pkg-config
 .
 Since the pkg-config that is installed during cross-compiling is the one
 of the build-arch (amd64), and not the one of the host-arch (armhf),
 using `pkg-config` instead of `arm-linux-gnueabihf-pkg-config` would
 prevent detection of the libraries.
 .
 freefilesync (11.23-1) UNRELEASED; urgency=medium
 .
   * Initial release. (Closes: #925512)
 Also, set wx-config version
 Useful when there are multiple versions of wx-config installed on the system

Author: Fab Stz <fabstz-it@yahoo.fr>
Author: bgstack15
Origin: self
Forwarded: by-email-to-author-on-2022-08-11
Last-Update: 2026-03-29

--- a/FreeFileSync/Source/Makefile
+++ b/FreeFileSync/Source/Makefile
@@ -2,6 +2,9 @@ CXX ?= g++
 exeName = FreeFileSync
 CXX=g++-14
 
+PKG_CONFIG=pkgconf
+WX_CONFIG=wx-config --version=3.2
+
 CXXFLAGS += -std=c++23 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" \
            -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wnon-virtual-dtor -Wno-unused-function -Wshadow -Wno-maybe-uninitialized \
            -DNDEBUG -pthread
@@ -9,37 +12,38 @@ CXXFLAGS += -std=c++23 -pipe -DWXINTL_NO
 LDFLAGS += -pthread
 
 
-CXXFLAGS += `wx-config --cxxflags --debug=no`
-LDFLAGS  += `wx-config --libs std, aui, richtext --debug=no`
+CXXFLAGS += `$(WX_CONFIG) --cxxflags --debug=no`
+LDFLAGS  += `$(WX_CONFIG) --libs std, aui, richtext --debug=no`
 
-CXXFLAGS += `pkg-config --cflags openssl`
-LDFLAGS  += `pkg-config --libs openssl`
+CXXFLAGS += `$(PKG_CONFIG) --cflags openssl`
+LDFLAGS  += `$(PKG_CONFIG) --libs openssl`
 
-CXXFLAGS += `pkg-config --cflags libcurl`
-LDFLAGS  += `pkg-config --libs libcurl`
+CXXFLAGS += `$(PKG_CONFIG) --cflags libcurl`
+LDFLAGS  += `$(PKG_CONFIG) --libs libcurl`
 
-CXXFLAGS += `pkg-config --cflags libidn2`
-LDFLAGS  += `pkg-config --libs libidn2`
+CXXFLAGS += `$(PKG_CONFIG) --cflags libidn2`
+LDFLAGS  += `$(PKG_CONFIG) --libs libidn2`
 
-CXXFLAGS += `pkg-config --cflags libssh2`
-LDFLAGS  += `pkg-config --libs libssh2`
+CXXFLAGS += `$(PKG_CONFIG) --cflags libssh2`
+LDFLAGS  += `$(PKG_CONFIG) --libs libssh2`
 
-CXXFLAGS += `pkg-config --cflags gtk+-3.0`
+CXXFLAGS += `$(PKG_CONFIG) --cflags gtk+-3.0`
+LDFLAGS  += `$(PKG_CONFIG) --libs gtk+-3.0`
 #treat as system headers so that warnings are hidden:
 CXXFLAGS += -isystem/usr/include/gtk-3.0
 
 with_notifications ?= YES
 ifeq ($(with_notifications),YES)
 # package libglibmm-2.4-dev or glibmm24-devel
-cxxFlags  += `pkg-config --cflags giomm-2.4` -Dwith_notifications
-linkFlags += `pkg-config --libs   giomm-2.4`
+cxxFlags  += `$(PKG_CONFIG) --cflags giomm-2.4` -Dwith_notifications
+linkFlags += `$(PKG_CONFIG) --libs   giomm-2.4`
 endif
 
 #support for SELinux (optional)
-SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES)
+SELINUX_EXISTING=$(shell $(PKG_CONFIG) --exists libselinux && echo YES)
 ifeq ($(SELINUX_EXISTING),YES)
-CXXFLAGS += `pkg-config --cflags libselinux` -DHAVE_SELINUX
-LDFLAGS  += `pkg-config --libs libselinux`
+CXXFLAGS += `$(PKG_CONFIG) --cflags libselinux` -DHAVE_SELINUX
+LDFLAGS  += `$(PKG_CONFIG) --libs libselinux`
 endif
 
 ifeq ($(DPKG_VENDOR),)
--- a/FreeFileSync/Source/RealTimeSync/Makefile
+++ b/FreeFileSync/Source/RealTimeSync/Makefile
@@ -2,6 +2,9 @@ CXX ?= g++
 exeName = RealTimeSync
 CXX=g++-14
 
+PKG_CONFIG=pkgconf
+WX_CONFIG=wx-config --version=3.2
+
 CXXFLAGS += -std=c++23 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../../.. -I../../../zenXml -include "zen/i18n.h" \
            -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wnon-virtual-dtor -Wno-unused-function -Wshadow -Wno-maybe-uninitialized \
            -DNDEBUG -pthread
@@ -9,10 +12,11 @@ CXXFLAGS += -std=c++23 -pipe -DWXINTL_NO
 LDFLAGS += -pthread
 
 
-CXXFLAGS += `wx-config --cxxflags --debug=no`
-LDFLAGS  += `wx-config --libs std, aui, richtext --debug=no`
+CXXFLAGS += `$(WX_CONFIG) --cxxflags --debug=no`
+LDFLAGS  += `$(WX_CONFIG) --libs std, aui, richtext --debug=no`
 
-CXXFLAGS += `pkg-config --cflags gtk+-3.0`
+CXXFLAGS += `$(PKG_CONFIG) --cflags gtk+-3.0`
+LDFLAGS  += `$(PKG_CONFIG) --libs gtk+-3.0`
 #treat as system headers so that warnings are hidden:
 CXXFLAGS += -isystem/usr/include/gtk-3.0
 
