summaryrefslogtreecommitdiff
path: root/freefilesync/debian/patches/makefile-improvements.patch
blob: e27a107938a3e3eed5f67fddd35add3dc9c202ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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: 2024-02-09

--- a/FreeFileSync/Source/Makefile
+++ b/FreeFileSync/Source/Makefile
@@ -2,39 +2,45 @@ CXX ?= g++
 exeName = FreeFileSync
 CXX=g++-12
 
+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" -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 \
-           -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
+           -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
 
+CXXFLAGS  += `$(PKG_CONFIG) --cflags zlib`
+LDFLAGS += `$(PKG_CONFIG) --libs   zlib`
 
-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 libssh2`
-LDFLAGS += `pkg-config --libs   libssh2`
+CXXFLAGS  += `$(PKG_CONFIG) --cflags libssh2`
+LDFLAGS += `$(PKG_CONFIG) --libs   libssh2`
 
-CXXFLAGS  += `pkg-config --cflags gtk+-3.0`
-LDFLAGS   += `pkg-config --libs   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,15 +2,18 @@ CXX ?= g++
 exeName = RealTimeSync
 CXX=g++-12
 
+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" -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 \
-           -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
+           -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
 
 #Gtk - support "no button border"
-CXXFLAGS  += `pkg-config --cflags gtk+-3.0`
-LDFLAGS += `pkg-config --libs   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
 
bgstack15