From: notaz <notasas@gmail.com>
Date: Sat, 23 Sep 2023 19:39:52 +0000 (+0300)
Subject: log some build info
X-Git-Tag: r24~142
X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d87d06249b1c05a52288172d999648d13fab69b;p=pcsx_rearmed.git

log some build info

helpful for bug reports
---

diff --git a/Makefile b/Makefile
index 63ffcb62..c020274a 100644
--- a/Makefile
+++ b/Makefile
@@ -266,7 +266,7 @@ endif
 
 # misc
 OBJS += frontend/main.o frontend/plugin.o
-
+frontend/main.o: CFLAGS += -DBUILTIN_GPU=$(BUILTIN_GPU)
 
 frontend/menu.o frontend/main.o: frontend/revision.h
 frontend/plat_sdl.o frontend/libretro.o: frontend/revision.h
diff --git a/frontend/main.c b/frontend/main.c
index e2349903..34f68d40 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -436,6 +436,49 @@ static void log_wrong_cpu(void)
 #endif // DO_CPU_CHECKS
 }
 
+#define MKSTR2(x) #x
+#define MKSTR(x) MKSTR2(x)
+static const char *get_build_info(void)
+{
+	return " ("
+#ifdef __VERSION__
+		"cc " __VERSION__ " "
+#endif
+#if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
+		"64bit "
+#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
+		"32bit "
+#endif
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+		"be "
+#endif
+#if defined(__PIC__) || defined(__pic__)
+		"pic "
+#endif
+#if defined(__aarch64__)
+		"arm64"
+#elif defined(__arm__)
+		"arm"
+#endif
+#ifdef __ARM_ARCH
+		"v" MKSTR(__ARM_ARCH) " "
+#endif
+#if defined(__AVX__)
+		"avx "
+#elif defined(__SSSE3__)
+		"ssse3 "
+#elif defined(__ARM_NEON) || defined(__ARM_NEON__)
+		"neon "
+#endif
+#if defined(LIGHTREC)
+		"lightrec "
+#elif !defined(DRC_DISABLE)
+		"ari64 "
+#endif
+		"gpu=" MKSTR(BUILTIN_GPU)
+		")";
+}
+
 int emu_core_preinit(void)
 {
 	// what is the name of the config file?
@@ -465,7 +508,7 @@ int emu_core_preinit(void)
 
 int emu_core_init(void)
 {
-	SysPrintf("Starting PCSX-ReARMed " REV "\n");
+	SysPrintf("Starting PCSX-ReARMed " REV "%s\n", get_build_info());
 
 #ifndef NO_FRONTEND
 	check_profile();