This commit is contained in:
Justin Ethier 2017-03-23 00:21:16 -04:00
parent 24a2b63b7f
commit afcc5eaecd
4 changed files with 14 additions and 5 deletions

View file

@ -7,7 +7,7 @@ include Makefile.config
# Commands
CYCLONE = cyclone -A .
CCOMP = $(CC) $(CFLAGS)
CCOMP = $(CC) $(LIB_CFLAGS)
INDENT_CMD = indent -linux -l80 -i2 -nut
# Directories
@ -162,6 +162,7 @@ runtime.o : runtime.c $(HEADERS)
-DCYC_CC_PROG=\"$(CC_PROG)\" \
-DCYC_CC_EXEC=\"$(CC_EXEC)\" \
-DCYC_CC_LIB=\"$(CC_LIB)\" \
-DCYC_CC_SO=\"$(CC_SO)\" \
$< -o $@
libcyclone.a : runtime.o gc.o dispatch.o mstreams.o

View file

@ -5,8 +5,9 @@
# Configuration options for the makefile
# Compiler options
CFLAGS ?= -O2 -Wall -Iinclude -L.
COMP_CFLAGS ?= -O2 -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
CFLAGS ?= -O2 -fPIC -Wall -Iinclude -L.
LIB_CFLAGS ?= -O2 -Wall -Iinclude -L.
COMP_CFLAGS ?= -O2 -fPIC -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
# Use these lines instead for debugging or profiling
#CFLAGS = -g -Wall
#CFLAGS = -g -pg -Wall
@ -17,6 +18,7 @@ LIBS = -pthread -lcyclone -lck -lm -ltommath
CC_PROG ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o"
CC_EXEC ?= "$(CC) ~exec-file~.o ~obj-files~ $(LIBS) $(COMP_CFLAGS) -o ~exec-file~"
CC_LIB ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o"
CC_SO ?= "$(CC) -shared -o ~exec-file~.so -o ~exec-file~.o"
AR ?= ar
#CD ?= cd

View file

@ -454,15 +454,16 @@
(let ((comp-lib-cmd
(string-replace-all
(string-replace-all
;(Cyc-compilation-environment 'cc-lib)
(get-comp-env 'cc-lib cc-lib)
"~src-file~" src-file)
"~exec-file~" exec-file)))
(cond
(cc?
(system comp-lib-cmd))
(system comp-lib-cmd)
)
(else
(display comp-lib-cmd)
(newline)
(newline))))))))
;; Collect values for the given command line arguments and option.

View file

@ -2156,6 +2156,11 @@ object Cyc_compilation_environment(void *data, object cont, object var)
snprintf(buf, sizeof(buf), "%s", CYC_CC_LIB);
make_string(str, buf);
_return_closcall1(data, cont, &str);
} else if (strncmp(((symbol) var)->desc, "cc-so", 6) == 0) {
char buf[1024];
snprintf(buf, sizeof(buf), "%s", CYC_CC_SO);
make_string(str, buf);
_return_closcall1(data, cont, &str);
}
}
Cyc_rt_raise2(data,