-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
197 lines (152 loc) · 5.41 KB
/
configure.ac
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
AC_INIT([[klee]],[[0.1.0]],[[email protected]])
AC_CONFIG_AUX_DIR(autoconf/)
AC_CONFIG_SRCDIR(["config.mk.in"])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([config.mk fake/Makefile])
AC_CONFIG_HEADERS([include/klee/Config/config.h])
AH_TOP([#ifndef KLEE_CONFIG_CONFIG_H
#define KLEE_CONFIG_CONFIG_H])
AH_BOTTOM([#endif])
AC_LANG([C++])
AC_CACHE_CHECK([type of operating system to host on],
[klee_cv_os_type],
[case $host in
*-*-linux*)
host_supports_posix_runtime=yes ;;
*)
host_supports_posix_runtime=no ;;
esac])
dnl --with-llvm is a shortcut for setting srcdir and objdir.
AC_ARG_WITH(llvm_config,
AS_HELP_STRING([--with-llvm-config],
[Name of the llvm-config binary to use to get libllvm pkgconfig info]),,)
AC_CHECK_PROGS(llvm_config, [${with_llvm_config} llvm-config-2.9 llvm-config-2.8 llvm-config-2.7 llvm-config-2.6 llvm-config], [:])
AC_MSG_CHECKING([${llvm_config} --version])
llvm_version=`${llvm_config} --version`
if test X${llvm_version} = X; then
AC_MSG_ERROR([unable to find llvm-config, use --with-llvm-config])
fi
AC_MSG_RESULT([$llvm_version])
libllvm_cflags=`${llvm_config} --cflags`
AC_SUBST(libllvm_CPPFLAGS,$libllvm_cflags)
libllvm_libs=`${llvm_config} --libs`
AC_SUBST(libllvm_LDFLAGS,$libllvm_libs)
AC_MSG_CHECKING([llvm version major])
llvm_version_major=`echo "$llvm_version" | cut -f1 -d.`
AC_MSG_RESULT([$llvm_version_major])
AC_MSG_CHECKING([llvm version minor])
llvm_version_minor=`echo "$llvm_version" | cut -f2 -d.`
AC_MSG_RESULT([$llvm_version_minor])
AC_DEFINE_UNQUOTED(LLVM_VERSION_MAJOR, $llvm_version_major, [LLVM major version number])
AC_SUBST(LLVM_VERSION_MAJOR,$llvm_version_major)
AC_DEFINE_UNQUOTED(LLVM_VERSION_MINOR, $llvm_version_minor, [LLVM minor version number])
AC_SUBST(LLVM_VERSION_MINOR,$llvm_version_minor)
AC_CHECK_PROGS(llvmar, [llvm-ar-${llvm_version} llvm-ar], [:])
AC_CHECK_PROGS(llvmas, [llvm-as-${llvm_version} llvm-as], [:])
AC_CHECK_PROGS(llvmranlib, [llvm-ranlib-${llvm_version} llvm-ranlib], [:])
dnl LLVM <= 2.6 requires RTTI.
if test $llvm_version_major -eq 2 -a $llvm_version_minor -le 6 ; then
requires_rtti=1
else
requires_rtti=0
fi
AC_SUBST(REQUIRES_RTTI,$requires_rtti)
dnl **************************************************************************
dnl User option to enable uClibc support.
AC_ARG_WITH(uclibc,
AS_HELP_STRING([--with-uclibc],
[Enable use of the klee uclibc at the given path]),,)
dnl If uclibc wasn't given, check for a uclibc in the current
dnl directory.
if (test X${with_uclibc} = X && test -d uclibc); then
with_uclibc=uclibc
fi
AC_MSG_CHECKING([uclibc])
if (test X${with_uclibc} != X); then
if test ! -d ${with_uclibc}; then
AC_MSG_ERROR([invalid uclibc directory: ${with_uclibc}])
fi
dnl Make the path absolute
with_uclibc=`cd $with_uclibc 2> /dev/null; pwd`
AC_MSG_RESULT([$with_uclibc])
else
AC_MSG_RESULT([no])
fi
AC_DEFINE_UNQUOTED(KLEE_UCLIBC, "$with_uclibc", [Path to KLEE uClibc])
AC_SUBST(KLEE_UCLIBC)
if test X${with_uclibc} != X ; then
AC_SUBST(ENABLE_UCLIBC,[[1]])
else
AC_SUBST(ENABLE_UCLIBC,[[0]])
fi
dnl **************************************************************************
dnl User option to enable the POSIX runtime
AC_ARG_ENABLE(posix-runtime,
AS_HELP_STRING([--enable-posix-runtime],
[Enable the POSIX runtime]),
,enableval=default)
AC_MSG_CHECKING([POSIX runtime])
if test ${enableval} = "default" ; then
if test X${with_uclibc} != X; then
enableval=$host_supports_posix_runtime
if test ${enableval} = "yes"; then
AC_MSG_RESULT([default (enabled)])
else
AC_MSG_RESULT([default (disabled, unsupported target)])
fi
else
enableval="no"
AC_MSG_RESULT([default (disabled, no uclibc)])
fi
else
if test ${enableval} = "yes" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
if test ${enableval} = "yes" ; then
AC_SUBST(ENABLE_POSIX_RUNTIME,[[1]])
else
AC_SUBST(ENABLE_POSIX_RUNTIME,[[0]])
fi
dnl **************************************************************************
dnl See if we should support __ctype_b_loc externals.
dnl FIXME: Do the proper test if we continue to need this.
case $host in
*-*-linux*)
AC_DEFINE_UNQUOTED(HAVE_CTYPE_EXTERNALS, 1, [Does the platform use __ctype_b_loc, etc.])
esac
dnl **************************************************************************
dnl Checks for header files.
AC_LANG_PUSH([C])
AC_CHECK_HEADERS([sys/acl.h])
AC_LANG_POP([C])
AC_CHECK_HEADERS([selinux/selinux.h],
AC_SUBST(HAVE_SELINUX, 1),
AC_SUBST(HAVE_SELINUX, 0))
AC_ARG_WITH(stp,
AS_HELP_STRING([--with-stp],
[Location of STP installation directory]),,)
if test X$with_stp = X ; then
AC_SUBST(ENABLE_EXT_STP,[[0]])
else
stp_root=`cd $with_stp 2> /dev/null; pwd`
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$stp_root/include"
AC_CHECK_HEADER(stp/c_interface.h,, [
AC_MSG_ERROR([Unable to use stp/c_interface.h header])
])
CPPFLAGS="$old_CPPFLAGS"
AC_CHECK_LIB(stp, vc_setInterfaceFlags,, [
AC_MSG_ERROR([Unable to link with libstp])
], -L$stp_root/lib)
AC_DEFINE(HAVE_EXT_STP, 1, [Using external STP])
AC_SUBST(ENABLE_EXT_STP,[[1]])
AC_SUBST(STP_ROOT,$stp_root)
fi
dnl **************************************************************************
dnl * Create the output files
dnl **************************************************************************
AC_OUTPUT