package compiler and linker metadata toolkit

meson.build 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. project('pkgconf', 'c',
  2. version : '1.6.0',
  3. license : 'ISC',
  4. meson_version : '>=0.40')
  5. cc = meson.get_compiler('c')
  6. cdata = configuration_data()
  7. check_headers = [
  8. ['HAVE_DLFCN_H', 'dlfcn.h'],
  9. ['HAVE_INTTYPES_H', 'inttypes.h'],
  10. ['HAVE_MEMORY_H', 'memory.h'],
  11. ['HAVE_STDINT_H', 'stdint.h'],
  12. ['HAVE_STDLIB_H', 'stdlib.h'],
  13. ['HAVE_STRINGS_H', 'strings.h'],
  14. ['HAVE_STRING_H', 'string.h'],
  15. ['HAVE_SYS_STAT_H', 'sys/stat.h'],
  16. ['HAVE_SYS_TYPES_H', 'sys/types.h'],
  17. ['HAVE_UNISTD_H', 'unistd.h'],
  18. ]
  19. foreach h : check_headers
  20. if cc.has_header(h.get(1))
  21. cdata.set(h.get(0), 1)
  22. endif
  23. endforeach
  24. check_functions = [
  25. ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', '#include<sys/cygwin.h>'],
  26. ['HAVE_STRLCAT', 'strlcat', '#include<string.h>'],
  27. ['HAVE_STRLCPY', 'strlcpy', '#include<string.h>'],
  28. ['HAVE_STRNDUP', 'strndup', '#include<string.h>'],
  29. ]
  30. foreach f : check_functions
  31. if cc.has_function(f.get(1), prefix : f.get(2))
  32. cdata.set(f.get(0), 1)
  33. endif
  34. endforeach
  35. default_path = []
  36. foreach f : ['libdir', 'datadir']
  37. default_path += [join_paths(get_option('prefix'), get_option(f), 'pkgconfig')]
  38. endforeach
  39. personality_path = []
  40. foreach f : ['libdir', 'datadir']
  41. personality_path += [join_paths(get_option('prefix'), get_option(f), 'pkgconfig', 'personality.d')]
  42. endforeach
  43. cdata.set_quoted('SYSTEM_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
  44. cdata.set_quoted('SYSTEM_INCLUDEDIR', join_paths(get_option('prefix'), get_option('includedir')))
  45. cdata.set_quoted('PKG_DEFAULT_PATH', ':'.join(default_path))
  46. cdata.set_quoted('PERSONALITY_PATH', ':'.join(personality_path))
  47. cdata.set_quoted('PACKAGE_NAME', meson.project_name())
  48. cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
  49. cdata.set_quoted('PACKAGE_BUGREPORT', 'http://github.com/pkgconf/pkgconf/issues')
  50. cdata.set('abs_top_srcdir', meson.source_root())
  51. cdata.set('abs_top_builddir', meson.build_root())
  52. subdir('libpkgconf')
  53. libpkgconf = shared_library('pkgconf',
  54. 'libpkgconf/argvsplit.c',
  55. 'libpkgconf/audit.c',
  56. 'libpkgconf/bsdstubs.c',
  57. 'libpkgconf/cache.c',
  58. 'libpkgconf/client.c',
  59. 'libpkgconf/dependency.c',
  60. 'libpkgconf/fileio.c',
  61. 'libpkgconf/fragment.c',
  62. 'libpkgconf/parser.c',
  63. 'libpkgconf/path.c',
  64. 'libpkgconf/personality.c',
  65. 'libpkgconf/pkg.c',
  66. 'libpkgconf/queue.c',
  67. 'libpkgconf/tuple.c',
  68. c_args: '-DLIBPKGCONF_EXPORT',
  69. install : true,
  70. version : '3.0.0',
  71. soversion : '3',
  72. )
  73. pkgconf_exe = executable('pkgconf',
  74. 'cli/main.c',
  75. 'cli/getopt_long.c',
  76. 'cli/renderer-msvc.c',
  77. link_with : libpkgconf,
  78. install : true)
  79. if get_option('tests')
  80. kyua_exe = find_program('kyua')
  81. atf_sh_exe = find_program('atf-sh')
  82. test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile=' + join_paths(meson.build_root(), 'Kyuafile'), '--build-root=' + meson.build_root()])
  83. configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata)
  84. subdir('tests')
  85. endif
  86. install_man('man/pkgconf.1')
  87. install_man('man/pkg.m4.7')
  88. install_man('man/pc.5')
  89. install_man('man/pkgconf-personality.5')
  90. install_data('pkg.m4', install_dir: 'share/aclocal')