]> git.ipfire.org Git - thirdparty/util-linux.git/blob - libsmartcols/meson.build
567e58aa753ae7dd59f5097c7c801569f73d2a5e
[thirdparty/util-linux.git] / libsmartcols / meson.build
1 dir_libsmartcols = include_directories('.', 'src')
2
3 defs = configuration_data()
4 defs.set('LIBSMARTCOLS_VERSION', pc_version)
5
6 configure_file(
7 input : 'src/libsmartcols.h.in',
8 output : 'libsmartcols.h',
9 configuration : defs,
10 install : build_libsmartcols,
11 install_dir : join_paths(get_option('includedir'), 'libsmartcols'),
12 )
13
14 scols_bison = generator(
15 bison,
16 output : ['@BASENAME@.c'],
17 arguments : ['@INPUT@', '--output=@OUTPUT@'])
18 scols_parser_c = scols_bison.process('src/filter-parser.y')
19
20 scols_flex = generator(
21 flex,
22 output : ['@BASENAME@.c'],
23 arguments : ['--outfile=@OUTPUT@', '@INPUT@'])
24 scols_scanner_c = scols_flex.process('src/filter-scanner.l')
25
26 lib_smartcols_sources = '''
27 src/smartcolsP.h
28 src/iter.c
29 src/symbols.c
30 src/cell.c
31 src/column.c
32 src/line.c
33 src/table.c
34 src/print.c
35 src/print-api.c
36 src/version.c
37 src/calculate.c
38 src/grouping.c
39 src/walk.c
40 src/init.c
41 src/filter.c
42 src/filter-param.c
43 src/filter-expr.c
44 '''.split() \
45 + scols_parser_c + scols_scanner_c
46
47
48 libsmartcols_sym = 'src/libsmartcols.sym'
49 libsmartcols_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsmartcols_sym)
50
51 lib_smartcols = both_libraries(
52 'smartcols',
53 list_h,
54 lib_smartcols_sources,
55 include_directories : [dir_include, dir_libsmartcols],
56 link_depends : libsmartcols_sym,
57 version : libsmartcols_version,
58 link_args : ['-Wl,--version-script=@0@'.format(libsmartcols_sym_path)],
59 link_with : lib_common,
60 dependencies : build_libsmartcols ? [] : disabler(),
61 install : build_libsmartcols)
62 smartcols_dep = declare_dependency(link_with: lib_smartcols, include_directories: '.')
63
64 lib_smartcols_static = lib_smartcols.get_static_lib()
65
66 if build_libsmartcols
67 pkgconfig.generate(lib_smartcols,
68 description : 'table or tree library',
69 subdirs : 'libsmartcols',
70 version : pc_version)
71 if meson.version().version_compare('>=0.54.0')
72 meson.override_dependency('smartcols', smartcols_dep)
73 endif
74 endif