Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (68 sloc) 1.77 KB
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([llevm], [0.0.1], [lukas@erlang-solutions.com])
AC_CONFIG_AUX_DIRS($srcdir/autoconf)
AC_PREREQ([2.67])
AC_CONFIG_SRCDIR([src/llevm.app.src])
AC_CANONICAL_HOST
TARGET=$host
AC_SUBST(TARGET)
# Checks for programs.
AC_PROG_CC
AC_LANG([C])
AC_PATH_PROGS([llvm_config_var], [llvm-config llvm-config-2.8], [no])
if test ${llvm_config_var} = no; then
AC_MSG_ERROR([llvm-config not found in path])
fi
AC_PATH_PROG([DOXYGEN_PATH], [doxygen], [no])
if test ${DOXYGEN_PATH} = no; then
AC_MSG_WARN([doxygen not found in path, cannot re-generate llvm nif])
fi
ERLANG_ROOT_DIR=`erl -noshell -eval 'io:format("~s~n",[[code:root_dir()]])' -s erlang halt`
AC_SUBST(ERLANG_ROOT_DIR)
ERTS_DIR=$ERLANG_ROOT_DIR`erl -noshell -eval 'io:format("~s~n",[[lists:concat([["/erts-", erlang:system_info(version)]])]])' -s erlang halt`
AC_SUBST(ERTS_DIR)
AC_MSG_NOTICE(ERL ROOT DIR: [$ERLANG_ROOT_DIR])
case $host_os in
darwin*)
CC=gcc
CXX=gcc
LINKER=gcc
;;
*)
CC=gcc
CXX=g++
LINKER=g++
;;
esac
AC_CHECK_SIZEOF(void *)
case $ac_cv_sizeof_void_p in
8)
CFLAGS="-m64"
;;
*)
CFLAGS="-m32"
;;
esac
CFLAGS="-g3 -Wall -fPIC"
case $host_os in
darwin*)
LDFLAGS="-fPIC -bundle -flat_namespace -undefined suppress"
;;
*)
LDFLAGS="-shared -fPIC"
;;
esac
AC_SUBST(LINKER)
# Checks for libraries.
# Checks for header files.
LLVM_INCLUDES=`$llvm_config_var --includedir`/llvm-c
AC_SUBST(LLVM_INCLUDES)
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_FUNC_MALLOC
if test ${DOXYGEN_PATH} != no; then
AC_CONFIG_FILES([api_gen/Makefile api_gen/doxygen.conf])
fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT