2017-06-20 00:11:42 +00:00
|
|
|
project('pkgconf', 'c',
|
2020-05-24 20:44:01 +00:00
|
|
|
version : '1.7.0',
|
2017-06-20 00:11:42 +00:00
|
|
|
license : 'ISC',
|
2019-07-12 13:20:05 +00:00
|
|
|
meson_version : '>=0.47')
|
2017-06-20 00:03:00 +00:00
|
|
|
|
2017-06-20 06:11:36 +00:00
|
|
|
|
2017-06-20 00:03:00 +00:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2017-06-20 06:11:36 +00:00
|
|
|
|
2017-06-20 00:03:00 +00:00
|
|
|
cdata = configuration_data()
|
|
|
|
check_headers = [
|
|
|
|
['HAVE_DLFCN_H', 'dlfcn.h'],
|
|
|
|
['HAVE_INTTYPES_H', 'inttypes.h'],
|
|
|
|
['HAVE_MEMORY_H', 'memory.h'],
|
|
|
|
['HAVE_STDINT_H', 'stdint.h'],
|
|
|
|
['HAVE_STDLIB_H', 'stdlib.h'],
|
|
|
|
['HAVE_STRINGS_H', 'strings.h'],
|
|
|
|
['HAVE_STRING_H', 'string.h'],
|
|
|
|
['HAVE_SYS_STAT_H', 'sys/stat.h'],
|
|
|
|
['HAVE_SYS_TYPES_H', 'sys/types.h'],
|
|
|
|
['HAVE_UNISTD_H', 'unistd.h'],
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach h : check_headers
|
|
|
|
if cc.has_header(h.get(1))
|
|
|
|
cdata.set(h.get(0), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
check_functions = [
|
2020-05-24 20:53:37 +00:00
|
|
|
['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', 'sys/cygwin.h'],
|
|
|
|
['HAVE_STRLCAT', 'strlcat', 'string.h'],
|
|
|
|
['HAVE_STRLCPY', 'strlcpy', 'string.h'],
|
|
|
|
['HAVE_STRNDUP', 'strndup', 'string.h'],
|
2017-06-20 00:03:00 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach f : check_functions
|
2020-05-24 20:53:37 +00:00
|
|
|
if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1))
|
2017-06-20 00:03:00 +00:00
|
|
|
cdata.set(f.get(0), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2017-06-20 06:23:55 +00:00
|
|
|
default_path = []
|
|
|
|
foreach f : ['libdir', 'datadir']
|
|
|
|
default_path += [join_paths(get_option('prefix'), get_option(f), 'pkgconfig')]
|
|
|
|
endforeach
|
|
|
|
|
2018-06-14 19:43:01 +00:00
|
|
|
personality_path = []
|
|
|
|
foreach f : ['libdir', 'datadir']
|
|
|
|
personality_path += [join_paths(get_option('prefix'), get_option(f), 'pkgconfig', 'personality.d')]
|
|
|
|
endforeach
|
|
|
|
|
2017-06-20 06:23:55 +00:00
|
|
|
cdata.set_quoted('SYSTEM_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
|
|
|
|
cdata.set_quoted('SYSTEM_INCLUDEDIR', join_paths(get_option('prefix'), get_option('includedir')))
|
|
|
|
cdata.set_quoted('PKG_DEFAULT_PATH', ':'.join(default_path))
|
2018-06-14 19:43:01 +00:00
|
|
|
cdata.set_quoted('PERSONALITY_PATH', ':'.join(personality_path))
|
2017-06-20 06:11:36 +00:00
|
|
|
cdata.set_quoted('PACKAGE_NAME', meson.project_name())
|
2017-06-20 00:03:00 +00:00
|
|
|
cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
|
2019-07-12 11:53:37 +00:00
|
|
|
cdata.set_quoted('PACKAGE_BUGREPORT', 'https://todo.sr.ht/~kaniini/pkgconf')
|
2017-06-20 06:11:36 +00:00
|
|
|
cdata.set('abs_top_srcdir', meson.source_root())
|
|
|
|
cdata.set('abs_top_builddir', meson.build_root())
|
2017-06-20 00:03:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
subdir('libpkgconf')
|
|
|
|
|
2017-06-20 00:11:42 +00:00
|
|
|
libpkgconf = shared_library('pkgconf',
|
2017-06-20 00:03:00 +00:00
|
|
|
'libpkgconf/argvsplit.c',
|
|
|
|
'libpkgconf/audit.c',
|
|
|
|
'libpkgconf/bsdstubs.c',
|
|
|
|
'libpkgconf/cache.c',
|
|
|
|
'libpkgconf/client.c',
|
|
|
|
'libpkgconf/dependency.c',
|
|
|
|
'libpkgconf/fileio.c',
|
|
|
|
'libpkgconf/fragment.c',
|
2018-05-10 02:21:39 +00:00
|
|
|
'libpkgconf/parser.c',
|
2017-06-20 00:03:00 +00:00
|
|
|
'libpkgconf/path.c',
|
2018-05-09 21:54:21 +00:00
|
|
|
'libpkgconf/personality.c',
|
2017-06-20 00:03:00 +00:00
|
|
|
'libpkgconf/pkg.c',
|
|
|
|
'libpkgconf/queue.c',
|
|
|
|
'libpkgconf/tuple.c',
|
2018-03-07 05:27:54 +00:00
|
|
|
c_args: '-DLIBPKGCONF_EXPORT',
|
2017-06-20 00:03:00 +00:00
|
|
|
install : true,
|
2018-01-05 17:18:19 +00:00
|
|
|
version : '3.0.0',
|
|
|
|
soversion : '3',
|
2017-06-20 00:03:00 +00:00
|
|
|
)
|
|
|
|
|
2017-06-20 06:11:36 +00:00
|
|
|
|
|
|
|
pkgconf_exe = executable('pkgconf',
|
2018-02-12 06:45:55 +00:00
|
|
|
'cli/main.c',
|
|
|
|
'cli/getopt_long.c',
|
|
|
|
'cli/renderer-msvc.c',
|
2017-06-20 00:11:42 +00:00
|
|
|
link_with : libpkgconf,
|
2017-06-20 00:03:00 +00:00
|
|
|
install : true)
|
|
|
|
|
2018-03-07 05:28:05 +00:00
|
|
|
if get_option('tests')
|
|
|
|
kyua_exe = find_program('kyua')
|
|
|
|
atf_sh_exe = find_program('atf-sh')
|
|
|
|
test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile=' + join_paths(meson.build_root(), 'Kyuafile'), '--build-root=' + meson.build_root()])
|
2017-06-20 06:11:36 +00:00
|
|
|
|
|
|
|
|
2018-03-07 05:28:05 +00:00
|
|
|
configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata)
|
|
|
|
subdir('tests')
|
|
|
|
endif
|
2017-06-20 06:11:36 +00:00
|
|
|
|
2017-12-06 00:45:06 +00:00
|
|
|
install_man('man/pkgconf.1')
|
2017-12-06 01:47:11 +00:00
|
|
|
install_man('man/pkg.m4.7')
|
2018-07-19 22:27:02 +00:00
|
|
|
install_man('man/pc.5')
|
|
|
|
install_man('man/pkgconf-personality.5')
|
2017-09-09 01:52:02 +00:00
|
|
|
install_data('pkg.m4', install_dir: 'share/aclocal')
|