diff --git a/Makefile b/Makefile index faa3d48c..153a6d88 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,11 @@ XLDFLAGS := $(LDFLAGS) $(RLDFLAGS) $(GCLDFLAGS) $(LIBDL) -lm XCFLAGS := -Wall -g -g3 -O3 $(CFLAGS) endif +ifeq ($(PLATFORM),solaris) +XLDFLAGS += -lsocket +XCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS +endif + ######################################################################## all: chibi-scheme$(EXE) all-libs chibi-scheme.pc $(META_FILES) diff --git a/Makefile.detect b/Makefile.detect index fddb88a8..3146f74d 100644 --- a/Makefile.detect +++ b/Makefile.detect @@ -35,6 +35,9 @@ else ifeq ($(shell uname -o),GNU/Linux) PLATFORM=linux else +ifeq ($(shell uname),SunOS) +PLATFORM=solaris +else PLATFORM=unix endif endif @@ -46,6 +49,7 @@ endif endif endif endif +endif ######################################################################## # Set default variables for the platform. @@ -72,6 +76,14 @@ CLINKFLAGS = -shared LIBDL = RLDFLAGS=-Wl,-R$(LIBDIR) else +ifeq ($(PLATFORM),solaris) +SO = .so +EXE = +CLIBFLAGS = -fPIC +CLINKFLAGS = -shared +LIBDL = -ldl +RLDFLAGS=-Wl,-R$(LIBDIR) +else ifeq ($(PLATFORM),windows) SO = .dll EXE = .exe @@ -112,6 +124,7 @@ endif endif endif endif +endif ifeq ($(PLATFORM),unix) #RLDFLAGS=-rpath $(LIBDIR) diff --git a/include/chibi/features.h b/include/chibi/features.h index 09926179..06a4209f 100644 --- a/include/chibi/features.h +++ b/include/chibi/features.h @@ -323,14 +323,12 @@ #define SEXP_NETBSD 1 #define SEXP_DRAGONFLY 0 #define SEXP_OPENBSD 0 -#define SEXP_NETBSD 0 #elif defined(__DragonFly__) -#define SEXP_DARWIN 1 +#define SEXP_DARWIN 0 #define SEXP_FREEBSD 0 #define SEXP_NETBSD 0 #define SEXP_DRAGONFLY 1 #define SEXP_OPENBSD 0 -#define SEXP_DRAGONFLY 0 #elif defined(__OpenBSD__) #define SEXP_DARWIN 0 #define SEXP_FREEBSD 0 diff --git a/lib/chibi/time.sld b/lib/chibi/time.sld index 526795e3..1fba628e 100644 --- a/lib/chibi/time.sld +++ b/lib/chibi/time.sld @@ -5,9 +5,12 @@ make-timeval make-tm timeval-seconds timeval-microseconds timezone-offset timezone-dst-time time-second time-minute time-hour time-day time-month time-year - time-day-of-week time-day-of-year time-dst? time-timezone-name - time-offset + time-day-of-week time-day-of-year time-dst? tm? timeval? timezone?) + (cond-expand + (solaris) + (else + (export time-offset time-timezone-name))) (cond-expand (emscripten) (else diff --git a/lib/chibi/time.stub b/lib/chibi/time.stub index d917671b..1e42b78a 100644 --- a/lib/chibi/time.stub +++ b/lib/chibi/time.stub @@ -7,21 +7,37 @@ (c-system-include "time.h") (c-system-include "sys/time.h"))) -(define-c-struct tm - predicate: tm? - constructor: (make-tm tm_sec tm_min tm_hour - tm_mday tm_mon tm_year tm_isdst) - (int tm_sec time-second) - (int tm_min time-minute) - (int tm_hour time-hour) - (int tm_mday time-day) - (int tm_mon time-month) - (int tm_year time-year) - (int tm_wday time-day-of-week) - (int tm_yday time-day-of-year) - (int tm_isdst time-dst?) - (string tm_zone time-timezone-name) - (int tm_gmtoff time-offset)) +(cond-expand + (solaris + (define-c-struct tm + predicate: tm? + constructor: (make-tm tm_sec tm_min tm_hour + tm_mday tm_mon tm_year tm_isdst) + (int tm_sec time-second) + (int tm_min time-minute) + (int tm_hour time-hour) + (int tm_mday time-day) + (int tm_mon time-month) + (int tm_year time-year) + (int tm_wday time-day-of-week) + (int tm_yday time-day-of-year) + (int tm_isdst time-dst?))) + (else + (define-c-struct tm + predicate: tm? + constructor: (make-tm tm_sec tm_min tm_hour + tm_mday tm_mon tm_year tm_isdst) + (int tm_sec time-second) + (int tm_min time-minute) + (int tm_hour time-hour) + (int tm_mday time-day) + (int tm_mon time-month) + (int tm_year time-year) + (int tm_wday time-day-of-week) + (int tm_yday time-day-of-year) + (int tm_isdst time-dst?) + (string tm_zone time-timezone-name) + (int tm_gmtoff time-offset)))) ;;> Accessors for the \scheme{tm} struct. ;;/