This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/JIT/configure.in

112 lines
2.6 KiB
Plaintext
Raw Normal View History

dnl
dnl JIT CONFIGURATION
dnl
AC_SUBST(JITFLAGS)
AC_SUBST(JITLD)
AC_SUBST(JITLIBS)
AC_SUBST(JITDEBUGPREDS)
AC_SUBST(JITSTATISTICPREDS)
AC_SUBST(JITCOMPILER)
AC_SUBST(JITCONFIGPREDS)
AC_SUBST(JITANALYSISPREDS)
AC_SUBST(JITTRANSFORMPREDS)
AC_SUBST(JITCODEGENPREDS)
AC_SUBST(PAPILIB)
AC_ARG_ENABLE(jit,
[ --enable-jit support just-in-time (JIT) compilation],
yap_jit="$enableval", yap_jit=no)
AC_ARG_ENABLE(debug-predicates,
[ --enable-debug-predicates support debug predicates ],
dbg_preds="$enableval", dbg_preds=no)
AC_ARG_ENABLE(statistic-predicates,
[ --enable-statistic-predicates support statistic predicates ],
stat_preds="$enableval", stat_preds=no)
if test "$yap_jit" = "yes"
then
AC_CHECK_PROG(LLVM, llvm-config, [yes],[no])
if test "$LLVM" = "no" ;then
AC_MSG_ERROR([--enable-jit was given, but test for LLVM 3.1 failed])
else
LLVM_VERSION="`llvm-config --version`"
if test "$LLVM_VERSION" != "3.1";then
AC_MSG_ERROR([Test for LLVM 3.1 failed])
fi
fi
AC_CHECK_PROG(CLANG, clang, [yes],[no])
if test "$CLANG" = "no" ;then
AC_MSG_ERROR([--enable-jit was given, but test for clang faild])
fi
YAP_EXTRAS="$YAP_EXTRAS -DYAP_JIT=1"
JITCOMPILER="JIT_Compiler.o"
JITCONFIGPREDS="jit_configpreds.o"
JITANALYSISPREDS="jit_analysispreds.o"
JITTRANSFORMPREDS="jit_transformpreds.o"
JITCODEGENPREDS="jit_codegenpreds.o"
JITFLAGS="`llvm-config --cxxflags`"
JITLD="`llvm-config --ldflags`"
JITLIBS="`llvm-config --libs all`"
fi
if test "$dbg_preds" = "yes"
then
if test "$yap_jit" = "no"
then
AC_MSG_ERROR([--enable-debug-predicates was given, but --enable-jit was not given])
fi
YAP_EXTRAS="$YAP_EXTRAS -DYAP_DBG_PREDS=1"
JITDEBUGPREDS="jit_debugpreds.o"
fi
if test "$stat_preds" = "yes"
then
if test "$yap_jit" = "no"
then
AC_MSG_ERROR([--enable-statistic-predicates was given, but --enable-jit was not given])
fi
AC_CHECK_HEADER([papi.h],
[],
[if test "$stat_preds" != "no"; then
AC_MSG_ERROR(
[--enable-statistic-predicates was given, but papi.h not found])
fi
])
AC_CHECK_LIB([papi], [PAPI_start],
[if test "$stat_preds" != "no"; then
PAPILIB="-lpapi"
fi
],
[if test "$stat_preds" != "no"; then
AC_MSG_ERROR(
[--enable-statistic-predicates was given, but test for papi failed])
fi
])
YAP_EXTRAS="$YAP_EXTRAS -DYAP_STAT_PREDS=1"
JITSTATISTICPREDS="jit_statisticpreds.o"
PAPILIB="-lpapi"
fi