Merge pull request #16 from cryptorick/freebsd-first-class

Make FreeBSD a "first class citizen" among femtolisp's build OSes.
This commit is contained in:
Jeff Bezanson 2015-04-19 19:04:32 -04:00
commit 2923137ef0
7 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,5 @@
CC = gcc
FREEBSD-GE-10 = $(shell test `uname` = FreeBSD -a `uname -r | cut -d. -f1` -ge 10 && echo YES)
CC = $(if $(FREEBSD-GE-10),clang,gcc)
NAME = flisp
SRCS = $(NAME).c builtins.c string.c equalhash.c table.c iostream.c
@ -32,7 +33,7 @@ flmain.o: flmain.c flisp.h
flmain.do: flmain.c flisp.h
$(LLT):
cd $(LLTDIR) && make
cd $(LLTDIR) && $(MAKE)
$(LIBTARGET).da: $(DOBJS)
rm -rf $@
@ -44,7 +45,7 @@ $(LIBTARGET).a: $(OBJS)
debug: $(DOBJS) $(LIBFILES) $(LIBTARGET).da flmain.do
$(CC) $(DEBUGFLAGS) $(DOBJS) flmain.do -o $(EXENAME) $(LIBS) $(LIBTARGET).da
make test
$(MAKE) test
release: $(OBJS) $(LIBFILES) $(LIBTARGET).a flmain.o
$(CC) $(SHIPFLAGS) $(OBJS) flmain.o -o $(EXENAME) $(LIBS) $(LIBTARGET).a

View File

@ -2307,6 +2307,8 @@ static void lisp_init(size_t initial_heapsize)
set(symbol("*os-name*"), symbol("macos"));
#elif defined(OPENBSD)
set(symbol("*os-name*"), symbol("openbsd"));
#elif defined(FREEBSD)
set(symbol("*os-name*"), symbol("freebsd"));
#else
set(symbol("*os-name*"), symbol("unknown"));
#endif

View File

@ -1,4 +1,5 @@
CC = gcc
FREEBSD-GE-10 = $(shell test `uname` = FreeBSD -a `uname -r | cut -d. -f1` -ge 10 && echo YES)
CC = $(if $(FREEBSD-GE-10),clang,gcc)
SRCS = bitvector.c hashing.c socket.c timefuncs.c ptrhash.c utf8.c ios.c \
dirpath.c htable.c bitvector-ops.c int2str.c dump.c random.c \

View File

@ -95,7 +95,7 @@ char *get_exename(char *buf, size_t size)
/* OpenBSD currently has no way of determining a processes pathname */
return NULL;
}
#elif defined(__FreeBSD__)
#elif defined(FREEBSD)
#include <sys/types.h>
#include <sys/sysctl.h>

View File

@ -23,13 +23,15 @@
# define MACOSX
#elif defined(__OpenBSD__)
# define OPENBSD
#elif defined(__FreeBSD__)
# define FREEBSD
#elif defined(_WIN32)
# define WIN32
#else
# error "unknown platform"
#endif
#if defined(OPENBSD)
#if defined(OPENBSD) || defined(FREEBSD)
#if defined(__x86_64__)
# define __SIZEOF_POINTER__ 8
#else
@ -70,7 +72,7 @@
# define BIG_ENDIAN __BIG_ENDIAN
# define PDP_ENDIAN __PDP_ENDIAN
# define BYTE_ORDER __BYTE_ORDER
#elif defined(MACOSX) || defined(OPENBSD)
#elif defined(MACOSX) || defined(OPENBSD) || defined(FREEBSD)
# include <machine/endian.h>
# define __LITTLE_ENDIAN LITTLE_ENDIAN
# define __BIG_ENDIAN BIG_ENDIAN

View File

@ -106,7 +106,7 @@ void timestring(double seconds, char *buffer, size_t len)
#endif
}
#if defined(LINUX) || defined(MACOSX) || defined(OPENBSD)
#if defined(LINUX) || defined(MACOSX) || defined(OPENBSD) || defined(FREEBSD)
extern char *strptime(const char *s, const char *format, struct tm *tm);
double parsetime(const char *str)
{

View File

@ -1,4 +1,5 @@
CC = gcc
FREEBSD-GE-10 = $(shell test `uname` = FreeBSD -a `uname -r | cut -d. -f1` -ge 10 && echo YES)
CC = $(if $(FREEBSD-GE-10),clang,gcc)
NAME = lisp
SRC = $(NAME).c