Merge remote-tracking branch 'weblate/master'
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 1 Oct 2021 15:32:36 +0000 (16:32 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 1 Oct 2021 15:32:36 +0000 (16:32 +0100)
24 files changed:
.gitignore
ChangeLog [deleted file]
MANIFEST [deleted file]
Make.rules.in [deleted file]
Makefile.am [new file with mode: 0644]
Makefile.in [deleted file]
config.h.in [deleted file]
config.rpath [new file with mode: 0755]
configure.ac
gitlog-to-changelog [deleted file]
ocaml-dep.sh.in [new file with mode: 0755]
ocaml-link.sh.in [new file with mode: 0755]
po/LINGUAS
po/Makefile.am [new file with mode: 0644]
po/Makefile.in [deleted file]
po/POTFILES
po/POTFILES-ml [new file with mode: 0644]
po/virt-top.pot
po/zanata-pull.sh [deleted file]
po/zanata.xml [deleted file]
src/.depend
src/Makefile.am [new file with mode: 0644]
src/Makefile.in [deleted file]
src/dummy.c [new file with mode: 0644]

index e3f77e7..3eacd90 100644 (file)
@@ -6,26 +6,38 @@
 *.cmxa
 *.dll
 *.exe
+*.gmo
 *.o
 *.opt
 *.orig
 *.so
 *~
 
-META
 Makefile
-aclocal.m4
-config.cache
-config.h
-config.log
-config.status
-configure
-core
-core.*
-html
+Makefile.in
+.deps
+
+/META
+/aclocal.m4
+/compile
+/config.cache
+/config.h
+/config.h.in
+/config.log
+/config.status
+/configure
+/core
+/core.*
+/depcomp
+/html
+/missing
+/ocaml-dep.sh
+/ocaml-link.sh
+/src/.depend
+/stamp-h1
 
-/Make.rules
 /autom4te.cache
+/local*
 /po/*.mo
 /po/*.po.bak
 /src/opt_gettext.ml
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644 (file)
index 6690b45..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,470 +0,0 @@
-2019-08-20  Richard W.M. Jones  <rjones@redhat.com>
-
-       Version 1.0.9.
-
-       src/top.ml: Don't depend on exact value of Failure argument.
-       File "top.ml", line 423, characters 14-31:
-       423 |       Failure "float_of_string" ->
-                           ^^^^^^^^^^^^^^^^^
-       Warning 52: Code should not depend on the actual values of
-       this constructor's arguments. They are only for information
-       and may change in future versions. (See manual section 9.5)
-
-2018-09-20  Richard W.M. Jones  <rjones@redhat.com>
-
-       build: Pass through CFLAGS and LDFLAGS to ocaml compiler (RHBZ#1630636).
-
-2017-11-18  Richard W.M. Jones  <rjones@redhat.com>
-
-       Link with -fPIC runtime.
-
-       Fixes for -safe-string in OCaml 4.06.
-
-2017-03-28  Richard W.M. Jones  <rjones@redhat.com>
-
-       chmod -x COPYING* files.
-
-       Use virConnectGetAllDomainStats API to collect domain stats (RHBZ#1422795).
-       This is much faster than using the basic libvirt APIs to collect
-       stats for each domain individually.
-
-       Note this will not work unless you have the latest ocaml-libvirt
-       package which includes this new API binding.
-
-       Remove unused variable is_calendar2.
-       Fixes commit effd1ec5897a2cac6e897ae7bce72f6b1e617b90.
-
-2017-03-27  Richard W.M. Jones  <rjones@redhat.com>
-
-       Move block_in_bytes entirely to the presentation layer.
-       Simplifies and updates commit dbef8dd3bf00417e75a12c851b053e49c9e1a79e.
-
-       Split up huge Top module into smaller modules.
-       This change is hopefully pure refactoring, splitting up the very large
-       and highly interlinked module into more manageable modules with
-       well-defined (or at least *better*-defined) interfaces between them.
-
-       src: Fix some comments which referred to the old filenames.
-       Fixes commit b7c3ef13cbd9c9cd49005a32ffb70faf6f5bbe8c.
-
-       Remove support for OCaml Calendar v1.
-       Calendar v2 was released in 2008 (9 years ago!), thus remove support
-       for v1.
-
-       This was already broken by commit dc0e217390132f7e76a4d9c0a8a81a9556d19081
-       so it likely didn't work anyway.
-
-       Update PO files.
-
-       Fix po/POTFILES for new location of source files.
-       Fixes commit b7c3ef13cbd9c9cd49005a32ffb70faf6f5bbe8c.
-
-       Refresh HACKING file.
-       Fixes commit b7c3ef13cbd9c9cd49005a32ffb70faf6f5bbe8c.
-
-       Remove +x (executable) permission on several source files.
-       Not sure why it was there, but it was incorrect.
-
-       Enable same warnings as libguestfs.
-       In particular 'warning 3' was still enabled before, meaning that the
-       code would fail with newer OCaml compilers:
-
-         File "top.ml", line 377, characters 12-25:
-         Warning 3: deprecated: String.create
-         Use Bytes.create instead.
-
-       Since we want to continue using old OCaml for now, don't enable
-       this warning.
-
-2016-10-31  Richard W.M. Jones  <rjones@redhat.com>
-
-       Rename source directory and files.
-       This renames the source directory from virt-top to src/ and removes
-       the unnecessary virt_top_* prefix from many source files.
-
-       This is entirely refactoring and makes no functional change.
-
-       Also this fixes the MANIFEST file and removes old Transifex
-       configuration, fixing commit defe5bdd4a32e0206a786d279e0f9cfc238e5e17.
-
-2016-01-04  Richard W.M. Jones  <rjones@redhat.com>
-
-       build: Add -g flag to ocamlopt.
-       Modern ocamlopt supports the -g flag fine (very old versions did not).
-
-2015-02-21  Richard W.M. Jones  <rjones@redhat.com>
-
-       Update translations from Zanata.
-
-       Move upstream translations from Tranifex to Zanata.
-       This is at the request of the Fedora localization team.
-       For further information see:
-
-       https://www.redhat.com/archives/libguestfs/2015-February/msg00168.html
-
-2014-08-02  Richard W.M. Jones  <rjones@redhat.com>
-
-       Disable warning about immutable strings (for OCaml 4.02).
-
-2012-10-12  Richard W.M. Jones  <rjones@redhat.com>
-
-       Version 1.0.8.
-
-2012-10-12  Hu Tao  <hutao@cn.fujitsu.com>
-
-       show `vcpu usages' by `virt-top -1'
-       Before this patch, `virt-top -1' shows total cpu usages
-       which euqal to `vcpu usages' + `hypervisor usages'. This
-       patch adds another column for domains showing `vcpu
-       usages'. An example is:
-
-       PHYCPU %CPU example_domain
-          0   10.4 10.4  0.8
-          1    1.6  1.6  1.4
-          2    2.6  2.6  2.6
-          3    0.0  0.0  0.1
-
-       RWMJ: I cleaned up this patch a little, but it should be
-       functionally the same.
-
-       Rename find_usages_from_stats as find_cpu_usages.
-       This is just code motion.
-
-2012-10-12  Richard W.M. Jones  <rjones@redhat.com>
-
-       OCaml stable dependencies.
-
-       Remove D.get_cpu_stats second parameter.
-       In upstream ocaml-libvirt, this second parameter has been removed,
-       because it was found that nr_pcpus can be found by calling the libvirt
-       API directly.
-
-2012-09-28  Richard W.M. Jones  <rjones@redhat.com>
-
-       Make the main code and exception handling simpler.
-
-       Better error messages when parsing the init file (RHBZ#836231).
-
-       Add missing sort order options in --help output (RHBZ#807176).
-
-       Man page: Add an explanation of columns (RHBZ#834208).
-
-       man page: Update copyright date.
-
-2012-03-06  Richard W.M. Jones  <rjones@redhat.com>
-
-       Version 1.0.7.
-
-       Ignore aclocal.m4.
-
-       Document requirements in README file.
-
-2012-03-06  Lai Jiangshan  <laijs@cn.fujitsu.com>
-
-       virt-top: correct "virt-top -1" command via cpuacct cgroup
-       Old "virt-top -1" is not correct, its output is generated by guess:
-       use average usage for pinned physical CPUs.
-
-       example(old "virt-top -1"):
-
-       PHYCPU %CPU rhel6  Windows
-          0    0.6  0.1=   0.5=
-          1    0.6  0.1=   0.5=#
-          2    0.6  0.1=   0.5=
-          3    0.6  0.1=#  0.5=
-
-       The output almost makes no sense(all the value are just average, not real).
-
-       This is new implement, it use cpuacct cgroup to gain *real* physical usages
-       via cpuacct cgroup by virDomainGetCPUStats() API.
-
-       new result:
-
-       PHYCPU %CPU rhel6  Windows
-          0    1.3  0.3     1.0
-          1    2.3  0.3     2.0
-          2    2.2  0.5     1.7
-          3    2.5  0.4     2.1
-
-       PHYCPU %CPU rhel6  Windows
-          0    1.7  0.4     1.3
-          1    3.6  1.0     2.7
-          2    1.6  0.4     1.2
-          3    4.8  3.1     1.7
-
-       Note: average flag(=) is dropped, there is not average value in here.
-       Note: running flag(#) is dropped, because if the value is not empty,
-             it means the guest was once running in the physical CPU in this period
-             between updates.
-
-       Changed from V3:
-               use new virDomainGetCPUStats() libvirt-API.
-               add a new function find_usages_from_stats() to gain cpu usages.
-
-2011-08-15  Richard W.M. Jones  <rjones@redhat.com>
-
-       Ensure manpages get built when using native compiler (thanks Laurent Léonard).
-
-2011-08-12  Richard W.M. Jones  <rjones@redhat.com>
-
-       Version 1.0.6.
-
-       Update MANIFEST and fix 'make dist'.
-       make dist now copies the generated manual pages into the tarball, so
-       that we don't have to keep these generated files in git.
-
-       Fix ordering of csv_mode and stream_mode in tuple.
-       Note that this bug could have been avoided by using a struct instead
-       of a tuple here.
-
-       This updates commit daf79631f3eff904ba89297148c4125ac7dfee39.
-
-2011-08-11  Richard W.M. Jones  <rjones@redhat.com>
-
-       docs: Explain how to debug libvirt initialization problems (RHBZ#680031).
-
-2011-04-02  Richard W.M. Jones  <rjones@redhat.com>
-
-       Pull translations from Transifex.
-
-2011-03-08  Richard W.M. Jones  <rjones@redhat.com>
-
-       Fix --end-time option with absolute times.
-       Assume the user enters a local time, and convert it to UTC.
-
-       This also adds some clarifying comments to the relative time
-       code (but doesn't change that code).
-
-       Note that the obsolete Calendar1 code is *not* updated by this change.
-
-       docs: Fix documentation for virt-top -c option.
-       Because of changes in libvirt, this no longer connects to Xen by
-       default.  Instead the default is to connect to the libvirt default
-       hypervisor (which could be Xen, KVM or others).  Update the --help
-       documentation and manual page accordingly.
-
-       Remove generated man pages from git.
-
-2011-03-07  KAMEZAWA Hiroyuki  <kamezawa@bluextal.(none)>
-
-       add memory stats to --csv mode.
-       In csv mode, memory usage in kbytes and %mem against total system
-       memory is shown.
-
-2011-03-07  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>
-
-       Record memory statistics information to 'rd' object.
-       This helps to share the calculation (between modes) and
-       will help to show memory statistics in --csv mode
-
-       Signged-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
-
-2011-03-07  Richard W.M. Jones  <rjones@redhat.com>
-
-       Import virt-top into transifex.
-       http://www.transifex.net/projects/p/virttop/
-
-2011-02-02  Richard W.M. Jones  <rjones@redhat.com>
-
-       Update generated man page files.
-
-2011-02-02  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>
-
-       Add --block-in-bytes option.
-       This option and the 'B' key toggles block I/O stats between
-       requests and bytes.
-
-       Add --stream flag.
-       Output is sent to stdout (similar to the top -b option).
-
-2011-01-24  Richard W.M. Jones  <rjones@redhat.com>
-
-       Obey virt-top --end-time down to near millisecond accuracy (RHBZ#637964).
-       Adjust the final delay down so that the --end-time option is obeyed
-       down to near millisecond accuracy.
-
-       The 'usleep' function has been renamed more accurately as 'millisleep'
-       since it sleeps for milliseconds not microseconds.
-
-2011-01-06  Richard W.M. Jones  <rjones@redhat.com>
-
-       Version 1.0.5.
-
-       Add aclocal.m4 file to git.
-       This file is sort of generated, but at the moment only has
-       a single line which includes m4/ocaml.m4, that is vital for
-       the build.
-
-       Re-add virt-top/README file.
-       This seems to have been dropped during the hg->git transition.
-
-       Document background noise of RX packets from bridges (RHBZ#647987).
-       For more information see:
-       https://bugzilla.redhat.com/show_bug.cgi?id=647987#c9
-
-       man page: Remove excess blank line.
-
-       main: Record and print full exception stack traces.
-       This turns on stack trace recording unconditionally (the same
-       effect as if OCAMLRUNPARAM=b was always supplied), and also prints
-       stack traces to the log file if there is an exception.
-
-       See also:
-       http://caml.inria.fr/pub/docs/manual-ocaml/libref/Printexc.html
-
-       Note that this requires OCaml >= 3.11.0.
-
-       Fix pad function to work for negative widths (RHBZ#634435).
-       The pad function is supposed to pad a string to a width.  Under some
-       circumstances, the width parameter could be negative resulting in a
-       call to String.sub such as:
-
-         String.sub str 0 (-1)
-
-       which caused an exception to be thrown and not caught, causing
-       virt-top to exit.  Fix the pad function to return an empty string if
-       width <= 0 instead of throwing an exception.
-
-       See also:
-       https://bugzilla.redhat.com/show_bug.cgi?id=634435
-
-       Update dependencies.
-
-       Update generated man pages.
-
-       Fix virt-top --end-time option when TZ<>UTC (RHBZ#637964).
-       Return the end time as seconds since 1970, and don't adjust it
-       for timezone.  In the main module the end time is compared against
-       the result of Unix.gettimeofday, which is also seconds since 1970,
-       so the comparison now works.
-
-       Tested with TZ=UTC-05, TZ=UTC and TZ=UTC+05.
-
-       NB: This has not been tested against ocaml-calendar 1.x, although
-       that version of calendar is obsolete and no one should be using it.
-
-       Update dependencies file.
-
-       man page: memory option shows total guest memory (RHBZ#647991).
-
-       man page: Update copyright date and link to web pages.
-
-       Remove references to xm/xentop manual pages (RHBZ#648186).
-       These Xen tools are obsolete since virsh/virt-top works across
-       all hypervisors.
-
-2010-09-02  Richard Jones  <rjones@redhat.com>
-
-       Change order of return values from getyx - fixes display of historical CPU.
-       In this commit:
-       http://cvs.savannah.gnu.org/viewvc/ocaml-tmk/functions.c?root=ocaml-tmk&r1=1.2&r2=1.3
-       Sam changed (fixed) the order that the coordinates are returned
-       from the ncurses 'getyx' call.  Since this commit was made 3 years
-       ago it should be safe to assume everyone is using the new ocaml-ncurses
-       by now.
-
-       This meant the historical %CPU was being displayed off the bottom of
-       the screen instead of on the top row at the right.  Now it is displayed
-       in the correct place.
-
-2010-06-15  Kiyoto Hashida  <khashida@redhat.com>
-
-       Update Japanese translations (RHBZ#493799).
-
-2010-03-05  Yulia  <ypoyarko@redhat.com>
-
-       Updated Russian translations (RHBZ#493799).
-
-2010-03-05  Richard Jones  <rjones@redhat.com>
-
-       Newer autoconf adds PACKAGE_URL definition.
-
-2010-02-12  Richard Jones  <rjones@redhat.com>
-
-       zh_CN: Remove bogus Plural-Forms line.
-
-       Japanese: update bogus 'Plural-Forms: Plural-Forms'.
-
-2010-02-12  Hajime Taira  <htaira@redhat.com>
-
-       Update Japanese translations (RHBZ#493799).
-
-2010-01-28  Richard Jones  <rjones@redhat.com>
-
-       Rename te_IN.po -> te.po (Piotr Drąg).
-
-       Telugu translation added by Krishna Babu K (RHBZ#493799c32)
-
-       Polish translation updated by Piotr Drag (RHBZ#493799c31)
-
-       Portuguese translation added by Glaucia Cintra (RHBZ#493799c30)
-
-       Chinese translation updated by Wei Liu (RHBZ#493799c29)
-
-       Oriya translation added by Manoj Kumar Giri (RHBZ#493799c28)
-
-       Spanish translation updated by Daniel Cabrera (RHBZ#493799c27)
-
-2009-12-30  Richard Jones  <rjones@redhat.com>
-
-       Update to ocaml-autoconf macros 1.1
-
-       Fix detection of ocaml-findlib.
-
-2009-10-06  Richard Jones  <rjones@trick.home.annexia.org>
-
-       HACKING file, update (C) messages.
-
-       Update PO files.
-
-       Remove extra spaces after s_ and f_ operators.
-
-       Safer curses functions.
-       Add safer curses functions which don't require use of dangerous
-       ignore() function.
-
-       Replace failwith (sprintf...) with failwithf
-
-       Remove -w s and fix so it compiles without warnings.
-
-       Remove NSIS installer.
-
-       Change over to using ocaml.m4 macros.
-
-2009-10-05  Richard Jones  <rjones@trick.home.annexia.org>
-
-       Updated MANIFEST.
-
-       TODO.virt-top renamed as TODO
-
-       Typo fixed.
-
-       Update manpage with --version option.
-
-       Add virt-top --version command line option.
-
-       Add the real virt-top version to help display.
-
-       Version 1.0.4 for release.
-
-       Fix changelog and manifest files.
-
-       gitlog-to-changelog: If the date field is empty, don't barf.
-
-       Added Jim Meyering's gitlog-to-changelog program.
-
-       Add total hardware memory field (RHBZ#521785)
-
-       Don't need to explicitly link against ncurses.
-
-       Update PO files.
-
-       Add Japanese to list of translations.
-
-       Use msgfmt to generate *.mo files correctly.
-
-       Update documentation.
-
-       Update dependencies.
-
-       Rename .hgignore -> .gitignore, update dependencies.
diff --git a/MANIFEST b/MANIFEST
deleted file mode 100644 (file)
index 4e4014b..0000000
--- a/MANIFEST
+++ /dev/null
@@ -1,78 +0,0 @@
-.gitignore
-ChangeLog
-config.guess
-config.h.in
-config.sub
-configure.ac
-COPYING
-COPYING.LIB
-HACKING
-gitlog-to-changelog
-install-sh
-Makefile.in
-Make.rules.in
-MANIFEST
-m4/ocaml.m4
-po/as.po
-po/ca.po
-po/de.po
-po/es.po
-po/eu.po
-po/fr.po
-po/gu.po
-po/hu.po
-po/id.po
-po/it.po
-po/ja.po
-po/ka.po
-po/kn.po
-po/LINGUAS
-po/Makefile.in
-po/ml.po
-po/mr.po
-po/nl.po
-po/or.po
-po/pa.po
-po/pl.po
-po/pt_BR.po
-po/pt.po
-po/POTFILES
-po/ru.po
-po/sr.po
-po/sv.po
-po/te.po
-po/tg.po
-po/tr.po
-po/uk.po
-po/virt-top.pot
-po/zanata-pull.sh
-po/zanata.xml
-po/zh_CN.po
-po/zh_TW.po
-README
-TODO
-src/.depend
-src/Makefile.in
-src/README
-src/collect.ml
-src/collect.mli
-src/csv_output.ml
-src/csv_output.mli
-src/main.ml
-src/opt_calendar.ml
-src/opt_csv.ml
-src/opt_xml.ml
-src/redraw.ml
-src/redraw.mli
-src/screen.ml
-src/screen.mli
-src/stream_output.ml
-src/stream_output.mli
-src/top.ml
-src/top.mli
-src/types.ml
-src/types.mli
-src/utils.ml
-src/utils.mli
-src/version.ml.in
-src/virt-top.pod
diff --git a/Make.rules.in b/Make.rules.in
deleted file mode 100644 (file)
index 12037e1..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# ocaml-libvirt
-# Copyright (C) 2007-2009 Red Hat Inc., Richard W.M. Jones
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
-
-# This file is included by Makefiles in subdirectories.
-
-OCAMLFIND      = @OCAMLFIND@
-OCAMLDEP       = @OCAMLDEP@
-OCAMLC         = @OCAMLC@
-OCAMLOPT       = @OCAMLOPT@
-
-# Common rules for building OCaml objects.
-
-ifneq ($(OCAMLFIND),)
-.mli.cmi:
-       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
-.ml.cmo:
-       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
-.ml.cmx:
-       $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
-else
-.mli.cmi:
-       $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
-.ml.cmo:
-       $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
-.ml.cmx:
-       $(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) -c $<
-endif
-
-%.ml %.mli: %.mly
-       ocamlyacc $<
-.mll.ml:
-       ocamllex $<
-
-# Dependencies.
-
-depend: .depend
-
-ifneq ($(OCAMLFIND),)
-.depend: $(wildcard *.mli) $(wildcard *.ml)
-       rm -f $@ $@-t
-       $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $(OCAMLDEPFLAGS) $^ | \
-         sed 's/ :/:/' | \
-         sed 's/ *$$//' | \
-         sed -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
-          sort > $@-t
-       mv $@-t $@
-else
-.depend: $(wildcard *.mli) $(wildcard *.ml)
-       rm -f $@ $@-t
-       $(OCAMLDEP) $(OCAMLCINCS) $(OCAMLDEPFLAGS) $^ | \
-         sed 's/ :/:/' | \
-         sed 's/ *$$//' | \
-         sed -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
-          sort > $@-t
-       mv $@-t $@
-endif
-
-ifeq ($(wildcard .depend),.depend)
-include .depend
-endif
-
-.PHONY: depend dist check-manifest dpkg doc
-
-.SUFFIXES:      .cmo .cmi .cmx .ml .mli .mll .mly
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..51530c7
--- /dev/null
@@ -0,0 +1,64 @@
+# virt-top
+# Copyright (C) 2007-2021 Red Hat Inc., Richard W.M. Jones
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+SUBDIRS = src po
+
+EXTRA_DIST = \
+       .gitignore \
+       HACKING
+
+dist-hook: po/POTFILES po/POTFILES-ml
+
+po/POTFILES: configure.ac
+       rm -f $@ $@-t
+       find . -name '*.c' | \
+       grep -v '/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/' | \
+       LC_ALL=C sort > $@-t
+       mv $@-t $@
+
+po/POTFILES-ml: configure.ac
+       rm -f $@ $@-t
+       find . -name '*.ml' | \
+       grep -v '/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/' | \
+       LC_ALL=C sort > $@-t
+       mv $@-t $@
+
+# Commit everything in current directory to HEAD, and set commit
+# message to current version (only for maintainer).
+
+maintainer-commit:
+       git commit -a -m "Version $(VERSION)."
+
+# Tag HEAD with current version (only for maintainer).
+
+maintainer-tag:
+       git tag -a "v$(VERSION)" -m "Version $(VERSION)" -f
+
+# Maintainer only: check no files are missing from EXTRA_DIST rules,
+# and that all generated files have been included in the tarball.
+# (Note you must have done 'make dist')
+
+maintainer-check-extra-dist:
+       zcat $(PACKAGE_NAME)-$(VERSION).tar.gz | tar tf - | sort | \
+         sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tarfiles
+       git ls-files | sort > gitfiles
+       comm -13 tarfiles gitfiles > comm-out
+       @echo Checking for differences between EXTRA_DIST and git ...
+       cat comm-out
+       [ ! -s comm-out ]
+       rm tarfiles gitfiles comm-out
+       @echo PASS: EXTRA_DIST tests
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644 (file)
index d0aec17..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# virt-top
-# Copyright (C) 2007-2014 Red Hat Inc., Richard W.M. Jones
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
-
-PACKAGE                = @PACKAGE_NAME@
-VERSION                = @PACKAGE_VERSION@
-
-INSTALL                = @INSTALL@
-
-MAKENSIS       = @MAKENSIS@
-
-SUBDIRS                = src
-
-all opt depend install:
-       $(MAKE) -C src $@
-
-clean:
-       for d in . $(SUBDIRS); do \
-         (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \
-       done
-       rm -f src/virt-top
-
-distclean: clean
-       rm -f config.h config.log config.status configure
-       rm -rf autom4te.cache
-       rm -f Makefile
-       rm -f src/Makefile
-
-# Distribution.
-
-dist: ChangeLog
-       $(MAKE) check-manifest
-       rm -rf $(PACKAGE)-$(VERSION)
-       mkdir $(PACKAGE)-$(VERSION)
-       tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
-       $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
-       $(INSTALL) -m 0644 aclocal.m4 $(PACKAGE)-$(VERSION)/
-       $(INSTALL) -m 0644 src/virt-top.1 $(PACKAGE)-$(VERSION)/src/
-       $(INSTALL) -m 0644 src/virt-top.txt $(PACKAGE)-$(VERSION)/src/
-       tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
-       rm -rf $(PACKAGE)-$(VERSION)
-       ls -l $(PACKAGE)-$(VERSION).tar.gz
-
-check-manifest:
-       git ls-files | sort > .check-manifest; \
-       sort MANIFEST > .orig-manifest; \
-       diff -u .orig-manifest .check-manifest; rv=$$?; \
-       rm -f .orig-manifest .check-manifest; \
-       exit $$rv
-
-ChangeLog: $(shell find -type f)
-       ./gitlog-to-changelog > $@.new
-       mv $@.new $@
-
-.PHONY: all opt depend install clean distclean force
diff --git a/config.h.in b/config.h.in
deleted file mode 100644 (file)
index f80de9c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
diff --git a/config.rpath b/config.rpath
new file mode 100755 (executable)
index 0000000..4b7dc49
--- /dev/null
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+#   Copyright 1996-2021 Free Software Foundation, Inc.
+#   Taken from GNU libtool, 2001
+#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+#   This file is free software; the Free Software Foundation gives
+#   unlimited permission to copy and/or distribute it, with or without
+#   modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+#   than 256 bytes, otherwise the compiler driver will dump core. The only
+#   known workaround is to choose shorter directory names for the build
+#   directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+  wl='-Wl,'
+else
+  case "$host_os" in
+    aix*)
+      wl='-Wl,'
+      ;;
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      ;;
+    hpux9* | hpux10* | hpux11*)
+      wl='-Wl,'
+      ;;
+    irix5* | irix6* | nonstopux*)
+      wl='-Wl,'
+      ;;
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+        ecc*)
+          wl='-Wl,'
+          ;;
+        icc* | ifort*)
+          wl='-Wl,'
+          ;;
+        lf95*)
+          wl='-Wl,'
+          ;;
+        nagfor*)
+          wl='-Wl,-Wl,,'
+          ;;
+        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+          wl='-Wl,'
+          ;;
+        ccc*)
+          wl='-Wl,'
+          ;;
+        xl* | bgxl* | bgf* | mpixl*)
+          wl='-Wl,'
+          ;;
+        como)
+          wl='-lopt='
+          ;;
+        *)
+          case `$CC -V 2>&1 | sed 5q` in
+            *Sun\ F* | *Sun*Fortran*)
+              wl=
+              ;;
+            *Sun\ C*)
+              wl='-Wl,'
+              ;;
+          esac
+          ;;
+      esac
+      ;;
+    newsos6)
+      ;;
+    *nto* | *qnx*)
+      ;;
+    osf3* | osf4* | osf5*)
+      wl='-Wl,'
+      ;;
+    rdos*)
+      ;;
+    solaris*)
+      case $cc_basename in
+        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+          wl='-Qoption ld '
+          ;;
+        *)
+          wl='-Wl,'
+          ;;
+      esac
+      ;;
+    sunos4*)
+      wl='-Qoption ld '
+      ;;
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      wl='-Wl,'
+      ;;
+    sysv4*MP*)
+      ;;
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      wl='-Wl,'
+      ;;
+    unicos*)
+      wl='-Wl,'
+      ;;
+    uts4*)
+      ;;
+  esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  # Set some defaults for GNU ld with shared library support. These
+  # are reset later if shared libraries are not supported. Putting them
+  # here allows them to be overridden if necessary.
+  # Unlike libtool, we use -rpath here, not --rpath, since the documented
+  # option of GNU ld is called -rpath, not --rpath.
+  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+  case "$host_os" in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    haiku*)
+      ;;
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      ;;
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    netbsd*)
+      ;;
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+        ld_shlibs=no
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+          ld_shlibs=no
+          ;;
+        *)
+          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+          else
+            ld_shlibs=no
+          fi
+          ;;
+      esac
+      ;;
+    sunos4*)
+      hardcode_direct=yes
+      ;;
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+  esac
+  if test "$ld_shlibs" = no; then
+    hardcode_libdir_flag_spec=
+  fi
+else
+  case "$host_os" in
+    aix3*)
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes; then
+        # Neither direct hardcoding nor static linking is supported with a
+        # broken collect2.
+        hardcode_direct=unsupported
+      fi
+      ;;
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+        # On IA64, the linker does run time linking by default, so we don't
+        # have to do anything special.
+        aix_use_runtimelinking=no
+      else
+        aix_use_runtimelinking=no
+        # Test if we are trying to use run time linking or normal
+        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+        # need to do runtime linking.
+        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+          for ld_flag in $LDFLAGS; do
+            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+              aix_use_runtimelinking=yes
+              break
+            fi
+          done
+          ;;
+        esac
+      fi
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      if test "$GCC" = yes; then
+        case $host_os in aix4.[012]|aix4.[012].*)
+          collect2name=`${CC} -print-prog-name=collect2`
+          if test -f "$collect2name" && \
+            strings "$collect2name" | grep resolve_lib_name >/dev/null
+          then
+            # We have reworked collect2
+            :
+          else
+            # We have old collect2
+            hardcode_direct=unsupported
+            hardcode_minus_L=yes
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_libdir_separator=
+          fi
+          ;;
+        esac
+      fi
+      # Begin _LT_AC_SYS_LIBPATH_AIX.
+      echo 'int main () { return 0; }' > conftest.c
+      ${CC} ${LDFLAGS} conftest.c -o conftest
+      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      if test -z "$aix_libpath"; then
+        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      fi
+      if test -z "$aix_libpath"; then
+        aix_libpath="/usr/lib:/lib"
+      fi
+      rm -f conftest.c conftest
+      # End _LT_AC_SYS_LIBPATH_AIX.
+      if test "$aix_use_runtimelinking" = yes; then
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+      else
+        if test "$host_cpu" = ia64; then
+          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+        else
+          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        fi
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    bsdi[45]*)
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      libext=lib
+      ;;
+    darwin* | rhapsody*)
+      hardcode_direct=no
+      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    freebsd2.[01]*)
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    freebsd* | dragonfly* | midnightbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    hpux9*)
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      ;;
+    hpux10*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        hardcode_direct=yes
+        # hardcode_minus_L: Not really in the search PATH,
+        # but as the default location of the library.
+        hardcode_minus_L=yes
+      fi
+      ;;
+    hpux11*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct=no
+            ;;
+          *)
+            hardcode_direct=yes
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+        esac
+      fi
+      ;;
+    irix5* | irix6* | nonstopux*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    netbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    newsos6)
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    *nto* | *qnx*)
+      ;;
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+        hardcode_direct=yes
+        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        else
+          case "$host_os" in
+            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+              hardcode_libdir_flag_spec='-R$libdir'
+              ;;
+            *)
+              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+              ;;
+          esac
+        fi
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      ;;
+    osf3*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    osf4* | osf5*)
+      if test "$GCC" = yes; then
+        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+        # Both cc and cxx compiler support -rpath directly
+        hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+    solaris*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+    sunos4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    sysv4)
+      case $host_vendor in
+        sni)
+          hardcode_direct=yes # is this really true???
+          ;;
+        siemens)
+          hardcode_direct=no
+          ;;
+        motorola)
+          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+          ;;
+      esac
+      ;;
+    sysv4.3*)
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+        ld_shlibs=yes
+      fi
+      ;;
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      ;;
+    sysv5* | sco3.2v5* | sco5v6*)
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      ;;
+    uts4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    *)
+      ld_shlibs=no
+      ;;
+  esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec=      # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+  aix3*)
+    library_names_spec='$libname.a'
+    ;;
+  aix[4-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  amigaos*)
+    case "$host_cpu" in
+      powerpc*)
+        library_names_spec='$libname$shrext' ;;
+      m68k)
+        library_names_spec='$libname.a' ;;
+    esac
+    ;;
+  beos*)
+    library_names_spec='$libname$shrext'
+    ;;
+  bsdi[45]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  cygwin* | mingw* | pw32* | cegcc*)
+    shrext=.dll
+    library_names_spec='$libname.dll.a $libname.lib'
+    ;;
+  darwin* | rhapsody*)
+    shrext=.dylib
+    library_names_spec='$libname$shrext'
+    ;;
+  dgux*)
+    library_names_spec='$libname$shrext'
+    ;;
+  freebsd[23].*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  freebsd* | dragonfly* | midnightbsd*)
+    library_names_spec='$libname$shrext'
+    ;;
+  gnu*)
+    library_names_spec='$libname$shrext'
+    ;;
+  haiku*)
+    library_names_spec='$libname$shrext'
+    ;;
+  hpux9* | hpux10* | hpux11*)
+    case $host_cpu in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    library_names_spec='$libname$shrext'
+    ;;
+  interix[3-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  irix5* | irix6* | nonstopux*)
+    library_names_spec='$libname$shrext'
+    case "$host_os" in
+      irix5* | nonstopux*)
+        libsuff= shlibsuff=
+        ;;
+      *)
+        case $LD in
+          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+          *) libsuff= shlibsuff= ;;
+        esac
+        ;;
+    esac
+    ;;
+  linux*oldld* | linux*aout* | linux*coff*)
+    ;;
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  knetbsd*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  netbsd*)
+    library_names_spec='$libname$shrext'
+    ;;
+  newsos6)
+    library_names_spec='$libname$shrext'
+    ;;
+  *nto* | *qnx*)
+    library_names_spec='$libname$shrext'
+    ;;
+  openbsd*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  os2*)
+    libname_spec='$name'
+    shrext=.dll
+    library_names_spec='$libname.a'
+    ;;
+  osf3* | osf4* | osf5*)
+    library_names_spec='$libname$shrext'
+    ;;
+  rdos*)
+    ;;
+  solaris*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sunos4*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  sysv4 | sysv4.3*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv4*MP*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+    library_names_spec='$libname$shrext'
+    ;;
+  tpf*)
+    library_names_spec='$libname$shrext'
+    ;;
+  uts4*)
+    library_names_spec='$libname$shrext'
+    ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
index b3f7add..3286941 100644 (file)
@@ -1,5 +1,5 @@
 # virt-top
-# Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones
+# Copyright (C) 2007-2021 Red Hat Inc., Richard W.M. Jones
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([virt-top],[1.0.9])
+AC_INIT([virt-top],[1.1.0])
+AM_INIT_AUTOMAKE([foreign])
 AC_CONFIG_MACRO_DIR([m4])
 
 AC_PROG_INSTALL
 
+dnl Enable GNU stuff.
+AC_USE_SYSTEM_EXTENSIONS
+
+dnl Check for basic C environment.
+AC_PROG_CC_STDC
+AC_PROG_CPP
+AC_C_PROTOTYPES
+test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
+AM_PROG_CC_C_O
+
+dnl Check support for 64 bit file offsets.
+AC_SYS_LARGEFILE
+
 dnl Check for basic OCaml environment & findlib.
 AC_PROG_OCAML
-AC_PROG_FINDLIB
+if test "$OCAMLC" = "no"; then
+    AC_MSG_ERROR([You must install the OCaml compiler])
+fi
+
+AM_CONDITIONAL([HAVE_OCAMLOPT],[test "$OCAMLBEST" = "opt"])
 
+AC_PROG_FINDLIB
 if test "x$OCAMLFIND" = "xno"; then
     AC_MSG_ERROR([OCaml findlib is required])
 fi
@@ -54,31 +73,62 @@ if test "x$OCAML_PKG_curses" = "xno"; then
 fi
 
 dnl Check for optional OCaml packages.
+AC_CHECK_OCAML_PKG(calendar)
+AC_CHECK_OCAML_PKG(csv)
 AC_CHECK_OCAML_PKG(gettext)
 AC_CHECK_OCAML_PKG(xml-light)
-AC_CHECK_OCAML_PKG(csv)
-AC_CHECK_OCAML_PKG(calendar)
 
-AC_SUBST(OCAML_PKG_unix)
-AC_SUBST(OCAML_PKG_extlib)
-AC_SUBST(OCAML_PKG_curses)
-AC_SUBST(OCAML_PKG_gettext)
-AC_SUBST(OCAML_PKG_xml_light)
-AC_SUBST(OCAML_PKG_csv)
-AC_SUBST(OCAML_PKG_calendar)
+AM_CONDITIONAL([HAVE_PKG_CALENDAR], [test "x$OCAML_PKG_calendar" != "xno"])
+AM_CONDITIONAL([HAVE_PKG_CSV],      [test "x$OCAML_PKG_csv" != "xno"])
+AM_CONDITIONAL([HAVE_PKG_GETTEXT],  [test "x$OCAML_PKG_gettext" != "xno"])
+AM_CONDITIONAL([HAVE_PKG_XML_LIGHT],[test "x$OCAML_PKG_xml_light" != "xno"])
+
+dnl Check if ocamlc/ocamlopt -runtime-variant _pic works.  It was
+dnl added in OCaml >= 4.03, but in theory might be disabled by
+dnl downstream distros.
+OCAML_RUNTIME_VARIANT_PIC_OPTION=""
+if test "x$OCAMLC" != "xno"; then
+    AC_MSG_CHECKING([if OCaml ‘-runtime-variant _pic’ works])
+    rm -f conftest.ml contest
+    echo 'print_endline "hello world"' > conftest.ml
+    if $OCAMLOPT conftest.ml -runtime-variant _pic -o conftest >&5 2>&5 ; then
+        AC_MSG_RESULT([yes])
+        OCAML_RUNTIME_VARIANT_PIC_OPTION="-runtime-variant _pic"
+    else
+        AC_MSG_RESULT([no])
+    fi
+    rm -f conftest.ml contest
+fi
+AC_SUBST([OCAML_RUNTIME_VARIANT_PIC_OPTION])
 
 dnl Check for optional perldoc (for building manual pages).
-AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc)
+AC_CHECK_PROG([HAVE_PERLDOC], perldoc, perldoc)
+AM_CONDITIONAL([HAVE_PERLDOC], [test "x$HAVE_PERLDOC" = "xperldoc"])
 
 dnl Check for recommended ocaml-gettext tool.
-AC_CHECK_PROG(OCAML_GETTEXT,ocaml-gettext,ocaml-gettext)
-
-dnl Check for msgfmt tool.
-AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
+AC_CHECK_PROG([OCAML_GETTEXT], ocaml-gettext, ocaml-gettext)
+AM_CONDITIONAL([HAVE_OCAML_GETTEXT],[test "x$OCAML_GETTEXT" = "xocaml-gettext"])
+
+dnl Check for GNU gettext tools (optional).
+AC_CHECK_PROG([XGETTEXT],[xgettext],[xgettext],[no])
+AC_CHECK_PROG([MSGCAT],[msgcat],[msgcat],[no])
+AC_CHECK_PROG([MSGFMT],[msgfmt],[msgfmt],[no])
+AC_CHECK_PROG([MSGMERGE],[msgmerge],[msgmerge],[no])
+
+dnl Check they are the GNU gettext tools.
+AC_MSG_CHECKING([msgfmt is GNU tool])
+if $MSGFMT --version >/dev/null 2>&1 && $MSGFMT --version | grep -q 'GNU gettext
+'; then
+    msgfmt_is_gnu=yes
+else
+    msgfmt_is_gnu=no
+fi
+AC_MSG_RESULT([$msgfmt_is_gnu])
+AM_CONDITIONAL([HAVE_GNU_GETTEXT],
+    [test "x$XGETTEXT" != "xno" && test "x$MSGCAT" != "xno" && test "x$MSGFMT" != "xno" && test "x$MSGMERGE" != "xno" && test "x$msgfmt_is_gnu" != "xno"])
 
-dnl Substitute CFLAGS and LDFLAGS if set.
-AC_SUBST([CFLAGS])
-AC_SUBST([LDFLAGS])
+dnl Check for gettext.
+AM_GNU_GETTEXT([external])
 
 dnl Write gettext modules for the programs.
 dnl http://www.le-gall.net/sylvain+violaine/documentation/ocaml-gettext/html/reference-manual/ch03s04.html
@@ -120,8 +170,9 @@ echo "------------------------------------------------------------"
 
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([ocaml-dep.sh],  [chmod +x,-w ocaml-dep.sh])
+AC_CONFIG_FILES([ocaml-link.sh], [chmod +x,-w ocaml-link.sh])
 AC_CONFIG_FILES([Makefile
-       Make.rules
        po/Makefile
        src/Makefile
        src/version.ml
diff --git a/gitlog-to-changelog b/gitlog-to-changelog
deleted file mode 100755 (executable)
index cf0fef0..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/usr/bin/perl
-# Convert git log output to ChangeLog format.
-
-my $VERSION = '2009-10-05 15:04'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job.  Otherwise, update this string manually.
-
-# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Written by Jim Meyering
-
-use strict;
-use warnings;
-use Getopt::Long;
-use POSIX qw(strftime);
-
-(my $ME = $0) =~ s|.*/||;
-
-# use File::Coda; # http://meyering.net/code/Coda/
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-sub usage ($)
-{
-  my ($exit_code) = @_;
-  my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
-  if ($exit_code != 0)
-    {
-      print $STREAM "Try `$ME --help' for more information.\n";
-    }
-  else
-    {
-      print $STREAM <<EOF;
-Usage: $ME [OPTIONS] [ARGS]
-
-Convert git log output to ChangeLog format.  If present, any ARGS
-are passed to "git log".  To avoid ARGS being parsed as options to
-$ME, they may be preceded by '--'.
-
-OPTIONS:
-
-   --since=DATE convert only the logs since DATE;
-                  the default is to convert all log entries.
-   --format=FMT set format string for commit subject and body;
-                  see 'man git-log' for the list of format metacharacters;
-                  the default is '%s%n%b%n'
-
-   --help       display this help and exit
-   --version    output version information and exit
-
-EXAMPLE:
-
-  $ME --since=2008-01-01 > ChangeLog
-  $ME -- -n 5 foo > last-5-commits-to-branch-foo
-
-EOF
-    }
-  exit $exit_code;
-}
-
-# If the string $S is a well-behaved file name, simply return it.
-# If it contains white space, quotes, etc., quote it, and return the new string.
-sub shell_quote($)
-{
-  my ($s) = @_;
-  if ($s =~ m![^\w+/.,-]!)
-    {
-      # Convert each single quote to '\''
-      $s =~ s/\'/\'\\\'\'/g;
-      # Then single quote the string.
-      $s = "'$s'";
-    }
-  return $s;
-}
-
-sub quoted_cmd(@)
-{
-  return join (' ', map {shell_quote $_} @_);
-}
-
-{
-  my $since_date = '1970-01-01 UTC';
-  my $format_string = '%s%n%b%n';
-  GetOptions
-    (
-     help => sub { usage 0 },
-     version => sub { print "$ME version $VERSION\n"; exit },
-     'since=s' => \$since_date,
-     'format=s' => \$format_string,
-    ) or usage 1;
-
-  my @cmd = (qw (git log --log-size), "--since=$since_date",
-             '--pretty=format:%ct  %an  <%ae>%n%n'.$format_string, @ARGV);
-  open PIPE, '-|', @cmd
-    or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
-            . "(Is your Git too old?  Version 1.5.1 or later is required.)\n");
-
-  my $prev_date_line = '';
-  while (1)
-    {
-      defined (my $in = <PIPE>)
-        or last;
-      $in =~ /^log size (\d+)$/
-        or die "$ME:$.: Invalid line (expected log size):\n$in";
-      my $log_nbytes = $1;
-
-      my $log;
-      my $n_read = read PIPE, $log, $log_nbytes;
-      $n_read == $log_nbytes
-        or die "$ME:$.: unexpected EOF\n";
-
-      my @line = split "\n", $log;
-      my $author_line = shift @line;
-      defined $author_line
-        or die "$ME:$.: unexpected EOF\n";
-      if ($author_line =~ /^(\d+)  (.*>)$/) {
-          my $date_line = sprintf "%s  $2\n", strftime ("%F", localtime ($1));
-          # If this line would be the same as the previous date/name/email
-          # line, then arrange not to print it.
-          if ($date_line ne $prev_date_line)
-          {
-              $prev_date_line eq ''
-                  or print "\n";
-              print $date_line;
-          }
-          $prev_date_line = $date_line;
-      }
-
-      # Omit "Signed-off-by..." lines.
-      @line = grep !/^Signed-off-by: .*>$/, @line;
-
-      # If there were any lines
-      if (@line == 0)
-        {
-          warn "$ME: warning: empty commit message:\n  $prev_date_line\n";
-        }
-      else
-        {
-          # Remove leading and trailing blank lines.
-          while ($line[0] =~ /^\s*$/) { shift @line; }
-          while ($line[$#line] =~ /^\s*$/) { pop @line; }
-
-          # Prefix each non-empty line with a TAB.
-          @line = map { length $_ ? "\t$_" : '' } @line;
-
-          print "\n", join ("\n", @line), "\n";
-        }
-
-      defined ($in = <PIPE>)
-        or last;
-      $in ne "\n"
-        and die "$ME:$.: unexpected line:\n$in";
-    }
-
-  close PIPE
-    or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
-  # FIXME-someday: include $PROCESS_STATUS in the diagnostic
-}
-
-# Local Variables:
-# indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "my $VERSION = '"
-# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "'; # UTC"
-# End:
diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in
new file mode 100755 (executable)
index 0000000..49c816a
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash -
+# (C) Copyright 2009-2020 Red Hat Inc.
+# @configure_input@
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# This is a smarter wrapper around ocamldep(1) which is used to create
+# the .depend files which are present in each subdirectory that builds
+# OCaml code.
+#
+# Usage:
+#   .depend: *.mli *.ml
+#       $(top_builddir)/ocaml-dep.sh $^
+#   -include .depend
+
+set -e
+
+# List of directories that contain common OCaml libraries.  If it
+# contains OCaml code that can be included from another directory,
+# then it should go here.  Note that OCaml modules in these
+# directories must have unique names (eg. not ‘Utils’) else
+# dependencies don't get built right.
+include_dirs="
+common/mlgettext
+common/mlpcre
+common/mlprogress
+common/mlstdutils
+common/mltools
+common/mlutils
+common/mlv2v
+common/mlvisit
+common/mlxml
+lib
+"
+
+# Output file is always created in the current directory.
+output=.depend
+
+subdir=$(realpath --relative-to=@abs_top_builddir@ .)
+srcdir=$(realpath --relative-to=. @abs_top_srcdir@/${subdir})
+srcdir_re=$(realpath --relative-to=. @abs_top_srcdir@/${subdir} | sed 's/\./[.]/g')
+top_builddir=$(realpath --relative-to=. @abs_top_builddir@)
+
+includes="-I @abs_top_srcdir@/$subdir -I @abs_top_builddir@/$subdir"
+for i in $include_dirs; do
+    includes="$includes -I @abs_top_srcdir@/$i -I @abs_top_builddir@/$i"
+done
+
+rm -f $output $output-t
+
+echo "# OCaml dependencies generated by $0" > $output-t
+echo >> $output-t
+
+# Rewrite paths
+# 1. Normalize absolute srcdir to relative path
+# 2. Object files (*.cm*, *.o), in srcdir: Rewrite to builddir
+# 3. Generated _config.ml in srcdir: Rewrite to builddir
+# 4. Other object files below abs_top_srcdir: rewrite to corresponding builddir
+# 5. Eliminate "./" prefix
+@OCAMLFIND@ ocamldep @OCAMLDEP_ALL@ @OCAMLDEP_ONE_LINE@ $includes "$@" \
+    | sed \
+          -e "s,@abs_top_srcdir@/${subdir},.,g" \
+          -e "s,\B${srcdir_re}/\\([^ ]*[.]\\)\\(cm[^ ]*\\|o\\),\\1\\2,g" \
+          -e "s,\B${srcdir_re}/\\([^ /]*_config[.]ml\\),\\1,g" \
+          -e "s,@abs_top_srcdir@/\\([^ ]*[.]\\)\\(cm[^ ]*\\|o\\),${top_builddir}/\\1\\2,g" \
+          -e 's,\(^\| \)./,\1,g' \
+    >> $output-t
+
+chmod -w $output-t
+
+mv $output-t $output
diff --git a/ocaml-link.sh.in b/ocaml-link.sh.in
new file mode 100755 (executable)
index 0000000..8f77dc2
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash -
+# Script used to link OCaml programs.
+# @configure_input@
+# (C) Copyright 2015-2020 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# See guestfs-hacking(1) section "HOW OCAML PROGRAMS ARE COMPILED AND LINKED"
+
+# Hack automake to link OCaml-based binaries properly.
+# There is no other way to add the -cclib parameter to the end of
+# the command line.
+
+# Usage:
+#   ./ocaml-link.sh -cclib '...' -- ARGS
+# Pass the cclib argument separately, and the rest as separated
+# arguments.
+
+TEMP=`getopt -a -o '' --long 'cclib:' \
+  -n "$(basename $0)" -- "$@"`
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+eval set -- "$TEMP"
+
+cclib=
+
+while true ; do
+  case "$1" in
+    -cclib|--cclib) cclib="$2" ; shift 2 ;;
+    --) shift ; break ;;
+    *) echo "Internal error!" ; exit 1 ;;
+  esac
+done
+
+# Integration with silent rules of automake: print the full command
+# line option in verbose mode.
+if [ x"${V:-@AM_DEFAULT_VERBOSITY@}" = x1 ]; then
+  echo "$@" \
+     @OCAML_RUNTIME_VARIANT_PIC_OPTION@ \
+     -linkpkg \
+     -cclib "'@LDFLAGS@ $cclib'"
+fi
+# NB -cclib must come last.
+exec "$@" \
+     @OCAML_RUNTIME_VARIANT_PIC_OPTION@ \
+     -linkpkg \
+     -cclib "@LDFLAGS@ $cclib"
index 8fa3cba..5490f5b 100644 (file)
@@ -1,5 +1,6 @@
 as
 ca
+cs
 de
 es
 eu
diff --git a/po/Makefile.am b/po/Makefile.am
new file mode 100644 (file)
index 0000000..791baa3
--- /dev/null
@@ -0,0 +1,93 @@
+# libguestfs
+# Copyright (C) 2009-2020 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+DOMAIN = $(PACKAGE_NAME)
+COPYRIGHT_HOLDER = Red Hat Inc.
+MSGID_BUGS_ADDRESS = https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
+
+# Languages.
+# Don't use LINGUAS (uppercase) as Gentoo defines it (RHBZ#804464).
+linguas     := $(shell cat $(srcdir)/LINGUAS)
+
+POTFILES    := $(shell $(SED) 's,^,$(top_srcdir)/,' $(srcdir)/POTFILES)
+POTFILES_ML := $(shell $(SED) 's,^,$(top_srcdir)/,' $(srcdir)/POTFILES-ml)
+POFILES     := $(linguas:%=%.po)
+GMOFILES    := $(linguas:%=%.gmo)
+
+EXTRA_DIST = \
+       LINGUAS \
+       POTFILES POTFILES-ml \
+       $(DOMAIN).pot \
+       $(POFILES) \
+       $(GMOFILES)
+
+if HAVE_GNU_GETTEXT
+
+XGETTEXT_ARGS = \
+       --default-domain=$(DOMAIN) \
+       --from-code=utf-8 \
+       --add-comments=TRANSLATORS: \
+       --keyword=_ --keyword=N_ --keyword=__ --keyword=__x \
+       --flag=error:3:c-format \
+       --flag=error_at_line:5:c-format \
+       --flag=asprintf:2:c-format \
+       --flag=vasprintf:2:c-format \
+       --flag=xasprintf:1:c-format \
+       --copyright-holder='$(COPYRIGHT_HOLDER)' \
+       --package-name="$(PACKAGE_NAME)" \
+       --package-version="$(PACKAGE_VERSION)" \
+       --msgid-bugs-address="$(MSGID_BUGS_ADDRESS)" \
+       --directory=$(top_srcdir)
+
+# For explanation, see
+# http://mingw-users.1079350.n2.nabble.com/Getting-rid-of-xgettext-s-quot-CHARSET-quot-warning-td5620533.html
+FIX_CHARSET = \
+       $(SED) -i 's|text/plain; charset=CHARSET|text/plain; charset=utf-8|g'
+
+$(DOMAIN).pot: Makefile POTFILES $(POTFILES) POTFILES-ml $(POTFILES_ML)
+       rm -f $@-t
+       touch $@-t
+if HAVE_OCAML_GETTEXT
+       cd $(top_srcdir) && $(OCAML_GETTEXT) --action extract --extract-pot $(abs_srcdir)/$@-t $(shell cat $(abs_srcdir)/POTFILES-ml)
+        \
+       $(FIX_CHARSET) $@-t
+endif
+       $(XGETTEXT) -j -o $@-t $(XGETTEXT_ARGS) \
+         --files-from=$(abs_srcdir)/POTFILES
+       $(FIX_CHARSET) $@-t
+       mv $@-t $@
+
+.po.gmo:
+       rm -f $@ $@-t
+       $(MSGFMT) -c -o $@-t $(srcdir)/$<
+       mv $@-t $@
+
+# Install.
+# Cannot use 'localedir' since this conflicts with autoconf.
+langinstdir = $(datadir)/locale
+
+install-data-hook: $(GMOFILES)
+       mkdir -p $(DESTDIR)$(langinstdir)
+       for lang in $(linguas); do \
+         d=$(DESTDIR)$(langinstdir)/$$lang/LC_MESSAGES; \
+         mkdir -p $$d; \
+         install -m 0644 $$lang.gmo $$d/$(DOMAIN).mo; \
+       done
+
+.PRECIOUS: $(DOMAIN).pot $(POFILES)
+
+endif
diff --git a/po/Makefile.in b/po/Makefile.in
deleted file mode 100644 (file)
index 949c2d9..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-# Makefile for po subdirectory.
-# @configure_input@
-#
-# Copyright (C) 2007-2008 Red Hat Inc.
-# Written by Richard W.M. Jones <rjones@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-OCAML_GETTEXT_PACKAGE = virt-top
-LINGUAS                = $(shell cat LINGUAS)
-SOURCES                = POTFILES
-
-MSGFMT         = @MSGFMT@
-
-OCAML_GETTEXT  = @OCAML_GETTEXT@
-OCAML_GETTEXT_EXTRACT_OPTIONS =
-OCAML_GETTEXT_COMPILE_OPTIONS =
-OCAML_GETTEXT_INSTALL_OPTIONS =
-OCAML_GETTEXT_MERGE_OPTIONS   =
-
-PODIR          = @prefix@/share/locale
-
-POFILES                = $(addsuffix .po,$(LINGUAS))
-MOFILES                = $(addsuffix .mo,$(LINGUAS))
-POTFILE                = $(OCAML_GETTEXT_PACKAGE).pot
-
-all: $(MOFILES) $(POTFILE)
-
-install: install-po
-
-uninstall: uninstall-po
-
-clean:: clean-po
-
-%.mo: %.po
-       $(MSGFMT) -o $@ $^
-
-%.pot: $(SOURCES) $(shell cat $(SOURCES))
-       $(OCAML_GETTEXT) --action extract $(OCAML_GETTEXT_EXTRACT_OPTIONS) \
-       --extract-pot $@ $<
-
-# Also includes a fix for incorrectly escaped multi-byte sequences.
-%.po: $(POTFILE)
-       $(OCAML_GETTEXT) --action merge   $(OCAML_GETTEXT_MERGE_OPTIONS) \
-       --merge-pot $(POTFILE) $@
-       mv $@ $@.orig
-       perl -wpe 's/\\(\d{3})/pack "C*", $$1/ge' < $@.orig > $@
-
-$(BUILDPO):
-       mkdir -p $(BUILDPO)
-
-.PRECIOUS: $(POTFILE) 
-
-install-po: $(MOFILES) 
-       $(OCAML_GETTEXT) --action install $(OCAML_GETTEXT_INSTALL_OPTIONS) \
-       --install-textdomain $(OCAML_GETTEXT_PACKAGE) \
-       --install-destdir $(PODIR) $(MOFILES)
-
-uninstall-po:
-       $(OCAML_GETTEXT) --action uninstall $(OCAML_GETTEXT_INSTALL_OPTIONS) \
-       --uninstall-textdomain $(OCAML_GETTEXT_PACKAGE) \
-       --uninstall-orgdir $(PODIR) $(MOFILES)
-
-clean-po:
-       -$(OCAML_GETTEXT) --action uninstall $(OCAML_GETTEXT_INSTALL_OPTIONS) \
-       --uninstall-textdomain $(OCAML_GETTEXT_PACKAGE) \
-       --uninstall-orgdir $(BUILDPO) $(MOFILES)
-       -$(RM) $(MOFILES) 
index 6150703..22b1625 100644 (file)
@@ -1,14 +1 @@
-../src/collect.ml
-../src/csv_output.ml
-../src/main.ml
-../src/opt_calendar.ml
-../src/opt_csv.ml
-../src/opt_gettext.ml
-../src/opt_xml.ml
-../src/redraw.ml
-../src/screen.ml
-../src/stream.ml
-../src/top.ml
-../src/types.ml
-../src/utils.ml
-../src/version.ml
+./src/dummy.c
diff --git a/po/POTFILES-ml b/po/POTFILES-ml
new file mode 100644 (file)
index 0000000..b6356eb
--- /dev/null
@@ -0,0 +1,14 @@
+./src/collect.ml
+./src/csv_output.ml
+./src/main.ml
+./src/opt_calendar.ml
+./src/opt_csv.ml
+./src/opt_gettext.ml
+./src/opt_xml.ml
+./src/redraw.ml
+./src/screen.ml
+./src/stream_output.ml
+./src/top.ml
+./src/types.ml
+./src/utils.ml
+./src/version.ml
index 3d7a1e5..09cd370 100644 (file)
 # SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
+# Copyright (C) YEAR Red Hat Inc.
+# This file is distributed under the same license as the virt-top package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2017-03-27 11:32+0000\n"
+"Project-Id-Version: virt-top 1.0.9\n"
+"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
+"component=libguestfs&product=Virtualization+Tools\n"
+"POT-Creation-Date: 2021-10-01 16:15+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
 
-#: ../src/top.ml:1670
+#: src/top.ml:588
 msgid "# %s virt-top configuration file\n"
 msgstr ""
 
-#: ../src/top.ml:1688
+#: src/top.ml:606
 msgid "# Enable CSV output to the named file\n"
 msgstr ""
 
-#: ../src/top.ml:1691
+#: src/top.ml:609
 msgid "# To protect this file from being overwritten, uncomment next line\n"
 msgstr ""
 
-#: ../src/top.ml:1685
+#: src/top.ml:603
 msgid "# To send debug and error messages to a file, uncomment next line\n"
 msgstr ""
 
-#: ../src/top.ml:1671
+#: src/top.ml:589
 msgid "# generated on %s by %s\n"
 msgstr ""
 
-#: ../src/top.ml:65
+#: src/types.ml:43
 msgid "%CPU"
 msgstr ""
 
-#: ../src/top.ml:66
+#: src/types.ml:44
 msgid "%MEM"
 msgstr ""
 
-#: ../src/top.ml:1237
-msgid "%d domains, %d active, %d running, %d sleeping, %d paused, %d inactive D:%d O:%d X:%d"
+#: src/redraw.ml:481
+msgid ""
+"%d domains, %d active, %d running, %d sleeping, %d paused, %d inactive D:%d "
+"O:%d X:%d"
 msgstr ""
 
-#: ../src/top.ml:245
+#: src/top.ml:177
 msgid "%s: could not parse '%s' in init file: expecting %s"
 msgstr ""
 
-#: ../src/top.ml:240
+#: src/top.ml:172
 msgid "%s: could not parse '%s' in init file: expecting a number"
 msgstr ""
 
-#: ../src/top.ml:235
+#: src/top.ml:167
 msgid "%s: could not parse '%s' in init file: expecting an integer"
 msgstr ""
 
-#: ../src/top.ml:105
+#: src/types.ml:83
 msgid "%s: display should be %s"
 msgstr ""
 
-#: ../src/top.ml:83
+#: src/types.ml:61
 msgid "%s: sort order should be: %s"
 msgstr ""
 
-#: ../src/top.ml:217
+#: src/top.ml:149
 msgid "%s: unknown parameter"
 msgstr ""
 
-#: ../src/top.ml:269
-msgid "%s:%d: configuration item ``%s'' ignored\n%!"
+#: src/top.ml:201
+msgid ""
+"%s:%d: configuration item ``%s'' ignored\n"
+"%!"
 msgstr ""
 
-#: ../src/top.ml:147
+#: src/top.ml:79
 msgid "-d: cannot set a negative delay"
 msgstr ""
 
-#: ../src/top.ml:173
+#: src/top.ml:105
 msgid "Batch mode"
 msgstr ""
 
-#: ../src/top.ml:72
+#: src/types.ml:50
 msgid "Block read reqs"
 msgstr ""
 
-#: ../src/top.ml:73
+#: src/types.ml:51
 msgid "Block write reqs"
 msgstr ""
 
-#: ../src/top.ml:1244
+#: src/redraw.ml:488
 msgid "CPU: %2.1f%%  Mem: %Ld MB (%Ld MB by guests)"
 msgstr ""
 
-#: ../src/top.ml:1493
+#: src/top.ml:411
 msgid "Change delay from %.1f to: "
 msgstr ""
 
-#: ../src/top.ml:177 ../src/top.ml:175
+#: src/top.ml:109 src/top.ml:107
 msgid "Connect to libvirt URI"
 msgstr ""
 
-#: ../src/top.ml:1744
+#: src/top.ml:662
 msgid "Connect: %s; Hostname: %s"
 msgstr ""
 
-#: ../src/top.ml:1783
+#: src/top.ml:701
 msgid "DISPLAY MODES"
 msgstr ""
 
-#: ../src/top.ml:1500
+#: src/top.ml:418
 msgid "Delay must be > 0"
 msgstr ""
 
-#: ../src/top.ml:189
+#: src/top.ml:121
 msgid "Delay time interval (seconds)"
 msgstr ""
 
-#: ../src/top.ml:1737
+#: src/top.ml:655
 msgid "Delay: %.1f secs; Batch: %s; Secure: %s; Sort: %s"
 msgstr ""
 
-#: ../src/top.ml:181
+#: src/top.ml:113
 msgid "Disable CPU stats in CSV"
 msgstr ""
 
-#: ../src/top.ml:185
+#: src/top.ml:117
 msgid "Disable block device stats in CSV"
 msgstr ""
 
-#: ../src/top.ml:183
+#: src/top.ml:115
 msgid "Disable memory stats in CSV"
 msgstr ""
 
-#: ../src/top.ml:187
+#: src/top.ml:119
 msgid "Disable net stats in CSV"
 msgstr ""
 
-#: ../src/top.ml:214
+#: src/top.ml:146
 msgid "Display version number and exit"
 msgstr ""
 
-#: ../src/top.ml:199
+#: src/top.ml:131
 msgid "Do not read init file"
 msgstr ""
 
-#: ../src/top.ml:68
+#: src/types.ml:46
 msgid "Domain ID"
 msgstr ""
 
-#: ../src/top.ml:69
+#: src/types.ml:47
 msgid "Domain name"
 msgstr ""
 
-#: ../src/top.ml:1797
+#: src/top.ml:715
 msgid "Domains display"
 msgstr ""
 
-#: ../src/main.ml:69 ../src/main.ml:44 ../src/top.ml:1711 ../src/top.ml:1708
+#: src/top.ml:629 src/top.ml:626 src/main.ml:69 src/main.ml:44
 msgid "Error"
 msgstr ""
 
-#: ../src/top.ml:193
+#: src/top.ml:125
 msgid "Exit at given time"
 msgstr ""
 
-#: ../src/top.ml:1766
+#: src/top.ml:684
 msgid "Help"
 msgstr ""
 
-#: ../src/top.ml:195
+#: src/top.ml:127
 msgid "Historical CPU delay"
 msgstr ""
 
-#: ../src/top.ml:179
+#: src/top.ml:111
 msgid "Log statistics to CSV file"
 msgstr ""
 
-#: ../src/top.ml:1749
+#: src/top.ml:667
 msgid "MAIN KEYS"
 msgstr ""
 
-#: ../src/top.ml:1804
+#: src/top.ml:722
 msgid "More help in virt-top(1) man page. Press any key to return."
 msgstr ""
 
-#: ../src/top.ml:294
-msgid "NB: If you want to monitor a local hypervisor, you usually need to be root"
+#: src/top.ml:226
+msgid ""
+"NB: If you want to monitor a local hypervisor, you usually need to be root"
 msgstr ""
 
-#: ../src/top.ml:70
+#: src/types.ml:48
 msgid "Net RX bytes"
 msgstr ""
 
-#: ../src/top.ml:71
+#: src/types.ml:49
 msgid "Net TX bytes"
 msgstr ""
 
-#: ../src/top.ml:1506
+#: src/top.ml:424
 msgid "Not a valid number"
 msgstr ""
 
-#: ../src/top.ml:201
+#: src/top.ml:133
 msgid "Number of iterations to run"
 msgstr ""
 
-#: ../src/top.ml:1740 ../src/top.ml:1739
+#: src/top.ml:658 src/top.ml:657
 msgid "Off"
 msgstr ""
 
-#: ../src/top.ml:1740 ../src/top.ml:1739
+#: src/top.ml:658 src/top.ml:657
 msgid "On"
 msgstr ""
 
-#: ../src/top.ml:1764
+#: src/top.ml:682
 msgid "Quit"
 msgstr ""
 
-#: ../src/top.ml:208
+#: src/top.ml:140
 msgid "Run from a script (no user interface)"
 msgstr ""
 
-#: ../src/top.ml:1771
+#: src/top.ml:689
 msgid "SORTING"
 msgstr ""
 
-#: ../src/top.ml:206
+#: src/top.ml:138
 msgid "Secure (\"kiosk\") mode"
 msgstr ""
 
-#: ../src/top.ml:1780
+#: src/top.ml:698
 msgid "Select sort field"
 msgstr ""
 
-#: ../src/top.ml:191
+#: src/top.ml:123
 msgid "Send debug messages to file"
 msgstr ""
 
-#: ../src/top.ml:197
+#: src/top.ml:129
 msgid "Set name of init file"
 msgstr ""
 
-#: ../src/top.ml:203
+#: src/top.ml:135
 msgid "Set sort order (%s)"
 msgstr ""
 
-#: ../src/top.ml:1514
+#: src/top.ml:432
 msgid "Set sort order for main display"
 msgstr ""
 
-#: ../src/top.ml:1765
+#: src/top.ml:683
 msgid "Set update interval"
 msgstr ""
 
-#: ../src/top.ml:1776
+#: src/top.ml:694
 msgid "Sort by %CPU"
 msgstr ""
 
-#: ../src/top.ml:1777
+#: src/top.ml:695
 msgid "Sort by %MEM"
 msgstr ""
 
-#: ../src/top.ml:1779
+#: src/top.ml:697
 msgid "Sort by ID"
 msgstr ""
 
-#: ../src/top.ml:1778
+#: src/top.ml:696
 msgid "Sort by TIME"
 msgstr ""
 
-#: ../src/top.ml:171
+#: src/top.ml:103
 msgid "Start by displaying block devices"
 msgstr ""
 
-#: ../src/top.ml:169
+#: src/top.ml:101
 msgid "Start by displaying network interfaces"
 msgstr ""
 
-#: ../src/top.ml:167
+#: src/top.ml:99
 msgid "Start by displaying pCPUs (default: tasks)"
 msgstr ""
 
-#: ../src/top.ml:67
+#: src/types.ml:45
 msgid "TIME (CPU time)"
 msgstr ""
 
-#: ../src/top.ml:1800
+#: src/top.ml:718
 msgid "Toggle block devices"
 msgstr ""
 
-#: ../src/top.ml:1799
+#: src/top.ml:717
 msgid "Toggle network interfaces"
 msgstr ""
 
-#: ../src/top.ml:1798
+#: src/top.ml:716
 msgid "Toggle physical CPUs"
 msgstr ""
 
-#: ../src/top.ml:1515
+#: src/top.ml:433
 msgid "Type key or use up and down cursor keys."
 msgstr ""
 
-#: ../src/top.ml:1809
+#: src/top.ml:727
 msgid "Unknown command - try 'h' for help"
 msgstr ""
 
-#: ../src/top.ml:1763
+#: src/top.ml:681
 msgid "Update display"
 msgstr ""
 
-#: ../src/top.ml:1703
+#: src/top.ml:621
 msgid "Wrote settings to %s"
 msgstr ""
 
-#: ../src/top.ml:1745
+#: src/top.ml:663
 msgid "default"
 msgstr ""
 
-#: ../src/top.ml:210
+#: src/top.ml:142
 msgid "dump output to stdout (no userinterface)"
 msgstr ""
 
-#: ../src/opt_xml.ml:46
+#: src/opt_xml.ml:46
 msgid "get_xml_desc didn't return <domain/>"
 msgstr ""
 
-#: ../src/top.ml:212
+#: src/top.ml:144
 msgid "show block device load in bytes rather than reqs"
 msgstr ""
 
-#: ../src/top.ml:1767
+#: src/top.ml:685
 msgid "toggle block info req/bytes"
 msgstr ""
 
-#: ../src/top.ml:1725
+#: src/top.ml:643
 msgid "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d by Red Hat"
 msgstr ""
 
-#: ../src/top.ml:218
-msgid "virt-top : a 'top'-like utility for virtualization\n\nSUMMARY\n  virt-top [-options]\n\nOPTIONS"
+#: src/top.ml:150
+msgid ""
+"virt-top : a 'top'-like utility for virtualization\n"
+"\n"
+"SUMMARY\n"
+"  virt-top [-options]\n"
+"\n"
+"OPTIONS"
 msgstr ""
 
-#: ../src/top.ml:42
+#: src/top.ml:39
 msgid "virt-top was compiled without support for CSV files"
 msgstr ""
 
-#: ../src/top.ml:53
+#: src/top.ml:46
 msgid "virt-top was compiled without support for dates and times"
 msgstr ""
-
diff --git a/po/zanata-pull.sh b/po/zanata-pull.sh
deleted file mode 100755 (executable)
index d051b7a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash -
-# Pull translations from Zanata.
-# Copyright (C) 2011-2015 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-set -e
-
-echo zanata po pull
-zanata po pull
-
-# Remove PO files that have no translations in them.
-for f in *.po; do
-  if ! grep -q '^msgstr "[^"]' $f; then
-    echo rm $f
-    rm $f
-  fi
-done
diff --git a/po/zanata.xml b/po/zanata.xml
deleted file mode 100644 (file)
index 64810f9..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<config xmlns="http://zanata.org/namespace/config/">
-  <url>https://fedora.zanata.org</url>
-  <project>virt-top</project>
-  <project-version>master</project-version>
-  <project-type>gettext</project-type>
-
-  <locales>
-    <locale>sq</locale>
-    <locale>ar</locale>
-    <locale>as</locale>
-    <locale>ast</locale>
-    <locale>bal</locale>
-    <locale>eu</locale>
-    <locale>bn</locale>
-    <locale>bn-IN</locale>
-    <locale>brx</locale>
-    <locale>bs</locale>
-    <locale>br</locale>
-    <locale>bg</locale>
-    <locale>ca</locale>
-    <locale>zh-CN</locale>
-    <locale>zh-HK</locale>
-    <locale>zh-TW</locale>
-    <locale>kw</locale>
-    <locale>kw-GB</locale>
-    <locale>cs</locale>
-    <locale>da</locale>
-    <locale>nl</locale>
-    <locale>en-GB</locale>
-    <locale>eo</locale>
-    <locale>et</locale>
-    <locale>fi</locale>
-    <locale>fr</locale>
-    <locale>gl</locale>
-    <locale>ka</locale>
-    <locale>de</locale>
-    <locale>el</locale>
-    <locale>gu</locale>
-    <locale>he</locale>
-    <locale>hi</locale>
-    <locale>hu</locale>
-    <locale>is</locale>
-    <locale>id</locale>
-    <locale>ia</locale>
-    <locale>it</locale>
-    <locale>ja</locale>
-    <locale>kn</locale>
-    <locale>kk</locale>
-    <locale>km</locale>
-    <locale>ky</locale>
-    <locale>ko</locale>
-    <locale>lt</locale>
-    <locale>nds</locale>
-    <locale>mk</locale>
-    <locale>mai</locale>
-    <locale>ms</locale>
-    <locale>ml</locale>
-    <locale>mr</locale>
-    <locale>mn</locale>
-    <locale>ne</locale>
-    <locale>nb</locale>
-    <locale>nn</locale>
-    <locale>or</locale>
-    <locale>pa</locale>
-    <locale>fa</locale>
-    <locale>pl</locale>
-    <locale>pt</locale>
-    <locale>pt-BR</locale>
-    <locale>ro</locale>
-    <locale>ru</locale>
-    <locale>sr</locale>
-    <locale>sr@latin</locale>
-    <locale>si</locale>
-    <locale>sk</locale>
-    <locale>sl</locale>
-    <locale>es</locale>
-    <locale>sv</locale>
-    <locale>tg</locale>
-    <locale>ta</locale>
-    <locale>te</locale>
-    <locale>bo</locale>
-    <locale>tr</locale>
-    <locale>uk</locale>
-    <locale>ur</locale>
-    <locale>wba</locale>
-    <locale>cy</locale>
-    <locale>lv</locale>
-    <locale>kw@uccor</locale>
-    <locale>kw@kkcor</locale>
-    <locale>af</locale>
-    <locale>am</locale>
-    <locale>be</locale>
-    <locale>hr</locale>
-    <locale>de-CH</locale>
-    <locale>th</locale>
-    <locale>vi</locale>
-    <locale>zu</locale>
-    <locale>ilo</locale>
-    <locale>nso</locale>
-    <locale>tw</locale>
-    <locale>yo</locale>
-    <locale>anp</locale>
-  </locales>
-
-</config>
index 1075f36..ce785dd 100644 (file)
-collect.cmi: types.cmi
-collect.cmo: utils.cmi types.cmi collect.cmi
-collect.cmx: utils.cmx types.cmx collect.cmi
-csv_output.cmi: types.cmi collect.cmi
-csv_output.cmo: collect.cmi csv_output.cmi
-csv_output.cmx: collect.cmx csv_output.cmi
-main.cmo: top.cmi opt_gettext.cmo
-main.cmx: top.cmx opt_gettext.cmx
-opt_calendar.cmo: top.cmi opt_gettext.cmo
-opt_calendar.cmx: top.cmx opt_gettext.cmx
-opt_csv.cmo: top.cmi opt_gettext.cmo csv_output.cmi
-opt_csv.cmx: top.cmx opt_gettext.cmx csv_output.cmx
-opt_gettext.cmo:
-opt_gettext.cmx:
-opt_xml.cmo: opt_gettext.cmo collect.cmi
-opt_xml.cmx: opt_gettext.cmx collect.cmx
-redraw.cmi: types.cmi collect.cmi
-redraw.cmo: utils.cmi types.cmi screen.cmi opt_gettext.cmo collect.cmi redraw.cmi
-redraw.cmx: utils.cmx types.cmx screen.cmx opt_gettext.cmx collect.cmx redraw.cmi
-screen.cmi:
-screen.cmo: screen.cmi
-screen.cmx: screen.cmi
-stream_output.cmi: types.cmi collect.cmi
-stream_output.cmo: utils.cmi screen.cmi collect.cmi stream_output.cmi
-stream_output.cmx: utils.cmx screen.cmx collect.cmx stream_output.cmi
-top.cmi: types.cmi
-top.cmo: version.cmo utils.cmi types.cmi stream_output.cmi screen.cmi redraw.cmi opt_gettext.cmo csv_output.cmi collect.cmi top.cmi
-top.cmx: version.cmx utils.cmx types.cmx stream_output.cmx screen.cmx redraw.cmx opt_gettext.cmx csv_output.cmx collect.cmx top.cmi
-types.cmi:
-types.cmo: utils.cmi opt_gettext.cmo types.cmi
-types.cmx: utils.cmx opt_gettext.cmx types.cmi
-utils.cmi:
-utils.cmo: utils.cmi
-utils.cmx: utils.cmi
-version.cmo:
-version.cmx:
+# OCaml dependencies generated by ../ocaml-dep.sh
+
+collect.cmo : \
+    utils.cmi \
+    types.cmi \
+    collect.cmi
+collect.cmx : \
+    utils.cmx \
+    types.cmx \
+    collect.cmi
+collect.cmi : \
+    types.cmi
+csv_output.cmo : \
+    collect.cmi \
+    csv_output.cmi
+csv_output.cmx : \
+    collect.cmx \
+    csv_output.cmi
+csv_output.cmi : \
+    types.cmi \
+    collect.cmi
+main.cmo : \
+    top.cmi \
+    opt_gettext.cmo
+main.cmx : \
+    top.cmx \
+    opt_gettext.cmx
+opt_calendar.cmo : \
+    top.cmi \
+    opt_gettext.cmo
+opt_calendar.cmx : \
+    top.cmx \
+    opt_gettext.cmx
+opt_csv.cmo : \
+    top.cmi \
+    opt_gettext.cmo \
+    csv_output.cmi
+opt_csv.cmx : \
+    top.cmx \
+    opt_gettext.cmx \
+    csv_output.cmx
+opt_gettext.cmo :
+opt_gettext.cmx :
+opt_xml.cmo : \
+    opt_gettext.cmo \
+    collect.cmi
+opt_xml.cmx : \
+    opt_gettext.cmx \
+    collect.cmx
+redraw.cmo : \
+    utils.cmi \
+    types.cmi \
+    screen.cmi \
+    opt_gettext.cmo \
+    collect.cmi \
+    redraw.cmi
+redraw.cmx : \
+    utils.cmx \
+    types.cmx \
+    screen.cmx \
+    opt_gettext.cmx \
+    collect.cmx \
+    redraw.cmi
+redraw.cmi : \
+    types.cmi \
+    collect.cmi
+screen.cmo : \
+    screen.cmi
+screen.cmx : \
+    screen.cmi
+screen.cmi :
+stream_output.cmo : \
+    utils.cmi \
+    screen.cmi \
+    collect.cmi \
+    stream_output.cmi
+stream_output.cmx : \
+    utils.cmx \
+    screen.cmx \
+    collect.cmx \
+    stream_output.cmi
+stream_output.cmi : \
+    types.cmi \
+    collect.cmi
+top.cmo : \
+    version.cmo \
+    utils.cmi \
+    types.cmi \
+    stream_output.cmi \
+    screen.cmi \
+    redraw.cmi \
+    opt_gettext.cmo \
+    csv_output.cmi \
+    collect.cmi \
+    top.cmi
+top.cmx : \
+    version.cmx \
+    utils.cmx \
+    types.cmx \
+    stream_output.cmx \
+    screen.cmx \
+    redraw.cmx \
+    opt_gettext.cmx \
+    csv_output.cmx \
+    collect.cmx \
+    top.cmi
+top.cmi : \
+    types.cmi
+types.cmo : \
+    utils.cmi \
+    opt_gettext.cmo \
+    types.cmi
+types.cmx : \
+    utils.cmx \
+    opt_gettext.cmx \
+    types.cmi
+types.cmi :
+utils.cmo : \
+    utils.cmi
+utils.cmx : \
+    utils.cmi
+utils.cmi :
+version.cmo :
+version.cmx :
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..32a51ac
--- /dev/null
@@ -0,0 +1,125 @@
+# virt-top
+# Copyright (C) 2007-2021 Red Hat Inc., Richard W.M. Jones
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+CLEANFILES = *~ *.bak *.orig *.rej
+CLEANFILES += *.cmi *.cmo *.cma *.cmx *.cmxa dll*.so *.a *.annot
+
+EXTRA_DIST = \
+       .depend \
+       collect.ml \
+       collect.mli \
+       csv_output.ml \
+       csv_output.mli \
+       dummy.c \
+       main.ml \
+       opt_calendar.ml \
+       opt_csv.ml \
+       opt_gettext.ml \
+       opt_xml.ml \
+       redraw.ml \
+       redraw.mli \
+       screen.ml \
+       screen.mli \
+       stream_output.ml \
+       stream_output.mli \
+       top.ml \
+       top.mli \
+       types.ml \
+       types.mli \
+       utils.ml \
+       utils.mli \
+       version.ml \
+       virt-top.pod
+
+OCAMLPACKAGES = -package unix,extlib,curses,str,libvirt
+
+if HAVE_PKG_GETTEXT
+OCAMLPACKAGES  += -package gettext-stub
+endif
+
+BOBJS = \
+       version.cmo \
+       opt_gettext.cmo \
+       utils.cmo \
+       types.cmo \
+       collect.cmo \
+       screen.cmo \
+       redraw.cmo \
+       csv_output.cmo \
+       stream_output.cmo \
+       top.cmo
+if HAVE_PKG_XML_LIGHT
+BOBJS += opt_xml.cmo
+OCAMLPACKAGES += -package xml-light
+endif
+if HAVE_PKG_CSV
+BOBJS += opt_csv.cmo
+OCAMLPACKAGES += -package csv
+endif
+if HAVE_PKG_CALENDAR
+BOBJS += opt_calendar.cmo
+OCAMLPACKAGES += -package calendar
+endif
+BOBJS += main.cmo
+
+XOBJS = $(BOBJS:.cmo=.cmx)
+
+OCAMLFLAGS = -g -warn-error CDEFLMPSUVYZX-3 -ccopt '@CFLAGS@'
+OCAMLLIBS =
+
+bin_PROGRAMS = virt-top
+
+virt_top_SOURCES = dummy.c
+
+if !HAVE_OCAMLOPT
+OBJECTS = $(BOBJS)
+else
+OBJECTS = $(XOBJS)
+endif
+
+virt_top_DEPENDENCIES = $(OBJECTS)
+virt_top_LINK = \
+       ../ocaml-link.sh -cclib '$(OCAMLLIBS)' -- \
+         $(OCAMLFIND) $(OCAMLBEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \
+         $(OBJECTS) -o $@
+
+.mli.cmi:
+       $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
+.ml.cmo:
+       $(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
+.ml.cmx:
+       $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
+
+# Dependencies.
+.depend: $(srcdir)/*.ml $(srcdir)/*.mli
+       ../ocaml-dep.sh $^
+-include .depend
+
+# Manual page.
+if HAVE_PERLDOC
+
+virt-top.1: virt-top.pod
+       pod2man -u --section 1 -c "Virtualization Support" \
+               --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
+               $< > $@
+
+virt-top.txt: virt-top.pod
+       pod2text $< > $@
+
+CLEANFILES += virt-top.1 virt-top.txt
+
+endif
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644 (file)
index ba4eb1d..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-# virt-top
-# Copyright (C) 2007-2014 Red Hat Inc., Richard W.M. Jones
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-PACKAGE                := @PACKAGE_NAME@
-VERSION                := @PACKAGE_VERSION@
-
-INSTALL                := @INSTALL@
-HAVE_PERLDOC   := @HAVE_PERLDOC@
-
-prefix         = @prefix@
-exec_prefix    = @exec_prefix@
-bindir         = @bindir@
-
-OCAML_PKG_curses    = @OCAML_PKG_curses@
-OCAML_PKG_xml_light = @OCAML_PKG_xml_light@
-OCAML_PKG_csv      = @OCAML_PKG_csv@
-OCAML_PKG_calendar  = @OCAML_PKG_calendar@
-OCAML_PKG_gettext   = @OCAML_PKG_gettext@
-
-OCAMLCPACKAGES := -package unix,extlib,curses,str,libvirt
-
-ifneq ($(OCAML_PKG_gettext),no)
-OCAMLCPACKAGES  += -package gettext-stub
-endif
-
-OBJS           := \
-                  version.cmo \
-                  opt_gettext.cmo \
-                  utils.cmo \
-                  types.cmo \
-                  collect.cmo \
-                  screen.cmo \
-                  redraw.cmo \
-                  csv_output.cmo \
-                  stream_output.cmo \
-                  top.cmo
-ifneq ($(OCAML_PKG_xml_light),no)
-OBJS           += opt_xml.cmo
-OCAMLCPACKAGES += -package xml-light
-endif
-ifneq ($(OCAML_PKG_csv),no)
-OBJS           += opt_csv.cmo
-OCAMLCPACKAGES += -package csv
-endif
-ifneq ($(OCAML_PKG_calendar),no)
-OBJS           += opt_calendar.cmo
-OCAMLCPACKAGES += -package calendar
-endif
-OBJS           += main.cmo
-
-XOBJS          := $(OBJS:.cmo=.cmx)
-
-OCAMLCFLAGS    := -g -warn-error CDEFLMPSUVYZX-3 -ccopt '@CFLAGS@'
-OCAMLCLIBS     := -linkpkg -runtime-variant _pic -cclib '@LDFLAGS@'
-
-OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
-OCAMLOPTFLAGS  := $(OCAMLCFLAGS)
-OCAMLOPTLIBS   := $(OCAMLCLIBS)
-
-BYTE_TARGETS   := virt-top
-OPT_TARGETS    := virt-top.opt
-
-ifeq ($(HAVE_PERLDOC),perldoc)
-BYTE_TARGETS   += virt-top.1 virt-top.txt
-OPT_TARGETS    += virt-top.1 virt-top.txt
-endif
-
-all: $(BYTE_TARGETS)
-
-opt: $(OPT_TARGETS)
-
-virt-top: $(OBJS)
-       ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
-         -o $@ $^
-
-virt-top.opt: $(XOBJS)
-       ocamlfind ocamlopt \
-         $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
-         -o $@ $^
-
-# Manual page.
-ifeq ($(HAVE_PERLDOC),perldoc)
-virt-top.1: virt-top.pod
-       pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
-               $< > $@
-
-virt-top.txt: virt-top.pod
-       pod2text $< > $@
-endif
-
-install:
-       if [ -x virt-top.opt ]; then \
-         mkdir -p $(DESTDIR)$(bindir); \
-         $(INSTALL) -m 0755 virt-top.opt $(DESTDIR)$(bindir)/virt-top; \
-       fi
-
-include ../Make.rules
diff --git a/src/dummy.c b/src/dummy.c
new file mode 100644 (file)
index 0000000..ebab619
--- /dev/null
@@ -0,0 +1,2 @@
+/* Dummy source, to be used for OCaml-based tools with no C sources. */
+enum { foo = 1 };