Add cpuid-tycho
This commit is contained in:
16
sysutils/cpuid-tycho/patches/patch-GNUmakefile
Normal file
16
sysutils/cpuid-tycho/patches/patch-GNUmakefile
Normal file
@@ -0,0 +1,16 @@
|
||||
$OpenBSD$
|
||||
Index: GNUmakefile
|
||||
--- GNUmakefile.orig
|
||||
+++ GNUmakefile
|
||||
@@ -7,6 +7,11 @@ uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo
|
||||
prefix := /usr/local
|
||||
bindir := $(prefix)/bin
|
||||
|
||||
+ifeq ($(uname_S),OpenBSD)
|
||||
+CFLAGS += -pthread
|
||||
+LDFLAGS += -pthread
|
||||
+endif
|
||||
+
|
||||
ifneq ($(findstring MINGW,$(uname_S)),)
|
||||
win32 = Yep
|
||||
endif
|
||||
41
sysutils/cpuid-tycho/patches/patch-threads_c
Normal file
41
sysutils/cpuid-tycho/patches/patch-threads_c
Normal file
@@ -0,0 +1,41 @@
|
||||
$OpenBSD$
|
||||
|
||||
Index: threads.c
|
||||
--- threads.c.orig
|
||||
+++ threads.c
|
||||
@@ -49,13 +49,15 @@
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
|
||||
-#elif defined(TARGET_OS_SOLARIS)
|
||||
+#elif defined(TARGET_OS_SOLARIS) || defined(TARGET_OS_OPENBSD)
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
+#if defined(TARGET_OS_SOLARIS)
|
||||
#include <sys/processor.h>
|
||||
#include <sys/procset.h>
|
||||
+#endif
|
||||
|
||||
|
||||
#elif defined(TARGET_OS_MACOSX)
|
||||
@@ -116,7 +118,7 @@ uint32_t thread_count_native(struct cpuid_state_t *sta
|
||||
return 1;
|
||||
|
||||
return count;
|
||||
-#elif defined(TARGET_OS_SOLARIS)
|
||||
+#elif defined(TARGET_OS_SOLARIS) || defined(TARGET_OS_OPENBSD)
|
||||
long count;
|
||||
|
||||
if ((count = sysconf(_SC_NPROCESSORS_ONLN)) == -1)
|
||||
@@ -289,7 +291,8 @@ int thread_bind_native(__unused_variable struct cpuid_
|
||||
|
||||
return ret == 0 ? 0 : 1;
|
||||
#else
|
||||
-#error "thread_bind_native() not defined for this platform"
|
||||
+#warning "thread_bind_native() not defined for this platform"
|
||||
+ return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
40
sysutils/cpuid-tycho/patches/patch-threads_c.orig
Normal file
40
sysutils/cpuid-tycho/patches/patch-threads_c.orig
Normal file
@@ -0,0 +1,40 @@
|
||||
$OpenBSD$
|
||||
Index: threads.c
|
||||
--- threads.c.orig
|
||||
+++ threads.c
|
||||
@@ -44,13 +44,15 @@
|
||||
#undef MAX_CPUS
|
||||
#define MAX_CPUS CPU_MAXSIZE
|
||||
|
||||
-#elif defined(TARGET_OS_SOLARIS)
|
||||
+#elif defined(TARGET_OS_SOLARIS) || defined(TARGET_OS_OPENBSD)
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
+#if defined(TARGET_OS_SOLARIS)
|
||||
#include <sys/processor.h>
|
||||
#include <sys/procset.h>
|
||||
+#endif
|
||||
|
||||
|
||||
#elif defined(TARGET_OS_MACOSX)
|
||||
@@ -111,7 +113,7 @@ uint32_t thread_count_native(struct cpuid_state_t *sta
|
||||
return 1;
|
||||
|
||||
return count;
|
||||
-#elif defined(TARGET_OS_SOLARIS)
|
||||
+#elif defined(TARGET_OS_SOLARIS) || defined(TARGET_OS_OPENBSD)
|
||||
long count;
|
||||
|
||||
if ((count = sysconf(_SC_NPROCESSORS_ONLN)) == -1)
|
||||
@@ -263,7 +265,8 @@ int thread_bind_native(__unused_variable struct cpuid_
|
||||
|
||||
return ret == 0 ? 0 : 1;
|
||||
#else
|
||||
-#error "thread_bind_native() not defined for this platform"
|
||||
+#warning "thread_bind_native() not defined for this platform"
|
||||
+ return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user