Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/configure.ac  view on Meta::CPAN

AC_MSG_RESULT($platform_win32)

dnl The "--enable-interpreter" option forces the use of the interpreter.
AC_ARG_ENABLE(interpreter,
AS_HELP_STRING([--enable-interpreter], [Enable the libjit interpreter]),
[case "${enableval}" in
  yes) interp=true ;;
  no)  interp=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-interpreter) ;;
esac], [interp=false])
if test x$interp = xtrue; then
	AC_DEFINE(USE_LIBJIT_INTERPRETER, 1, [Define if you want to use the libjit interpreter])
fi

dnl The "--enable-signals" option forces the use of the OS signals for exception handling.
AC_ARG_ENABLE(signals,
AS_HELP_STRING([--enable-signals], [Enable OS signal handling]),
[case "${enableval}" in
  yes) use_signals=true ;;
  no)  use_signals=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-signals) ;;
esac], [use_signals=false])
if test x$use_signals = xtrue; then
	AC_DEFINE(JIT_USE_SIGNALS, 1, [Define if you want to use the OS signals for exception handling])
fi

dnl The "--enable-long-double" option forces the use of long double for
dnl jit_nfloat.
AC_ARG_ENABLE(long-double,
AS_HELP_STRING([--enable-long-double], [Enable the use of long double for jit_nfloat]))

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_YACC
AM_PROG_LEX
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

dnl Set the correct flags for compiling with MSVC.  "/QIfist" is needed
dnl on systems with both VC 6.0 and VC 7.0 installed: sometimes VC 7.0
dnl picks up the wrong intrinsic libraries (particularly for __ftol2).
dnl The "/EHs" option is required to enable exception handling in C++.
if test "x$CC" = "xcl" ; then
	CFLAGS="/nologo /QIfist"
	CXXFLAGS="/nologo /QIfist /EHs"
fi

dnl Check for file extensions.
AC_EXEEXT
AC_OBJEXT

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h strings.h memory.h stdlib.h stdarg.h varargs.h)
AC_CHECK_HEADERS(tgmath.h math.h ieeefp.h pthread.h unistd.h sys/types.h)
AC_CHECK_HEADERS(sys/mman.h fcntl.h dlfcn.h sys/cygwin.h sys/stat.h)
AC_CHECK_HEADERS(time.h sys/time.h)

dnl A macro that helps detect the size of types in a cross-compile environment.
AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[for ac_size in 4 8 1 2 12 16 $2 ; do # List sizes in rough order of prevalence.
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "confdefs.h"
#include <sys/types.h>
]], [[switch (0) case 0: case (sizeof ($1) == $ac_size):;]])], [AC_CV_NAME=$ac_size], [])
  if test x$AC_CV_NAME != x ; then break; fi
done
])
if test x$AC_CV_NAME = x ; then
  AC_CV_NAME=0
fi
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])

dnl A macro that detects if "char" is unsigned in a cross-compile environment.
AC_DEFUN([AC_COMPILE_CHAR_UNSIGNED],
[AC_MSG_CHECKING(if char is unsigned)
AC_CACHE_VAL(ac_cv_c_char_unsigned,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "confdefs.h"
]], [[switch (-1) case -1: case (char)255:;]])], [ac_cv_c_char_unsigned=yes], []))
if test x$ac_cv_c_char_unsigned = x ; then
  ac_cv_c_char_unsigned=no
fi
AC_MSG_RESULT($ac_cv_c_char_unsigned)
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
  AC_DEFINE(__CHAR_UNSIGNED__, 1, [Define to 1 if "char" is unsigned])
fi
])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_COMPILE_CHAR_UNSIGNED
AC_COMPILE_CHECK_SIZEOF(char, 1)
AC_COMPILE_CHECK_SIZEOF(short, 2)
AC_COMPILE_CHECK_SIZEOF(int, 4)
AC_COMPILE_CHECK_SIZEOF(long, 4)
AC_COMPILE_CHECK_SIZEOF(long long, 8)
AC_COMPILE_CHECK_SIZEOF(__int64, 8)
AC_COMPILE_CHECK_SIZEOF(float, 4)
AC_COMPILE_CHECK_SIZEOF(double, 8)
AC_COMPILE_CHECK_SIZEOF(long double, 12)
AC_COMPILE_CHECK_SIZEOF(void *, 4)

dnl Determine the types to use for specific sizes of integers and floats.
AC_SUBST(JITINT8)

libjit/configure.ac  view on Meta::CPAN

	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.500 second using v1.01-cache-2.11-cpan-97f6503c9c8 )