1 --------------------------------------------------------------------------
2 -- Copyright (c) 2007-2010, 2012, 2013, 2015 ETH Zurich.
3 -- Copyright (c) 2014, HP Labs.
4 -- All rights reserved.
6 -- This file is distributed under the terms in the attached LICENSE file.
7 -- If you do not find this file, copies can be found by writing to:
8 -- ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
9 -- Attn: Systems Group.
11 -- Configuration options for Hake
13 --------------------------------------------------------------------------
23 -- Toolchain definitions. By default, these rely on $PATH
27 arm_gnu_path = "/home/netos/tools/gcc-arm-embedded/" ++
28 "gcc-arm-none-eabi-4_9-2014q4" ++
30 arm_gnu_prefix = "arm-none-eabi-"
31 arm_gnu_tool = findTool arm_gnu_path arm_gnu_prefix
33 arm_cc = arm_gnu_tool "gcc"
34 arm_objcopy = arm_gnu_tool "objcopy"
35 arm_objdump = arm_gnu_tool "objdump"
36 arm_ar = arm_gnu_tool "ar"
37 arm_ranlib = arm_gnu_tool "ranlib"
38 arm_cxx = arm_gnu_tool "g++"
43 k1om_cc = "k1om-mpss-linux-gcc"
44 k1om_objcopy = "k1om-mpss-linux-objcopy"
45 k1om_objdump = "k1om-mpss-linux-objdump"
46 k1om_ar = "k1om-mpss-linux-ar"
47 k1om_ranlib = "k1om-mpss-linux-anlib"
48 k1om_cxx = "k1om-mpss-linux-g++"
51 runghc = "runghc" -- run GHC interactively
52 circo = "circo" -- from graphviz
57 -- path to source and install directories; these are automatically set by hake.sh at setup time
59 -- source_dir = undefined -- (set by hake.sh, see end of file)
62 -- install_dir = undefined -- (set by hake.sh, see end of file)
64 -- Set of architectures for which to generate rules
65 architectures :: [String]
66 -- architectures = undefined -- (set by hake.sh, see end of file)
68 -- Optimisation flags (-Ox -g etc.) passed to compiler
70 cOptFlags = ["-g", "-O2"]
72 -- Selects which libc to compile with, "oldc" or "newlib"
77 newlib_malloc :: String
78 --newlib_malloc = "sbrk" -- use sbrk and newlib's malloc()
79 --newlib_malloc = "dlmalloc" -- use dlmalloc
80 newlib_malloc = "oldmalloc"
82 -- Configure pagesize for libbarrelfish's morecore implementation
83 -- x86_64 accepts "small", "large", and "huge" for 4kB, 2MB and 1GB pages
84 -- respectively. x86_32 accepts "small" and "large" for 4kB and 2MB/4MB pages
85 -- respectively. All other architectures default to their default page size.
86 morecore_pagesize :: String
87 morecore_pagesize = "small"
89 -- Use a frame pointer
93 -- Default timeslice duration in milliseconds
97 -- Put kernel into microbenchmarks mode
98 microbenchmarks :: Bool
99 microbenchmarks = False
105 -- Enable QEMU networking. (ie. make network work in small memory)
106 support_qemu_networking :: Bool
107 support_qemu_networking = False
109 -- armv7 platform to build for
110 -- Currently available: gem5, pandaboard
111 armv7_platform :: String
112 --armv7_platform = "gem5"
113 armv7_platform = "pandaboard"
115 -- on pandaboard, build a heterogenous image and let the cortex-A9 set up and start the
116 -- cortex-M3 processor (build targets "heteropanda_slave" and "heteropanda_master_image")
120 -- enable network tracing
121 trace_network_subsystem :: Bool
122 trace_network_subsystem = False
124 -- May want to disable LRPC to improve trace visuals
125 trace_disable_lrpc :: Bool
126 trace_disable_lrpc = False
129 use_kaluga_dvm :: Bool
130 use_kaluga_dvm = True
132 -- Domain and driver debugging
142 rtl8029_debug :: Bool
143 rtl8029_debug = False
148 libahci_debug :: Bool
149 libahci_debug = False
154 ethersrv_debug :: Bool
155 ethersrv_debug = False
160 libacpi_debug :: Bool
161 libacpi_debug = False
163 acpi_interface_debug :: Bool
164 acpi_interface_debug = False
166 lpc_timer_debug :: Bool
167 lpc_timer_debug = False
181 eclipse_kernel_debug :: Bool
182 eclipse_kernel_debug = False
187 skb_client_debug :: Bool
188 skb_client_debug = False
190 flounder_debug :: Bool
191 flounder_debug = False
193 flounder_failed_debug :: Bool
194 flounder_failed_debug = False
196 webserver_debug :: Bool
197 webserver_debug = False
199 sqlclient_debug :: Bool
200 sqlclient_debug = False
205 sqlite_backend_debug :: Bool
206 sqlite_backend_debug = False
214 loopback_debug :: Bool
215 loopback_debug = False
217 octopus_debug :: Bool
218 octopus_debug = False
226 -- Deadlock debugging
227 debug_deadlocks :: Bool
228 debug_deadlocks = False
230 -- Partitioned memory server
231 memserv_percore :: Bool
232 memserv_percore = False
234 -- Lazy THC implementation (requires use_fp = True)
236 lazy_thc | elem "armv7" architectures = False
237 | elem "armv5" architectures = False
238 | elem "xscale" architectures = False
241 -- Enable capability tracing debug facility
245 -- Mapping Database configuration options (this affects lib/mdb/)
246 -- enable extensive tracing of mapping db implementation
250 -- enable tracing of top level mdb_insert, mdb_remove calls
251 mdb_trace_no_recursive :: Bool
252 mdb_trace_no_recursive = False
254 -- fail on invariant violations
255 mdb_fail_invariants :: Bool
256 mdb_fail_invariants = True
258 -- check invariants before/after mdb_insert/mdb_remove.
259 mdb_check_invariants :: Bool
260 mdb_check_invariants = False
262 -- recheck invariants at each tracing point
263 mdb_recheck_invariants :: Bool
264 mdb_recheck_invariants = False
266 -- enable extensive tracing of mapping db implementation (userspace version)
267 mdb_trace_user :: Bool
268 mdb_trace_user = False
270 -- fail on invariant violations
271 mdb_fail_invariants_user :: Bool
272 mdb_fail_invariants_user = True
274 -- recheck invariants at each tracing point
275 mdb_recheck_invariants_user :: Bool
276 mdb_recheck_invariants_user = True
278 -- check invariants before/after mdb_insert/mdb_remove.
279 mdb_check_invariants_user :: Bool
280 mdb_check_invariants_user = True
283 data Scheduler = RBED | RR deriving (Show,Eq)
284 scheduler :: Scheduler
287 -- Physical Address Extensions (PAE)-enabled paging on x86-32
291 -- Page Size Extensions (PSE)-enabled paging on x86-32
292 -- Always enabled when pae_paging == True, regardless of value
296 -- No Execute Extensions (NXE)-enabled paging on x86-32
297 -- May not be True when pae_paging == False
301 oneshot_timer :: Bool
302 oneshot_timer = False
304 defines :: [RuleToken]
305 defines = [ Str ("-D" ++ d) | d <- [
306 if microbenchmarks then "CONFIG_MICROBENCHMARKS" else "",
307 if trace then "CONFIG_TRACE" else "",
308 if support_qemu_networking then "CONFIG_QEMU_NETWORK" else "",
309 if trace_network_subsystem then "NETWORK_STACK_TRACE" else "",
310 if trace_disable_lrpc then "TRACE_DISABLE_LRPC" else "",
311 if global_debug then "GLOBAL_DEBUG" else "",
312 if e1000n_debug then "E1000N_SERVICE_DEBUG" else "",
313 if ahcid_debug then "AHCI_SERVICE_DEBUG" else "",
314 if libahci_debug then "AHCI_LIB_DEBUG" else "",
315 if vfs_debug then "VFS_DEBUG" else "",
316 if eMAC_debug then "EMAC_SERVICE_DEBUG" else "",
317 if rtl8029_debug then "RTL8029_SERVICE_DEBUG" else "",
318 if ethersrv_debug then "ETHERSRV_SERVICE_DEBUG" else "",
319 if netd_debug then "NETD_SERVICE_DEBUG" else "",
320 if libacpi_debug then "ACPI_DEBUG_OUTPUT" else "",
321 if acpi_interface_debug then "ACPI_BF_DEBUG" else "",
322 if lpc_timer_debug then "LPC_TIMER_DEBUG" else "",
323 if lwip_debug then "LWIP_BARRELFISH_DEBUG" else "",
324 if libpci_debug then "PCI_CLIENT_DEBUG" else "",
325 if usrpci_debug then "PCI_SERVICE_DEBUG" else "",
326 if timer_debug then "TIMER_CLIENT_DEBUG" else "",
327 if eclipse_kernel_debug then "ECLIPSE_KERNEL_DEBUG" else "",
328 if skb_debug then "SKB_SERVICE_DEBUG" else "",
329 if skb_client_debug then "SKB_CLIENT_DEBUG" else "",
330 if flounder_debug then "FLOUNDER_DEBUG" else "",
331 if flounder_failed_debug then "FLOUNDER_FAILED_DEBUG" else "",
332 if webserver_debug then "WEBSERVER_DEBUG" else "",
333 if sqlclient_debug then "SQL_CLIENT_DEBUG" else "",
334 if sqlite_debug then "SQL_SERVICE_DEBUG" else "",
335 if sqlite_backend_debug then "SQL_BACKEND_DEBUG" else "",
336 if nfs_debug then "NFS_CLIENT_DEBUG" else "",
337 if rpc_debug then "RPC_DEBUG" else "",
338 if loopback_debug then "LOOPBACK_DEBUG" else "",
339 if octopus_debug then "DIST_SERVICE_DEBUG" else "",
340 if term_debug then "TERMINAL_LIBRARY_DEBUG" else "",
341 if serial_debug then "SERIAL_DRIVER_DEBUG" else "",
342 if debug_deadlocks then "CONFIG_DEBUG_DEADLOCKS" else "",
343 if memserv_percore then "CONFIG_MEMSERV_PERCORE" else "",
344 if lazy_thc then "CONFIG_LAZY_THC" else "",
345 if pae_paging then "CONFIG_PAE" else "",
346 if pse_paging then "CONFIG_PSE" else "",
347 if nxe_paging then "CONFIG_NXE" else "",
348 if libc == "oldc" then "CONFIG_OLDC" else "CONFIG_NEWLIB",
349 if oneshot_timer then "CONFIG_ONESHOT_TIMER" else "",
350 if use_kaluga_dvm then "USE_KALUGA_DVM" else "",
351 if heteropanda then "HETEROPANDA" else "",
352 if caps_trace then "TRACE_PMEM_CAPS" else ""
355 -- Sets the include path for the libc
357 libcInc = if libc == "oldc" then "/include/oldc"
358 else "/lib/newlib/newlib/libc/include"
360 -- Sets the include path for lwIP
362 lwipInc = "/lib/lwip/src/include"
364 lwipxxxInc = "/lib/lwip/src/include/ipv4"
366 -- some defines depend on the architecture/compile options
367 arch_defines :: Options -> [RuleToken]
369 -- enable config flags for interconnect drivers in use for this arch
371 | d <- ["CONFIG_INTERCONNECT_DRIVER_" ++ (map toUpper n)
372 | n <- optInterconnectDrivers opts]
374 -- enable config flags for flounder backends in use for this arch
376 | d <- ["CONFIG_FLOUNDER_BACKEND_" ++ (map toUpper n)
377 | n <- optFlounderBackends opts]
380 -- newlib common compile flags (maybe put these in a config.h file?)
381 newlibAddCFlags :: [String]
382 newlibAddCFlags = [ "-DPACKAGE_NAME=\"newlib\"" ,
383 "-DPACKAGE_TARNAME=\"newlib\"",
384 "-DPACKAGE_VERSION=\"1.19.0\"",
385 "-DPACKAGE_BUGREPORT=\"\"",
386 "-DPACKAGE_URL=\"\"",
387 "-D_I386MACH_ALLOW_HW_INTERRUPTS",
388 "-DMISSING_SYSCALL_NAMES",
389 "-D_WANT_IO_C99_FORMATS",
390 "-D_COMPILING_NEWLIB",
391 "-D_WANT_IO_LONG_LONG",
392 "-D_WANT_IO_LONG_DOUBLE",