meson: Install items according to their relevance

The m4 and bash completion items are usable and relevant
depending on the host system's configuration.  So, we check for the
presence of the programs that these items depend on, and only install
them when those programs are found.

For the Valgrind suppression files, we don't install them on Windows as
Valgrind is currently not supported on Windows.

Als fix the path where the GDB helpers are installed, as the path is
incorrectly constructed.

This will fix the "install" stage when building on Visual Studio at
least as there are some post-install steps that are related to them,
which will make use of these programs.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
This commit is contained in:
Chun-wei Fan 2017-07-27 16:48:11 +08:00
parent fcf26cbf05
commit 915ab35e96
4 changed files with 37 additions and 21 deletions

View File

@ -693,13 +693,15 @@ endif
# subdir('fam')
#endif
install_data([
'completion/gapplication',
'completion/gdbus',
'completion/gsettings',
'completion/gresource'
],
install_dir: join_paths(get_option('datadir'), 'bash-completion/completions'))
if have_bash
install_data([
'completion/gapplication',
'completion/gdbus',
'completion/gsettings',
'completion/gresource'
],
install_dir: join_paths(get_option('datadir'), 'bash-completion/completions'))
endif
if enable_dtrace
gio_dtrace_obj = dtrace_obj_gen.process('gio_probes.d')

View File

@ -274,6 +274,7 @@ else
endif
install_data('gtester-report', install_dir : get_option('bindir'))
install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
gdb_conf = configuration_data()
@ -283,7 +284,7 @@ configure_file(
output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
configuration: gdb_conf,
install: true,
install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + glib_libdir)
install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + get_option('libdir'))
)
if enable_systemtap

View File

@ -102,7 +102,7 @@ configure_file(
output: 'libgobject-2.0.so.@0@-gdb.py'.format(library_version),
configuration: gdb_conf,
install: true,
install_dir: join_paths(get_option('datadir'), 'gdb/auto-load/' + glib_libdir)
install_dir: join_paths(get_option('datadir'), 'gdb/auto-load/' + get_option('libdir'))
)
if enable_systemtap

View File

@ -1499,6 +1499,11 @@ endif
python = import('python3').find_python()
# Determine which user environment-dependent files that we want to install
have_bash = find_program('bash', required : false).found() # For completion scripts
have_m4 = find_program('m4', required : false).found() # For m4 macros
have_sh = find_program('sh', required : false).found() # For glib-gettextize
# FIXME: defines in config.h that are not actually used anywhere
# (we add them for now to minimise the diff)
glib_conf.set('HAVE_DLFCN_H', 1)
@ -1608,19 +1613,27 @@ endforeach
# NOTE: We skip glib-zip.in because the filenames it assumes don't match ours
# Install glib-gettextize executable
configure_file(input : 'glib-gettextize.in',
install : true,
install_dir : 'bin',
output : 'glib-gettextize',
configuration : glib_conf)
# Install glib-gettextize executable, if a UNIX-style shell is found
if have_sh
configure_file(input : 'glib-gettextize.in',
install : true,
install_dir : 'bin',
output : 'glib-gettextize',
configuration : glib_conf)
endif
# Install m4 macros that other projects use
install_data('m4macros/glib-2.0.m4', 'm4macros/glib-gettext.m4', 'm4macros/gsettings.m4',
install_dir : join_paths(get_option('datadir'), 'aclocal'))
# Install Valgrind suppression file
install_data('glib.supp',
install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'valgrind'))
if have_m4
# Install m4 macros that other projects use
install_data('m4macros/glib-2.0.m4', 'm4macros/glib-gettext.m4', 'm4macros/gsettings.m4',
install_dir : join_paths(get_option('datadir'), 'aclocal'))
endif
if host_system != 'windows'
# Install Valgrind suppression file (except on Windows,
# as Valgrind is currently not supported on Windows)
install_data('glib.supp',
install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'valgrind'))
endif
configure_file(input : 'config.h.meson',
output : 'config.h',