configure: move directory options from config-host.mak to meson
Since installation is not part of Makefiles anymore, Make need not know the directories anymore. Meson already knows them through built-in options, do everything using them instead of the config_host dictionary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
fe0038bec2
commit
16bf7a3326
4
Makefile
4
Makefile
@ -99,6 +99,10 @@ ifeq ($(wildcard build.ninja),)
|
|||||||
.PHONY: config-host.mak
|
.PHONY: config-host.mak
|
||||||
x := $(shell rm -rf meson-private meson-info meson-logs)
|
x := $(shell rm -rf meson-private meson-info meson-logs)
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(origin prefix),file)
|
||||||
|
.PHONY: config-host.mak
|
||||||
|
x := $(shell rm -rf meson-private meson-info meson-logs)
|
||||||
|
endif
|
||||||
|
|
||||||
# 1. ensure config-host.mak is up-to-date
|
# 1. ensure config-host.mak is up-to-date
|
||||||
config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
|
config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
|
||||||
|
31
configure
vendored
31
configure
vendored
@ -1523,11 +1523,9 @@ for opt do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
firmwarepath="${firmwarepath:-$prefix/share/qemu-firmware}"
|
|
||||||
libdir="${libdir:-$prefix/lib}"
|
libdir="${libdir:-$prefix/lib}"
|
||||||
libexecdir="${libexecdir:-$prefix/libexec}"
|
libexecdir="${libexecdir:-$prefix/libexec}"
|
||||||
includedir="${includedir:-$prefix/include}"
|
includedir="${includedir:-$prefix/include}"
|
||||||
localedir="${localedir:-$datadir/locale}"
|
|
||||||
|
|
||||||
if test "$mingw32" = "yes" ; then
|
if test "$mingw32" = "yes" ; then
|
||||||
mandir="$prefix"
|
mandir="$prefix"
|
||||||
@ -1535,7 +1533,7 @@ if test "$mingw32" = "yes" ; then
|
|||||||
docdir="$prefix"
|
docdir="$prefix"
|
||||||
bindir="$prefix"
|
bindir="$prefix"
|
||||||
sysconfdir="$prefix"
|
sysconfdir="$prefix"
|
||||||
local_statedir=
|
local_statedir="$prefix"
|
||||||
else
|
else
|
||||||
mandir="${mandir:-$prefix/share/man}"
|
mandir="${mandir:-$prefix/share/man}"
|
||||||
datadir="${datadir:-$prefix/share}"
|
datadir="${datadir:-$prefix/share}"
|
||||||
@ -1544,6 +1542,8 @@ else
|
|||||||
sysconfdir="${sysconfdir:-$prefix/etc}"
|
sysconfdir="${sysconfdir:-$prefix/etc}"
|
||||||
local_statedir="${local_statedir:-$prefix/var}"
|
local_statedir="${local_statedir:-$prefix/var}"
|
||||||
fi
|
fi
|
||||||
|
firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
|
||||||
|
localedir="${localedir:-$datadir/locale}"
|
||||||
|
|
||||||
case "$cpu" in
|
case "$cpu" in
|
||||||
ppc)
|
ppc)
|
||||||
@ -5729,12 +5729,6 @@ if test "$mingw32" = "yes" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
qemu_confdir="$sysconfdir/$qemu_suffix"
|
|
||||||
qemu_moddir="$libdir/$qemu_suffix"
|
|
||||||
qemu_datadir="$datadir/$qemu_suffix"
|
|
||||||
qemu_icondir="$datadir/icons"
|
|
||||||
qemu_desktopdir="$datadir/applications"
|
|
||||||
|
|
||||||
# We can only support ivshmem if we have eventfd
|
# We can only support ivshmem if we have eventfd
|
||||||
if [ "$eventfd" = "yes" ]; then
|
if [ "$eventfd" = "yes" ]; then
|
||||||
ivshmem=yes
|
ivshmem=yes
|
||||||
@ -5901,23 +5895,6 @@ echo "# Automatically generated by configure - do not modify" > $config_host_mak
|
|||||||
echo >> $config_host_mak
|
echo >> $config_host_mak
|
||||||
|
|
||||||
echo all: >> $config_host_mak
|
echo all: >> $config_host_mak
|
||||||
echo "prefix=$prefix" >> $config_host_mak
|
|
||||||
echo "bindir=$bindir" >> $config_host_mak
|
|
||||||
echo "libdir=$libdir" >> $config_host_mak
|
|
||||||
echo "libexecdir=$libexecdir" >> $config_host_mak
|
|
||||||
echo "includedir=$includedir" >> $config_host_mak
|
|
||||||
echo "sysconfdir=$sysconfdir" >> $config_host_mak
|
|
||||||
echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
|
|
||||||
echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
|
|
||||||
echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak
|
|
||||||
echo "qemu_moddir=$qemu_moddir" >> $config_host_mak
|
|
||||||
if test "$mingw32" = "no" ; then
|
|
||||||
echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
echo "qemu_helperdir=$libexecdir" >> $config_host_mak
|
|
||||||
echo "qemu_localedir=$localedir" >> $config_host_mak
|
|
||||||
echo "qemu_icondir=$qemu_icondir" >> $config_host_mak
|
|
||||||
echo "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak
|
|
||||||
echo "GIT=$git" >> $config_host_mak
|
echo "GIT=$git" >> $config_host_mak
|
||||||
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
|
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
|
||||||
echo "GIT_UPDATE=$git_update" >> $config_host_mak
|
echo "GIT_UPDATE=$git_update" >> $config_host_mak
|
||||||
@ -7000,8 +6977,10 @@ NINJA=$ninja $meson setup \
|
|||||||
--datadir "$datadir" \
|
--datadir "$datadir" \
|
||||||
--mandir "$mandir" \
|
--mandir "$mandir" \
|
||||||
--sysconfdir "$sysconfdir" \
|
--sysconfdir "$sysconfdir" \
|
||||||
|
--localedir "$localedir" \
|
||||||
--localstatedir "$local_statedir" \
|
--localstatedir "$local_statedir" \
|
||||||
-Ddocdir="$docdir" \
|
-Ddocdir="$docdir" \
|
||||||
|
-Dqemu_firmwarepath="$firmwarepath" \
|
||||||
-Dqemu_suffix="$qemu_suffix" \
|
-Dqemu_suffix="$qemu_suffix" \
|
||||||
-Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
|
-Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
|
||||||
-Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
|
-Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
|
||||||
|
@ -9,6 +9,6 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \
|
|||||||
|
|
||||||
configure_file(input: '50-qemu-gpu.json.in',
|
configure_file(input: '50-qemu-gpu.json.in',
|
||||||
output: '50-qemu-gpu.json',
|
output: '50-qemu-gpu.json',
|
||||||
configuration: config_host,
|
configuration: { 'libexecdir' : get_option('libexecdir') },
|
||||||
install_dir: qemu_datadir / 'vhost-user')
|
install_dir: qemu_datadir / 'vhost-user')
|
||||||
endif
|
endif
|
||||||
|
47
meson.build
47
meson.build
@ -29,8 +29,14 @@ if get_option('qemu_suffix').startswith('/')
|
|||||||
error('qemu_suffix cannot start with a /')
|
error('qemu_suffix cannot start with a /')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
qemu_confdir = get_option('sysconfdir') / get_option('qemu_suffix')
|
||||||
qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
|
qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
|
||||||
qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
|
qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
|
||||||
|
qemu_moddir = get_option('libdir') / get_option('qemu_suffix')
|
||||||
|
|
||||||
|
qemu_desktopdir = get_option('datadir') / 'applications'
|
||||||
|
qemu_icondir = get_option('datadir') / 'icons'
|
||||||
|
|
||||||
config_host_data = configuration_data()
|
config_host_data = configuration_data()
|
||||||
genh = []
|
genh = []
|
||||||
|
|
||||||
@ -734,6 +740,19 @@ endif
|
|||||||
# config-host.h #
|
# config-host.h #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
|
config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir'))
|
||||||
|
config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix'))
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_DATADIR', get_option('prefix') / qemu_datadir)
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_DESKTOPDIR', get_option('prefix') / qemu_desktopdir)
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH', get_option('qemu_firmwarepath'))
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('prefix') / get_option('libexecdir'))
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_ICONDIR', get_option('prefix') / qemu_icondir)
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('prefix') / get_option('localedir'))
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') / get_option('localstatedir'))
|
||||||
|
config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir)
|
||||||
|
config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir'))
|
||||||
|
|
||||||
config_host_data.set('CONFIG_COCOA', cocoa.found())
|
config_host_data.set('CONFIG_COCOA', cocoa.found())
|
||||||
config_host_data.set('CONFIG_LIBUDEV', libudev.found())
|
config_host_data.set('CONFIG_LIBUDEV', libudev.found())
|
||||||
config_host_data.set('CONFIG_MPATH', mpathpersist.found())
|
config_host_data.set('CONFIG_MPATH', mpathpersist.found())
|
||||||
@ -756,9 +775,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]
|
|||||||
|
|
||||||
ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
|
ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
|
||||||
arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
|
arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
|
||||||
strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'bindir', 'prefix', 'qemu_confdir', 'qemu_datadir',
|
strings = ['HOST_DSOSUF', 'CONFIG_IASL']
|
||||||
'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir',
|
|
||||||
'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath', 'sysconfdir']
|
|
||||||
foreach k, v: config_host
|
foreach k, v: config_host
|
||||||
if ignored.contains(k)
|
if ignored.contains(k)
|
||||||
# do nothing
|
# do nothing
|
||||||
@ -1639,7 +1656,7 @@ foreach m : block_mods + softmmu_mods
|
|||||||
name_prefix: '',
|
name_prefix: '',
|
||||||
link_whole: m,
|
link_whole: m,
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: config_host['qemu_moddir'])
|
install_dir: qemu_moddir)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
|
softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
|
||||||
@ -1800,7 +1817,7 @@ foreach target : target_dirs
|
|||||||
output: exe['name'] + stp['ext'],
|
output: exe['name'] + stp['ext'],
|
||||||
capture: true,
|
capture: true,
|
||||||
install: stp['install'],
|
install: stp['install'],
|
||||||
install_dir: qemu_datadir / '../systemtap/tapset',
|
install_dir: get_option('datadir') / 'systemtap/tapset',
|
||||||
command: [
|
command: [
|
||||||
tracetool, '--group=all', '--format=' + stp['fmt'],
|
tracetool, '--group=all', '--format=' + stp['fmt'],
|
||||||
'--binary=' + stp['bin'],
|
'--binary=' + stp['bin'],
|
||||||
@ -1913,17 +1930,17 @@ endif
|
|||||||
#########################
|
#########################
|
||||||
|
|
||||||
summary_info = {}
|
summary_info = {}
|
||||||
summary_info += {'Install prefix': config_host['prefix']}
|
summary_info += {'Install prefix': get_option('prefix')}
|
||||||
summary_info += {'BIOS directory': config_host['qemu_datadir']}
|
summary_info += {'BIOS directory': qemu_datadir}
|
||||||
summary_info += {'firmware path': config_host['qemu_firmwarepath']}
|
summary_info += {'firmware path': get_option('qemu_firmwarepath')}
|
||||||
summary_info += {'binary directory': config_host['bindir']}
|
summary_info += {'binary directory': get_option('bindir')}
|
||||||
summary_info += {'library directory': config_host['libdir']}
|
summary_info += {'library directory': get_option('libdir')}
|
||||||
summary_info += {'module directory': config_host['qemu_moddir']}
|
summary_info += {'module directory': qemu_moddir}
|
||||||
summary_info += {'libexec directory': config_host['libexecdir']}
|
summary_info += {'libexec directory': get_option('libexecdir')}
|
||||||
summary_info += {'include directory': config_host['includedir']}
|
summary_info += {'include directory': get_option('includedir')}
|
||||||
summary_info += {'config directory': config_host['sysconfdir']}
|
summary_info += {'config directory': get_option('sysconfdir')}
|
||||||
if targetos != 'windows'
|
if targetos != 'windows'
|
||||||
summary_info += {'local state directory': config_host['qemu_localstatedir']}
|
summary_info += {'local state directory': get_option('localstatedir')}
|
||||||
summary_info += {'Manual directory': get_option('mandir')}
|
summary_info += {'Manual directory': get_option('mandir')}
|
||||||
else
|
else
|
||||||
summary_info += {'local state directory': 'queried at runtime'}
|
summary_info += {'local state directory': 'queried at runtime'}
|
||||||
|
@ -2,6 +2,8 @@ option('qemu_suffix', type : 'string', value: 'qemu',
|
|||||||
description: 'Suffix for QEMU data/modules/config directories (can be empty)')
|
description: 'Suffix for QEMU data/modules/config directories (can be empty)')
|
||||||
option('docdir', type : 'string', value : 'doc',
|
option('docdir', type : 'string', value : 'doc',
|
||||||
description: 'Base directory for documentation installation (can be empty)')
|
description: 'Base directory for documentation installation (can be empty)')
|
||||||
|
option('qemu_firmwarepath', type : 'string', value : '',
|
||||||
|
description: 'search PATH for firmware files')
|
||||||
option('sphinx_build', type : 'string', value : '',
|
option('sphinx_build', type : 'string', value : '',
|
||||||
description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)')
|
description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)')
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ foreach f: [
|
|||||||
]
|
]
|
||||||
configure_file(input: files(f),
|
configure_file(input: files(f),
|
||||||
output: f,
|
output: f,
|
||||||
configuration: {'DATADIR': config_host['qemu_datadir']},
|
configuration: {'DATADIR': qemu_datadir},
|
||||||
install: install_blobs,
|
install: install_blobs,
|
||||||
install_dir: qemu_datadir / 'firmware')
|
install_dir: qemu_datadir / 'firmware')
|
||||||
endforeach
|
endforeach
|
||||||
|
@ -86,7 +86,7 @@ blobs = files(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if install_blobs
|
if install_blobs
|
||||||
install_data(blobs, install_dir: config_host['qemu_datadir'])
|
install_data(blobs, install_dir: qemu_datadir)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('descriptors')
|
subdir('descriptors')
|
||||||
|
@ -15,5 +15,5 @@ executable('virtiofsd', files(
|
|||||||
|
|
||||||
configure_file(input: '50-qemu-virtiofsd.json.in',
|
configure_file(input: '50-qemu-virtiofsd.json.in',
|
||||||
output: '50-qemu-virtiofsd.json',
|
output: '50-qemu-virtiofsd.json',
|
||||||
configuration: config_host,
|
configuration: { 'libexecdir' : get_option('libexecdir') },
|
||||||
install_dir: qemu_datadir / 'vhost-user')
|
install_dir: qemu_datadir / 'vhost-user')
|
||||||
|
@ -2,12 +2,12 @@ foreach s: [16, 24, 32, 48, 64, 128, 256, 512]
|
|||||||
s = '@0@x@0@'.format(s.to_string())
|
s = '@0@x@0@'.format(s.to_string())
|
||||||
install_data('qemu_@0@.png'.format(s),
|
install_data('qemu_@0@.png'.format(s),
|
||||||
rename: 'qemu.png',
|
rename: 'qemu.png',
|
||||||
install_dir: config_host['qemu_icondir'] / 'hicolor' / s / 'apps')
|
install_dir: qemu_icondir / 'hicolor' / s / 'apps')
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
install_data('qemu_32x32.bmp',
|
install_data('qemu_32x32.bmp',
|
||||||
rename: 'qemu.bmp',
|
rename: 'qemu.bmp',
|
||||||
install_dir: config_host['qemu_icondir'] / 'hicolor' / '32x32' / 'apps')
|
install_dir: qemu_icondir / 'hicolor' / '32x32' / 'apps')
|
||||||
|
|
||||||
install_data('qemu.svg',
|
install_data('qemu.svg',
|
||||||
install_dir: config_host['qemu_icondir'] / 'hicolor' / 'scalable' / 'apps')
|
install_dir: qemu_icondir / 'hicolor' / 'scalable' / 'apps')
|
||||||
|
@ -139,7 +139,7 @@ subdir('shader')
|
|||||||
if have_system
|
if have_system
|
||||||
subdir('icons')
|
subdir('icons')
|
||||||
|
|
||||||
install_data('qemu.desktop', install_dir: config_host['qemu_desktopdir'])
|
install_data('qemu.desktop', install_dir: qemu_desktopdir)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
modules += {'ui': ui_modules}
|
modules += {'ui': ui_modules}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
@set VERSION @VERSION@
|
|
||||||
@set CONFDIR @qemu_confdir@
|
|
Loading…
Reference in New Issue
Block a user