Lines 171-182
Link Here
|
171 |
AC_SUBST([LIBXML2_LIBS]) |
171 |
AC_SUBST([LIBXML2_LIBS]) |
172 |
|
172 |
|
173 |
dnl Check for OCaml (optional, for OCaml bindings). |
173 |
dnl Check for OCaml (optional, for OCaml bindings). |
|
|
174 |
AC_ARG_ENABLE([ocaml], |
175 |
AS_HELP_STRING([--enable-ocaml],[Enable ocaml binding])) |
176 |
|
177 |
|
174 |
AC_PROG_OCAML |
178 |
AC_PROG_OCAML |
175 |
AC_PROG_FINDLIB |
179 |
AC_PROG_FINDLIB |
176 |
AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLC" != "xno" -a "x$OCAMLFIND" != "xno"]) |
|
|
177 |
|
180 |
|
|
|
181 |
|
182 |
|
183 |
AS_IF([test "x$enable_ocaml" != "xno"], [ |
178 |
if test "x$OCAMLC" != "xno"; then |
184 |
if test "x$OCAMLC" != "xno"; then |
179 |
dnl Check if we have caml/unixsupport.h header (OCaml bindings only). |
|
|
180 |
old_CFLAGS="$CFLAGS" |
185 |
old_CFLAGS="$CFLAGS" |
181 |
CFLAGS="$CFLAGS -I$OCAMLLIB" |
186 |
CFLAGS="$CFLAGS -I$OCAMLLIB" |
182 |
AC_CHECK_HEADERS([caml/unixsupport.h],[],[], |
187 |
AC_CHECK_HEADERS([caml/unixsupport.h],[],[], |
Lines 186-192
Link Here
|
186 |
]) |
191 |
]) |
187 |
CFLAGS="$old_CFLAGS" |
192 |
CFLAGS="$old_CFLAGS" |
188 |
|
193 |
|
189 |
dnl Do we have function caml_raise_with_args? |
194 |
dnl Do we have function caml_raise_with_args? |
190 |
f=caml_raise_with_args |
195 |
f=caml_raise_with_args |
191 |
AC_MSG_CHECKING([for function $f]) |
196 |
AC_MSG_CHECKING([for function $f]) |
192 |
echo "char $f (); char foo() { return $f (); }" > conftest.c |
197 |
echo "char $f (); char foo() { return $f (); }" > conftest.c |
Lines 195-231
Link Here
|
195 |
if $OCAMLOPT -c conftest.c 2>/dev/null && \ |
200 |
if $OCAMLOPT -c conftest.c 2>/dev/null && \ |
196 |
$OCAMLOPT -c conftest_ml.ml 2>/dev/null && \ |
201 |
$OCAMLOPT -c conftest_ml.ml 2>/dev/null && \ |
197 |
$OCAMLOPT conftest.o conftest_ml.cmx -o conftest 2>/dev/null ; then |
202 |
$OCAMLOPT conftest.o conftest_ml.cmx -o conftest 2>/dev/null ; then |
198 |
AC_DEFINE([HAVE_CAML_RAISE_WITH_ARGS],[1], |
203 |
AC_DEFINE([HAVE_CAML_RAISE_WITH_ARGS],[1], |
199 |
[Defined if function caml_raise_with_args exists.]) |
204 |
[Defined if function caml_raise_with_args exists.]) |
200 |
AC_MSG_RESULT([found]) |
205 |
AC_MSG_RESULT([found]) |
201 |
else |
206 |
else |
202 |
AC_MSG_RESULT([not found]) |
207 |
AC_MSG_FAILURE([not found]) |
203 |
fi |
208 |
|
204 |
rm -f conftest conftest.* conftest_ml.* |
209 |
fi |
|
|
210 |
rm -f conftest conftest.* conftest_ml.* |
205 |
fi |
211 |
fi |
206 |
|
212 |
|
207 |
dnl Check for Perl (optional, for Perl bindings). |
213 |
]) |
208 |
dnl XXX This isn't quite right, we should check for Perl devel library. |
214 |
|
209 |
AC_CHECK_PROG([PERL],[perl],[perl],[no]) |
215 |
AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLC" != "xno" -a "x$OCAMLFIND" != "xno" -a "x$enable_ocaml" != "xno"]) |
|
|
216 |
|
217 |
dnl For Perl |
210 |
|
218 |
|
211 |
dnl Check for Perl modules that must be present to compile and |
|
|
212 |
dnl test the Perl bindings. |
213 |
missing_perl_modules=no |
219 |
missing_perl_modules=no |
214 |
for pm in Test::More ExtUtils::MakeMaker IO::Stringy; do |
220 |
AC_ARG_ENABLE([perl], |
215 |
AC_MSG_CHECKING([for $pm]) |
221 |
AS_HELP_STRING([--with-perl],[build Perl binding])) |
216 |
if ! perl -M$pm -e1 >/dev/null 2>&1; then |
|
|
217 |
AC_MSG_RESULT([no]) |
218 |
missing_perl_modules=yes |
219 |
else |
220 |
AC_MSG_RESULT([yes]) |
221 |
fi |
222 |
done |
223 |
if test "x$missing_perl_modules" = "xyes"; then |
224 |
AC_MSG_WARN([some Perl modules required to compile or test the Perl bindings are missing]) |
225 |
fi |
226 |
|
222 |
|
|
|
223 |
PERL= |
224 |
AS_IF([test "x$enable_perl" != "xno" ],[ |
225 |
AC_CHECK_PROG([PERL],[perl],[yes],[no]) |
226 |
|
227 |
for pm in Test::More ExtUtils::MakeMaker IO::Stringy; do |
228 |
AC_MSG_CHECKING([for $pm]) |
229 |
if ! perl -M$pm -e1 >/dev/null 2>&1; then |
230 |
AC_MSG_RESULT([no]) |
231 |
missing_perl_modules=yes |
232 |
else |
233 |
AC_MSG_RESULT([yes]) |
234 |
fi |
235 |
done |
236 |
|
237 |
AS_IF([test "x$missing_perl_modules" = "xyes"], |
238 |
[AC_MSG_FAILURE([some Perl modules required to compile or test the Perl bindings are missing])], |
239 |
) |
240 |
]) |
227 |
AM_CONDITIONAL([HAVE_PERL], |
241 |
AM_CONDITIONAL([HAVE_PERL], |
228 |
[test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"]) |
242 |
[test "x$PERL" = "xyes" -a "x$missing_perl_modules" != "xyes" -a "x$enable_perl" = "xyes"]) |
229 |
|
243 |
|
230 |
dnl dnl Check for Python (optional, for Python bindings). |
244 |
dnl dnl Check for Python (optional, for Python bindings). |
231 |
dnl AC_CHECK_PROG([PYTHON],[python],[python],[no]) |
245 |
dnl AC_CHECK_PROG([PYTHON],[python],[python],[no]) |