Alien-LibJIT
view release on metacpan or search on metacpan
libjit/configure.ac view on Meta::CPAN
elif test "$ac_cv_sizeof_double" = 8 ; then
JITFLOAT64=double
else
AC_MSG_ERROR(unknown)
fi
AC_MSG_RESULT($JITFLOAT64)
AC_MSG_CHECKING(for the native floating-point type)
JITNFLOATISDOUBLE=''
if test "$ac_cv_sizeof_long_double" != 0 ; then
dnl MSVC's "long double" is the same as "double", so we make sure
dnl to preserve compatibility between MSVC and gcc unless the
dnl --enable-long-double option is provided.
if test "x$enable_long_double" = "xyes" ; then
JITNATIVEFLOAT='long double'
elif test "x$enable_long_double" = "xno" -o "$ac_cv_sizeof_long_double" = "$ac_cv_sizeof_double" -o "x$platform_win32" = "xyes" ; then
JITNATIVEFLOAT='double'
JITNFLOATISDOUBLE='#define JIT_NFLOAT_IS_DOUBLE 1'
else
JITNATIVEFLOAT='long double'
fi
elif test "$ac_cv_sizeof_double" != 0 ; then
JITNATIVEFLOAT=double
JITNFLOATISDOUBLE='#define JIT_NFLOAT_IS_DOUBLE 1'
elif test "$ac_cv_sizeof_float" != 0 ; then
JITNATIVEFLOAT=float
else
AC_MSG_ERROR(unknown)
fi
AC_MSG_RESULT($JITNATIVEFLOAT)
dnl Check to see if we are using gcc or not.
if test x$GCC = xyes ; then
CFLAGS="$CFLAGS -Wall"
fi
if test x$GXX = xyes ; then
CXXFLAGS="$CXXFLAGS -Wall"
fi
dnl If CFLAGS contains "-fomit-frame-pointer", then remove it.
dnl We need to have frame pointers to perform stack walking.
case "x$CFLAGS" in
*-fomit-frame-pointer*)
CFLAGS=`echo "$CFLAGS" | sed 's/-fomit-frame-pointer//'` ;;
*) ;;
esac
case "x$CXXFLAGS" in
*-fomit-frame-pointer*)
CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-fomit-frame-pointer//'` ;;
*) ;;
esac
dnl Add "-fno-omit-frame-pointer" to the CFLAGS because current gcc versions
dnl have no frame pointers by default on some archs.
if test x$GCC = xyes ; then
CFLAGS="$CFLAGS -fno-omit-frame-pointer"
CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
fi
dnl Find the option to use to turn on C++ exception handling.
AC_CACHE_CHECK(for C++ exception handling option, ac_cv_prog_cxx_exceptions,
[echo 'int main(int argc, char **argv){try { throw 1; } catch(int i) { return i; } return 0;}' > conftest.c
if test -z "`${CXX-c++} -o conftest conftest.c 2>&1`"; then
ac_cv_prog_cxx_exceptions='none needed'
else
if test -z "`${CXX-c++} -fexceptions -o conftest conftest.c 2>&1`"; then
ac_cv_prog_cxx_exceptions=-fexceptions
else
if test -z "`${CXX-c++} -fhandle-exceptions -o conftest conftest.c 2>&1`"; then
ac_cv_prog_cxx_exceptions=-fhandle-exceptions
else
ac_cv_prog_cxx_exceptions='none needed'
fi
fi
fi
rm -f conftest*
])
if test "x$ac_cv_prog_cxx_exceptions" != "xnone needed" ; then
CXXFLAGS="$ac_cv_prog_cxx_exceptions $CXXFLAGS"
fi
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)
( run in 0.700 second using v1.01-cache-2.11-cpan-119454b85a5 )