X-Git-Url: http://git.annexia.org/?p=virt-top.git;a=blobdiff_plain;f=configure.ac;h=57517f862857f087103e3cd684e18e9478cc9f7c;hp=8926a9bcab9c7c73025661ae6f93f4767c6e458c;hb=e6cca10e5cf86b9bd280e371fb1195835a96bff0;hpb=87751781213a1252711b896290a7cc3f07ec0169 diff --git a/configure.ac b/configure.ac index 8926a9b..57517f8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # ocaml-libvirt -# Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones +# Copyright (C) 2007-2008 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 @@ -17,7 +17,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ocaml-libvirt,0.4.0.3) +AC_INIT(ocaml-libvirt,0.4.1.1) dnl Check for basic C environment. AC_PROG_CC @@ -147,6 +147,29 @@ AC_CHECK_TYPES([virJobPtr, virStoragePoolPtr, virStorageVolPtr],,, dnl Check for optional ncurses. AC_CHECK_LIB(ncurses,initscr) +dnl Check for optional GNOME icons (from gnome-icon-theme package). +AC_ARG_WITH(icons, + AC_HELP_STRING([--with-icons=PATH], + [Set path to installed icons @<:@default=/usr/share/icons@:>@]), + [],[with_icons=/usr/share/icons]) +icons="" +if test "x$with_icons" != "xno"; then + for size in 16 24 32 48; do + for f in devices/computer.png; do + fname="${with_icons}/gnome/${size}x${size}/${f}" + AC_MSG_CHECKING([checking for icon $fname]) + if test -f "$fname"; then + AC_MSG_RESULT([yes]) + icons="$size $f $fname $icons" + else + AC_MSG_RESULT([no]) + fi + done + done +fi +AC_SUBST(with_icons) +AC_SUBST(icons) + dnl Check for basic OCaml environment & findlib. dnl Note that findlib is not necessary, but things will work better dnl if it is present. @@ -170,6 +193,7 @@ if test "x$OCAMLFIND" != "x"; then AC_CHECK_OCAML_PKG(xml-light) AC_CHECK_OCAML_PKG(csv) AC_CHECK_OCAML_PKG(dbus) + AC_CHECK_OCAML_PKG(gettext) dnl Need to check which version of calendar is installed. AC_CHECK_OCAML_MODULE(calendar,pkg_calendar2,CalendarLib.Date,[+calendar]) @@ -185,6 +209,7 @@ if test "x$OCAMLFIND" != "x"; then AC_SUBST(pkg_xml_light) AC_SUBST(pkg_csv) AC_SUBST(pkg_dbus) + AC_SUBST(pkg_gettext) AC_SUBST(pkg_calendar) AC_SUBST(pkg_calendar2) else @@ -204,6 +229,7 @@ else AC_CHECK_OCAML_MODULE(xml-light,pkg_xml_light,Xml,[+xml-light]) AC_CHECK_OCAML_MODULE(csv,pkg_csv,Csv,[+csv]) AC_CHECK_OCAML_MODULE(dbus,pkg_dbus,DBus,[+dbus]) + AC_CHECK_OCAML_MODULE(gettext,pkg_gettext,Gettext,[+gettext]) dnl XXX Version check - see above. AC_CHECK_OCAML_MODULE(calendar,pkg_calendar,Calendar,[+calendar]) fi @@ -224,6 +250,12 @@ AC_SUBST(subdirs) dnl Check for optional perldoc (for building manual pages). AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc) +dnl Check for optional gdk-pixbuf-mlsource (for icons). +AC_CHECK_PROG(HAVE_GDK_PIXBUF_MLSOURCE,gdk-pixbuf-mlsource,gdk-pixbuf-mlsource) + +dnl Check for recommended ocaml-gettext tool. +AC_CHECK_PROG(OCAML_GETTEXT,ocaml-gettext,ocaml-gettext) + dnl Check for optional NSIS (for building a Windows installer). AC_ARG_WITH([nsis], [AS_HELP_STRING([--with-nsis], @@ -313,6 +345,42 @@ AC_SUBST(GNUTLS_DLL_PATH) AC_SUBST(GTK_DLL_PATH) AC_SUBST(GTK_PATH) +dnl Write gettext modules for the programs. +dnl http://www.le-gall.net/sylvain+violaine/documentation/ocaml-gettext/html/reference-manual/ch03s04.html +for d in mlvirsh virt-ctrl virt-df virt-top; do + f=`echo $d | tr - _`_gettext.ml + AC_MSG_NOTICE([creating $d/$f]) + rm -f $d/$f + echo "(* This file is generated automatically by ./configure. *)" > $d/$f + if test "x$pkg_gettext" != "xno"; then + # Gettext module is available, so use it. + cat <>$d/$f +module Gettext = Gettext.Program ( + struct + let textdomain = "$d" + let codeset = None + let dir = None + let dependencies = [[]] + end +) (GettextStub.Native) +EOT + else + # No gettext module is available, so fake the translation functions. + cat <>$d/$f +module Gettext = struct + external s_ : string -> string = "%identity" + external f_ : ('a -> 'b, 'c, 'd) format -> ('a -> 'b, 'c, 'd) format + = "%identity" + let sn_ : string -> string -> int -> string + = fun s p n -> if n = 1 then s else p + let fn_ : ('a -> 'b, 'c, 'd) format -> ('a -> 'b, 'c, 'd) format -> int + -> ('a -> 'b, 'c, 'd) format + = fun s p n -> if n = 1 then s else p +end +EOT + fi +done + dnl Summary. echo "------------------------------------------------------------" echo "Thanks for downloading" $PACKAGE_STRING @@ -325,6 +393,7 @@ AC_CONFIG_FILES([META libvirt/libvirt_version.ml Makefile Make.rules + po/Makefile libvirt/Makefile examples/Makefile mlvirsh/Makefile