File 0007-Implement-Linux-configuration.patch of Package wangemu
From 4c19386e134198a55cdb3fe04dae10d574eab148 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@gmail.com>
Date: Tue, 14 Oct 2025 09:34:00 +0200
Subject: [PATCH 07/11] Implement Linux configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
---
Makefile.linux | 4 ++--
src/host.cpp | 8 ++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Makefile.linux b/Makefile.linux
index 3f2a33f..2fd2851 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -31,7 +31,7 @@ OBJFILES := $(patsubst src/%.cpp,obj/%.o,$(CPP_SOURCES)) \
$(patsubst src/%.c,obj/%.o,$(C_SOURCES))
# debug build
-debug: OPTFLAGS := -g -O0
+debug: OPTFLAGS := -g -O0 -D_DEBUG
debug: wangemu tags
# optimized build
@@ -39,7 +39,7 @@ opt: OPTFLAGS := -O2
opt: wangemu tags
CXX := `wx-config --cxx`
-CXXFLAGS := `wx-config --cxxflags` -fno-common
+CXXFLAGS := `wx-config --cxxflags` -fno-common -D__LINUX__
CXXWARNINGS := -Wall -Wextra -Wshadow -Wformat -Wundef -Wstrict-aliasing=1 \
-Wno-deprecated-declarations \
-Wno-ctor-dtor-privacy -Woverloaded-virtual
diff --git a/src/host.cpp b/src/host.cpp
index bb85dea..aa2f1c3 100644
--- a/src/host.cpp
+++ b/src/host.cpp
@@ -194,6 +194,14 @@ host::initialize()
#endif
config = std::make_unique<wxFileConfig>("", "", ini_path.GetFullPath());
wxConfigBase::Set(config.get());
+#elif defined(__LINUX__)
+ config = std::make_unique<wxFileConfig>(
+ wxEmptyString, // appName
+ wxEmptyString, // vendorName
+ app_home + "wangemu.ini", // localFilename
+ wxEmptyString, // globalFilename
+ wxCONFIG_USE_LOCAL_FILE
+ );
#endif
// needed so we can compute a time difference to get ms later
--
2.51.0