Skip to content

Commit ebe1db3

Browse files
committed
Build on GNU/kfreeBSD and GNU/Hurd
Use __GLIBC__ instead of __linux Simplify Make.inc as per JuliaMath/openspecfun@e91925a
1 parent 91f517b commit ebe1db3

4 files changed

Lines changed: 18 additions & 33 deletions

File tree

Make.inc

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -82,37 +82,22 @@ override OS=WINNT
8282
endif
8383

8484
#keep these if statements separate
85-
ifeq ($(OS), WINNT)
86-
SHLIB_EXT = dll
87-
SONAME_FLAG = -soname
88-
CFLAGS_add += -nodefaultlibs
89-
shlibdir = $(bindir)
90-
else
91-
shlibdir = $(libdir)
92-
endif
93-
94-
ifeq ($(OS), Linux)
95-
SHLIB_EXT = so
96-
SONAME_FLAG = -soname
97-
CFLAGS_add+=-fPIC
98-
endif
99-
100-
ifeq ($(OS), FreeBSD)
101-
SHLIB_EXT = so
102-
SONAME_FLAG = -soname
103-
CFLAGS_add+=-fPIC
104-
endif
105-
106-
ifeq ($(OS), OpenBSD)
107-
SHLIB_EXT = so
108-
SONAME_FLAG = -soname
109-
CFLAGS_add+=-fPIC
110-
endif
11185

112-
ifeq ($(OS), Darwin)
113-
SHLIB_EXT = dylib
114-
SONAME_FLAG = -install_name
115-
CFLAGS_add+=-fPIC
86+
ifeq ($(OS), WINNT)
87+
SHLIB_EXT = dll
88+
SONAME_FLAG = -soname
89+
override CFLAGS_add += -nodefaultlibs
90+
shlibdir = $(bindir)
91+
else
92+
ifeq ($(OS), Darwin)
93+
SHLIB_EXT = dylib
94+
SONAME_FLAG = -install_name
95+
else
96+
SHLIB_EXT = so
97+
SONAME_FLAG = -soname
98+
endif
99+
override CFLAGS_add += -fPIC
100+
shlibdir = $(libdir)
116101
endif
117102

118103
# The target specific FLAGS_add

i387/bsd_asm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#if defined(__APPLE__)
4040
#include "osx_asm.h"
4141
#define CNAME(x) EXT(x)
42-
#elif defined(__FreeBSD__) || defined(__linux__) || defined(_WIN32)
42+
#else
4343
#include "bsd_cdefs.h"
4444

4545
#ifdef PIC

src/fpmath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#define _PDP_ENDIAN __ORDER_PDP_ENDIAN__
4848
#define _BYTE_ORDER __BYTE_ORDER__
4949

50-
#elif defined(__linux)
50+
#elif defined(__GLIBC__)
5151

5252
#include <features.h>
5353
#include <endian.h>

src/types-compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <limits.h>
66
#include <stdint.h>
77

8-
#ifdef __linux__
8+
#ifdef __GLIBC__
99
/* Not sure what to do about __pure2 on linux */
1010
#define __pure2
1111
#endif

0 commit comments

Comments
 (0)