-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfigure.ac
More file actions
355 lines (310 loc) · 7.2 KB
/
configure.ac
File metadata and controls
355 lines (310 loc) · 7.2 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
LT_PREREQ([2.4.6])
AC_PREREQ([2.71])
AC_INIT([bolthur-kernel], [0.1.0-dev], [https://github.com/bolthur/kernel/issues], [bolthur-kernel], [https://github.com/bolthur/kernel])
AC_COPYRIGHT([Copyright (C) 2018 - 2025 bolthur project])
AC_CONFIG_AUX_DIR([build-aux/config])
AC_CONFIG_MACRO_DIR([build-aux/m4])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([nostdinc subdir-objects -Werror])
AC_LANG([C])
AC_ARG_ENABLE([device],
AS_HELP_STRING(
[--enable-device],
[set target device to compile for [possible targets: raspi0_1, raspi2b_r1, raspi3b]]
),
[enable_device=$enableval],
[AC_MSG_ERROR([Target device missing])]
)
AC_ARG_ENABLE(
[output],
AS_HELP_STRING(
[--enable-output],
[activate kernel output [default: off]]
),
[enable_output=yes]
)
AC_ARG_ENABLE(
[output-mm-phys],
AS_HELP_STRING(
[--enable-output-mm-phys],
[activate physical memory mapping output [default: off]]
),
[enable_output_mm_phys=yes]
)
AC_ARG_ENABLE(
[output-mm-virt],
AS_HELP_STRING(
[--enable-output-mm-virt],
[activate virtual memory mapping output [default: off]]
),
[enable_output_mm_virt=yes]
)
AC_ARG_ENABLE(
[output-mm-heap],
AS_HELP_STRING(
[--enable-output-mm-heap],
[activate heap output [default: off]]
),
[enable_output_mm_heap=yes]
)
AC_ARG_ENABLE(
[output-mm-shared],
AS_HELP_STRING(
[--enable-output-mm-shared],
[activate shared memory output [default: off]]
),
[enable_output_mm_shared=yes]
)
AC_ARG_ENABLE(
[output-mailbox],
AS_HELP_STRING(
[--enable-output-mailbox],
[activate mailbox output [default: off]]
),
[enable_output_mailbox=yes]
)
AC_ARG_ENABLE(
[output-timer],
AS_HELP_STRING(
[--enable-output-timer],
[activate timer output [default: off]]
),
[enable_output_timer=yes]
)
AC_ARG_ENABLE(
[output-initrd],
AS_HELP_STRING(
[--enable-output-initrd],
[activate initrd output [default: off]]
),
[enable_output_initrd=yes]
)
AC_ARG_ENABLE(
[output-event],
AS_HELP_STRING(
[--enable-output-event],
[activate event output [default: off]]
),
[enable_output_event=yes]
)
AC_ARG_ENABLE(
[output-process],
AS_HELP_STRING(
[--enable-output-process],
[activate task output [default: off]]
),
[enable_output_process=yes]
)
AC_ARG_ENABLE(
[output-interrupt],
AS_HELP_STRING(
[--enable-output-interrupt],
[activate interrupt output [default: off]]
),
[enable_output_interrupt=yes]
)
AC_ARG_ENABLE(
[output-exception],
AS_HELP_STRING(
[--enable-output-exception],
[activate exception output [default: off]]
),
[enable_output_exception=yes]
)
AC_ARG_ENABLE(
[output-elf],
AS_HELP_STRING(
[--enable-output-elf],
[activate elf output [default: off]]
),
[enable_output_elf=yes]
)
AC_ARG_ENABLE(
[output-syscall],
AS_HELP_STRING(
[--enable-output-syscall],
[activate syscall output [default: off]]
),
[enable_output_syscall=yes]
)
AC_ARG_ENABLE(
[output-serial],
AS_HELP_STRING(
[--enable-output-serial],
[activate serial handling output [default: off]]
),
[enable_output_serial=yes]
)
AC_ARG_ENABLE(
[output-message],
AS_HELP_STRING(
[--enable-output-message],
[activate message output [default: off]]
),
[enable_output_message=yes]
)
AC_ARG_ENABLE(
[output-rpc],
AS_HELP_STRING(
[--enable-output-rpc],
[activate rpc output [default: off]]
),
[enable_output_rpc=yes]
)
AC_ARG_ENABLE(
[output-ssp],
AS_HELP_STRING(
[--enable-output-ssp],
[activate ssp origin output [default: off]]
),
[enable_output_ssp=yes]
)
AC_ARG_ENABLE(
[remote-debug],
AS_HELP_STRING(
[--enable-remote-debug],
[activate remote debugging [default: off]]
),
[enable_remote_debug=yes]
)
AC_ARG_ENABLE(
[release],
AS_HELP_STRING(
[--enable-release],
[activate release build [default: off]]
),
[enable_release=yes]
)
AC_ARG_WITH(
[optimization-level],
AS_HELP_STRING(
[--with-optimization-level],
[compile with specific code optimization level [possible values: 0, 1, 2, 3, s, g | default: 2]]
),
[with_optimization_level=$withval]
)
AC_ARG_WITH(
[debug-symbols],
AS_HELP_STRING(
[--with-debug-symbols],
[compile with debug symbols]
),
[with_debug_debug_symbols=yes]
)
# enable output and enable remote debugging together is not allowed
AS_IF([test "x$enable_output" == "xyes" && test "x$enable_remote_debug" == "xyes"], [
AC_MSG_ERROR([Enabled kernel output and remote debug are not possible at the same time])
])
# enable output and enable remote debugging together is not allowed
AS_IF([test "x$enable_debug" == "xyes" && test "x$enable_release" == "xyes"], [
AC_MSG_ERROR([Enabled debug and release are not possible at the same time])
])
# check necessary programs
BOLTHUR_PROG_READLINK
# set program
BOLTHUR_LANG_PROGRAM
# set target and flags
BOLTHUR_SET_DEVICE
BOLTHUR_KERNEL_SET_HOST
# checks for programs
AC_PROG_CC
AM_PROG_AS
BOLTHUR_PROG_OBJCOPY
BOLTHUR_PROG_STRIP
# prepare cppecheck stuff
BOLTHUR_PREPARE_CPPCHECK
# add directory for ramdisk
AC_SUBST(ROOT_DIR, $($BOLTHUR_READLINK -f ${srcdir}))
AC_SUBST(BUILD_DIR, $($BOLTHUR_READLINK -f ${ac_pwd}))
AC_SUBST(SYSROOT_DIR, $(dirname $(dirname $($BOLTHUR_READLINK -f $($CC $CFLAGS --print-file-name=libc.a)))))
# doxygen stuff
DX_DOXYGEN_FEATURE(ON)
DX_HTML_FEATURE(ON)
DX_MAN_FEATURE(ON)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN([bolthur/kernel], [$(srcdir)/doxyfile], [doc])
# checks for programs
AC_PROG_CC
AM_PROG_AS
BOLTHUR_PROG_OBJCOPY
BOLTHUR_PROG_STRIP
# get host cpu count
AX_COUNT_CPUS
AC_SUBST(CPU_COUNT)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_C_RESTRICT
# init libtool
LT_INIT([disable-shared static])
LT_LANG([C])
# embed git revision and compiler
AC_DEFINE_UNQUOTED(
[PACKAGE_REVISION],
["m4_esyscmd_s([git describe --always])"],
[Define to the revision of this package.]
)
AC_DEFINE_UNQUOTED(
[PACKAGE_COMPILER],
["$CC"],
[Define to the used compiler of this package.]
)
# Some compiler dependent features.
AC_DEFINE_UNQUOTED(
[__allocator],
[__attribute__((malloc))],
[Keyword for mark something as allocator.]
)
AC_DEFINE_UNQUOTED(
[__packed],
[__attribute__((__packed__))],
[Keyword for packing structures.]
)
AC_DEFINE_UNQUOTED(
[__section(x)],
[__attribute__((__section__(x)))],
[Keyword for section placement.]
)
AC_DEFINE_UNQUOTED(
[__aligned(x)],
[__attribute__((__aligned__(x)))],
[Keyword for alignment.]
)
AC_DEFINE_UNQUOTED(
[__no_optimization],
[__attribute__((__optimize__("O0")))],
[Disable optimization]
)
AC_DEFINE_UNQUOTED(
[__no_sanitize],
[__attribute__((no_sanitize("undefined")))],
[disable undefined behaviour sanitization]
)
AC_DEFINE_UNQUOTED(
[__no_stack_protector],
[__attribute__((__optimize__("no-stack-protector")))],
[disable stack protector mechanism]
)
AC_DEFINE_UNQUOTED(
[__bootstrap],
[__attribute__((__section__(".text.boot"),__optimize__("O0","no-stack-protector"), no_sanitize("undefined")))],
[Bootstrap function]
)
AC_DEFINE_UNQUOTED(
[__bootstrap_data],
[__section(".data.boot")],
[Bootstrap data]
)
AC_CONFIG_FILES([
Makefile
bolthur/Makefile
])
AC_CONFIG_SUBDIRS([
bolthur/application
bolthur/library
bolthur/kernel
bolthur/server
])
AC_OUTPUT