meson: enable override of arch-independent pkg-config

Add meson_option pkgconfigdatadir to set the directory for
arch-independent pkg-config files.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
This commit is contained in:
heitbaum 2022-02-06 07:56:38 +00:00 committed by Rudi Heitbaum
parent 8c8bbb9034
commit c5f7524f62
2 changed files with 6 additions and 2 deletions

View file

@ -57,12 +57,14 @@ pc_data = configuration_data()
pc_data.set('prefix', get_option('prefix'))
# meson does not allow installing the includedir outside of the prefix
pc_data.set('includedir', '${prefix}/' + get_option('includedir'))
# Dirs of external packages
pkgconfigdatadir = get_option('pkgconfigdatadir') != '' ? get_option('pkgconfigdatadir') : get_option('datadir') / 'pkgconfig'
foreach pc : pcs
configure_file(
input : pc + '.pc.in',
output : pc + '.pc',
install_dir : get_option('datadir') + '/pkgconfig',
install_dir : pkgconfigdatadir,
configuration : pc_data,
)
endforeach
@ -100,7 +102,7 @@ if get_option('legacy') == true
configure_file(
input : pc + '.pc.in',
output : pc + '.pc',
install_dir : get_option('datadir') + '/pkgconfig',
install_dir : pkgconfigdatadir,
configuration : pc_data,
)
endforeach

View file

@ -1 +1,3 @@
option('legacy', type: 'boolean', value: false)
option('pkgconfigdatadir', type : 'string', value : '',
description : 'directory for arch-independent pkg-config files')