Version 1.0.9.
[virt-top.git] / configure.ac
index 66e4159..b3f7add 100644 (file)
@@ -17,7 +17,7 @@
 
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([virt-top],[1.0.7])
+AC_INIT([virt-top],[1.0.9])
 AC_CONFIG_MACRO_DIR([m4])
 
 AC_PROG_INSTALL
@@ -57,12 +57,7 @@ dnl Check for optional OCaml packages.
 AC_CHECK_OCAML_PKG(gettext)
 AC_CHECK_OCAML_PKG(xml-light)
 AC_CHECK_OCAML_PKG(csv)
-
-dnl Need to check which version of calendar is installed.
 AC_CHECK_OCAML_PKG(calendar)
-if test "x$OCAML_PKG_calendar" != "xno"; then
-    AC_CHECK_OCAML_MODULE(is_calendar2,calendar,[CalendarLib.Date],[+$OCAML_PKG_calendar])
-fi
 
 AC_SUBST(OCAML_PKG_unix)
 AC_SUBST(OCAML_PKG_extlib)
@@ -71,7 +66,6 @@ AC_SUBST(OCAML_PKG_gettext)
 AC_SUBST(OCAML_PKG_xml_light)
 AC_SUBST(OCAML_PKG_csv)
 AC_SUBST(OCAML_PKG_calendar)
-AC_SUBST(is_calendar2)
 
 dnl Check for optional perldoc (for building manual pages).
 AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc)
@@ -82,28 +76,30 @@ AC_CHECK_PROG(OCAML_GETTEXT,ocaml-gettext,ocaml-gettext)
 dnl Check for msgfmt tool.
 AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
 
+dnl Substitute CFLAGS and LDFLAGS if set.
+AC_SUBST([CFLAGS])
+AC_SUBST([LDFLAGS])
+
 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 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$OCAML_PKG_gettext" != "xno"; then
-        # Gettext module is available, so use it.
-        cat <<EOT >>$d/$f
+AC_MSG_NOTICE([creating src/opt_gettext.ml])
+rm -f src/opt_gettext.ml
+echo "(* This file is generated automatically by ./configure. *)" > src/opt_gettext.ml
+if test "x$OCAML_PKG_gettext" != "xno"; then
+    # Gettext module is available, so use it.
+    cat <<EOT >>src/opt_gettext.ml
 module Gettext = Gettext.Program (
   struct
-    let textdomain = "$d"
+    let textdomain = "virt-top"
     let codeset = None
     let dir = None
     let dependencies = [[]]
   end
 ) (GettextStub.Native)
 EOT
-    else
-        # No gettext module is available, so fake the translation functions.
-        cat <<EOT >>$d/$f
+else
+    # No gettext module is available, so fake the translation functions.
+    cat <<EOT >>src/opt_gettext.ml
 module Gettext = struct
   external s_ : string -> string = "%identity"
   external f_ : ('a -> 'b, 'c, 'd) format -> ('a -> 'b, 'c, 'd) format
@@ -115,8 +111,7 @@ module Gettext = struct
     = fun s p n -> if n = 1 then s else p
 end
 EOT
-    fi
-done
+fi
 
 dnl Summary.
 echo "------------------------------------------------------------"
@@ -128,7 +123,7 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile
        Make.rules
        po/Makefile
-       virt-top/Makefile
-       virt-top/virt_top_version.ml
+       src/Makefile
+       src/version.ml
        ])
 AC_OUTPUT