-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproject.b
175 lines (163 loc) · 3.96 KB
/
project.b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
project: "boron"
options [
-debug: false "Compile for debugging"
assemble: false "Enable assemble function (requires libjit)"
checksum: true "Enable checksum function"
compress: 'zlib "Include compressor ('zlib/'bzip2/none)"
hashmap: true "Enable hash-map! datatype"
execute: true "Enable execute function"
random: true "Include random number generator"
readline: 'linenoise "Console editing ('linenoise/'gnu/none)"
socket: true "Enable socket port!"
ssl: false "Enable SSL/TLS port! (requires mbedtls)"
static: false "Build static library and stand-alone executable"
thread: false "Enable thread functions"
timecode: false "Enable timecode! datatype"
atom-limit: 2048 "Set maximum number of words"
atom-names: mul atom-limit 16 "Set byte size of word name buffer"
]
default [
either -debug [debug] [release]
objdir %obj
include_from [%include %urlan %eval %support]
macx [
cflags {-std=c99}
cflags {-pedantic}
;universal
]
unix [
;cflags {-std=c99}
cflags {-std=gnu99} ; Try this if c99 fails.
cflags {-pedantic}
]
win32 [
if thread [cflags {-D_WIN32_WINNT=0x0600}]
]
]
lib-spec: [
cflags rejoin [
{-DCONFIG_ATOM_LIMIT=} atom-limit
{ -DCONFIG_ATOM_NAMES=} atom-names
]
if checksum [
cflags {-DCONFIG_CHECKSUM}
]
if eq? compress 'zlib [
cflags {-DCONFIG_COMPRESS=1}
win32 [libs either msvc [%zdll] [%z]]
macx [libs %z]
unix [libs %z]
]
if eq? compress 'bzip2 [
cflags {-DCONFIG_COMPRESS=2}
win32 [libs %libbz2]
macx [libs %bz2]
unix [libs %bz2]
]
if hashmap [
cflags {-DCONFIG_HASHMAP}
sources [%urlan/hashmap.c]
]
if execute [
cflags {-DCONFIG_EXECUTE}
]
if random [
cflags {-DCONFIG_RANDOM}
sources [
%support/well512.c
%eval/random.c
]
]
if ssl [
socket: true
cflags {-DCONFIG_SSL}
libs %mbedtls
]
if socket [
cflags {-DCONFIG_SOCKET}
sources [%eval/port_socket.c]
]
if timecode [
cflags {-DCONFIG_TIMECODE}
]
if thread [
cflags {-DCONFIG_THREAD}
linux [libs %pthread]
sources [%eval/port_thread.c]
]
if assemble [
cflags {-DCONFIG_ASSEMBLE}
libs %jit
]
;cflags {-DTRACK_MALLOC} sources [%urlan/memtrack.c]
sources_from %urlan [
%env.c
%array.c
%binary.c
%block.c
%coord.c
%date.c
%path.c
%string.c
%context.c
%gc.c
%serialize.c
%tokenize.c
%vector.c
%parse_block.c
%parse_string.c
]
sources [
%support/str.c
%support/mem_util.c
%support/quickSortIndex.c
%support/fpconv.c
%eval/boron.c
%eval/port_file.c
%eval/wait.c
]
macx [sources [%unix/os.c]]
unix [
sources [%unix/os.c]
libs %m
]
win32 [
sources [%win32/os.c]
ifn static [
lflags either msvc ["/def:win32\boron.def"]["win32/boron.def"]
]
libs %ws2_32
]
]
either static [
exe-libs: []
lib %boron bind lib-spec context [
libs: func [l] [append exe-libs l]
]
][
shlib [%boron 2,0,8] lib-spec
]
exe %boron [
win32 [
console
libs %ws2_32
readline: false
]
libs_from %. %boron
if static [
foreach l exe-libs [libs l]
]
switch readline [
linenoise [
cflags {-DCONFIG_LINENOISE}
sources [%support/linenoise.c]
]
gnu [
cflags {-DCONFIG_READLINE}
libs [%readline %history]
]
]
sources [
%eval/main.c
]
]