-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; 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 <<EOT >>$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 <<EOT >>$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
-