mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-22 07:09:17 +02:00
Merge pull request #482 from nmeum/search-path-prepending
Allow prepending include/library search path through -COPT/-CLNK
This commit is contained in:
commit
25165b6782
2 changed files with 24 additions and 27 deletions
|
@ -31,14 +31,11 @@ endif
|
||||||
CFLAGS += $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -Wno-shift-negative-value -Wno-unused-command-line-argument -Iinclude
|
CFLAGS += $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -Wno-shift-negative-value -Wno-unused-command-line-argument -Iinclude
|
||||||
BASE_CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -Wno-shift-negative-value -Wno-unused-command-line-argument -I$(PREFIX)/include
|
BASE_CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -Wno-shift-negative-value -Wno-unused-command-line-argument -I$(PREFIX)/include
|
||||||
# Used by Cyclone to compile programs, no need for PIC there
|
# Used by Cyclone to compile programs, no need for PIC there
|
||||||
BASE_PROG_CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -Wall -I$(PREFIX)/include
|
BASE_PROG_CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -Wall
|
||||||
ifeq ($(OS),Darwin)
|
COMP_CFLAGS ?= $(BASE_CFLAGS)
|
||||||
COMP_CFLAGS ?= $(BASE_CFLAGS) -L$(PREFIX)/lib
|
COMP_LIBDIRS ?= -L$(PREFIX)/lib
|
||||||
|
COMP_INCDIRS ?= -I$(PREFIX)/include
|
||||||
COMP_PROG_CFLAGS ?= $(BASE_PROG_CFLAGS)
|
COMP_PROG_CFLAGS ?= $(BASE_PROG_CFLAGS)
|
||||||
else
|
|
||||||
COMP_CFLAGS ?= $(BASE_CFLAGS) -L$(PREFIX)/lib
|
|
||||||
COMP_PROG_CFLAGS ?= $(BASE_PROG_CFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Use these lines instead for debugging or profiling
|
# Use these lines instead for debugging or profiling
|
||||||
#CFLAGS = -g -Wall
|
#CFLAGS = -g -Wall
|
||||||
|
@ -62,15 +59,15 @@ endif
|
||||||
# concurrencykit was installed via Ports, it won't be picked up without explicitly looking
|
# concurrencykit was installed via Ports, it won't be picked up without explicitly looking
|
||||||
# for it here
|
# for it here
|
||||||
ifeq ($(OS),FreeBSD)
|
ifeq ($(OS),FreeBSD)
|
||||||
LDFLAGS += -L/usr/local/lib
|
COMP_LIBDIRS += -L/usr/local/lib
|
||||||
CFLAGS += -I/usr/local/include
|
COMP_INCDIRS += -I/usr/local/include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Commands "baked into" cyclone for invoking the C compiler
|
# Commands "baked into" cyclone for invoking the C compiler
|
||||||
CC_PROG ?= "$(CC) ~src-file~ $(COMP_PROG_CFLAGS) -c -o ~exec-file~.o"
|
CC_PROG ?= "$(CC) ~src-file~ $(COMP_PROG_CFLAGS) ~cc-extra~ $(COMP_INCDIRS) -c -o ~exec-file~.o"
|
||||||
CC_EXEC ?= "$(CC) ~exec-file~.o ~obj-files~ $(LIBS) $(COMP_CFLAGS) -o ~exec-file~"
|
CC_EXEC ?= "$(CC) ~exec-file~.o ~obj-files~ $(LIBS) $(COMP_CFLAGS) ~ld-extra~ $(COMP_LIBDIRS) -o ~exec-file~"
|
||||||
CC_LIB ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o"
|
CC_LIB ?= "$(CC) ~src-file~ $(COMP_CFLAGS) ~cc-extra~ $(COMP_LIBDIRS) -c -o ~exec-file~.o"
|
||||||
CC_SO ?= "$(CC) -shared $(LDFLAGS) -o ~exec-file~.so ~exec-file~.o"
|
CC_SO ?= "$(CC) -shared $(LDFLAGS) -o ~exec-file~.so ~exec-file~.o"
|
||||||
|
|
||||||
AR ?= ar
|
AR ?= ar
|
||||||
|
|
12
cyclone.scm
12
cyclone.scm
|
@ -880,29 +880,29 @@
|
||||||
lib-deps))))
|
lib-deps))))
|
||||||
(comp-prog-cmd
|
(comp-prog-cmd
|
||||||
(string-append
|
(string-append
|
||||||
|
(string-replace-all
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
;(Cyc-compilation-environment 'cc-prog)
|
;(Cyc-compilation-environment 'cc-prog)
|
||||||
(get-comp-env 'cc-prog cc-prog)
|
(get-comp-env 'cc-prog cc-prog)
|
||||||
"~src-file~" src-file)
|
"~src-file~" src-file)
|
||||||
|
"~cc-extra~" cc-opts)
|
||||||
"~exec-file~" exec-file)
|
"~exec-file~" exec-file)
|
||||||
" "
|
" "
|
||||||
cc-opts
|
|
||||||
" "
|
|
||||||
cc-opts*))
|
cc-opts*))
|
||||||
(comp-objs-cmd
|
(comp-objs-cmd
|
||||||
(string-append
|
(string-append
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
|
(string-replace-all
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
;(Cyc-compilation-environment 'cc-exec)
|
;(Cyc-compilation-environment 'cc-exec)
|
||||||
(get-comp-env 'cc-exec cc-exec)
|
(get-comp-env 'cc-exec cc-exec)
|
||||||
"~exec-file~" exec-file)
|
"~exec-file~" exec-file)
|
||||||
|
"~ld-extra~" cc-prog-linker-opts)
|
||||||
"~obj-files~" objs-str)
|
"~obj-files~" objs-str)
|
||||||
"~exec-file~" exec-file)
|
"~exec-file~" exec-file)
|
||||||
" "
|
" "
|
||||||
cc-prog-linker-opts
|
|
||||||
" "
|
|
||||||
c-linker-options
|
c-linker-options
|
||||||
)))
|
)))
|
||||||
;(write `(DEBUG all imports ,lib-deps objs ,objs-str))
|
;(write `(DEBUG all imports ,lib-deps objs ,objs-str))
|
||||||
|
@ -920,14 +920,14 @@
|
||||||
;; Compile library
|
;; Compile library
|
||||||
(let ((comp-lib-cmd
|
(let ((comp-lib-cmd
|
||||||
(string-append
|
(string-append
|
||||||
|
(string-replace-all
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
(string-replace-all
|
(string-replace-all
|
||||||
(get-comp-env 'cc-lib cc-lib)
|
(get-comp-env 'cc-lib cc-lib)
|
||||||
"~src-file~" src-file)
|
"~src-file~" src-file)
|
||||||
|
"~cc-extra~" cc-opts)
|
||||||
"~exec-file~" exec-file)
|
"~exec-file~" exec-file)
|
||||||
" "
|
" "
|
||||||
cc-opts
|
|
||||||
" "
|
|
||||||
cc-opts*))
|
cc-opts*))
|
||||||
(comp-so-cmd
|
(comp-so-cmd
|
||||||
(string-append
|
(string-append
|
||||||
|
|
Loading…
Add table
Reference in a new issue