File: meson.build

package info (click to toggle)
thunk-gen 1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 148 kB
  • sloc: yacc: 654; lex: 88; sh: 76; makefile: 3
file content (54 lines) | stat: -rw-r--r-- 2,155 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
project('thunk_gen', 'c', version: '1.8')

subdir('src')
pkg = import('pkgconfig')
if meson.version().version_compare('>=0.56')
UV = ['binary=' + meson.project_build_root() / 'src' /
       meson.project_name(),
      'tgscript=' + meson.project_source_root() / 'scripts/tg_m4',
      'pdscript=' + meson.project_source_root() / 'scripts/parse_decls.sh',
      'mkadscript=' + meson.project_source_root() / 'scripts/mkasmdefs.sh',
      'm4script=' + meson.project_source_root() / 'scripts/thunks.m4',
      'makeinc=' + meson.project_source_root() / 'scripts/thunk_gen.mk'
     ]
else
UV = []
endif
pkg.generate(
  name: meson.project_name(),
  description: 'thunk generator',
  # we need sdkdir as buildroot prefixes it with sysroot path
  variables: [
              'sdkdir=${prefix}',
              'binary=${sdkdir}' / get_option('libexecdir') /
               meson.project_name() / meson.project_name(),
              'tgscript=${sdkdir}' / get_option('libexecdir') /
               meson.project_name() / 'tg_m4',
              'pdscript=${sdkdir}' / get_option('libexecdir') /
               meson.project_name() / 'parse_decls.sh',
              'mkadscript=${sdkdir}' / get_option('libexecdir') /
               meson.project_name() / 'mkasmdefs.sh',
              'm4script=${sdkdir}' / get_option('datadir') /
               meson.project_name() / 'thunks.m4',
              'makeinc=${sdkdir}' / get_option('datadir') /
               meson.project_name() / 'thunk_gen.mk'
             ],
  uninstalled_variables: UV,
  install_dir: get_option('datadir') / 'pkgconfig',
)

if not meson.is_subproject()
  install_data(['scripts/thunks.m4', 'scripts/thunk_gen.mk'],
    install_dir: get_option('prefix') / get_option('datadir') /
      meson.project_name())
  install_data(['scripts/tg_m4', 'scripts/parse_decls.sh',
              'scripts/mkasmdefs.sh'],
    install_dir: get_option('prefix') / get_option('libexecdir') /
      meson.project_name())
endif

dep = declare_dependency(variables: UV)
if meson.version().version_compare('>=0.54')
  meson.override_dependency('thunk_gen', dep)
  meson.override_find_program('thunk_gen', exe)
endif