[5fd05862] | 1 | # libarch
|
---|
| 2 | arch_src = []
|
---|
[5f176da] | 3 | subdir('arch' / UARCH)
|
---|
[5fd05862] | 4 |
|
---|
| 5 | c_args = [ '-fno-builtin', '-D_LIBC_SOURCE' ]
|
---|
| 6 |
|
---|
| 7 | root_path = '..' / '..' / '..'
|
---|
| 8 |
|
---|
| 9 | incdirs = [
|
---|
| 10 | 'include',
|
---|
[5f176da] | 11 | 'arch' / UARCH / 'include',
|
---|
| 12 | root_path / 'abi' / 'arch' / UARCH / 'include',
|
---|
[5fd05862] | 13 | root_path / 'abi' / 'include',
|
---|
| 14 | ]
|
---|
| 15 |
|
---|
| 16 | includes += include_directories(incdirs, is_system: true)
|
---|
| 17 |
|
---|
| 18 | allow_shared = true
|
---|
| 19 |
|
---|
| 20 | # FIXME: symlinks from uspace to kernel will break in future Meson version
|
---|
| 21 | # we should instead move the duplicated library parts into a shared location.
|
---|
| 22 |
|
---|
| 23 | if CONFIG_DEVEL_FILES
|
---|
[d63c842] | 24 | uspace_lib_install_script_text += 'mkdir -p "${MESON_INSTALL_DESTDIR_PREFIX}include/libc"'
|
---|
| 25 |
|
---|
[5fd05862] | 26 | foreach idir : incdirs
|
---|
[d63c842] | 27 | _sdir = meson.current_source_dir() / idir
|
---|
| 28 | uspace_lib_install_script_text += 'cp -R -L -T "@0@" "${MESON_INSTALL_DESTDIR_PREFIX}include/libc"'.format(_sdir)
|
---|
[5fd05862] | 29 | endforeach
|
---|
| 30 | endif
|
---|
| 31 |
|
---|
| 32 | src = [ arch_src ]
|
---|
| 33 |
|
---|
| 34 | src += files(
|
---|
| 35 | 'generic/libc.c',
|
---|
| 36 | 'generic/ddi.c',
|
---|
| 37 | 'generic/as.c',
|
---|
| 38 | 'generic/bd.c',
|
---|
| 39 | 'generic/bd_srv.c',
|
---|
| 40 | 'generic/perm.c',
|
---|
| 41 | 'generic/cap.c',
|
---|
| 42 | 'generic/clipboard.c',
|
---|
| 43 | 'generic/config.c',
|
---|
| 44 | 'generic/context.c',
|
---|
| 45 | 'generic/corecfg.c',
|
---|
| 46 | 'generic/ctype.c',
|
---|
| 47 | 'generic/devman.c',
|
---|
| 48 | 'generic/device/hw_res.c',
|
---|
| 49 | 'generic/device/hw_res_parsed.c',
|
---|
| 50 | 'generic/device/pio_window.c',
|
---|
| 51 | 'generic/device/clock_dev.c',
|
---|
| 52 | 'generic/device/led_dev.c',
|
---|
| 53 | 'generic/dirent.c',
|
---|
| 54 | 'generic/dhcp.c',
|
---|
| 55 | 'generic/dnsr.c',
|
---|
| 56 | 'generic/dlfcn.c',
|
---|
| 57 | 'generic/elf/elf.c',
|
---|
| 58 | 'generic/elf/elf_load.c',
|
---|
| 59 | 'generic/elf/elf_mod.c',
|
---|
| 60 | 'generic/event.c',
|
---|
| 61 | 'generic/errno.c',
|
---|
| 62 | 'generic/gsort.c',
|
---|
| 63 | 'generic/inttypes.c',
|
---|
| 64 | 'generic/ipc_test.c',
|
---|
| 65 | 'generic/loc.c',
|
---|
| 66 | 'generic/mem.c',
|
---|
| 67 | 'generic/str.c',
|
---|
| 68 | 'generic/string.c',
|
---|
| 69 | 'generic/str_error.c',
|
---|
| 70 | 'generic/strtol.c',
|
---|
| 71 | 'generic/l18n/langs.c',
|
---|
| 72 | 'generic/pcb.c',
|
---|
| 73 | 'generic/smc.c',
|
---|
| 74 | 'generic/task.c',
|
---|
| 75 | 'generic/imath.c',
|
---|
| 76 | 'generic/inet/addr.c',
|
---|
| 77 | 'generic/inet/endpoint.c',
|
---|
| 78 | 'generic/inet/host.c',
|
---|
| 79 | 'generic/inet/hostname.c',
|
---|
| 80 | 'generic/inet/hostport.c',
|
---|
| 81 | 'generic/inet/tcp.c',
|
---|
| 82 | 'generic/inet/udp.c',
|
---|
| 83 | 'generic/inet.c',
|
---|
| 84 | 'generic/inetcfg.c',
|
---|
| 85 | 'generic/inetping.c',
|
---|
| 86 | 'generic/io/asprintf.c',
|
---|
| 87 | 'generic/io/input.c',
|
---|
| 88 | 'generic/io/io.c',
|
---|
| 89 | 'generic/io/chardev.c',
|
---|
| 90 | 'generic/io/chardev_srv.c',
|
---|
| 91 | 'generic/io/chargrid.c',
|
---|
| 92 | 'generic/io/output.c',
|
---|
| 93 | 'generic/io/printf.c',
|
---|
| 94 | 'generic/io/log.c',
|
---|
| 95 | 'generic/io/logctl.c',
|
---|
| 96 | 'generic/io/label.c',
|
---|
| 97 | 'generic/io/kio.c',
|
---|
| 98 | 'generic/io/klog.c',
|
---|
| 99 | 'generic/io/serial.c',
|
---|
| 100 | 'generic/io/snprintf.c',
|
---|
| 101 | 'generic/io/vprintf.c',
|
---|
| 102 | 'generic/io/vsnprintf.c',
|
---|
| 103 | 'generic/io/printf_core.c',
|
---|
| 104 | 'generic/io/con_srv.c',
|
---|
| 105 | 'generic/io/console.c',
|
---|
| 106 | 'generic/io/table.c',
|
---|
| 107 | 'generic/io/visualizer.c',
|
---|
| 108 | 'generic/io/window.c',
|
---|
| 109 | 'generic/iplink.c',
|
---|
| 110 | 'generic/iplink_srv.c',
|
---|
| 111 | 'generic/irc.c',
|
---|
| 112 | 'generic/irq.c',
|
---|
| 113 | 'generic/ieee_double.c',
|
---|
| 114 | 'generic/power_of_ten.c',
|
---|
| 115 | 'generic/double_to_str.c',
|
---|
| 116 | 'generic/malloc.c',
|
---|
| 117 | 'generic/rndgen.c',
|
---|
| 118 | 'generic/stdio/scanf.c',
|
---|
| 119 | 'generic/stdio/sprintf.c',
|
---|
| 120 | 'generic/stdio/sscanf.c',
|
---|
| 121 | 'generic/stdio/sstream.c',
|
---|
| 122 | 'generic/stdio/vsprintf.c',
|
---|
| 123 | 'generic/thread/fibril.c',
|
---|
| 124 | 'generic/thread/fibril_synch.c',
|
---|
| 125 | 'generic/thread/thread.c',
|
---|
| 126 | 'generic/thread/tls.c',
|
---|
| 127 | 'generic/thread/futex.c',
|
---|
| 128 | 'generic/thread/mpsc.c',
|
---|
| 129 | 'generic/sysinfo.c',
|
---|
| 130 | 'generic/ipc.c',
|
---|
| 131 | 'generic/ns.c',
|
---|
| 132 | 'generic/async/client.c',
|
---|
| 133 | 'generic/async/server.c',
|
---|
| 134 | 'generic/async/ports.c',
|
---|
| 135 | 'generic/loader.c',
|
---|
| 136 | 'generic/getopt.c',
|
---|
| 137 | 'generic/adt/checksum.c',
|
---|
| 138 | 'generic/adt/circ_buf.c',
|
---|
| 139 | 'generic/adt/list.c',
|
---|
| 140 | 'generic/adt/hash_table.c',
|
---|
| 141 | 'generic/adt/odict.c',
|
---|
| 142 | 'generic/adt/prodcons.c',
|
---|
| 143 | 'generic/time.c',
|
---|
| 144 | 'generic/tmpfile.c',
|
---|
| 145 | 'generic/stdio.c',
|
---|
| 146 | 'generic/stdlib.c',
|
---|
| 147 | 'generic/udebug.c',
|
---|
| 148 | 'generic/vfs/canonify.c',
|
---|
| 149 | 'generic/vfs/inbox.c',
|
---|
| 150 | 'generic/vfs/mtab.c',
|
---|
| 151 | 'generic/vfs/vfs.c',
|
---|
| 152 | 'generic/setjmp.c',
|
---|
| 153 | 'generic/stack.c',
|
---|
| 154 | 'generic/stacktrace.c',
|
---|
| 155 | 'generic/arg_parse.c',
|
---|
| 156 | 'generic/stats.c',
|
---|
| 157 | 'generic/assert.c',
|
---|
| 158 | 'generic/bsearch.c',
|
---|
| 159 | 'generic/pci.c',
|
---|
| 160 | 'generic/pio_trace.c',
|
---|
| 161 | 'generic/qsort.c',
|
---|
| 162 | 'generic/ubsan.c',
|
---|
| 163 | 'generic/uuid.c',
|
---|
| 164 | 'generic/vbd.c',
|
---|
| 165 | 'generic/vol.c',
|
---|
| 166 | )
|
---|
| 167 |
|
---|
| 168 | if CONFIG_RTLD
|
---|
| 169 | src += files(
|
---|
| 170 | 'generic/rtld/rtld.c',
|
---|
| 171 | 'generic/rtld/dynamic.c',
|
---|
| 172 | 'generic/rtld/module.c',
|
---|
| 173 | 'generic/rtld/symbol.c',
|
---|
| 174 | )
|
---|
| 175 | endif
|
---|
| 176 |
|
---|
| 177 | test_src = files(
|
---|
| 178 | 'test/adt/circ_buf.c',
|
---|
| 179 | 'test/adt/odict.c',
|
---|
| 180 | 'test/cap.c',
|
---|
| 181 | 'test/casting.c',
|
---|
| 182 | 'test/double_to_str.c',
|
---|
| 183 | 'test/fibril/timer.c',
|
---|
| 184 | 'test/getopt.c',
|
---|
| 185 | 'test/gsort.c',
|
---|
| 186 | 'test/ieee_double.c',
|
---|
| 187 | 'test/imath.c',
|
---|
| 188 | 'test/inttypes.c',
|
---|
| 189 | 'test/io/table.c',
|
---|
| 190 | 'test/main.c',
|
---|
| 191 | 'test/mem.c',
|
---|
| 192 | 'test/perf.c',
|
---|
| 193 | 'test/perm.c',
|
---|
| 194 | 'test/qsort.c',
|
---|
| 195 | 'test/sprintf.c',
|
---|
| 196 | 'test/stdio/scanf.c',
|
---|
| 197 | 'test/stdio.c',
|
---|
| 198 | 'test/stdlib.c',
|
---|
| 199 | 'test/str.c',
|
---|
| 200 | 'test/string.c',
|
---|
| 201 | 'test/strtol.c',
|
---|
| 202 | 'test/uuid.c',
|
---|
| 203 | )
|
---|
| 204 |
|
---|
| 205 | # Startfiles.
|
---|
| 206 | # This is what other systems know as crt*.o files, i.e. a set of object files
|
---|
| 207 | # that are automatically built into every program binary (but not libraries).
|
---|
| 208 | # We haven't yet installed the object files where the compiler can find them,
|
---|
| 209 | # so we have to add them manually.
|
---|
| 210 | #
|
---|
| 211 |
|
---|
| 212 | start_src = [ arch_start_src, files('generic/crt/crt1.c') ]
|
---|
| 213 |
|
---|
| 214 | libstartfiles = static_library('startfiles', start_src,
|
---|
| 215 | include_directories: includes,
|
---|
[63660a3] | 216 | c_args: arch_uspace_c_args + c_args,
|
---|
[5fd05862] | 217 | install: CONFIG_DEVEL_FILES,
|
---|
| 218 | install_dir: 'lib',
|
---|
| 219 | pic: false,
|
---|
| 220 | )
|
---|
| 221 |
|
---|
| 222 | startfiles = libstartfiles.extract_all_objects()
|
---|