Alien-LibJIT
view release on metacpan or search on metacpan
libjit/configure.ac view on Meta::CPAN
dnl Determine if the C++ compiler understands the "throw()" idiom.
AC_CACHE_CHECK(for C++ throw() idiom, ac_cv_prog_cxx_throw_idiom,
[echo 'extern "C" void func(void) throw(); int main(int argc, char **argv){return 0;}' > conftest.c
if test -z "`${CXX-c++} -o conftest conftest.c 2>&1`"; then
ac_cv_prog_cxx_throw_idiom=yes
else
ac_cv_prog_cxx_throw_idiom=no
fi
rm -f conftest*
])
AC_SUBST(JITTHROWIDIOM)
if test "x$ac_cv_prog_cxx_throw_idiom" = "xyes" ; then
JITTHROWIDIOM='throw()'
else
JITTHROWIDIOM=''
fi
dnl Determine if the C compiler understands the "-fno-gcse" option.
dnl We will get better code in the interpreter if we use this option.
AC_CACHE_CHECK(for -fno-gcse option, ac_cv_prog_no_gcse,
[echo 'int main(int argc, char **argv){ return 0;}' > conftest.c
if test -z "`${CC-cc} -fno-gcse -o conftest conftest.c 2>&1`"; then
ac_cv_prog_no_gcse=yes
else
ac_cv_prog_no_gcse=no
fi
rm -f conftest*
])
if test "x$ac_cv_prog_no_gcse" = "xyes" ; then
CFLAGS="-fno-gcse $CFLAGS"
fi
dnl Determine if the C++ compiler understands the "-lstdc++" option.
dnl Needed to force the shared libraries to link in the C++ code.
AC_CACHE_CHECK(for -lstdc++ option, ac_cv_prog_stdcpp,
[echo 'int main(int argc, char **argv){ return 0;}' > conftest.c
if test -z "`${CXX-c++} -o conftest conftest.c -lstdc++ 2>&1`"; then
ac_cv_prog_stdcpp=yes
else
ac_cv_prog_stdcpp=no
fi
rm -f conftest*
])
AC_SUBST(LIB_STDCPP)
if test "x$ac_cv_prog_stdcpp" = "xyes" ; then
LIB_STDCPP="-lstdc++"
else
LIB_STDCPP=""
fi
dnl Check for computed goto support in the compiler.
AC_MSG_CHECKING(for computed goto support)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
static void *labels[] = {&&label0, &&label1, &&label2};
unsigned char *pc = 0;
goto *labels[*pc];
label0: ;
label1: ;
label2: ;
]])], [AC_DEFINE(HAVE_COMPUTED_GOTO, 1, Define if you have support for computed gotos) compgoto=yes], [compgoto=no])
AC_MSG_RESULT($compgoto)
AC_MSG_CHECKING(for pic computed goto support)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
static int labelOffsets[] =
{&&label0 - &&label0, &&label1 - &&label0, &&label2 - &&label0};
unsigned char *pc = 0;
goto *(&&label0 + labelOffsets[*pc]);
label0: ;
label1: ;
label2: ;
]])], [AC_DEFINE(HAVE_PIC_COMPUTED_GOTO, 1, Define if you have PIC support for computed gotos) piccompgoto=yes], [piccompgoto=no])
AC_MSG_RESULT($piccompgoto)
dnl Check for building on a multi os system
if test x$GCC = xyes ; then
multi_os_directory=`$CC -print-multi-os-directory`
case $multi_os_directory in
.) ;; # Avoid trailing /.
*) libdir=$libdir/$multi_os_directory ;;
esac
fi
AC_SUBST(libdir)
dnl Checks for library functions.
if test "x$suppress_libm" = "xno" ; then
AC_CHECK_LIB(m, sin)
fi
if test "x$platform_win32" = "xno" ; then
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(pthread, pthread_create)
fi
AC_FUNC_MEMCMP
AC_CHECK_FUNCS(memset memcmp memchr memcpy memmove bcopy bzero bcmp)
AC_CHECK_FUNCS(strlen strcpy strcat strncpy strcmp strncmp)
AC_CHECK_FUNCS(strchr strrchr vsprintf vsnprintf _vsnprintf getpagesize)
AC_CHECK_FUNCS(isnan isinf finite fmod remainder drem ceil floor)
AC_CHECK_FUNCS(acos asin atan atan2 cos cosh exp log log10 pow)
AC_CHECK_FUNCS(sin sinh sqrt tan tanh)
AC_CHECK_FUNCS(isnanf isinff finitef fmodf remainderf dremf ceilf floorf)
AC_CHECK_FUNCS(acosf asinf atanf atan2f cosf coshf expf logf log10f powf)
AC_CHECK_FUNCS(sinf sinhf sqrtf tanf tanhf)
AC_CHECK_FUNCS(isnanl isinfl finitel fmodl remainderl dreml ceill floorl)
AC_CHECK_FUNCS(acosl asinl atanl atan2l cosl coshl expl logl log10l powl)
AC_CHECK_FUNCS(sinl sinhl sqrtl tanl tanhl)
AC_CHECK_FUNCS(trunc truncf truncl)
AC_CHECK_FUNCS(roundf round roundl rint rintf rintl)
AC_CHECK_FUNCS(dlopen cygwin_conv_to_win32_path mmap munmap mprotect)
AC_CHECK_FUNCS(sigsetjmp __sigsetjmp _setjmp)
AC_FUNC_ALLOCA
AC_CONFIG_FILES([
Makefile
include/Makefile
include/jit/Makefile
include/jit/jit-defs.h
tools/Makefile
jit/Makefile
jitdynamic/Makefile
jitplus/Makefile
dpas/Makefile
tutorial/Makefile
tests/Makefile
doc/Makefile])
AC_OUTPUT
( run in 0.311 second using v1.01-cache-2.11-cpan-8644d7adfcd )