Skip to content

Commit 2cfa86b

Browse files
authored
Merge pull request #1707 from extrowerk/haiku_support
Haiku supporting patches
2 parents 8ef7d4f + 6463bff commit 2cfa86b

File tree

8 files changed

+27
-4
lines changed

8 files changed

+27
-4
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ endif
9797

9898
shared :
9999
ifndef NO_SHARED
100-
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
100+
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
101101
@$(MAKE) -C exports so
102102
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
103103
@ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
@@ -267,6 +267,8 @@ ifeq ($(F_COMPILER), GFORTRAN)
267267
ifdef SMP
268268
ifeq ($(OSNAME), WINNT)
269269
-@echo "LOADER = $(FC)" >> $(NETLIB_LAPACK_DIR)/make.inc
270+
else ifeq ($(OSNAME), Haiku)
271+
-@echo "LOADER = $(FC)" >> $(NETLIB_LAPACK_DIR)/make.inc
270272
else
271273
-@echo "LOADER = $(FC) -pthread" >> $(NETLIB_LAPACK_DIR)/make.inc
272274
endif

Makefile.install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ endif
6666
#for install shared library
6767
ifndef NO_SHARED
6868
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
69-
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
69+
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
7070
@install -pm755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
7171
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
7272
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \

c_check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ $os = WINNT if ($data =~ /OS_WINNT/);
6464
$os = CYGWIN_NT if ($data =~ /OS_CYGWIN_NT/);
6565
$os = Interix if ($data =~ /OS_INTERIX/);
6666
$os = Android if ($data =~ /OS_ANDROID/);
67+
$os = Haiku if ($data =~ /OS_HAIKU/);
6768

6869
$architecture = x86 if ($data =~ /ARCH_X86/);
6970
$architecture = x86_64 if ($data =~ /ARCH_X86_64/);

common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ extern "C" {
105105
#endif
106106
#endif
107107

108+
#ifdef OS_HAIKU
109+
#define NO_SYSV_IPC
110+
#endif
111+
108112
#ifdef OS_WINDOWS
109113
#ifdef ATOM
110114
#define GOTO_ATOM ATOM

ctest.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ OS_INTERIX
101101
OS_LINUX
102102
#endif
103103

104+
#if defined(__HAIKU__)
105+
OS_HAIKU
106+
#endif
107+
104108
#if defined(__i386) || defined(_X86)
105109
ARCH_X86
106110
#endif

driver/others/blas_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7070
/*********************************************************************/
7171

7272
#include "common.h"
73-
#if defined(OS_LINUX) || defined(OS_NETBSD) || defined(OS_DARWIN) || defined(OS_ANDROID) || defined(OS_SUNOS) || defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLY)
73+
#if defined(OS_LINUX) || defined(OS_NETBSD) || defined(OS_DARWIN) || defined(OS_ANDROID) || defined(OS_SUNOS) || defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLY) || defined(OS_HAIKU)
7474
#include <dlfcn.h>
7575
#include <signal.h>
7676
#include <sys/resource.h>

driver/others/memory.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
108108
#include <sys/resource.h>
109109
#endif
110110

111+
#ifdef OS_HAIKU
112+
#include <unistd.h>
113+
#endif
114+
111115
#if defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLY) || defined(OS_DARWIN)
112116
#include <sys/sysctl.h>
113117
#include <sys/resource.h>
@@ -238,6 +242,14 @@ int get_num_procs(void) {
238242
}
239243
#endif
240244

245+
#ifdef OS_HAIKU
246+
int get_num_procs(void) {
247+
static int nums = 0;
248+
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
249+
return nums;
250+
}
251+
#endif
252+
241253
#ifdef OS_WINDOWS
242254

243255
int get_num_procs(void) {

exports/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ endif
122122
dllinit.$(SUFFIX) : dllinit.c
123123
$(CC) $(CFLAGS) -c -o $(@F) -s $<
124124

125-
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
125+
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
126126

127127
so : ../$(LIBSONAME)
128128

0 commit comments

Comments
 (0)