meson.build 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. project('tang', 'c',
  2. version: '8',
  3. license: 'GPL3+',
  4. default_options: [
  5. 'c_std=c99',
  6. 'prefix=/usr',
  7. 'sysconfdir=/etc',
  8. 'localstatedir=/var',
  9. 'warning_level=3',
  10. 'werror=true'
  11. ]
  12. )
  13. libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
  14. sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
  15. bindir = join_paths(get_option('prefix'), get_option('bindir'))
  16. systemunitdir = join_paths(get_option('prefix'), 'lib/systemd/system')
  17. licensedir = join_paths(get_option('prefix'), 'share', 'licenses', meson.project_name())
  18. jwkdir = join_paths(get_option('localstatedir'), 'db', meson.project_name())
  19. data = configuration_data()
  20. data.set('libexecdir', libexecdir)
  21. data.set('sysconfdir', sysconfdir)
  22. data.set('systemunitdir', systemunitdir)
  23. data.set('jwkdir', jwkdir)
  24. add_project_arguments(
  25. '-D_POSIX_C_SOURCE=200809L',
  26. '-Wstrict-aliasing',
  27. '-Wchar-subscripts',
  28. '-Wformat',
  29. '-Wformat-security',
  30. '-Wmissing-declarations',
  31. '-Wmissing-prototypes',
  32. '-Wnested-externs',
  33. '-Wpointer-arith',
  34. '-Wshadow',
  35. '-Wsign-compare',
  36. '-Wstrict-prototypes',
  37. '-Wtype-limits',
  38. '-Wunused-function',
  39. '-Wno-missing-field-initializers',
  40. '-Wno-unused-parameter',
  41. '-Wno-pedantic',
  42. language: 'c'
  43. )
  44. jose = dependency('jose', version: '>=8')
  45. a2x = find_program('a2x', required: false)
  46. compiler = meson.get_compiler('c')
  47. if not compiler.has_header('http_parser.h')
  48. error('http-parser devel files not found.')
  49. endif
  50. http_parser = compiler.find_library('http_parser')
  51. licenses = ['COPYING']
  52. libexecbins = []
  53. bins = []
  54. mans = []
  55. units = []
  56. subdir('doc')
  57. subdir('src')
  58. subdir('units')
  59. subdir('tests')
  60. install_data(libexecbins, install_dir: libexecdir)
  61. install_data(bins, install_dir: bindir)
  62. install_data(units, install_dir: systemunitdir)
  63. install_data(licenses, install_dir: licensedir)
  64. if a2x.found()
  65. foreach m : mans
  66. custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
  67. command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
  68. install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
  69. install: true
  70. )
  71. endforeach
  72. else
  73. warning('Will not build man pages due to missing a2x (asciidoc) dependency!')
  74. endif
  75. # vim:set ts=2 sw=2 et: