forked from garazdawi/llevm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
72 lines (58 loc) · 1.71 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([llevm], [0.0.1], [[email protected]])
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/erts/emulator/beam #`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])
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"
LINKER=gcc
;;
*)
LDFLAGS="-shared -fPIC"
LINKER=g++
;;
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