diff options
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | modules/devices/alpha/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/arm/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/ia64/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/m68k/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/mips/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/parisc/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/ppc/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/s390/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/sh/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/sparc/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/x86/processor.c | 6 |
12 files changed, 34 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e3366bdd..b73ec489 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ cmake_policy(VERSION 2.6) set(HARDINFO_VERSION "0.6-alpha") option(HARDINFO_NOSYNC "Disable database sync via libsoup" 1) +option(OVRARCH "Override HARDINFO_ARCH value" "") +option(OVRCPUINFO "Specify a different file for /proc/cpuinfo" "") SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) include(GNUInstallDirs) @@ -47,6 +49,13 @@ else() message(FATAL_ERROR "Unsupported architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}") endif() +if (OVRARCH) + set(HARDINFO_ARCH ${OVRARCH}) +endif() +if (OVRCPUINFO) + add_definitions(-DPROC_CPUINFO=${OVRCPUINFO}) +endif() + message(STATUS "Building HardInfo for architecture: ${HARDINFO_OS}-${HARDINFO_ARCH}") add_definitions("-std=gnu89") diff --git a/modules/devices/alpha/processor.c b/modules/devices/alpha/processor.c index 71e886e7..ae58058f 100644 --- a/modules/devices/alpha/processor.c +++ b/modules/devices/alpha/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/arm/processor.c b/modules/devices/arm/processor.c index 410c3a71..d83be9ec 100644 --- a/modules/devices/arm/processor.c +++ b/modules/devices/arm/processor.c @@ -74,7 +74,9 @@ int processor_has_flag(gchar * strflags, gchar * strflag) return ret; } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/ia64/processor.c b/modules/devices/ia64/processor.c index 7a05c51a..57cc94e0 100644 --- a/modules/devices/ia64/processor.c +++ b/modules/devices/ia64/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/m68k/processor.c b/modules/devices/m68k/processor.c index 2137b9a4..995e34af 100644 --- a/modules/devices/m68k/processor.c +++ b/modules/devices/m68k/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/mips/processor.c b/modules/devices/mips/processor.c index 4a0498ce..ca9f44bb 100644 --- a/modules/devices/mips/processor.c +++ b/modules/devices/mips/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/parisc/processor.c b/modules/devices/parisc/processor.c index 66a75fe5..99248e9e 100644 --- a/modules/devices/parisc/processor.c +++ b/modules/devices/parisc/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processors_scan(void) diff --git a/modules/devices/ppc/processor.c b/modules/devices/ppc/processor.c index 10a53a65..59ebab01 100644 --- a/modules/devices/ppc/processor.c +++ b/modules/devices/ppc/processor.c @@ -47,7 +47,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/s390/processor.c b/modules/devices/s390/processor.c index b47fa67b..0e8cafb6 100644 --- a/modules/devices/s390/processor.c +++ b/modules/devices/s390/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/sh/processor.c b/modules/devices/sh/processor.c index 3f91efbd..a2018ff8 100644 --- a/modules/devices/sh/processor.c +++ b/modules/devices/sh/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/sparc/processor.c b/modules/devices/sparc/processor.c index 0557c0b6..9310c45d 100644 --- a/modules/devices/sparc/processor.c +++ b/modules/devices/sparc/processor.c @@ -27,7 +27,9 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO #define PROC_CPUINFO "/proc/cpuinfo" +#endif GSList * processor_scan(void) diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c index f8543c17..2ca40136 100644 --- a/modules/devices/x86/processor.c +++ b/modules/devices/x86/processor.c @@ -254,6 +254,10 @@ gchar *byte_order_str() { #endif } +#ifndef PROC_CPUINFO +#define PROC_CPUINFO "/proc/cpuinfo" +#endif + GSList *processor_scan(void) { GSList *procs = NULL, *l = NULL; @@ -261,7 +265,7 @@ GSList *processor_scan(void) FILE *cpuinfo; gchar buffer[512]; - cpuinfo = fopen("/proc/cpuinfo", "r"); + cpuinfo = fopen(PROC_CPUINFO, "r"); if (!cpuinfo) return NULL; |