Skip to content

Commit

Permalink
Build on GNU/kfreeBSD and GNU/Hurd
Browse files Browse the repository at this point in the history
Use __GLIBC__ instead of __linux
Simplify Make.inc as per JuliaMath/openspecfun@e91925a
  • Loading branch information
ginggs committed Nov 10, 2015
1 parent 91f517b commit ebe1db3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
45 changes: 15 additions & 30 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
ifeq ($(OS), WINNT)
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)

This comment has been minimized.

Copy link
@iblislin

iblislin Jan 18, 2016

Contributor

Hi!
I am going to make some patch for FreeBSD... and I was wondering why we have such strange indentation?

This comment has been minimized.

Copy link
@ViralBShah

ViralBShah Jan 19, 2016

Member

No real reason. Could use a cleanup.

endif

# The target specific FLAGS_add
Expand Down
2 changes: 1 addition & 1 deletion i387/bsd_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/fpmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/types-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ebe1db3

Please sign in to comment.