2012-05-23 21:26:15 +02:00
|
|
|
dnl ---- configure.ac for gb.jit
|
|
|
|
|
2014-04-05 23:22:43 +02:00
|
|
|
m4_include([../version.m4])
|
2022-09-03 13:24:51 +02:00
|
|
|
AC_INIT([gambas3-gb-jit-llvm],[GB_VERSION],[GB_MAIL],[],[GB_URL])
|
2012-05-23 21:26:15 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2014-04-05 23:22:43 +02:00
|
|
|
|
2018-05-17 01:13:56 +02:00
|
|
|
GB_INIT(gb.jit.llvm)
|
2022-09-03 13:24:51 +02:00
|
|
|
LT_INIT
|
2012-05-23 21:26:15 +02:00
|
|
|
|
2012-05-30 16:11:38 +02:00
|
|
|
min_llvm_version=3.1
|
2015-03-11 02:30:55 +01:00
|
|
|
max_llvm_version=3.5
|
|
|
|
next_max_llvm_version=3.6
|
2012-05-30 16:11:38 +02:00
|
|
|
|
2012-05-25 17:54:00 +02:00
|
|
|
dnl llvm-config file can be forced with LLVM_CONFIG env var
|
2015-03-11 02:30:55 +01:00
|
|
|
if test "x$LLVM_CONFIG" = x; then
|
|
|
|
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
|
|
|
|
fi
|
2012-05-25 17:54:00 +02:00
|
|
|
|
|
|
|
if test "x$LLVM_CONFIG" = xno; then
|
2018-05-17 01:13:56 +02:00
|
|
|
touch DISABLED DISABLED.gb.jit.llvm
|
2012-05-25 02:50:33 +02:00
|
|
|
else
|
2015-03-11 02:30:55 +01:00
|
|
|
AC_MSG_CHECKING([for LLVM, version between $min_llvm_version and $max_llvm_version])
|
2012-05-30 16:11:38 +02:00
|
|
|
|
2012-05-25 17:54:00 +02:00
|
|
|
LLVM_VERSION=`$LLVM_CONFIG --version`
|
2014-06-22 18:58:59 +02:00
|
|
|
|
2015-03-11 02:30:55 +01:00
|
|
|
AX_COMPARE_VERSION($LLVM_VERSION, [ge], $min_llvm_version, [min_llvm_version_ok=y], [min_llvm_version_ok=n])
|
|
|
|
AX_COMPARE_VERSION($LLVM_VERSION, [lt], $next_max_llvm_version, [max_llvm_version_ok=y], [max_llvm_version_ok=n])
|
|
|
|
|
|
|
|
if test "x$min_llvm_version_ok$max_llvm_version_ok" = xyy; then
|
|
|
|
AC_MSG_RESULT([yes ($LLVM_VERSION)])
|
2017-07-15 21:44:05 +02:00
|
|
|
|
|
|
|
if test "x$LLVM_LIBS" = x; then
|
|
|
|
LLVM_LIBS=-lLLVM-$LLVM_VERSION
|
|
|
|
fi
|
|
|
|
|
2015-03-11 02:30:55 +01:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
2018-05-17 01:13:56 +02:00
|
|
|
touch DISABLED DISABLED.gb.jit.llvm
|
2015-03-11 02:30:55 +01:00
|
|
|
fi
|
2012-05-23 21:26:15 +02:00
|
|
|
fi
|
|
|
|
|
2017-07-14 16:39:25 +02:00
|
|
|
dnl [GB_FIND(libLLVM-$LLVM_VERSION.$SHLIBEXT, `$LLVM_CONFIG --prefix` /usr/lib/llvm* /usr/local /usr, lib)],
|
2014-09-29 14:18:32 +02:00
|
|
|
|
2012-05-23 21:26:15 +02:00
|
|
|
GB_COMPONENT(
|
2018-05-17 01:13:56 +02:00
|
|
|
jitllvm, JITLLVM, gb.jit.llvm, [src],
|
2016-10-13 16:20:33 +02:00
|
|
|
[GB_FIND(llvm/ExecutionEngine/JIT.h llvm/Config/llvm-config.h llvm-c/Core.h, `$LLVM_CONFIG --prefix` /usr/lib/llvm* /usr/local /usr, include)],
|
2017-07-14 16:39:25 +02:00
|
|
|
[],
|
2017-07-15 21:44:05 +02:00
|
|
|
[$C_LIB `$LLVM_CONFIG --ldflags` $LLVM_LIBS],
|
2012-05-25 02:50:33 +02:00
|
|
|
[-I../../main/gbx -I../../main/share -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS])
|
|
|
|
|
2022-09-03 13:24:51 +02:00
|
|
|
AC_CONFIG_FILES([Makefile src/Makefile])
|
|
|
|
AC_OUTPUT
|
2012-05-25 02:50:33 +02:00
|
|
|
|
2012-05-23 21:26:15 +02:00
|
|
|
GB_PRINT_MESSAGES
|