build on Solaris-like systems

This commit is contained in:
Richard Lowe 2019-08-07 01:23:27 +00:00
parent a01de232b2
commit 2311e41003
4 changed files with 54 additions and 17 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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.
;;/