Description: Main patch to compile on Debian & derivatives
 - Set the path to the resource dir on Debian
 . remove the "arch" name from the produced executable name.
 - update compilation flags:
    - CPPFLAGS: required because it is set in debian/rules
    - LDFLAGS: remove -s because stripping this is done in dh_strip. If we
      kept it, the dbgsym packages would be almost empty.
    - LDFLAGS: remove -no-pie because this would conflict with
      DEB_BUILD_MAINT_OPTIONS set in debian/rules. The value hardening=+all
      enables PIE, while -no-pie would conflit with that.
Author: bgstack15
Author: Fab Stz <fabstz-it@yahoo.fr>
Source: Original research
Last-Modified: 2022-08-03
Last-Version: 11.23
Forwarded: not-needed

--- a/FreeFileSync/Source/ffs_paths.cpp
+++ b/FreeFileSync/Source/ffs_paths.cpp
@@ -54,7 +54,7 @@
 
 Zstring fff::getResourceDirPath()
 {
-    return appendPath(getProcessParentFolderPath(), Zstr("Resources"));
+    return Zstr("/usr/share/freefilesync/");
 }
 
 
--- a/FreeFileSync/Source/Makefile
+++ b/FreeFileSync/Source/Makefile
@@ -1,5 +1,5 @@
 CXX ?= g++
-exeName = FreeFileSync_$(shell arch)
+exeName = FreeFileSync
 
 PKG_CONFIG=pkgconf
 WX_CONFIG=wx-config --version=3.2
@@ -8,7 +8,7 @@
            -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
 
-LDFLAGS += -s -no-pie `$(WX_CONFIG) --libs std, aui, richtext --debug=no` -pthread
+LDFLAGS += `$(WX_CONFIG) --libs std, aui, richtext --debug=no` -pthread
 
 
 CXXFLAGS  += `$(PKG_CONFIG) --cflags openssl`
@@ -127,7 +127,7 @@
 
 $(tmpPath)/ffs/src/%.o : %
 	mkdir -p $(dir $@)
-	$(CXX) $(CXXFLAGS) -c $< -o $@
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
 
 clean:
 	rm -rf $(tmpPath)
--- a/FreeFileSync/Source/RealTimeSync/Makefile
+++ b/FreeFileSync/Source/RealTimeSync/Makefile
@@ -1,5 +1,5 @@
 CXX ?= g++
-exeName = RealTimeSync_$(shell arch)
+exeName = RealTimeSync
 
 PKG_CONFIG=pkgconf
 WX_CONFIG=wx-config --version=3.2
@@ -8,7 +8,7 @@
            -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
 
-LDFLAGS += -s -no-pie `$(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+-2.0`
@@ -63,7 +63,7 @@
 
 $(tmpPath)/ffs/src/rts/%.o : %
 	mkdir -p $(dir $@)
-	$(CXX) $(CXXFLAGS) -c $< -o $@
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
 
 clean:
 	rm -rf $(tmpPath)
