From: Richard W.M. Jones Date: Fri, 29 Jul 2011 16:10:25 +0000 (+0100) Subject: Generate config.ml from Makefile, add iconsdir path. X-Git-Tag: 0.2.1~5 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=fb002571a0432d83a25487c2644fc831180c4443;p=guestfs-browser.git Generate config.ml from Makefile, add iconsdir path. Because iconsdir contains the prefix, we can't generate it from configure. --- diff --git a/Makefile.am b/Makefile.am index 09cb806..2dbe1ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,7 +40,6 @@ SOURCES = \ cmdline.mli \ cmdline.ml \ config.mli \ - config.ml \ deviceSet.mli \ deviceSet.ml \ filetree.mli \ @@ -84,6 +83,9 @@ SOURCES = \ window.mli \ window.ml +BUILT_SOURCES = \ + config.ml + # Note this list must be in dependency order. OBJECTS = \ config.cmo \ @@ -171,11 +173,25 @@ icon_DATA = guestfs-browser.svg guestfs-browser-large.png guestfs-browser.png desktopdir = $(datadir)/applications desktop_DATA = guestfs-browser.desktop -guestfs-browser.desktop: guestfs-browser.desktop.in - $(SED) "s,\@icondir\@,$(icondir),g" < $< > $@ +guestfs-browser.desktop: guestfs-browser.desktop.in Makefile + $(SED) "s,\@icondir\@,$(icondir),g" < $< > $@-t + mv $@-t $@ TESTS += test-desktop-file-validate.sh +# Config. Can't use autoconf to build this because we want +# to embed the true icondir path. +config.ml: config.ml.in Makefile + < $< \ + $(SED) \ + -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \ + -e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \ + -e "s,\@HIVEXREGEDIT\@,$(HIVEXREGEDIT),g" \ + -e "s,\@OPENER\@,$(OPENER),g" \ + -e "s,\@icondir\@,$(icondir),g" \ + > $@-t + mv $@-t $@ + # Man page. man_MANS = guestfs-browser.1 diff --git a/config.ml.in b/config.ml.in index 74773a5..c9cefd8 100644 --- a/config.ml.in +++ b/config.ml.in @@ -23,3 +23,5 @@ let hivexregedit = "@HIVEXREGEDIT@" let hivexregedit = if hivexregedit <> "no" then Some hivexregedit else None let opener = "@OPENER@" let opener = if opener <> "no" then Some opener else None + +let icondir = "@icondir@" diff --git a/config.mli b/config.mli index d83b673..69c962f 100644 --- a/config.mli +++ b/config.mli @@ -1,5 +1,5 @@ (* Guestfs Browser. - * Copyright (C) 2010 Red Hat Inc. + * Copyright (C) 2010-2011 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 @@ -16,13 +16,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) -(** Configuration supplied by autoconf. - - This module is generated by running [./configure], and - contains miscellaneous compile-time constants. *) +(** Configuration. *) val package : string (** The package name. *) + val version : string (** The version number as a string. *) @@ -31,3 +29,6 @@ val hivexregedit : string option val opener : string option (** External program for viewing files, or None if not available. *) + +val icondir : string + (** The icon directory. *) diff --git a/configure.ac b/configure.ac index 44be079..3a0b364 100644 --- a/configure.ac +++ b/configure.ac @@ -110,5 +110,5 @@ fi AM_CONDITIONAL([HAVE_PERLDOC],[test "x$PERLDOC" != "xno"]) AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile config.ml]) +AC_CONFIG_FILES([Makefile]) AC_OUTPUT