-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfigure.ac
More file actions
225 lines (183 loc) · 5.47 KB
/
configure.ac
File metadata and controls
225 lines (183 loc) · 5.47 KB
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([treedec], [0.9.3+], [larisch.larisch@kaust.edu.sa,felix@salfelder.org])
AC_CONFIG_SRCDIR([src/graph_traits.hpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([])
LT_INIT()
AM_CONDITIONAL([DIST], [false] )
# debugging
AC_MSG_CHECKING([if debug code should be compiled in])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[Enable building of debug code. [[default: disabled]]])],
[
if test "X$enable_debug" = "Xno" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
enable_debug=yes
enable_develop=yes
fi
],
[
AC_MSG_RESULT([no])
enable_debug=no
])
AC_MSG_CHECKING([if develop code should be compiled in])
AC_ARG_ENABLE([develop],
[AS_HELP_STRING([--enable-develop],[Enable building of develop code. [[default: disabled]]])],
[
if test "X$enable_develop" = "Xno" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
enable_develop=yes
fi
],
[
AC_MSG_RESULT([no])
enable_debug=no
])
# Checks for programs.
AC_PROG_CXX
AC_LANG(C++)
AX_COMPILER_VENDOR
OLD_CXXFLAGS="CXXFLAGS"
CXXFLAGS="$CXXFLAGS"
# python stuff
default_python_version=2.7
AC_ARG_WITH([python],
[AS_HELP_STRING([--with-python],
[Enable python library])],
[python=$withval],
[python="auto"])
AS_IF([test "$python" = auto], [
AM_PATH_PYTHON([$default_python_version],
[python="$default_python_version"], [python="no"]
)
],[
AS_IF([test "$python" != no], [
python_version_required="${python##python}"
AM_PATH_PYTHON([$python_version_required],,
AC_MSG_ERROR([python $PYTHON_VERSION is not $python_version_required])
)
])])
AC_ARG_VAR([CYTHON], [the Cython compiler])
AS_IF([test "$python" != no], [
PYTHON_INCLUDE_DIR=$PYTHON_PREFIX/include
PYTHON_LIB_DIR=$PYTHON_PREFIX/lib
AC_ARG_WITH(python-include-dir,
[ --with-python-include-dir=DIR look in DIR for Python headers],
[PYTHON_INCLUDE_DIR=$withval],)
AC_SUBST(PYTHON_INCLUDE_DIR)
AC_ARG_WITH(python-lib-dir,
[ --with-python-lib-dir=DIR look in DIR for Python libraries],
[PYTHON_LIB_DIR=$withval],)
AC_SUBST(PYTHON_LIB_DIR)
])
AM_CONDITIONAL([USE_PYTHON], [test x$python != xno] )
cythonver_req="0.20.0"
CYTHON=${CYTHON-cython}
AS_IF([test "$python" != no], [
AC_PATH_PROGS([CYTHON], [$CYTHON], [no])
AS_IF([test "$CYTHON" = no], [
cython=no
AC_MSG_RESULT([cannot find cython.])
],
AC_MSG_CHECKING([for $CYTHON >= $cythonver_req])
[cythonver=`$CYTHON --version 2>&1 | sed -e 's/[[^0-9\.]]//g'`]
AS_IF([test -n "$cythonver"], [
AS_VERSION_COMPARE(${cythonver},${cythonver_req},
[cmp=-1],[cmp=0],[cmp=1])
AC_MSG_RESULT([${cythonver}])
AS_IF([test "${cmp}" = "-1"],
[AC_MSG_ERROR([need $CYTHON >= $cythonver_req])])
],[
AC_MSG_RESULT([not identified])
])
unset cythonver
cython=no
)
])
AM_CONDITIONAL([USE_CYTHON], [test x$cython != xno] )
# Checks for libraries.
# Checks for header files.
AC_LANG_PUSH([C++])
# unconditional c++11
CXXFLAGS=" $CXXFLAGS"
AC_CHECK_HEADERS([boost/tuple/tuple.hpp], [],
AC_MSG_ERROR([could not find a boost header])
)
have_boostlibs=yes
AC_CHECK_LIB([boost_system], [main], , have_boostlibs=no)
AC_CHECK_LIB([boost_thread], [main], , have_boostlibs=no)
have_gala=no
AC_ARG_WITH([gala], AS_HELP_STRING([--without-gala], [Disable gala]))
AS_IF([test "x$with_gala" != xno], [
AC_CHECK_HEADERS([gala/graph.h],
[ have_gala=yes ],
AC_MSG_NOTICE([consider installing gala])
)
AS_IF([test "x$with_gala" = xyes -a x$have_gala = xno], [
AC_MSG_ERROR([gala not found, but set])
])
])
AM_CONDITIONAL([USE_GALA], [test $have_gala = yes])
AC_CHECK_HEADERS([tlx/container/btree_set.hpp])
AC_LANG_POP([C++])
# BUG: in auto mode disable python if there are no headers...
AS_IF([test "$python" != no], [
AS_IF([test x"$PYTHON" != x], [
AM_CHECK_PYTHON_HEADERS([:],
[AC_MSG_ERROR(please install python headers matching $PYTHON)])
])
])
# HACK. actually we only check if profiling works.
# it doesnt with clang.
AM_CONDITIONAL([CLANG], [test "x$ax_cv_cxx_compiler_vendor" = "xclang"])
# HACK. does old automake not support nested conditionals??
AM_CONDITIONAL([TDECOMP], [test "$have_gala" = yes -a "$have_boostlibs" != no -a "x$ax_cv_cxx_compiler_vendor" != "xclang"])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
# Checks for library functions.
if test "$enable_develop" = "yes" ; then
CPPFLAGS="$CPPFLAGS -DTRACE_UNTESTED"
CXXFLAGS="$CXXFLAGS -Wall -Wextra -pedantic"
fi
if test "$enable_debug" = "yes" ; then
CXXFLAGS="$CXXFLAGS -O0 -g"
else
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
AM_CONDITIONAL([VPATH_BUILD], [test ! x$srcdir = "x."])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([examples/Makefile])
AC_CONFIG_FILES([examples/gr/Makefile])
AC_CONFIG_FILES([tdlib/Makefile])
AC_CONFIG_FILES([tdlib/tests/Makefile])
AC_CONFIG_FILES([treedec/Makefile])
AC_CONFIG_FILES([treedec/tests/Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([src/bits/Makefile])
AC_CONFIG_FILES([src/applications/Makefile])
AC_CONFIG_FILES([src/impl/Makefile])
AC_CONFIG_FILES([tests/Makefile])
AC_OUTPUT
if test -d .git; then
:
else
echo '*' > .gitignore
fi
AC_MSG_RESULT([
** Configuration summary for $PACKAGE $VERSION:
prefix: $prefix
PYTHON: $PYTHON
CYTHON: $CYTHON
gala: $have_gala
CXX: $CXX
CPPFLAGS: $CPPFLAGS
CXXFLAGS: $CXXFLAGS
LIBS: $LIBS
])