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
#keep these if statements separate
ifeq ($(OS), WINNT)
SHLIB_EXT = dll
SONAME_FLAG = -soname
CFLAGS_add += -nodefaultlibs
shlibdir = $(bindir)
else
shlibdir = $(libdir)
endif
ifeq ($(OS), Linux)
SHLIB_EXT = so
SONAME_FLAG = -soname
CFLAGS_add+=-fPIC
endif
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
SHLIB_EXT = dll
SONAME_FLAG = -soname
override CFLAGS_add += -nodefaultlibs
shlibdir = $(bindir)
else
ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
SONAME_FLAG = -install_name
else
SHLIB_EXT = so
SONAME_FLAG = -soname
endif
override CFLAGS_add += -fPIC
shlibdir = $(libdir)
endif
# The target specific FLAGS_add

View file

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

View file

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

View file

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