]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/gdome_xslt/configure.ac
Initial revision
[helm.git] / helm / DEVEL / gdome_xslt / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT
3 AC_CONFIG_SRCDIR([C/gdome_xslt/gdome_xslt.h])
4
5 PACKAGE=gdome2-xslt
6 VERSION=0.0.3
7 VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
8 AC_SUBST(VERSION_INFO)
9
10 AC_ARG_WITH(
11         gmetadom-prefix,
12         [  --with-gmetadom-prefix=PFX prefix dir where gmetadom is installed],
13         [
14                 with_gmetadom_prefix=yes
15                 GMETADOM_PREFIX=$withval
16         ],
17         [
18                 with_gmetadom_prefix=no
19         ]
20 )
21
22 AC_ARG_WITH(
23         gdome-prefix,
24         [  --with-gdome-prefix=PFX prefix dir where gdome is installed],
25         [
26                 with_gdome_prefix=yes
27                 GDOME_PREFIX=$withval
28         ],
29         [
30                 with_gdome_prefix=no
31         ]
32 )
33
34 AC_PROG_CC
35 AC_PROG_CXX
36 AC_PROG_INSTALL
37
38 AM_CONFIG_HEADER(config.h)
39 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
40 AM_PROG_LIBTOOL
41
42 GDOME_CONFIG="gdome-config"
43 GDOME_MIN_VERSION=0.7.0
44 AC_MSG_CHECKING(for Gdome2 libraries >= $GDOME_MIN_VERSION) 
45 if test "x$GDOME_PREFIX" != "x"
46 then
47         if ${GDOME_PREFIX}/bin/$GDOME_CONFIG --version > /dev/null 2>&1
48         then
49                 GDOME_CONFIG=${GDOME_PREFIX}/bin/$GDOME_CONFIG
50         elif ! $GDOME_CONFIG --version > /dev/null 2>&1
51         then
52                 AC_MSG_ERROR(Could not find Gdome2 anywhere (see config.log for details).)
53         fi
54 fi
55
56 vers=`$GDOME_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
57 minvers=`echo $GDOME_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
58 if test "$vers" -ge "$minvers"
59 then
60         GDOME_LIBS="`$GDOME_CONFIG --libs`"
61         GDOME_CFLAGS="`$GDOME_CONFIG --cflags`"
62         AC_MSG_RESULT(found)
63 else
64         AC_MSG_ERROR(You need at least Gdome2 $GDOME_MIN_VERSION for this version of $PACKAGE)
65 fi
66
67 AC_SUBST(GDOME_CFLAGS)
68 AC_SUBST(GDOME_LIBS)
69
70 GMETADOM_CONFIG="gmetadom-config"
71 GMETADOM_MIN_VERSION=0.1.4
72 AC_MSG_CHECKING(for GMetaDOM libraries >= $GMETADOM_MIN_VERSION) 
73 if test "x$GMETADOM_PREFIX" != "x"
74 then
75         if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1
76         then
77                 GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG
78         elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1
79         then
80                 AC_MSG_ERROR(Could not find GMetaDOM anywhere (see config.log for details).)
81         fi
82 fi
83
84 vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
85 minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
86 if test "$vers" -ge "$minvers"
87 then
88         GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`"
89         GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`"
90         AC_MSG_RESULT(found)
91 else
92         AC_MSG_ERROR(You need at least GMetaDOM $GMETADOM_MIN_VERSION for this version of $PACKAGE)
93 fi
94
95 AC_SUBST(GMETADOM_CFLAGS)
96 AC_SUBST(GMETADOM_LIBS)
97
98 LIBXSLT_CONFIG="xslt-config"
99 LIBXSLT_MIN_VERSION=1.0.16
100 AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) 
101 if test "x$LIBXSLT_PREFIX" != "x"
102 then
103         if ${LIBXSLT_PREFIX}/bin/$LIBXSLT_CONFIG --version > /dev/null 2>&1
104         then
105                 LIBXSLT_CONFIG=${LIBXSLT_PREFIX}/bin/$LIBXSLT_CONFIG
106         elif ! $LIBXSLT_CONFIG --version > /dev/null 2>&1
107         then
108                 AC_MSG_ERROR(Could not find libxslt anywhere (see config.log for details).)
109         fi
110 fi
111
112 vers=`$LIBXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
113 minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
114 if test "$vers" -ge "$minvers"
115 then
116         LIBXSLT_LIBS="`$LIBXSLT_CONFIG --libs`"
117         LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG --cflags`"
118         AC_MSG_RESULT(found)
119 else
120         AC_MSG_ERROR(You need at least libxslt $LIBXSLT_MIN_VERSION for this version of $PACKAGE)
121 fi
122
123 AC_SUBST(LIBXSLT_CFLAGS)
124 AC_SUBST(LIBXSLT_LIBS)
125
126 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
127 if test $HAVE_OCAMLC = "no"; then
128   AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
129 else
130   OCAMLC=ocamlc
131   OCAMLSTDLIBDIR="`ocamlc -where`"
132   OCAMLSTUBDIR="`ocamlc -where`/stublibs"
133   AC_SUBST(OCAMLC)
134   AC_SUBST(OCAMLSTDLIBDIR)
135   AC_SUBST(OCAMLSTUBDIR)
136 fi
137
138 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
139 if test $HAVE_OCAMLOPT = "no"; then
140         AC_MSG_WARN(ocaml native libraries won't be compiled since ocamlopt was not found)
141 else
142   OCAMLOPT=ocamlopt
143   AC_SUBST(OCAMLOPT)
144 fi
145 AM_CONDITIONAL(HAVE_OCAMLOPT_COND, test x$HAVE_OCAMLOPT = xyes)
146
147 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
148 if test $HAVE_OCAMLFIND = "no"; then
149   AC_MSG_ERROR(could not find ocamlfind in PATH, please make sure findlib is installed)
150 else
151   OCAMLFIND=ocamlfind
152   AC_SUBST(OCAMLFIND)
153 fi
154
155 AC_CHECK_PROG(HAVE_OCAMLDEP, ocamldep, yes, no)
156 if test $HAVE_OCAMLDEP = "yes"; then
157   OCAMLDEP=ocamldep
158   AC_SUBST(OCAMLDEP)
159 fi
160
161 AC_CHECK_PROG(HAVE_OCAMLMKLIB, ocamlmklib, yes, no)
162 if test $HAVE_OCAMLMKLIB = "no"; then
163   AC_MSG_ERROR(could not find ocamlmklib in PATH, please make sure ocamlmklib is installed)
164 else
165   OCAMLMKLIB=ocamlmklib
166   AC_SUBST(OCAMLMKLIB)
167 fi
168
169 AC_MSG_CHECKING(for gdome2 ocaml binding)
170 ocamlfind query gdome2 ||
171   AC_MSG_ERROR(gdome2 not installed (according to findlib))
172 MLGDOME_CFLAGS="`$OCAMLFIND query -i-format gdome2`"
173 AC_SUBST(MLGDOME_CFLAGS)
174
175 AC_MSG_CHECKING(for the ocaml library dir)
176 OCAML_LIB_DIR=`ocamlc -where`
177 AC_MSG_RESULT($OCAML_LIB_DIR)
178
179 AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
180         OCAML_INCLUDE_DIR=/usr/include/caml,
181         OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
182 )
183
184 AC_SUBST(PACKAGE)
185 AC_SUBST(VERSION)
186 AC_SUBST(OCAML_INCLUDE_DIR)
187
188 AC_CONFIG_FILES([
189   Makefile
190   C/Makefile
191   C/gdome_xslt/Makefile
192   C/test/Makefile
193   C++/gdome_xslt/Makefile
194   C++/test/Makefile
195   C++/Makefile
196   ocaml/Makefile
197   ocaml/gdome_xslt/Makefile
198   ocaml/gdome_xslt/META
199   ocaml/test/Makefile
200   gdome_xslt_cpp_smart-config
201   test_files/Makefile])
202 AC_CONFIG_COMMANDS([default],[[chmod +x gdome_xslt_cpp_smart-config]],[[]])
203 AC_OUTPUT