-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
349 lines (297 loc) · 14.2 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# Copyright 2007-2011 Konrad-Zuse-Zentrum für Informationstechnik Berlin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
AC_PREREQ(2.65)
AC_INIT(scalaris, 0.3.0+svn, [email protected])
###########################################################
#
# check tokyo cabinet and toke
#
###########################################################
ENABLE_TOKE=
TOKEPREFIX=
AC_ARG_ENABLE([toke],
AS_HELP_STRING([--disable-toke],
[disable support for tokyo cabinet through toke]),
[TOKEPREFIX=no])
AC_ARG_ENABLE([toke],
AS_HELP_STRING([--enable-toke@<:@=DIR@:>@],
[enable support for tokyo cabinet through toke]),
[ENABLE_TOKE=yes
TOKEPREFIX=$enableval])
###########################################################
#
# check browser for 'make test-vts'
#
###########################################################
BROWSER=
AC_ARG_WITH([browser],
[AS_HELP_STRING([--with-browser=BROWSER],
[absolute path of the browser to use for 'make test-vts'])],
[if test -n "$withval"; then
BROWSER="$withval"
fi],
[AC_PATH_PROG([BROWSER], [xdg-open])])
AC_SUBST(BROWSER)
AS_IF([test ! -x "$BROWSER"],
[AC_MSG_WARN(["$BROWSER" was not found or is not executable ('make test-vts' will likely fail)])])
###########################################################
#
# check whether to compile to native code using HiPE
#
###########################################################
COMPILE_NATIVE=no
AC_ARG_ENABLE([native],
AS_HELP_STRING([--enable-native],
[enable compilation to native code using HiPE]),
[COMPILE_NATIVE=yes])
###########################################################
#
# check erlang
#
###########################################################
AC_LANG_ERLANG
AC_ERLANG_NEED_ERLC
AC_ERLANG_NEED_ERL
AC_ERLANG_SUBST_ROOT_DIR
AC_ERLANG_SUBST_LIB_DIR
AC_CACHE_CHECK([for Erlang/OTP ERTS version],
[erlang_cv_erts_ver],
[AC_LANG_PUSH([Erlang])[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
Version = erlang:system_info(version),
file:write_file("conftest.out", Version),
ReturnValue = 0,
halt(ReturnValue)])],
[erlang_cv_erts_ver=`cat conftest.out`],
[AC_MSG_FAILURE([test Erlang program execution failed])])
AC_LANG_POP([Erlang])[]dnl
])
AC_SUBST([ERLANG_ERTS_VER], [$erlang_cv_erts_ver])
AC_PATH_PROG(EPMD, epmd, "/bin/false", "$PATH:$ERLANG_ROOT_DIR/bin:$ERLANG_ROOT_DIR/erts-$ERLANG_ERTS_VER/bin")
ERLANG_TOKE_FLAGS=
AS_IF([test "x$TOKEPREFIX" != xno],
[
ERLANG_TOKE_MESSAGE=
AS_IF([test "x$TOKEPREFIX" != x], [export ERL_LIBS="$TOKEPREFIX"])
AC_ERLANG_CHECK_LIB(toke,
[AC_CHECK_FILE($ERLANG_LIB_DIR_toke/priv/libtoke.so,
[HAVETOKE=", {d, have_toke}"
HAVETOKE_DIALYZER="-Dhave_toke"
ERLANG_TOKE_FLAGS="-pa $ERLANG_LIB_DIR_toke/ebin"
],
[HAVETOKE=""
HAVETOKE_DIALYZER=""
ERLANG_TOKE_MESSAGE="toke library libtoke.so not found"
])
],
[HAVETOKE=""
HAVETOKE_DIALYZER=""
ERLANG_TOKE_MESSAGE="toke erlang library not found"
])
AS_IF([test "x$TOKEPREFIX" != x], [export ERL_LIBS=""])
AS_IF([test "x$ERLANG_TOKE_MESSAGE" != x],
[AS_IF([test "x$ENABLE_TOKE" != xyes],
[ERLANG_TOKE_MESSAGE="$ERLANG_TOKE_MESSAGE, disabling toke support..."
AC_MSG_NOTICE($ERLANG_TOKE_MESSAGE)],
AC_MSG_FAILURE($ERLANG_TOKE_MESSAGE))])
])
AC_SUBST([ERLANG_TOKE_FLAGS])
ERLANG_NATIVE_FLAGS=
AS_IF([test "x$COMPILE_NATIVE" != xno], [ERLANG_NATIVE_FLAGS=", native"])
AC_ERLANG_CHECK_LIB(tools, , AC_MSG_FAILURE([erlang-tools not found - you won't be able compile the erlang sources]))
AC_ERLANG_CHECK_LIB(common_test, , AC_MSG_NOTICE([erlang-common_test not found - you won't be able to run the unit tests without common_test]))
AC_ERLANG_CHECK_LIB(edoc, , AC_MSG_NOTICE([erlang-edoc not found - you won't be able to create the documentation or run 'make install']))
AC_CHECK_FILE($ERLANG_LIB_DIR_common_test/priv/bin/run_test,
[AC_SUBST(RUN_TEST,[$ERLANG_LIB_DIR_common_test/priv/bin/run_test])],
[AC_CHECK_FILE($ac_cv_erlang_root_dir/bin/run_test,
[AC_SUBST(RUN_TEST,[$ac_cv_erlang_root_dir/bin/run_test])],
[AC_PATH_PROG([RUN_TEST],[run_test])
if test -z $ac_cv_path_RUN_TEST ; then
AC_MSG_NOTICE([run_test not found - on erlang < R14 consider running install.sh in the common_test directory otherwise you won't be able to run the unit tests])
fi])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::gb_tree()).], [ok])],
[GBTREESISBUILTIN=""; GBTREESISBUILTIN_DIALYZER=""; AC_MSG_NOTICE([gb_tree() is a built-in type])],
[GBTREESISBUILTIN=", {d, types_not_builtin}"; GBTREESISBUILTIN_DIALYZER="-Dtypes_not_builtin"; AC_MSG_NOTICE([gb_tree() is not built-in])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::term()).], [ok])],
[TERMISBUILTIN=""; TERMISBUILTIN_DIALYZER=""; AC_MSG_NOTICE([term() is a built-in type])],
[TERMISBUILTIN=", {d, term_not_builtin}"; TERMISBUILTIN_DIALYZER="-Dterm_not_builtin"; AC_MSG_NOTICE([term() is not built-in])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::node()).], [ok])],
[NODEISBUILTIN=""; NODEISBUILTIN_DIALYZER=""; AC_MSG_NOTICE([node() is a built-in type])],
[NODEISBUILTIN=", {d, node_not_builtin}"; NODEISBUILTIN_DIALYZER="-Dnode_not_builtin"; AC_MSG_NOTICE([node() is not built-in])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::module()).], [ok])],
[MODULEISBUILTIN=""; MODULEISBUILTIN_DIALYZER=""; AC_MSG_NOTICE([module() is a built-in type])],
[MODULEISBUILTIN=", {d, module_not_builtin}"; MODULEISBUILTIN_DIALYZER="-Dmodule_not_builtin"; AC_MSG_NOTICE([module() is not built-in])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::boolean()).], [ok])],
[BOOLEANISBUILTIN=""; BOOLEANISBUILTIN_DIALYZER=""; AC_MSG_NOTICE([boolean() is a built-in type])],
[BOOLEANISBUILTIN=", {d, boolean_not_builtin}"; BOOLEANISBUILTIN_DIALYZER="-Dboolean_not_builtin"; AC_MSG_NOTICE([boolean() is not built-in])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::tid()).], [ok])],
[TIDISBUILTIN=""; TIDISBUILTIN_DIALYZER=""; AC_MSG_NOTICE([tid() is a built-in type])],
[TIDISBUILTIN=", {d, tid_not_builtin}"; TIDISBUILTIN_DIALYZER="-Dtid_not_builtin"; AC_MSG_NOTICE([tid() is not built-in])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::{ok, mytype()} | ok).], [ok])],
[RECURSIVETYPESALLOWED=""; RECURSIVETYPESALLOWED_DIALYZER=""; AC_MSG_NOTICE([recursive types are supported])],
[RECURSIVETYPESALLOWED=", {d, recursive_types_are_not_allowed}"; RECURSIVETYPESALLOWED_DIALYZER="-Drecursive_types_are_not_allowed"; AC_MSG_NOTICE([recursive types are not supported])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::{ok, mytype2()} | ok). -type(mytype2() :: ok).], [ok])],
[TYPEFORWARDDECLARATIONS=""; TYPEFORWARDDECLARATIONS_DIALYZER=""; AC_MSG_NOTICE([type forward declarations are supported])],
[TYPEFORWARDDECLARATIONS=", {d, type_forward_declarations_are_not_allowed}"; TYPEFORWARDDECLARATIONS_DIALYZER="-Dtype_forward_declarations_are_not_allowed"; AC_MSG_NOTICE([type forward declarations are not supported])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[-export_type([mytype/0]). -type(mytype()::ok).]], [ok])],
[EXPORTTYPESUPPORT=", {d, with_export_type_support}"; EXPORTTYPESUPPORT_DIALYZER="-Dwith_export_type_support"; DIALYZER_FLAGS="$DIALYZER_FLAGS -Dwith_export_type_support"; AC_MSG_NOTICE([export_type is supported])],
[EXPORTTYPESUPPORT=""; EXPORTTYPESUPPORT_DIALYZER=""; AC_MSG_NOTICE([export_type is not supported])])
if test "x$RECURSIVETYPESALLOWED" != x -o "x$TYPEFORWARDDECLARATIONS" != x; then
AC_MSG_NOTICE([forward declarations or recursive types are not allowed])
FORWARDORRECURSIVE=", {d, forward_or_recursive_types_are_not_allowed}"
FORWARDORRECURSIVE_DIALYZER="-Dforward_or_recursive_types_are_not_allowed"
fi
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [crypto:start()])],
[AC_MSG_NOTICE([crypto:start() is available])],
[AC_MSG_FAILURE([cannot start the crypto subsystem])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([-type(mytype()::{ok, arity()}).], [ok])],
[AC_MSG_NOTICE([arity() is available])],
[AC_MSG_FAILURE([the type arity() is not available; you are probably using Erlang < R13 which is not supported anymore])])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [httpc:set_option(max_sessions, 1)])],
[AC_MSG_NOTICE([httpc is available])],
[AC_MSG_NOTICE([httpc unavailable, using wrapper module]);EMAKEFILECOMPILECOMPAT=["{\"contrib/compat/httpc.erl\",[debug_info, nowarn_unused_function, nowarn_obsolete_guard, nowarn_unused_vars,{outdir, \"ebin\"}]}."]])
EMAKEFILEDEFINES="$HAVETOKE $GBTREESISBUILTIN $TERMISBUILTIN $NODEISBUILTIN $MODULEISBUILTIN $BOOLEANISBUILTIN $TIDISBUILTIN $RECURSIVETYPESALLOWED $TYPEFORWARDDECLARATIONS $FORWARDORRECURSIVE $EXPORTTYPESUPPORT $ERLANG_NATIVE_FLAGS"
DIALYZER_FLAGS="$HAVETOKE_DIALYZER $GBTREESISBUILTIN_DIALYZER $TERMISBUILTIN_DIALYZER $NODEISBUILTIN_DIALYZER $MODULEISBUILTIN_DIALYZER $BOOLEANISBUILTIN_DIALYZER $TIDISBUILTIN_DIALYZER $RECURSIVETYPESALLOWED_DIALYZER $TYPEFORWARDDECLARATIONS_DIALYZER $FORWARDORRECURSIVE_DIALYZER $EXPORTTYPESUPPORT_DIALYZER"
AC_SUBST(EMAKEFILEDEFINES)
AC_SUBST(EMAKEFILECOMPILECOMPAT)
AC_SUBST(DIALYZER_FLAGS)
###########################################################
#
# check java-functions, build-classpath availability for java-api/scalaris
#
###########################################################
JAVAFUNCTIONS=
AC_ARG_WITH([java-functions],
[AS_HELP_STRING([--with-java-functions=JAVAFUNCTIONS],
[use the given java-functions script for java-api/scalaris (default is /usr/share/java-utils/java-functions)])],
[with_java_functions=$withval],
[with_java_functions=/usr/share/java-utils/java-functions])
AC_CHECK_FILE($with_java_functions, [JAVAFUNCTIONS=$with_java_functions],
[JAVAFUNCTIONS=$with_java_functions
AC_MSG_WARN([java-functions was not found in "$with_java_functions" (java-api/scalaris may fail)])])
AC_SUBST(JAVAFUNCTIONS)
BUILDCLASSPATH=
AC_ARG_WITH([build-classpath],
[AS_HELP_STRING([--with-build-classpath=BUILDCLASSPATH],
[absolute path of the build-classpath script to use for java-api/scalaris])],
[if test -n "$withval"; then
BUILDCLASSPATH="$withval"
fi],
[AC_PATH_PROG([BUILDCLASSPATH], [build-classpath])])
AC_SUBST(BUILDCLASSPATH)
AS_IF([test ! -x "$BUILDCLASSPATH"],
[AC_MSG_WARN([build-classpath was not found in "$BUILDCLASSPATH" or is not executable (java-api/scalaris may fail)])])
###########################################################
#
# check ruby
#
###########################################################
ENABLERUBYINSTALL=
RUBYSITELIBDIR=
AC_ARG_WITH([ruby-sitelibdir],
[AS_HELP_STRING([--with-ruby-sitelibdir=SITELIBDIR],
[where to install ruby libraries])],
[if test -n "$withval"; then
RUBYSITELIBDIR="$withval"
ENABLERUBYINSTALL="install-ruby"
fi],
[])
AC_SUBST(ENABLERUBYINSTALL)
AC_SUBST(RUBYSITELIBDIR)
###########################################################
#
# check python
#
###########################################################
PYTHONSITELIBDIR=
ENABLEPYTHONINSTALL=
AM_PATH_PYTHON(,, [:])
AS_IF([test "$PYTHON" != ":"],
[PYTHONSITELIBDIR=$am_cv_python_pythondir
ENABLEPYTHONINSTALL="install-python"])
AC_SUBST(ENABLEPYTHONINSTALL)
AC_SUBST(PYTHONSITELIBDIR)
###########################################################
#
# check python3
#
###########################################################
ENABLEPYTHON3INSTALL=
PYTHON3SITELIBDIR=
AC_ARG_WITH([python3-sitelibdir],
[AS_HELP_STRING([--with-python3-sitelibdir=SITELIBDIR],
[where to install python3 libraries])],
[if test -n "$withval"; then
PYTHON3SITELIBDIR="$withval"
ENABLEPYTHON3INSTALL="install-python3"
fi],
[])
AC_SUBST(ENABLEPYTHON3INSTALL)
AC_SUBST(PYTHON3SITELIBDIR)
###########################################################
#
# check opennebula
#
###########################################################
ENABLEONEINSTALL=
ONEPREFIX=
AC_ARG_ENABLE([opennebula],
AS_HELP_STRING([--disable-opennebula],
[disable support for opennebula]),
[ONEPREFIX=no])
AC_ARG_ENABLE([opennebula],
AS_HELP_STRING([--enable-opennebula@<:@=DIR@:>@],
[enable support for opennebula]),
[ENABLEONEINSTALL="install-one"
ONEPREFIX=$enableval])
AC_SUBST(ENABLEONEINSTALL)
###########################################################
#
# check MACOSX vs. Linux for flexbisonparse driver
#
###########################################################
case `uname -s` in
linux*)
DRIVER_OS=LINUX
;;
Linux*)
DRIVER_OS=LINUX
;;
Darwin*)
DRIVER_OS=MACOSX
;;
darwin*)
DRIVER_OS=MACOSX
;;
esac
echo "detected OS is: '$DRIVER_OS'"
AC_SUBST(DRIVER_OS)
mkdir -p ~/.yaws 2> /dev/null
AC_CONFIG_FILES([Emakefile Makefile bin/scalarisctl java-api/scalaris java-api/scalaris-java.conf])
AC_OUTPUT
chmod u+x bin/scalarisctl
chmod u+x java-api/scalaris