configure: move GTK+ detection to Meson
This also allows removing CONFIG_NEED_X11, all the ingredients can be computed easily in meson.build. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9d71037f4b
commit
1b6954713f
|
@ -414,7 +414,7 @@ cfi="false"
|
||||||
cfi_debug="false"
|
cfi_debug="false"
|
||||||
seccomp="auto"
|
seccomp="auto"
|
||||||
glusterfs="auto"
|
glusterfs="auto"
|
||||||
gtk="$default_feature"
|
gtk="auto"
|
||||||
tls_priority="NORMAL"
|
tls_priority="NORMAL"
|
||||||
gnutls="$default_feature"
|
gnutls="$default_feature"
|
||||||
nettle="$default_feature"
|
nettle="$default_feature"
|
||||||
|
@ -1377,9 +1377,9 @@ for opt do
|
||||||
--enable-uuid|--disable-uuid)
|
--enable-uuid|--disable-uuid)
|
||||||
echo "$0: $opt is obsolete, UUID support is always built" >&2
|
echo "$0: $opt is obsolete, UUID support is always built" >&2
|
||||||
;;
|
;;
|
||||||
--disable-gtk) gtk="no"
|
--disable-gtk) gtk="disabled"
|
||||||
;;
|
;;
|
||||||
--enable-gtk) gtk="yes"
|
--enable-gtk) gtk="enabled"
|
||||||
;;
|
;;
|
||||||
--tls-priority=*) tls_priority="$optarg"
|
--tls-priority=*) tls_priority="$optarg"
|
||||||
;;
|
;;
|
||||||
|
@ -2329,10 +2329,10 @@ if test "$cocoa" = "enabled"; then
|
||||||
if test "$sdl" = "enabled"; then
|
if test "$sdl" = "enabled"; then
|
||||||
error_exit "Cocoa and SDL UIs cannot both be enabled at once"
|
error_exit "Cocoa and SDL UIs cannot both be enabled at once"
|
||||||
fi
|
fi
|
||||||
if test "$gtk" = "yes"; then
|
if test "$gtk" = "enabled"; then
|
||||||
error_exit "Cocoa and GTK UIs cannot both be enabled at once"
|
error_exit "Cocoa and GTK UIs cannot both be enabled at once"
|
||||||
fi
|
fi
|
||||||
gtk=no
|
gtk=disabled
|
||||||
sdl=disabled
|
sdl=disabled
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2759,31 +2759,6 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
|
||||||
# GTK probe
|
|
||||||
|
|
||||||
if test "$gtk" != "no"; then
|
|
||||||
gtkpackage="gtk+-3.0"
|
|
||||||
gtkx11package="gtk+-x11-3.0"
|
|
||||||
gtkversion="3.22.0"
|
|
||||||
if $pkg_config --exists "$gtkpackage >= $gtkversion"; then
|
|
||||||
gtk_cflags=$($pkg_config --cflags $gtkpackage)
|
|
||||||
gtk_libs=$($pkg_config --libs $gtkpackage)
|
|
||||||
gtk_version=$($pkg_config --modversion $gtkpackage)
|
|
||||||
if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
|
|
||||||
need_x11=yes
|
|
||||||
gtk_cflags="$gtk_cflags $x11_cflags"
|
|
||||||
gtk_libs="$gtk_libs $x11_libs"
|
|
||||||
fi
|
|
||||||
gtk="yes"
|
|
||||||
elif test "$gtk" = "yes"; then
|
|
||||||
feature_not_found "gtk" "Install gtk3-devel"
|
|
||||||
else
|
|
||||||
gtk="no"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# GNUTLS probe
|
# GNUTLS probe
|
||||||
|
|
||||||
|
@ -3640,16 +3615,6 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$opengl" = "yes" && test "$have_x11" = "yes"; then
|
|
||||||
for target in $target_list; do
|
|
||||||
case $target in
|
|
||||||
lm32-softmmu) # milkymist-tmu2 requires X11 and OpenGL
|
|
||||||
need_x11=yes
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# libxml2 probe
|
# libxml2 probe
|
||||||
if test "$libxml2" != "no" ; then
|
if test "$libxml2" != "no" ; then
|
||||||
|
@ -5673,9 +5638,6 @@ fi
|
||||||
if test "$module_upgrades" = "yes"; then
|
if test "$module_upgrades" = "yes"; then
|
||||||
echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
|
echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
|
||||||
fi
|
fi
|
||||||
if test "$need_x11" = "yes"; then
|
|
||||||
echo "CONFIG_NEED_X11=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
if test "$pipe2" = "yes" ; then
|
if test "$pipe2" = "yes" ; then
|
||||||
echo "CONFIG_PIPE2=y" >> $config_host_mak
|
echo "CONFIG_PIPE2=y" >> $config_host_mak
|
||||||
fi
|
fi
|
||||||
|
@ -5763,11 +5725,6 @@ fi
|
||||||
if test "$bswap_h" = "yes" ; then
|
if test "$bswap_h" = "yes" ; then
|
||||||
echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
|
echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
|
||||||
fi
|
fi
|
||||||
if test "$gtk" = "yes" ; then
|
|
||||||
echo "CONFIG_GTK=y" >> $config_host_mak
|
|
||||||
echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
|
|
||||||
echo "GTK_LIBS=$gtk_libs" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
if test "$gio" = "yes" ; then
|
if test "$gio" = "yes" ; then
|
||||||
echo "CONFIG_GIO=y" >> $config_host_mak
|
echo "CONFIG_GIO=y" >> $config_host_mak
|
||||||
echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
|
echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
|
||||||
|
@ -6501,7 +6458,7 @@ NINJA=$ninja $meson setup \
|
||||||
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
|
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
|
||||||
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
|
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
|
||||||
-Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
|
-Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
|
||||||
-Dcocoa=$cocoa -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \
|
-Dcocoa=$cocoa -Dgtk=$gtk -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \
|
||||||
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
|
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
|
||||||
-Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \
|
-Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \
|
||||||
-Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \
|
-Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \
|
||||||
|
|
29
meson.build
29
meson.build
|
@ -776,19 +776,31 @@ if 'CONFIG_OPENGL' in config_host
|
||||||
opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
|
opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
|
||||||
link_args: config_host['OPENGL_LIBS'].split())
|
link_args: config_host['OPENGL_LIBS'].split())
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gtk = not_found
|
gtk = not_found
|
||||||
if 'CONFIG_GTK' in config_host
|
gtkx11 = not_found
|
||||||
gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
|
if not get_option('gtk').auto() or have_system
|
||||||
link_args: config_host['GTK_LIBS'].split())
|
gtk = dependency('gtk+-3.0', version: '>=3.22.0',
|
||||||
|
method: 'pkg-config',
|
||||||
|
required: get_option('gtk'),
|
||||||
|
static: enable_static)
|
||||||
|
if gtk.found()
|
||||||
|
gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
|
||||||
|
method: 'pkg-config',
|
||||||
|
required: false,
|
||||||
|
static: enable_static)
|
||||||
|
gtk = declare_dependency(dependencies: [gtk, gtkx11])
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
vte = not_found
|
vte = not_found
|
||||||
if 'CONFIG_VTE' in config_host
|
if 'CONFIG_VTE' in config_host
|
||||||
vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
|
vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
|
||||||
link_args: config_host['VTE_LIBS'].split())
|
link_args: config_host['VTE_LIBS'].split())
|
||||||
endif
|
endif
|
||||||
x11 = not_found
|
x11 = not_found
|
||||||
if config_host.has_key('CONFIG_NEED_X11')
|
if gtkx11.found() or 'lm32-softmmu' in target_dirs
|
||||||
x11 = dependency('x11', method: 'pkg-config', required: false,
|
x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found(),
|
||||||
static: enable_static)
|
static: enable_static)
|
||||||
endif
|
endif
|
||||||
vnc = not_found
|
vnc = not_found
|
||||||
|
@ -1062,6 +1074,7 @@ if glusterfs.found()
|
||||||
config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat)
|
config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat)
|
||||||
config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat)
|
config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat)
|
||||||
endif
|
endif
|
||||||
|
config_host_data.set('CONFIG_GTK', gtk.found())
|
||||||
config_host_data.set('CONFIG_LIBATTR', have_old_libattr)
|
config_host_data.set('CONFIG_LIBATTR', have_old_libattr)
|
||||||
config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found())
|
config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found())
|
||||||
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
|
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
|
||||||
|
@ -2230,7 +2243,7 @@ subdir('tools')
|
||||||
subdir('pc-bios')
|
subdir('pc-bios')
|
||||||
subdir('docs')
|
subdir('docs')
|
||||||
subdir('tests')
|
subdir('tests')
|
||||||
if 'CONFIG_GTK' in config_host
|
if gtk.found()
|
||||||
subdir('po')
|
subdir('po')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -2247,7 +2260,7 @@ if host_machine.system() == 'windows'
|
||||||
if build_docs
|
if build_docs
|
||||||
nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
|
nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
|
||||||
endif
|
endif
|
||||||
if 'CONFIG_GTK' in config_host
|
if gtk.found()
|
||||||
nsis_cmd += '-DCONFIG_GTK=y'
|
nsis_cmd += '-DCONFIG_GTK=y'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -2338,7 +2351,7 @@ endif
|
||||||
summary_info += {'SDL support': sdl.found()}
|
summary_info += {'SDL support': sdl.found()}
|
||||||
summary_info += {'SDL image support': sdl_image.found()}
|
summary_info += {'SDL image support': sdl_image.found()}
|
||||||
# TODO: add back version
|
# TODO: add back version
|
||||||
summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
|
summary_info += {'GTK support': gtk.found()}
|
||||||
summary_info += {'pixman': pixman.found()}
|
summary_info += {'pixman': pixman.found()}
|
||||||
# TODO: add back version
|
# TODO: add back version
|
||||||
summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
|
summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
|
||||||
|
|
|
@ -74,6 +74,8 @@ option('lzo', type : 'feature', value : 'auto',
|
||||||
description: 'lzo compression support')
|
description: 'lzo compression support')
|
||||||
option('rbd', type : 'feature', value : 'auto',
|
option('rbd', type : 'feature', value : 'auto',
|
||||||
description: 'Ceph block device driver')
|
description: 'Ceph block device driver')
|
||||||
|
option('gtk', type : 'feature', value : 'auto',
|
||||||
|
description: 'GTK+ user interface')
|
||||||
option('sdl', type : 'feature', value : 'auto',
|
option('sdl', type : 'feature', value : 'auto',
|
||||||
description: 'SDL user interface')
|
description: 'SDL user interface')
|
||||||
option('sdl_image', type : 'feature', value : 'auto',
|
option('sdl_image', type : 'feature', value : 'auto',
|
||||||
|
|
|
@ -57,7 +57,7 @@ if config_host.has_key('CONFIG_OPENGL_DMABUF')
|
||||||
ui_modules += {'egl-headless' : egl_headless_ss}
|
ui_modules += {'egl-headless' : egl_headless_ss}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if config_host.has_key('CONFIG_GTK')
|
if gtk.found()
|
||||||
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
|
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
|
||||||
|
|
||||||
gtk_ss = ss.source_set()
|
gtk_ss = ss.source_set()
|
||||||
|
|
Loading…
Reference in New Issue