3 dnl Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
4 dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 dnl J. Wenninger, Institut f. Computersprachen - TU Wien
8 dnl This file is part of CACAO.
10 dnl This program is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU General Public License as
12 dnl published by the Free Software Foundation; either version 2, or (at
13 dnl your option) any later version.
15 dnl This program is distributed in the hope that it will be useful, but
16 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 dnl General Public License for more details.
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 dnl check for interpreter
28 AC_DEFUN([AC_CHECK_ENABLE_INTRP],[
29 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
31 AC_MSG_CHECKING(whether interpreter should be compiled)
32 if test x"$enable_intrp" = "xyes"; then
34 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
35 AM_CONDITIONAL([ENABLE_INTRP], [true])
42 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
44 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
45 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
46 AC_DEFINE([WITH_FFI], 1, [use libffi])],
49 dnl check for libffcall
51 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
53 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
54 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
55 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
58 dnl check for libffi or libffcall
59 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
60 AC_ERROR(Enable only libffi or libffcall.)
62 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
63 AC_ERROR(Enable one of libffi or libffcall.)
68 AM_CONDITIONAL([ENABLE_INTRP], [false])