Specify wxwidgets version in Makefile (patch included)

Discuss new features and functions
Posts: 35
Joined: 14 Aug 2022

daviank

Hello,

If one has more than one version of wx-widgets installed, there might be problems at configure time because the wrong version might be used.

The attached patch permits to fix that problem by using a variable
WX_CONFIG=wx-config --version=3.2
--- a/FreeFileSync/Source/Makefile
+++ b/FreeFileSync/Source/Makefile
@@ -2,12 +2,13 @@
 exeName = FreeFileSync
 
 PKG_CONFIG=pkg-config
+WX_CONFIG=wx-config --version=3.2
 
 CXXFLAGS += -std=c++2b -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" \
            -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wnon-virtual-dtor -Wno-unused-function -Wshadow -Wno-maybe-uninitialized \
-           -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
+           -O3 -DNDEBUG `$(WX_CONFIG) --cxxflags --debug=no` -pthread
 
-LDFLAGS += `wx-config --libs std, aui, richtext --debug=no` -pthread
+LDFLAGS += `$(WX_CONFIG) --libs std, aui, richtext --debug=no` -pthread
 LDFLAGS += -lz
 
 
--- a/FreeFileSync/Source/RealTimeSync/Makefile
+++ b/FreeFileSync/Source/RealTimeSync/Makefile
@@ -2,12 +2,13 @@
 exeName = RealTimeSync
 
 PKG_CONFIG=pkg-config
+WX_CONFIG=wx-config --version=3.2
 
 CXXFLAGS += -std=c++2b -pipe -DWXINTL_NO_GETTEXT_MACRO -I../../.. -I../../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" \
            -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wnon-virtual-dtor -Wno-unused-function -Wshadow -Wno-maybe-uninitialized \
-           -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
+           -O3 -DNDEBUG `$(WX_CONFIG) --cxxflags --debug=no` -pthread
 
-LDFLAGS += `wx-config --libs std, aui, richtext --debug=no` -pthread
+LDFLAGS += `$(WX_CONFIG) --libs std, aui, richtext --debug=no` -pthread
 LDFLAGS += -lz
 
 #Gtk - support "no button border"