Build on GNU/kfreeBSD and GNU/Hurd

Use __GLIBC__ instead of __linux
Simplify Make.inc as per JuliaLang/openspecfun@e91925a
This commit is contained in:
Graham Inggs 2015-10-27 09:32:56 +02:00
parent 91f517b9f5
commit ebe1db3ce4
4 changed files with 18 additions and 33 deletions

View file

@ -82,37 +82,22 @@ override OS=WINNT
endif endif
#keep these if statements separate #keep these if statements separate
ifeq ($(OS), WINNT) ifeq ($(OS), WINNT)
SHLIB_EXT = dll SHLIB_EXT = dll
SONAME_FLAG = -soname SONAME_FLAG = -soname
CFLAGS_add += -nodefaultlibs override CFLAGS_add += -nodefaultlibs
shlibdir = $(bindir) shlibdir = $(bindir)
else else
shlibdir = $(libdir) ifeq ($(OS), Darwin)
endif SHLIB_EXT = dylib
SONAME_FLAG = -install_name
ifeq ($(OS), Linux) else
SHLIB_EXT = so SHLIB_EXT = so
SONAME_FLAG = -soname SONAME_FLAG = -soname
CFLAGS_add+=-fPIC endif
endif override CFLAGS_add += -fPIC
shlibdir = $(libdir)
ifeq ($(OS), FreeBSD)
SHLIB_EXT = so
SONAME_FLAG = -soname
CFLAGS_add+=-fPIC
endif
ifeq ($(OS), OpenBSD)
SHLIB_EXT = so
SONAME_FLAG = -soname
CFLAGS_add+=-fPIC
endif
ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
SONAME_FLAG = -install_name
CFLAGS_add+=-fPIC
endif endif
# The target specific FLAGS_add # The target specific FLAGS_add

View file

@ -39,7 +39,7 @@
#if defined(__APPLE__) #if defined(__APPLE__)
#include "osx_asm.h" #include "osx_asm.h"
#define CNAME(x) EXT(x) #define CNAME(x) EXT(x)
#elif defined(__FreeBSD__) || defined(__linux__) || defined(_WIN32) #else
#include "bsd_cdefs.h" #include "bsd_cdefs.h"
#ifdef PIC #ifdef PIC

View file

@ -47,7 +47,7 @@
#define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ #define _PDP_ENDIAN __ORDER_PDP_ENDIAN__
#define _BYTE_ORDER __BYTE_ORDER__ #define _BYTE_ORDER __BYTE_ORDER__
#elif defined(__linux) #elif defined(__GLIBC__)
#include <features.h> #include <features.h>
#include <endian.h> #include <endian.h>

View file

@ -5,7 +5,7 @@
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
#ifdef __linux__ #ifdef __GLIBC__
/* Not sure what to do about __pure2 on linux */ /* Not sure what to do about __pure2 on linux */
#define __pure2 #define __pure2
#endif #endif