Commit 30c88a28 authored by Romain Beauxis's avatar Romain Beauxis

Imported Upstream version 0.2.2

parent 5a7ce62e
0.2.2 (26-06-2011)
=====
* Cleaned up daemonization code,
added optional change of user,
should be useful when running
as root.
0.2.1 (18-09-2010)
=====
* Fixed requires, s/thread/threads/
......
......@@ -3,7 +3,7 @@
SRC=src
PROGNAME=ocaml-dtools
DISTFILES = bootstrap CHANGES configure configure.ac \
COPYING Makefile README \
COPYING Makefile README m4/*.m4 \
src/OCamlMakefile src/*Makefile.in src/META.in src/*.ml src/*.mli \
doc/html
......
#!/bin/sh
aclocal -I m4
autoconf
This source diff could not be displayed because it is too large. You can view the blob instead.
AC_INIT(ocaml-dtools, 0.2.1, savonet-users@lists.sourceforge.net)
AC_INIT(ocaml-dtools, 0.2.2, savonet-users@lists.sourceforge.net)
VERSION=$PACKAGE_VERSION
AC_MSG_RESULT(configuring $PACKAGE_STRING)
REQUIRES="str unix threads"
OCAMLFIND_LDCONF=""
AC_ARG_ENABLE([ldconf], AC_HELP_STRING([--disable-ldconf],[don't modify the dynamic loader configuration file (default is enable)]),[ac_enable_ldconf=$enableval],[ac_enable_ldconf=$enableval],[ac_enable_ldconf=yes])
if test "$ac_enable_ldconf" = no ; then
AC_MSG_RESULT(disabling modification of ld.conf)
OCAMLFIND_LDCONF=dummy
fi
# Check for Ocaml compilers
# we first look for ocamlc in the path; if not present, we fail
AC_CHECK_PROG(OCAMLC,ocamlc,`which ocamlc`,no)
if test "$OCAMLC" = no ; then
AC_MSG_ERROR(Cannot find ocamlc.)
fi
# we look for the directory of ocamlc in $OCAMLC
OCAMLBIN=`dirname $OCAMLC`
# we extract Ocaml version number and library path
OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
echo "ocaml version is $OCAMLVERSION"
OCAMLLIB=`$OCAMLC -v | tail -n 1 | cut -f 4 -d " "`
echo "ocaml library path is $OCAMLLIB"
# then we look for ocamlopt; if not present, we issue a warning
# if the version is not the same, we also discard it
# we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not
AC_PATH_PROG(OCAMLOPT,ocamlopt,no)
OCAMLBEST=byte
if test "$OCAMLOPT" = no ; then
AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.)
else
AC_MSG_CHECKING(ocamlopt version)
TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVERSION" != "$OCAMLVERSION" ; then
AC_MSG_RESULT(differs from ocamlc; ocamlopt discarded.)
OCAMLOPT=no
else
AC_MSG_RESULT(ok)
OCAMLBEST=native
fi
fi
# checking for ocamlc.opt
AC_PATH_PROG(OCAMLCDOTOPT,ocamlc.opt,no)
if test "$OCAMLCDOTOPT" != no ; then
AC_MSG_CHECKING(ocamlc.opt version)
TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVERSION" != "$OCAMLVERSION" ; then
AC_MSG_RESULT(differs from ocamlc; ocamlc.opt discarded.)
else
AC_MSG_RESULT(ok)
OCAMLC=$OCAMLCDOTOPT
fi
fi
# checking for ocamlopt.opt
if test "$OCAMLOPT" != no ; then
AC_PATH_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,no)
if test "$OCAMLOPTDOTOPT" != no ; then
AC_MSG_CHECKING(ocamlc.opt version)
TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVER" != "$OCAMLVERSION" ; then
AC_MSG_RESULT(differs from ocamlc; ocamlopt.opt discarded.)
else
AC_MSG_RESULT(ok)
OCAMLOPT=$OCAMLOPTDOTOPT
fi
fi
fi
# ocamldep, ocamllex and ocamlyacc should also be present in the path
AC_PATH_PROG(OCAMLDEP,ocamldep,no)
if test "$OCAMLDEP" = no ; then
AC_MSG_ERROR(Cannot find ocamldep.)
fi
AC_PATH_PROG(OCAMLLEX,ocamllex,no)
if test "$OCAMLLEX" = no ; then
AC_MSG_ERROR(Cannot find ocamllex.)
fi
AC_PATH_PROG(OCAMLYACC,ocamlyacc,no)
if test "$OCAMLYACC" = no ; then
AC_MSG_ERROR(Cannot find ocamlyacc.)
fi
AC_PATH_PROG(OCAMLDOC,ocamldoc,no)
AC_ARG_ENABLE([debugging],
AC_HELP_STRING(
[--enable-debugging],
[compile with debugging information (backtrace printing in particular)]))
if test "x$enable_debugging" = "xyes" ; then
OCAMLFLAGS="$OCAMLFLAGS -g"
fi
AC_PATH_PROG(OCAMLMKTOP,ocamlmktop,no)
if test "$OCAMLMKTOP" = no ; then
AC_MSG_ERROR(Cannot find ocamlmktop.)
fi
CAMLLIBPATH=`$OCAMLC -where`
if test "$OCAMLOPT" = no ; then
BEST=byte
else
BEST="byte native"
fi
# other progs
AC_PATH_PROG(OCAMLFIND,ocamlfind,no)
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(Cannot find ocamlfind.)
fi
#AC_PATH_PROG(OCAMLCP,ocamlcp,no)
#if test "$OCAMLCP" = no ; then
# AC_MSG_ERROR(Cannot find ocamlcp.)
#fi
AC_PATH_PROG(LATEX,latex,no)
#if test "$LATEX" = no ; then
# AC_MSG_ERROR(Cannot find LaTeX.)
#fi
AC_PATH_PROG(DVIPS,dvips,no)
#if test "$DVIPS" = no ; then
# AC_MSG_ERROR(Cannot find dvips.)
#fi
AC_PATH_PROG(PS2PDF,ps2pdf,no)
#if test "$PS2PDF" = no ; then
# AC_MSG_ERROR(Cannot find ps2pdf.)
#fi
AC_CHECK_OCAML_COMPILERS()
REQUIRES="str unix threads"
#
# Syslog
#
......@@ -152,45 +17,20 @@ AC_ARG_ENABLE([syslog],
AC_HELP_STRING([--disable-syslog],["don't use ocaml-syslog"]))
if test "x$enable_syslog" != "xno" ; then
AC_MSG_CHECKING(for ocaml-syslog)
if ! $OCAMLFIND query syslog > /dev/null 2>&1 ; then
SYSLOG_FILES=""
AC_MSG_RESULT(not found)
else
SYSLOG_FILES="dtools_syslog.ml"
AC_MSG_RESULT(ok)
REQUIRES="$REQUIRES syslog"
INC="$INC `$OCAMLFIND query syslog`"
fi
AC_CHECK_OCAML_BINDING([syslog])
fi
if test "$W_SYSLOG" != ""; then
SYSLOG_FILES="dtools_syslog.ml"
REQUIRES="$REQUIRES syslog"
INC="$INC `$OCAMLFIND query syslog`"
fi
# substitutions to perform
AC_SUBST(OCAMLC)
AC_SUBST(OCAMLOPT)
AC_SUBST(OCAMLFLAGS)
AC_SUBST(OCAMLDEP)
AC_SUBST(OCAMLLEX)
AC_SUBST(OCAMLYACC)
AC_SUBST(OCAMLBEST)
AC_SUBST(OCAMLVERSION)
AC_SUBST(OCAMLLIB)
AC_SUBST(OCAMLBIN)
AC_SUBST(OCAMLDOC)
AC_SUBST(OCAMLMKTOP) # TODO
AC_SUBST(OCAMLFIND) # TODO
AC_SUBST(OCAMLFIND_LDCONF)
AC_SUBST(OCAMLCP) # TODO
AC_SUBST(CAMLLIBPATH)
AC_SUBST(BEST)
AC_SUBST(REQUIRES)
AC_SUBST(SYSLOG_FILES)
AC_SUBST(INC)
AC_SUBST(LATEX) # TODO
AC_SUBST(DVIPS) # TODO
AC_SUBST(DVIPS) # TODO
AC_SUBST(PS2PDF) # TODO
# Finally create the Makefile and samples
AC_CONFIG_FILES([src/Makefile],[chmod a-w src/Makefile])
AC_CONFIG_FILES([src/META])
......
This diff is collapsed.
......@@ -24,15 +24,15 @@
Allow to define procedures that must be executed at start up, and
procedures that are to be executed at exit to have a clean quit.<br>
<hr width="100%">
<pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t </pre>
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre>
<pre><span class="keyword">val</span> <a name="VALstart"></a>start : <code class="type"><a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
<pre><span id="VALstart"><span class="keyword">val</span> start</span> : <code class="type"><a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
Root start atom<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstop"></a>stop : <code class="type"><a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
<pre><span id="VALstop"><span class="keyword">val</span> stop</span> : <code class="type"><a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
Root stop atom<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmake"></a>make : <code class="type">?name:string -><br> ?depends:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?triggers:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?after:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?before:<a href="Dtools.Init.html#TYPEt">t</a> list -> (unit -> unit) -> <a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
<pre><span id="VALmake"><span class="keyword">val</span> make</span> : <code class="type">?name:string -><br> ?depends:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?triggers:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?after:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?before:<a href="Dtools.Init.html#TYPEt">t</a> list -> (unit -> unit) -> <a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
Define a init atom associated with the given <code class="code">(unit -&gt; unit)</code>
procedure, which eventualy depends on others atoms (these atoms
will be executed before the one currently defined) an triggers
......@@ -40,16 +40,16 @@ Define a init atom associated with the given <code class="code">(unit -&gt; unit
defined). <code class="code">after</code> and <code class="code">before</code> allow to register the currently
defined atom in the depend and triggers lists of other atoms.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALat_start"></a>at_start : <code class="type">?name:string -><br> ?depends:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?triggers:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?after:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?before:<a href="Dtools.Init.html#TYPEt">t</a> list -> (unit -> unit) -> <a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
<pre><span id="VALat_start"><span class="keyword">val</span> at_start</span> : <code class="type">?name:string -><br> ?depends:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?triggers:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?after:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?before:<a href="Dtools.Init.html#TYPEt">t</a> list -> (unit -> unit) -> <a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
Same as <code class="code">make</code> plus a shortcut for "after Init.start".<br>
</div>
<pre><span class="keyword">val</span> <a name="VALat_stop"></a>at_stop : <code class="type">?name:string -><br> ?depends:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?triggers:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?after:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?before:<a href="Dtools.Init.html#TYPEt">t</a> list -> (unit -> unit) -> <a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
<pre><span id="VALat_stop"><span class="keyword">val</span> at_stop</span> : <code class="type">?name:string -><br> ?depends:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?triggers:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?after:<a href="Dtools.Init.html#TYPEt">t</a> list -><br> ?before:<a href="Dtools.Init.html#TYPEt">t</a> list -> (unit -> unit) -> <a href="Dtools.Init.html#TYPEt">t</a></code></pre><div class="info">
Same as <code class="code">make</code> plus a shortcut for "before Init.stop".<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexec"></a>exec : <code class="type"><a href="Dtools.Init.html#TYPEt">t</a> -> unit</code></pre><div class="info">
<pre><span id="VALexec"><span class="keyword">val</span> exec</span> : <code class="type"><a href="Dtools.Init.html#TYPEt">t</a> -> unit</code></pre><div class="info">
Launch the execution of a given init atom.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALinit"></a>init : <code class="type">?prohibit_root:bool -> (unit -> unit) -> unit</code></pre><div class="info">
<pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">?prohibit_root:bool -> (unit -> unit) -> unit</code></pre><div class="info">
This fuction must be used to launch the main procedure of the
program. It first execute the registered start atoms, then call
the main procedure, then execute the registered stop atoms.
......@@ -59,9 +59,9 @@ This fuction must be used to launch the main procedure of the
When invoqued with <code class="code">~prohibit_root:true</code>, it checks for root access
rights (euid, egid) and exit in this case.<br>
</div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONStartError"></a>StartError <span class="keyword">of</span> <code class="type">exn</code></pre>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONStopError"></a>StopError <span class="keyword">of</span> <code class="type">exn</code></pre>
<pre><span class="keyword">val</span> <a name="VALconf"></a>conf : <code class="type"><a href="Dtools.Conf.html#TYPEut">Dtools.Conf.ut</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_daemon"></a>conf_daemon : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_daemon_pidfile"></a>conf_daemon_pidfile : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_daemon_pidfile_path"></a>conf_daemon_pidfile_path : <code class="type">string <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_concurrent"></a>conf_concurrent : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_trace"></a>conf_trace : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_catch_exn"></a>conf_catch_exn : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALargs"></a>args : <code class="type">(string list * Arg.spec * string) list</code></pre><div class="info">
<pre><span id="EXCEPTIONStartError"><span class="keyword">exception</span> StartError</span> <span class="keyword">of</span> <code class="type">exn</code></pre>
<pre><span id="EXCEPTIONStopError"><span class="keyword">exception</span> StopError</span> <span class="keyword">of</span> <code class="type">exn</code></pre>
<pre><span id="VALconf"><span class="keyword">val</span> conf</span> : <code class="type"><a href="Dtools.Conf.html#TYPEut">Dtools.Conf.ut</a></code></pre><pre><span id="VALconf_daemon"><span class="keyword">val</span> conf_daemon</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_daemon_pidfile"><span class="keyword">val</span> conf_daemon_pidfile</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_daemon_pidfile_path"><span class="keyword">val</span> conf_daemon_pidfile_path</span> : <code class="type">string <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_concurrent"><span class="keyword">val</span> conf_concurrent</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_trace"><span class="keyword">val</span> conf_trace</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_catch_exn"><span class="keyword">val</span> conf_catch_exn</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALargs"><span class="keyword">val</span> args</span> : <code class="type">(string list * Arg.spec * string) list</code></pre><div class="info">
A set of command line options to be used with the Arg module.<br>
</div>
</body></html>
\ No newline at end of file
......@@ -19,12 +19,12 @@
<center><h1>Module <a href="type_Dtools.Log.html">Dtools.Log</a></h1></center>
<br>
<pre><span class="keyword">module</span> Log: <code class="code">sig</code> <a href="Dtools.Log.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t = <code class="type">< active : int -> bool;<br> f : 'a. int -> ('a, unit, string, unit) Pervasives.format4 -> 'a ></code> </pre>
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">< active : int -> bool;<br> f : 'a. int -> ('a, unit, string, unit) Pervasives.format4 -> 'a ></code> </pre>
<div class="info">
Type for loggers.<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEcustom_log"></a><code class="type"></code>custom_log = {</code><table class="typetable">
<br><code><span id="TYPEcustom_log"><span class="keyword">type</span> <code class="type"></code>custom_log</span> = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
......@@ -42,22 +42,22 @@ Type for loggers.<br>
}
<pre><span class="keyword">val</span> <a name="VALadd_custom_log"></a>add_custom_log : <code class="type">string -> <a href="Dtools.Log.html#TYPEcustom_log">custom_log</a> -> unit</code></pre><div class="info">
<pre><span id="VALadd_custom_log"><span class="keyword">val</span> add_custom_log</span> : <code class="type">string -> <a href="Dtools.Log.html#TYPEcustom_log">custom_log</a> -> unit</code></pre><div class="info">
Add a custom logging functions.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrm_custom_log"></a>rm_custom_log : <code class="type">string -> unit</code></pre><div class="info">
<pre><span id="VALrm_custom_log"><span class="keyword">val</span> rm_custom_log</span> : <code class="type">string -> unit</code></pre><div class="info">
Remove a custom logging functions.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmake"></a>make : <code class="type"><a href="Dtools.Conf.html#TYPEpath">Dtools.Conf.path</a> -> <a href="Dtools.Log.html#TYPEt">t</a></code></pre><div class="info">
<pre><span id="VALmake"><span class="keyword">val</span> make</span> : <code class="type"><a href="Dtools.Conf.html#TYPEpath">Dtools.Conf.path</a> -> <a href="Dtools.Log.html#TYPEt">t</a></code></pre><div class="info">
Make a logger labeled according to the given path.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstart"></a>start : <code class="type"><a href="Dtools.Init.html#TYPEt">Dtools.Init.t</a></code></pre><div class="info">
<pre><span id="VALstart"><span class="keyword">val</span> start</span> : <code class="type"><a href="Dtools.Init.html#TYPEt">Dtools.Init.t</a></code></pre><div class="info">
An atom that starts the logging.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstop"></a>stop : <code class="type"><a href="Dtools.Init.html#TYPEt">Dtools.Init.t</a></code></pre><div class="info">
<pre><span id="VALstop"><span class="keyword">val</span> stop</span> : <code class="type"><a href="Dtools.Init.html#TYPEt">Dtools.Init.t</a></code></pre><div class="info">
An atom that stops the logging.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALconf"></a>conf : <code class="type"><a href="Dtools.Conf.html#TYPEut">Dtools.Conf.ut</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_level"></a>conf_level : <code class="type">int <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_unix_timestamps"></a>conf_unix_timestamps : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_stdout"></a>conf_stdout : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_file"></a>conf_file : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_file_path"></a>conf_file_path : <code class="type">string <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_file_append"></a>conf_file_append : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALconf_file_perms"></a>conf_file_perms : <code class="type">int <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALargs"></a>args : <code class="type">(string list * Arg.spec * string) list</code></pre><div class="info">
<pre><span id="VALconf"><span class="keyword">val</span> conf</span> : <code class="type"><a href="Dtools.Conf.html#TYPEut">Dtools.Conf.ut</a></code></pre><pre><span id="VALconf_level"><span class="keyword">val</span> conf_level</span> : <code class="type">int <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_unix_timestamps"><span class="keyword">val</span> conf_unix_timestamps</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_stdout"><span class="keyword">val</span> conf_stdout</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_file"><span class="keyword">val</span> conf_file</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_file_path"><span class="keyword">val</span> conf_file_path</span> : <code class="type">string <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_file_append"><span class="keyword">val</span> conf_file_append</span> : <code class="type">bool <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALconf_file_perms"><span class="keyword">val</span> conf_file_perms</span> : <code class="type">int <a href="Dtools.Conf.html#TYPEt">Dtools.Conf.t</a></code></pre><pre><span id="VALargs"><span class="keyword">val</span> args</span> : <code class="type">(string list * Arg.spec * string) list</code></pre><div class="info">
A set of command line options to be used with the Arg module.<br>
</div>
</body></html>
\ No newline at end of file
......@@ -30,4 +30,5 @@ body { background-color : White }
tr { background-color : White }
td.typefieldcomment { background-color : #FFFFFF ; font-size: smaller ;}
pre { margin-bottom: 4px }
div.sig_block {margin-left: 2em}
\ No newline at end of file
div.sig_block {margin-left: 2em}
*:target { background: yellow; }
\ No newline at end of file
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
#
# DESCRIPTION
#
# This macro compares two version strings. Due to the various number of
# minor-version numbers that can exist, and the fact that string
# comparisons are not compatible with numeric comparisons, this is not
# necessarily trivial to do in a autoconf script. This macro makes doing
# these comparisons easy.
#
# The six basic comparisons are available, as well as checking equality
# limited to a certain number of minor-version levels.
#
# The operator OP determines what type of comparison to do, and can be one
# of:
#
# eq - equal (test A == B)
# ne - not equal (test A != B)
# le - less than or equal (test A <= B)
# ge - greater than or equal (test A >= B)
# lt - less than (test A < B)
# gt - greater than (test A > B)
#
# Additionally, the eq and ne operator can have a number after it to limit
# the test to that number of minor versions.
#
# eq0 - equal up to the length of the shorter version
# ne0 - not equal up to the length of the shorter version
# eqN - equal up to N sub-version levels
# neN - not equal up to N sub-version levels
#
# When the condition is true, shell commands ACTION-IF-TRUE are run,
# otherwise shell commands ACTION-IF-FALSE are run. The environment
# variable 'ax_compare_version' is always set to either 'true' or 'false'
# as well.
#
# Examples:
#
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
#
# would both be true.
#
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
#
# would both be false.
#
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
#
# would be true because it is only comparing two minor versions.
#
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
#
# would be true because it is only comparing the lesser number of minor
# versions of the two values.
#
# Note: The characters that separate the version numbers do not matter. An
# empty string is the same as version 0. OP is evaluated by autoconf, not
# configure, so must be a string, not a variable.
#
# The author would like to acknowledge Guido Draheim whose advice about
# the m4_case and m4_ifvaln functions make this macro only include the
# portions necessary to perform the specific comparison specified by the
# OP argument in the final configure script.
#
# LICENSE
#
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 11
dnl #########################################################################
AC_DEFUN([AX_COMPARE_VERSION], [
AC_REQUIRE([AC_PROG_AWK])
# Used to indicate true or false condition
ax_compare_version=false
# Convert the two version strings to be compared into a format that
# allows a simple string comparison. The end result is that a version
# string of the form 1.12.5-r617 will be converted to the form
# 0001001200050617. In other words, each number is zero padded to four
# digits, and non digits are removed.
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
dnl # then the first line is used to determine if the condition is true.
dnl # The sed right after the echo is to remove any indented white space.
m4_case(m4_tolower($2),
[lt],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
],
[gt],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
],
[le],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
],
[ge],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
],[
dnl Split the operator from the subversion count if present.
m4_bmatch(m4_substr($2,2),
[0],[
# A count of zero means use the length of the shorter version.
# Determine the number of characters in A and B.
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
# Set A to no more than B's length and B to no more than A's length.
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
],
[[0-9]+],[
# A count greater than zero means use only that many subversions
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
],
[.+],[
AC_WARNING(
[illegal OP numeric parameter: $2])
],[])
# Pad zeros at end of numbers to make same length.
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
B="$B`echo $A | sed 's/./0/g'`"
A="$ax_compare_version_tmp_A"
# Check for equality or inequality as necessary.
m4_case(m4_tolower(m4_substr($2,0,2)),
[eq],[
test "x$A" = "x$B" && ax_compare_version=true
],
[ne],[
test "x$A" != "x$B" && ax_compare_version=true
],[
AC_WARNING([illegal OP parameter: $2])
])
])
AS_VAR_POPDEF([A])dnl
AS_VAR_POPDEF([B])dnl
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
if test "$ax_compare_version" = "true" ; then
m4_ifvaln([$4],[$4],[:])dnl
m4_ifvaln([$5],[else $5])dnl
fi
]) dnl AX_COMPARE_VERSION
dnl ===========================================================================
dnl Helper macro to detect an optional binding
m4_defun([AC_OCAML_COMPARE_VERSION],
[if test -z "$2" ; then
VERSION_OK=yes
else
AS_VERSION_COMPARE([$1],[$2],
[VERSION_OK=],
[VERSION_OK=yes],
[VERSION_OK=yes])
fi])
m4_defun([AC_OCAML_CHECK_DEPS],
[dnl
m4_define([deps],[m4_translit([$1],['a-z'],['A-Z'])])
DEPS_CHECK=yes
for i in deps(); do
eval "dep_check=\$W_$i"
if test -z "${dep_check}"; then
DEPS_CHECK=
break
fi
done])
m4_defun([AC_MSG_RESULT_NOT],
[ifelse([$1],[],[AC_MSG_RESULT($2)],[AC_MSG_ERROR($2)])])
m4_defun([AC_COND_PLUGIN],
[ifelse([$1],[],
[AC_ARG_ENABLE([$2-dynamic-plugin],
AC_HELP_STRING(
[--enable-$2-dynamic-plugin],
[Compile $2 as an optional dynamic plugin.]))])])
AC_DEFUN([AC_CHECK_OCAML_BINDING],[dnl
m4_define([BINDING],[m4_translit([$1],['a-z.-'],['A-Z__'])])
m4_define([binding],[m4_translit([$1],['A-Z.-'],['a-z__'])])
AC_ARG_WITH([binding()-dir],
AC_HELP_STRING(
[--with-binding()-dir=path],
[look for ocaml-binding() library in "path" (autodetected by default)]))
AC_COND_PLUGIN([$4],[$1])
# Version stuff
m4_define([VERSION_CHECK],[ifelse([$2],[],[],[ >= $2])])
AC_MSG_CHECKING([for ocaml $1 module[]VERSION_CHECK()])
if ! test -z "$7"; then
OCAML_CHECK="$7"
else
OCAML_CHECK="${OCAMLFIND} query $1"
fi
# This (horrible) macro does the following:
# Detect optional binding
# If builtin and provided by ocamlfind,
# fills liquidsoap_ocamlcflags with "-package deps" for
# each dependency
# If builtin and provided by us, fills
# liquidsoap_ocamlcflags with "-I /path/to/ocaml-foo/src"
# and liquidsoap_ocamllfflags with "foo.cmxa"
# If plugin and provided by ocamlfind,
# fills plugin_packages with "deps"
# If plugin and provided by us, fills
# plugin_ocamlcflags with "-I /path/to/ocaml-foo/src"
# and plugin_ocamllflags with "foo.cmxa"
# Ultimately, plugin_ocamlcflags and plugin_ocamllflags
# are added to the global $PLUGINS_DATA variable and
# $PLUGINS is updated with the name of this plugin.
# W_plugin is set to "yes" for builtin compilation
# and "binding" for plugin compilation.
if test "x$enable_[]binding()_dynamic_plugin" = "xyes" ; then
BINDING()_SHARED="yes"
PLUGINS="$PLUGINS binding()"
fi
AC_OCAML_CHECK_DEPS([$3])
if test -z $DEPS_CHECK; then
AC_MSG_RESULT([[]binding() needs $3])
else
if test -z "${with_[]binding()_dir}" ; then
if ! ${OCAML_CHECK} > /dev/null 2>&1 ; then
AC_MSG_RESULT_NOT([$4],[Not found.])
else
BINDING()_version="`${OCAMLFIND} query -format "%v" $1 2>/dev/null`"
AC_OCAML_COMPARE_VERSION([${[]BINDING()_version}],[$2])
if test -z "${VERSION_OK}"; then
AC_MSG_RESULT_NOT([$4],[requires version >= $2 found ${[]BINDING()_version}.])
else
if test -z "${[]BINDING()_SHARED}"; then
BINDING()_PACKAGES="`${OCAMLFIND} query -r -separator " " -format "-package %p" $1 $5 2>/dev/null`"
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} ${[]BINDING()_PACKAGES}"
W_[]BINDING()=yes
else
[]binding()_packages="`${OCAMLFIND} query -r -separator " " -format "%p" $1 $5 2>/dev/null`"
W_[]BINDING()=[]binding()
fi
LIBS_VERSIONS="${LIBS_VERSIONS} $1=$[]BINDING()_version"
AC_MSG_RESULT(ok)
fi
fi
else
BINDING()_STOP_CHECK=
BINDING()_version=changequote({,})"[unknown version]"changequote([,])
BINDING()_requires=
if test -r ${with_[]binding()_dir}/META >/dev/null 2>&1; then
# Grab version
BINDING()_version=`cat "${with_[]binding()_dir}/META" | grep version | cut -d'=' -f 2 | tr -d ' ' | tr -d '"' | head -n 1`
AC_OCAML_COMPARE_VERSION([${[]BINDING()_version}],[$2])
if test -z "${VERSION_OK}"; then
AC_MSG_RESULT_NOT([$4],[requires version >= $2 found ${[]BINDING()version}.])
BINDING()_STOP_CHECK=yes
fi
BINDING()_requires=`cat "${with_[]binding()_dir}/META" | grep 'requires' | cut -d '=' -f 2 | tr -d '"'`
BINDING()_path="${with_[]binding()_dir}"
else
BINDING()_path=`${OCAMLFIND} -query $1 2>/dev/null`
if ! test -z "$2"; then
AC_MSG_RESULT_NOT([$4],[cannot find version from META file.])
BINDING()_STOP_CHECK=yes
fi
fi
if test -z "${STOP_CHECK}"; then
if ! test -z "$6"; then
for i in $6; do
CMA_OBJS="${CMA_OBJS} $i.${cma}"
done
else
CMA_OBJS=$1.${cma}
fi
BINDING()_PACKAGES="`${OCAMLFIND} query -r -separator " " -format "-package %p" $5 2>/dev/null`"
echo ${with_[]binding()_dir} | grep ^/ > /dev/null 2>&1 \
|| with_[]binding()_dir=${PWD}/${with_[]binding()_dir}
if test -z "${[]BINDING()_SHARED}"; then
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} -I ${with_[]binding()_dir} ${[]BINDING()_PACKAGES}"
else
[]binding()_ocamlcflags="-I ${with_[]binding()_dir} ${[]BINDING()_PACKAGES}"
fi
# We need to recurse here because
# some package may not be registered using ocamlfind
for i in ${[]BINDING()_requires}; do
BINDING()_PACKAGES="${[]BINDING()_PACKAGES} `${OCAMLFIND} query -r -separator " " -format "-package %p" $i 2>/dev/null`"
done
if test -z "${[]BINDING()_SHARED}"; then
liquidsoap_ocamllflags="${liquidsoap_ocamllflags} ${[]BINDING()_PACKAGES} ${CMA_OBJS}"
W_[]BINDING()=yes
else
[]binding()_ocamllflags="${[]BINDING()_PACKAGES} ${CMA_OBJS}"
W_[]BINDING()=[]binding()
fi
LIBS_VERSIONS="${LIBS_VERSIONS} $1=$[]BINDING()_version"
AC_MSG_RESULT(ok)
fi
fi
fi
AC_SUBST(W_[]BINDING())
if test -z "${W_[]BINDING()}" ; then
w_[]BINDING()="no (requires $1)"
else
if test -z "${[]BINDING()_SHARED}"; then
w_[]BINDING()=yes
else
PLUGINS_DATA="$PLUGINS_DATA
[]binding()_ocamlcflags=${[]binding()_ocamlcflags}
[]binding()_ocamllflags=${[]binding()_ocamllflags}
[]binding()_packages=${[]binding()_packages}"
w_[]BINDING()=plugin
fi
fi])
dnl autoconf macros for OCaml
dnl
dnl Copyright © 2009 Richard W.M. Jones
dnl Copyright © 2009 Stefano Zacchiroli
dnl Copyright © 2000-2005 Olivier Andrieu
dnl Copyright © 2000-2005 Jean-Christophe Filliâtre
dnl Copyright © 2000-2005 Georges Mariano
dnl
dnl For documentation, please read the ocaml.m4 man page.
AC_DEFUN([AC_PROG_OCAML],
[dnl
# checking for ocamlc
AC_CHECK_TOOL([OCAMLC],[ocamlc],[no])
if test "$OCAMLC" = "no"; then
AC_MSG_ERROR(Cannot find ocamlc.)
fi
AC_SUBST([OCAMLC])
OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
AC_MSG_RESULT([OCaml version is $OCAMLVERSION])
# Check if version is >= 3.12.0
AC_MSG_CHECKING([if ocaml compiler supports first-class modules])
AS_VERSION_COMPARE([$OCAMLVERSION],[3.12.0],[],[OCAML_HAS_FIRST_CLASS_MODULES="yes"],[OCAML_HAS_FIRST_CLASS_MODULES="yes"])
if test -n "${OCAML_HAS_FIRST_CLASS_MODULES}"; then
AC_MSG_RESULT([yes])