2 # autoconf input for Objective Caml programs
3 # Copyright (C) 2001 Jean-Christophe Filliâtre
4 # from a first script by Georges Mariano
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public
8 # License version 2, as published by the Free Software Foundation.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 # See the GNU Library General Public License version 2 for more details
15 # (enclosed in the file LGPL).
17 # modified by Kim Nguyẽn
19 # the script generated by autoconf from this input will set the following
21 # OCAMLC "ocamlc" if present in the path, or a failure
22 # or "ocamlc.opt" if present with same version number as ocamlc
23 # OCAMLOPT "ocamlopt" (or "ocamlopt.opt" if present), or "no"
24 # OCAMLBEST either "byte" if no native compiler was found,
27 # OCAMLLEX "ocamllex" (or "ocamllex.opt" if present)
28 # OCAMLYACC "ocamlyac"
29 # OCAMLLIB the path to the ocaml standard library
30 # OCAMLVERSION the ocaml version number
31 # OCAMLWEB "ocamlweb" (not mandatory)
32 # OCAMLWIN32 "yes"/"no" depending on Sys.os_type = "Win32"
33 # EXE ".exe" if OCAMLWIN32=yes, "" otherwise
35 # check for one particular file of the sources
36 # ADAPT THE FOLLOWING LINE TO YOUR SOURCES!
37 AC_INIT([tatoo], [0.0.1], [kim.nguyen@lri.fr])
39 # Check for Ocaml compilers
41 AC_CHECK_PROG(HAS_OCAMLFIND,ocamlfind,yes,no)
42 if test "$HAS_OCAMLFIND" = "no" ; then
43 AC_MSG_ERROR(Cannot find ocamlfind.)
48 # we first look for ocamlc in the path; if not present, we fail
49 OCAMLC="$OCAMLFIND ocamlc"
50 AC_MSG_CHECKING(ocamlc)
53 AC_MSG_RESULT(not found)
54 AC_MSG_ERROR(Cannot find ocamlc.)
56 AC_MSG_RESULT($OCAMLC)
58 OCAMLOPT="$OCAMLFIND ocamlopt"
59 AC_MSG_CHECKING(ocamlopt)
63 AC_MSG_RESULT(not found)
64 AC_MSG_ERROR(Cannot find ocamlopt.)
66 AC_MSG_RESULT($OCAMLOPT)
69 # we extract Ocaml version number and library path
70 OCAMLVERSION=$($OCAMLC -version)
71 echo "ocaml version is $OCAMLVERSION"
72 OCAMLLIB=$($OCAMLC -where)
73 echo "ocaml library path is $OCAMLLIB"
75 # ocamldep, ocamllex and ocamlyacc should also be present in the path
76 OCAMLOPT="ocamlfind ocamldep"
77 AC_MSG_CHECKING(ocamldep)
80 AC_MSG_RESULT(not found)
81 AC_MSG_ERROR(Cannot find ocamldep.)
83 AC_MSG_RESULT($OCAMLDEP)
86 AC_CHECK_PROG(OCAMLYACC,ocamlyacc, yes ,no)
87 if test "$OCAMLYACC" = "no" ; then
88 AC_MSG_ERROR(Cannot find ocamlyacc.)
91 AC_CHECK_PROG(CAMLP4,camlp4, yes,no)
92 if test "$CAMLP4" = "no" ; then
93 AC_MSG_ERROR(Cannot find camlp4.)
96 AC_MSG_CHECKING(for ulex)
97 ULEX_PATH=$($OCAMLFIND query ulex 2>/dev/null)
98 if test -z "$ULEX_PATH"; then
100 AC_MSG_ERROR(Cannot find ulex.)
105 AC_MSG_CHECKING(for expat)
106 EXPAT_PATH=$($OCAMLFIND query expat 2>/dev/null)
107 if test -z "$EXPAT_PATH"; then
109 AC_MSG_ERROR(Cannot find expat.)
114 # substitutions to perform