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
25 arm_gcc_path = "/home/netos/tools/gcc-arm-embedded/" ++
26 "gcc-arm-none-eabi-4_9-2014q4" ++
28 arm_gcc_prefix = "arm-none-eabi-"
29 arm_cc = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
30 arm_objcopy = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
31 arm_objdump = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
32 arm_ar = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
33 arm_ranlib = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
34 arm_cxx = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
39 k1om_cc = "k1om-mpss-linux-gcc"
40 k1om_objcopy = "k1om-mpss-linux-objcopy"
41 k1om_objdump = "k1om-mpss-linux-objdump"
42 k1om_ar = "k1om-mpss-linux-ar"
43 k1om_ranlib = "k1om-mpss-linux-anlib"
44 k1om_cxx = "k1om-mpss-linux-g++"
47 runghc = "runghc" -- run GHC interactively
48 circo = "circo" -- from graphviz
53 -- path to source and install directories; these are automatically set by hake.sh at setup time
55 -- source_dir = undefined -- (set by hake.sh, see end of file)
58 -- install_dir = undefined -- (set by hake.sh, see end of file)
60 -- Set of architectures for which to generate rules
61 architectures :: [String]
62 -- architectures = undefined -- (set by hake.sh, see end of file)
64 -- Optimisation flags (-Ox -g etc.) passed to compiler
66 cOptFlags = ["-g", "-O2"]
68 -- Selects which libc to compile with, "oldc" or "newlib"
73 newlib_malloc :: String
74 --newlib_malloc = "sbrk" -- use sbrk and newlib's malloc()
75 --newlib_malloc = "dlmalloc" -- use dlmalloc
76 newlib_malloc = "oldmalloc"
78 -- Configure pagesize for libbarrelfish's morecore implementation
79 -- x86_64 accepts "small", "large", and "huge" for 4kB, 2MB and 1GB pages
80 -- respectively. x86_32 accepts "small" and "large" for 4kB and 2MB/4MB pages
81 -- respectively. All other architectures default to their default page size.
82 morecore_pagesize :: String
83 morecore_pagesize = "small"
85 -- Use a frame pointer
89 -- Default timeslice duration in milliseconds
93 -- Put kernel into microbenchmarks mode
94 microbenchmarks :: Bool
95 microbenchmarks = False
101 -- Enable QEMU networking. (ie. make network work in small memory)
102 support_qemu_networking :: Bool
103 support_qemu_networking = False
105 -- armv7 platform to build for
106 -- Currently available: gem5, pandaboard
107 armv7_platform :: String
108 --armv7_platform = "gem5"
109 armv7_platform = "pandaboard"
111 -- on pandaboard, build a heterogenous image and let the cortex-A9 set up and start the
112 -- cortex-M3 processor (build targets "heteropanda_slave" and "heteropanda_master_image")
116 -- enable network tracing
117 trace_network_subsystem :: Bool
118 trace_network_subsystem = False
120 -- May want to disable LRPC to improve trace visuals
121 trace_disable_lrpc :: Bool
122 trace_disable_lrpc = False
125 use_kaluga_dvm :: Bool
126 use_kaluga_dvm = True
128 -- Domain and driver debugging
138 rtl8029_debug :: Bool
139 rtl8029_debug = False
144 libahci_debug :: Bool
145 libahci_debug = False
150 ethersrv_debug :: Bool
151 ethersrv_debug = False
156 libacpi_debug :: Bool
157 libacpi_debug = False
159 acpi_interface_debug :: Bool
160 acpi_interface_debug = False
162 lpc_timer_debug :: Bool
163 lpc_timer_debug = False
177 eclipse_kernel_debug :: Bool
178 eclipse_kernel_debug = False
183 skb_client_debug :: Bool
184 skb_client_debug = False
186 flounder_debug :: Bool
187 flounder_debug = False
189 flounder_failed_debug :: Bool
190 flounder_failed_debug = False
192 webserver_debug :: Bool
193 webserver_debug = False
195 sqlclient_debug :: Bool
196 sqlclient_debug = False
201 sqlite_backend_debug :: Bool
202 sqlite_backend_debug = False
210 loopback_debug :: Bool
211 loopback_debug = False
213 octopus_debug :: Bool
214 octopus_debug = False
222 -- Deadlock debugging
223 debug_deadlocks :: Bool
224 debug_deadlocks = False
226 -- Partitioned memory server
227 memserv_percore :: Bool
228 memserv_percore = False
230 -- Lazy THC implementation (requires use_fp = True)
232 lazy_thc | elem "armv7" architectures = False
233 | elem "armv5" architectures = False
234 | elem "xscale" architectures = False
237 -- Enable capability tracing debug facility
241 -- Mapping Database configuration options (this affects lib/mdb/)
242 -- enable extensive tracing of mapping db implementation
246 -- enable tracing of top level mdb_insert, mdb_remove calls
247 mdb_trace_no_recursive :: Bool
248 mdb_trace_no_recursive = False
250 -- fail on invariant violations
251 mdb_fail_invariants :: Bool
252 mdb_fail_invariants = True
254 -- check invariants before/after mdb_insert/mdb_remove.
255 mdb_check_invariants :: Bool
256 mdb_check_invariants = False
258 -- recheck invariants at each tracing point
259 mdb_recheck_invariants :: Bool
260 mdb_recheck_invariants = False
262 -- enable extensive tracing of mapping db implementation (userspace version)
263 mdb_trace_user :: Bool
264 mdb_trace_user = False
266 -- fail on invariant violations
267 mdb_fail_invariants_user :: Bool
268 mdb_fail_invariants_user = True
270 -- recheck invariants at each tracing point
271 mdb_recheck_invariants_user :: Bool
272 mdb_recheck_invariants_user = True
274 -- check invariants before/after mdb_insert/mdb_remove.
275 mdb_check_invariants_user :: Bool
276 mdb_check_invariants_user = True
279 data Scheduler = RBED | RR deriving (Show,Eq)
280 scheduler :: Scheduler
283 -- Physical Address Extensions (PAE)-enabled paging on x86-32
287 -- Page Size Extensions (PSE)-enabled paging on x86-32
288 -- Always enabled when pae_paging == True, regardless of value
292 -- No Execute Extensions (NXE)-enabled paging on x86-32
293 -- May not be True when pae_paging == False
297 oneshot_timer :: Bool
298 oneshot_timer = False
300 defines :: [RuleToken]
301 defines = [ Str ("-D" ++ d) | d <- [
302 if microbenchmarks then "CONFIG_MICROBENCHMARKS" else "",
303 if trace then "CONFIG_TRACE" else "",
304 if support_qemu_networking then "CONFIG_QEMU_NETWORK" else "",
305 if trace_network_subsystem then "NETWORK_STACK_TRACE" else "",
306 if trace_disable_lrpc then "TRACE_DISABLE_LRPC" else "",
307 if global_debug then "GLOBAL_DEBUG" else "",
308 if e1000n_debug then "E1000N_SERVICE_DEBUG" else "",
309 if ahcid_debug then "AHCI_SERVICE_DEBUG" else "",
310 if libahci_debug then "AHCI_LIB_DEBUG" else "",
311 if vfs_debug then "VFS_DEBUG" else "",
312 if eMAC_debug then "EMAC_SERVICE_DEBUG" else "",
313 if rtl8029_debug then "RTL8029_SERVICE_DEBUG" else "",
314 if ethersrv_debug then "ETHERSRV_SERVICE_DEBUG" else "",
315 if netd_debug then "NETD_SERVICE_DEBUG" else "",
316 if libacpi_debug then "ACPI_DEBUG_OUTPUT" else "",
317 if acpi_interface_debug then "ACPI_BF_DEBUG" else "",
318 if lpc_timer_debug then "LPC_TIMER_DEBUG" else "",
319 if lwip_debug then "LWIP_BARRELFISH_DEBUG" else "",
320 if libpci_debug then "PCI_CLIENT_DEBUG" else "",
321 if usrpci_debug then "PCI_SERVICE_DEBUG" else "",
322 if timer_debug then "TIMER_CLIENT_DEBUG" else "",
323 if eclipse_kernel_debug then "ECLIPSE_KERNEL_DEBUG" else "",
324 if skb_debug then "SKB_SERVICE_DEBUG" else "",
325 if skb_client_debug then "SKB_CLIENT_DEBUG" else "",
326 if flounder_debug then "FLOUNDER_DEBUG" else "",
327 if flounder_failed_debug then "FLOUNDER_FAILED_DEBUG" else "",
328 if webserver_debug then "WEBSERVER_DEBUG" else "",
329 if sqlclient_debug then "SQL_CLIENT_DEBUG" else "",
330 if sqlite_debug then "SQL_SERVICE_DEBUG" else "",
331 if sqlite_backend_debug then "SQL_BACKEND_DEBUG" else "",
332 if nfs_debug then "NFS_CLIENT_DEBUG" else "",
333 if rpc_debug then "RPC_DEBUG" else "",
334 if loopback_debug then "LOOPBACK_DEBUG" else "",
335 if octopus_debug then "DIST_SERVICE_DEBUG" else "",
336 if term_debug then "TERMINAL_LIBRARY_DEBUG" else "",
337 if serial_debug then "SERIAL_DRIVER_DEBUG" else "",
338 if debug_deadlocks then "CONFIG_DEBUG_DEADLOCKS" else "",
339 if memserv_percore then "CONFIG_MEMSERV_PERCORE" else "",
340 if lazy_thc then "CONFIG_LAZY_THC" else "",
341 if pae_paging then "CONFIG_PAE" else "",
342 if pse_paging then "CONFIG_PSE" else "",
343 if nxe_paging then "CONFIG_NXE" else "",
344 if libc == "oldc" then "CONFIG_OLDC" else "CONFIG_NEWLIB",
345 if oneshot_timer then "CONFIG_ONESHOT_TIMER" else "",
346 if use_kaluga_dvm then "USE_KALUGA_DVM" else "",
347 if heteropanda then "HETEROPANDA" else "",
348 if caps_trace then "TRACE_PMEM_CAPS" else ""
351 -- Sets the include path for the libc
353 libcInc = if libc == "oldc" then "/include/oldc"
354 else "/lib/newlib/newlib/libc/include"
356 -- Sets the include path for lwIP
358 lwipInc = "/lib/lwip/src/include"
360 lwipxxxInc = "/lib/lwip/src/include/ipv4"
362 -- some defines depend on the architecture/compile options
363 arch_defines :: Options -> [RuleToken]
365 -- enable config flags for interconnect drivers in use for this arch
367 | d <- ["CONFIG_INTERCONNECT_DRIVER_" ++ (map toUpper n)
368 | n <- optInterconnectDrivers opts]
370 -- enable config flags for flounder backends in use for this arch
372 | d <- ["CONFIG_FLOUNDER_BACKEND_" ++ (map toUpper n)
373 | n <- optFlounderBackends opts]
376 -- newlib common compile flags (maybe put these in a config.h file?)
377 newlibAddCFlags :: [String]
378 newlibAddCFlags = [ "-DPACKAGE_NAME=\"newlib\"" ,
379 "-DPACKAGE_TARNAME=\"newlib\"",
380 "-DPACKAGE_VERSION=\"1.19.0\"",
381 "-DPACKAGE_BUGREPORT=\"\"",
382 "-DPACKAGE_URL=\"\"",
383 "-D_I386MACH_ALLOW_HW_INTERRUPTS",
384 "-DMISSING_SYSCALL_NAMES",
385 "-D_WANT_IO_C99_FORMATS",
386 "-D_COMPILING_NEWLIB",
387 "-D_WANT_IO_LONG_LONG",
388 "-D_WANT_IO_LONG_DOUBLE",