From 13404ed090453ffa1a2b475b004b74db7086ff74 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 26 Feb 2024 19:22:53 +0100 Subject: Added ability to staticaly build box64 (for #1045 and #310, maybe a few others tickets) --- src/tools/my_cpuid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c index e4de411a..a7f9ae3e 100644 --- a/src/tools/my_cpuid.c +++ b/src/tools/my_cpuid.c @@ -39,7 +39,7 @@ int get_cpuMhz() else cpucore = -1; } - + #ifndef STATICBUILD if(!MHz) { // try with lscpu, grabbing the max frequency FILE* f = popen("lscpu | grep \"CPU max MHz:\" | sed -r 's/CPU max MHz:\\s{1,}//g'", "r"); @@ -68,6 +68,7 @@ int get_cpuMhz() } } } + #endif if(!MHz) MHz = 1000; // default to 1Ghz... sprintf(cpumhz, "%d", MHz); @@ -132,6 +133,7 @@ const char* getCpuName() return name; } setenv("BOX64_CPUNAME", name, 1); // temporary set + #ifndef STATICBUILD FILE* f = popen("lscpu | grep \"Model name:\" | sed -r 's/Model name:\\s{1,}//g'", "r"); if(f) { char tmp[200] = ""; @@ -171,6 +173,7 @@ const char* getCpuName() return name; } } + #endif // Nope, bye return name; } -- cgit 1.4.1