meson.build 2.4 KB

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