Skip to content

Commit

Permalink
meson: convert po/
Browse files Browse the repository at this point in the history
Meson warns if xgettext is not found.  In the future we may want to add
a required argument to i18n.gettext(); in the meanwhile, I am adding a
--enable-gettext/--disable-gettext option and feature detection in
configure.  This preserves QEMU's default behavior of detecting system
features, without any warning, if neither --enable-* nor --disable-*
is requested.

Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
elmarco authored and bonzini committed Aug 21, 2020
1 parent a0b9323 commit e8f3bd7
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 131 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ distclean: clean ninja-distclean
rm -f config-host.mak config-host.h*
rm -f tests/tcg/config-*.mak
rm -f config-all-disas.mak config.status
rm -f po/*.mo tests/qemu-iotests/common.env
rm -f tests/qemu-iotests/common.env
rm -f roms/seabios/config.mak roms/vgabios/config.mak
rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
rm -f *-config-target.h *-config-devices.mak *-config-devices.h
Expand Down Expand Up @@ -297,9 +297,6 @@ endif
mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
ifdef CONFIG_GTK
$(MAKE) -C po $@
endif
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
set -e; for x in $(KEYMAPS); do \
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
Expand Down
21 changes: 20 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ secret_keyring=""
libdaxctl=""
meson=""
skip_meson=no
gettext=""

bogus_os="no"
malloc_trim=""
Expand Down Expand Up @@ -1161,6 +1162,10 @@ for opt do
;;
--enable-vnc) vnc="enabled"
;;
--disable-gettext) gettext="false"
;;
--enable-gettext) gettext="true"
;;
--oss-lib=*) oss_lib="$optarg"
;;
--audio-drv-list=*) audio_drv_list="$optarg"
Expand Down Expand Up @@ -3032,6 +3037,19 @@ if test "$whpx" != "no" ; then
fi
fi

##########################################
# gettext probe
if test "$gettext" != "false" ; then
if has xgettext; then
gettext=true
else
if test "$gettext" = "true" ; then
feature_not_found "gettext" "Install xgettext binary"
fi
gettext=false
fi
fi

##########################################
# Sparse probe
if test "$sparse" != "no" ; then
Expand Down Expand Up @@ -8099,7 +8117,7 @@ DIRS="$DIRS docs docs/interop fsdev scsi"
DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
DIRS="$DIRS roms/seabios"
LINKS="Makefile"
LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
LINKS="$LINKS tests/tcg/lm32/Makefile"
LINKS="$LINKS tests/tcg/Makefile.target"
LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
Expand Down Expand Up @@ -8231,6 +8249,7 @@ NINJA=$PWD/ninjatool $meson setup \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
-Dsdl=$sdl -Dsdl_image=$sdl_image \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
-Dgettext=$gettext \
$cross_arg \
"$PWD" "$source_path"

Expand Down
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,9 @@ subdir('tools')
subdir('pc-bios')
subdir('tests')
subdir('docs')
if 'CONFIG_GTK' in config_host
subdir('po')
endif

if build_docs
makeinfo = find_program('makeinfo', required: build_docs)
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
option('gettext', type : 'boolean', value : true)
option('sdl', type : 'feature', value : 'auto')
option('sdl_image', type : 'feature', value : 'auto')
option('vnc', type : 'feature', value : 'enabled')
Expand Down
8 changes: 8 additions & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bg
de_DE
fr_FR
hu
it
sv
tr
zh_CN
52 changes: 0 additions & 52 deletions po/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ui/gtk.c
7 changes: 7 additions & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
i18n = import('i18n')

if get_option('gettext')
i18n.gettext(meson.project_name(),
args: '[email protected]',
preset: 'glib')
endif
74 changes: 0 additions & 74 deletions po/messages.po

This file was deleted.

1 change: 1 addition & 0 deletions tests/vm/freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class FreeBSDVM(basevm.BaseVM):
"bash",
"gmake",
"gsed",
"gettext",

# libs: crypto
"gnutls",
Expand Down
1 change: 1 addition & 0 deletions tests/vm/netbsd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class NetBSDVM(basevm.BaseVM):
"bash",
"gmake",
"gsed",
"gettext",

# libs: crypto
"gnutls",
Expand Down
1 change: 1 addition & 0 deletions tests/vm/openbsd
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class OpenBSDVM(basevm.BaseVM):
"bash",
"gmake",
"gsed",
"gettext",

# libs: usb
"libusb1",
Expand Down

0 comments on commit e8f3bd7

Please sign in to comment.