source: mainline/meson/part/exports/meson.build@ 7749646

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 7749646 was 7749646, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 6 years ago

Add tools/export.sh to replace make export

  • Property mode set to 100644
File size: 1.5 KB
Line 
1## Generate config.mk, config.sh
2
3# Get the directory where the compiler resides.
4
5cc_fullname = run_command(which, meson.get_compiler('c').cmd_array()[0].split(' ')[0], check: true).stdout().strip()
6cc_path = run_command(dirname, cc_fullname, check: true).stdout().strip()
7
8message(['Compiler directory is:', cc_path])
9
10export_cppflags = [
11 '-isystem', '$(HELENOS_EXPORT_ROOT)/include/libposix',
12 '-isystem', '$(HELENOS_EXPORT_ROOT)/include/libc',
13 '-idirafter', '$(HELENOS_EXPORT_ROOT)/include',
14]
15
16export_ldflags = [
17 '-nostdlib',
18 '-L$(HELENOS_EXPORT_ROOT)/lib',
19 '-Wl,--whole-archive',
20 '$(HELENOS_EXPORT_ROOT)/lib/libstartfiles.a',
21 '-Wl,--no-whole-archive',
22]
23
24export_ldlibs = [
25 '-Wl,--as-needed',
26 '-lposix',
27 '-lmath',
28 '-lc',
29 '-lgcc',
30 '-Wl,--no-as-needed',
31]
32
33cc_arch = meson.get_cross_property('cc_arch')
34
35conf_data = configuration_data({
36 'HELENOS_CROSS_PATH' : cc_path,
37 'HELENOS_ARCH' : cc_arch,
38 'HELENOS_CFLAGS' : ' '.join(arch_uspace_c_args),
39 'HELENOS_CXXFLAGS' : ' '.join(arch_uspace_c_args),
40 'HELENOS_CPPFLAGS' : ' '.join(export_cppflags),
41 'HELENOS_LDFLAGS' : ' '.join(export_ldflags),
42 'HELENOS_LDLIBS' : ' '.join(export_ldlibs),
43 'HELENOS_TARGET' : cc_arch + '-helenos',
44})
45
46config_mk = configure_file(
47 input: 'config.mk.in',
48 output: 'config.mk',
49 configuration: conf_data,
50)
51
52config_sh = custom_target('config.sh',
53 input: config_mk,
54 output: 'config.sh',
55 command: [ sed, 's:$(HELENOS_EXPORT_ROOT):${HELENOS_EXPORT_ROOT}:g', '@INPUT@' ],
56 capture: true,
57)
Note: See TracBrowser for help on using the repository browser.