[PATCH 1/2] build: require Config before Common_utils
Build the Config mllib module before Common_utils, as the latter will soon make use of the former. --- customize/Makefile.am | 2 +- resize/Makefile.am | 2 +- sparsify/Makefile.am | 2 +- sysprep/Makefile.am | 2 +- v2v/Makefile.am | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/customize/Makefile.am b/customize/Makefile.am index 869a2d7..d36721a 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -88,9 +88,9 @@ virt_customize_CFLAGS = \ $(LIBXML2_CFLAGS) BOBJECTS = \ + $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/common_gettext.cmo \ $(top_builddir)/mllib/common_utils.cmo \ - $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/regedit.cmo \ $(top_builddir)/mllib/uRI.cmo \ $(SOURCES_ML:.ml=.cmo) diff --git a/resize/Makefile.am b/resize/Makefile.am index 486a03d..12afd09 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -56,9 +56,9 @@ BOBJECTS = \ $(top_builddir)/mllib/fsync.cmo \ $(top_builddir)/mllib/progress.cmo \ $(top_builddir)/mllib/uRI.cmo \ + $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/common_gettext.cmo \ $(top_builddir)/mllib/common_utils.cmo \ - $(top_builddir)/mllib/config.cmo \ $(SOURCES_ML:.ml=.cmo) XOBJECTS = $(BOBJECTS:.cmo=.cmx) diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am index 2d85cca..205641d 100644 --- a/sparsify/Makefile.am +++ b/sparsify/Makefile.am @@ -52,10 +52,10 @@ virt_sparsify_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) BOBJECTS = \ + $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/common_gettext.cmo \ $(top_builddir)/mllib/common_utils.cmo \ $(top_builddir)/mllib/progress.cmo \ - $(top_builddir)/mllib/config.cmo \ $(SOURCES_ML:.ml=.cmo) XOBJECTS = $(BOBJECTS:.cmo=.cmx) diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index 55b131f..c57060d 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -103,10 +103,10 @@ virt_sysprep_CFLAGS = \ $(LIBXML2_CFLAGS) BOBJECTS = \ + $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/common_gettext.cmo \ $(top_builddir)/mllib/common_utils.cmo \ $(top_builddir)/mllib/uRI.cmo \ - $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/mkdtemp.cmo \ $(top_builddir)/mllib/regedit.cmo \ $(top_builddir)/customize/customize_utils.cmo \ diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 06f8380..5efb7fb 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -121,11 +121,11 @@ virt_v2v_CFLAGS = \ $(LIBVIRT_CFLAGS) BOBJECTS = \ + $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/common_gettext.cmo \ $(top_builddir)/mllib/common_utils.cmo \ $(top_builddir)/mllib/regedit.cmo \ $(top_builddir)/mllib/progress.cmo \ - $(top_builddir)/mllib/config.cmo \ $(top_builddir)/mllib/mkdtemp.cmo \ $(top_builddir)/mllib/JSON.cmo \ $(top_builddir)/customize/customize_utils.cmo \ -- 2.1.0
Create a version string that includes the "extra" string as well, and make use of it in print_version_and_exit (which can avoid creating a new Guestfs handle). Folloup of commit 478a552ab431762dd2a724ade0c3fd84a21b7cab. --- configure.ac | 2 ++ mllib/common_utils.ml | 6 +----- mllib/config.ml.in | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index eeb61ea..98e8605 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,8 @@ AC_DEFINE([PACKAGE_VERSION_MAJOR],[libguestfs_major],[Major version number.]) AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number.]) AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number.]) AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],["$libguestfs_extra"],[Extra version string.]) +PACKAGE_VERSION_FULL="libguestfs_major.libguestfs_minor.libguestfs_release${libguestfs_extra}" +AC_SUBST([PACKAGE_VERSION_FULL]) # Define $(SED). m4_ifdef([AC_PROG_SED],[ diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 0d6a4a6..652a412 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -344,11 +344,7 @@ let run_main_and_handle_errors ~prog main = * the OCaml tools. *) let print_version_and_exit ~prog () = - let g = G.create () in - let { G.major = major; minor = minor; - release = release; extra = extra } = G.version g in - G.close g; - printf "%s %Ld.%Ld.%Ld%s\n%!" prog major minor release extra; + printf "%s %s\n%!" prog Config.package_version_full; exit 0 let read_whole_file path = diff --git a/mllib/config.ml.in b/mllib/config.ml.in index 793a35a..fe7850b 100644 --- a/mllib/config.ml.in +++ b/mllib/config.ml.in @@ -19,6 +19,7 @@ let package_name = "@PACKAGE_NAME@" let package_version = "@PACKAGE_VERSION@" +let package_version_full = "@PACKAGE_VERSION_FULL@" let prefix = "@prefix@" let datadir = prefix ^ "/share" let host_cpu = "@host_cpu@" -- 2.1.0
On Mon, Apr 20, 2015 at 02:18:15PM +0200, Pino Toscano wrote:
Create a version string that includes the "extra" string as well, and make use of it in print_version_and_exit (which can avoid creating a new Guestfs handle).
Folloup of commit 478a552ab431762dd2a724ade0c3fd84a21b7cab.
ACK both. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
participants (2)
-
Pino Toscano -
Richard W.M. Jones