[c21d4d6] | 1 | #
|
---|
| 2 | # Copyright (c) 2005 Martin Decky
|
---|
| 3 | # Copyright (c) 2007 Jakub Jermar
|
---|
| 4 | # All rights reserved.
|
---|
| 5 | #
|
---|
| 6 | # Redistribution and use in source and binary forms, with or without
|
---|
| 7 | # modification, are permitted provided that the following conditions
|
---|
| 8 | # are met:
|
---|
| 9 | #
|
---|
| 10 | # - Redistributions of source code must retain the above copyright
|
---|
| 11 | # notice, this list of conditions and the following disclaimer.
|
---|
| 12 | # - Redistributions in binary form must reproduce the above copyright
|
---|
| 13 | # notice, this list of conditions and the following disclaimer in the
|
---|
| 14 | # documentation and/or other materials provided with the distribution.
|
---|
| 15 | # - The name of the author may not be used to endorse or promote products
|
---|
| 16 | # derived from this software without specific prior written permission.
|
---|
| 17 | #
|
---|
| 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 28 | #
|
---|
| 29 |
|
---|
[5fd05862] | 30 | # libarch
|
---|
| 31 | arch_src = []
|
---|
[5f176da] | 32 | subdir('arch' / UARCH)
|
---|
[5fd05862] | 33 |
|
---|
| 34 | c_args = [ '-fno-builtin', '-D_LIBC_SOURCE' ]
|
---|
| 35 |
|
---|
| 36 | root_path = '..' / '..' / '..'
|
---|
| 37 |
|
---|
| 38 | incdirs = [
|
---|
| 39 | 'include',
|
---|
[5f176da] | 40 | 'arch' / UARCH / 'include',
|
---|
| 41 | root_path / 'abi' / 'arch' / UARCH / 'include',
|
---|
[5fd05862] | 42 | root_path / 'abi' / 'include',
|
---|
| 43 | ]
|
---|
| 44 |
|
---|
| 45 | includes += include_directories(incdirs, is_system: true)
|
---|
| 46 |
|
---|
| 47 | allow_shared = true
|
---|
| 48 |
|
---|
| 49 | # FIXME: symlinks from uspace to kernel will break in future Meson version
|
---|
| 50 | # we should instead move the duplicated library parts into a shared location.
|
---|
| 51 |
|
---|
[7749646] | 52 | uspace_lib_devel_install_script_text += 'mkdir -p "${DESTDIR}include/libc"'
|
---|
| 53 | foreach idir : incdirs
|
---|
| 54 | _sdir = meson.current_source_dir() / idir
|
---|
| 55 | uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/libc"'.format(_sdir)
|
---|
| 56 | endforeach
|
---|
[5fd05862] | 57 |
|
---|
| 58 | src = [ arch_src ]
|
---|
| 59 |
|
---|
| 60 | src += files(
|
---|
| 61 | 'generic/libc.c',
|
---|
| 62 | 'generic/as.c',
|
---|
[5fc8244] | 63 | 'generic/ddi.c',
|
---|
[5fd05862] | 64 | 'generic/perm.c',
|
---|
[c24b0dcb] | 65 | 'generic/capa.c',
|
---|
[5fd05862] | 66 | 'generic/clipboard.c',
|
---|
| 67 | 'generic/config.c',
|
---|
| 68 | 'generic/context.c',
|
---|
| 69 | 'generic/corecfg.c',
|
---|
| 70 | 'generic/ctype.c',
|
---|
[5fc8244] | 71 | 'generic/device/clock_dev.c',
|
---|
[5fd05862] | 72 | 'generic/device/hw_res.c',
|
---|
| 73 | 'generic/device/hw_res_parsed.c',
|
---|
| 74 | 'generic/device/pio_window.c',
|
---|
| 75 | 'generic/dirent.c',
|
---|
| 76 | 'generic/dlfcn.c',
|
---|
| 77 | 'generic/elf/elf.c',
|
---|
| 78 | 'generic/elf/elf_load.c',
|
---|
| 79 | 'generic/elf/elf_mod.c',
|
---|
| 80 | 'generic/event.c',
|
---|
| 81 | 'generic/errno.c',
|
---|
| 82 | 'generic/gsort.c',
|
---|
| 83 | 'generic/inttypes.c',
|
---|
| 84 | 'generic/ipc_test.c',
|
---|
| 85 | 'generic/loc.c',
|
---|
| 86 | 'generic/mem.c',
|
---|
| 87 | 'generic/str.c',
|
---|
| 88 | 'generic/string.c',
|
---|
| 89 | 'generic/str_error.c',
|
---|
| 90 | 'generic/strtol.c',
|
---|
| 91 | 'generic/l18n/langs.c',
|
---|
| 92 | 'generic/pcb.c',
|
---|
[5fc8244] | 93 | 'generic/pio_trace.c',
|
---|
[5fd05862] | 94 | 'generic/smc.c',
|
---|
| 95 | 'generic/task.c',
|
---|
| 96 | 'generic/imath.c',
|
---|
| 97 | 'generic/io/asprintf.c',
|
---|
| 98 | 'generic/io/input.c',
|
---|
| 99 | 'generic/io/io.c',
|
---|
| 100 | 'generic/io/chargrid.c',
|
---|
| 101 | 'generic/io/output.c',
|
---|
| 102 | 'generic/io/printf.c',
|
---|
| 103 | 'generic/io/log.c',
|
---|
| 104 | 'generic/io/logctl.c',
|
---|
| 105 | 'generic/io/kio.c',
|
---|
| 106 | 'generic/io/klog.c',
|
---|
| 107 | 'generic/io/snprintf.c',
|
---|
| 108 | 'generic/io/vprintf.c',
|
---|
| 109 | 'generic/io/vsnprintf.c',
|
---|
| 110 | 'generic/io/printf_core.c',
|
---|
| 111 | 'generic/io/con_srv.c',
|
---|
| 112 | 'generic/io/console.c',
|
---|
| 113 | 'generic/io/table.c',
|
---|
| 114 | 'generic/irq.c',
|
---|
| 115 | 'generic/ieee_double.c',
|
---|
| 116 | 'generic/power_of_ten.c',
|
---|
| 117 | 'generic/double_to_str.c',
|
---|
| 118 | 'generic/malloc.c',
|
---|
| 119 | 'generic/rndgen.c',
|
---|
| 120 | 'generic/stdio/scanf.c',
|
---|
| 121 | 'generic/stdio/sprintf.c',
|
---|
| 122 | 'generic/stdio/sscanf.c',
|
---|
| 123 | 'generic/stdio/sstream.c',
|
---|
| 124 | 'generic/stdio/vsprintf.c',
|
---|
| 125 | 'generic/thread/fibril.c',
|
---|
| 126 | 'generic/thread/fibril_synch.c',
|
---|
| 127 | 'generic/thread/thread.c',
|
---|
| 128 | 'generic/thread/tls.c',
|
---|
| 129 | 'generic/thread/futex.c',
|
---|
| 130 | 'generic/thread/mpsc.c',
|
---|
| 131 | 'generic/sysinfo.c',
|
---|
| 132 | 'generic/ipc.c',
|
---|
| 133 | 'generic/ns.c',
|
---|
| 134 | 'generic/async/client.c',
|
---|
| 135 | 'generic/async/server.c',
|
---|
| 136 | 'generic/async/ports.c',
|
---|
| 137 | 'generic/loader.c',
|
---|
| 138 | 'generic/getopt.c',
|
---|
| 139 | 'generic/adt/checksum.c',
|
---|
| 140 | 'generic/adt/circ_buf.c',
|
---|
| 141 | 'generic/adt/list.c',
|
---|
| 142 | 'generic/adt/hash_table.c',
|
---|
| 143 | 'generic/adt/odict.c',
|
---|
| 144 | 'generic/adt/prodcons.c',
|
---|
| 145 | 'generic/time.c',
|
---|
| 146 | 'generic/tmpfile.c',
|
---|
| 147 | 'generic/stdio.c',
|
---|
| 148 | 'generic/stdlib.c',
|
---|
| 149 | 'generic/udebug.c',
|
---|
| 150 | 'generic/vfs/canonify.c',
|
---|
| 151 | 'generic/vfs/inbox.c',
|
---|
| 152 | 'generic/vfs/mtab.c',
|
---|
| 153 | 'generic/vfs/vfs.c',
|
---|
| 154 | 'generic/setjmp.c',
|
---|
| 155 | 'generic/stack.c',
|
---|
| 156 | 'generic/stacktrace.c',
|
---|
| 157 | 'generic/arg_parse.c',
|
---|
| 158 | 'generic/stats.c',
|
---|
| 159 | 'generic/assert.c',
|
---|
| 160 | 'generic/bsearch.c',
|
---|
| 161 | 'generic/qsort.c',
|
---|
| 162 | 'generic/ubsan.c',
|
---|
| 163 | 'generic/uuid.c',
|
---|
| 164 | )
|
---|
| 165 |
|
---|
| 166 | if CONFIG_RTLD
|
---|
| 167 | src += files(
|
---|
| 168 | 'generic/rtld/rtld.c',
|
---|
| 169 | 'generic/rtld/dynamic.c',
|
---|
| 170 | 'generic/rtld/module.c',
|
---|
| 171 | 'generic/rtld/symbol.c',
|
---|
| 172 | )
|
---|
| 173 | endif
|
---|
| 174 |
|
---|
| 175 | test_src = files(
|
---|
| 176 | 'test/adt/circ_buf.c',
|
---|
| 177 | 'test/adt/odict.c',
|
---|
[c24b0dcb] | 178 | 'test/capa.c',
|
---|
[5fd05862] | 179 | 'test/casting.c',
|
---|
| 180 | 'test/double_to_str.c',
|
---|
| 181 | 'test/fibril/timer.c',
|
---|
| 182 | 'test/getopt.c',
|
---|
| 183 | 'test/gsort.c',
|
---|
| 184 | 'test/ieee_double.c',
|
---|
| 185 | 'test/imath.c',
|
---|
| 186 | 'test/inttypes.c',
|
---|
| 187 | 'test/io/table.c',
|
---|
| 188 | 'test/main.c',
|
---|
| 189 | 'test/mem.c',
|
---|
| 190 | 'test/perf.c',
|
---|
| 191 | 'test/perm.c',
|
---|
| 192 | 'test/qsort.c',
|
---|
| 193 | 'test/sprintf.c',
|
---|
| 194 | 'test/stdio/scanf.c',
|
---|
| 195 | 'test/stdio.c',
|
---|
| 196 | 'test/stdlib.c',
|
---|
| 197 | 'test/str.c',
|
---|
| 198 | 'test/string.c',
|
---|
| 199 | 'test/strtol.c',
|
---|
| 200 | 'test/uuid.c',
|
---|
| 201 | )
|
---|
| 202 |
|
---|
| 203 | # Startfiles.
|
---|
| 204 | # This is what other systems know as crt*.o files, i.e. a set of object files
|
---|
| 205 | # that are automatically built into every program binary (but not libraries).
|
---|
| 206 | # We haven't yet installed the object files where the compiler can find them,
|
---|
| 207 | # so we have to add them manually.
|
---|
| 208 | #
|
---|
| 209 |
|
---|
| 210 | start_src = [ arch_start_src, files('generic/crt/crt1.c') ]
|
---|
| 211 |
|
---|
| 212 | libstartfiles = static_library('startfiles', start_src,
|
---|
| 213 | include_directories: includes,
|
---|
[63660a3] | 214 | c_args: arch_uspace_c_args + c_args,
|
---|
[5fd05862] | 215 | pic: false,
|
---|
| 216 | )
|
---|
| 217 |
|
---|
[fa5ab58] | 218 | if CONFIG_DEVEL_FILES
|
---|
| 219 | install_files += [[ 'lib', libstartfiles.full_path(), 'libstartfiles.a' ]]
|
---|
[123cd6d] | 220 | install_deps += [ libstartfiles ]
|
---|
[fa5ab58] | 221 | endif
|
---|