1 | # -*- Autoconf -*- |
---|
2 | # Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_PREREQ([2.59]) |
---|
5 | AC_INIT(bind10-devel, 20100318, bind10-dev@isc.org) |
---|
6 | AC_CONFIG_SRCDIR(README) |
---|
7 | AM_INIT_AUTOMAKE |
---|
8 | AC_CONFIG_HEADERS([config.h]) |
---|
9 | |
---|
10 | # Checks for programs. |
---|
11 | AC_PROG_CXX |
---|
12 | AC_PROG_CC |
---|
13 | AC_PROG_LIBTOOL |
---|
14 | |
---|
15 | # Use C++ language |
---|
16 | AC_LANG_CPLUSPLUS |
---|
17 | |
---|
18 | m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1]) |
---|
19 | AC_ARG_WITH([pythonpath], |
---|
20 | AC_HELP_STRING([--with-pythonpath=PATH], |
---|
21 | [specify an absolute path to python executable when automatic version check (incorrectly) fails]), |
---|
22 | [python_path="$withval"], [python_path="auto"]) |
---|
23 | if test "$python_path" = auto; then |
---|
24 | AM_PATH_PYTHON([3.1]) |
---|
25 | else |
---|
26 | # Older versions of automake can't handle python3 well. This is an |
---|
27 | # in-house workaround for them. |
---|
28 | PYTHON=$python_path |
---|
29 | AC_SUBST(PYTHON) |
---|
30 | PYTHON_PREFIX='${prefix}' |
---|
31 | AC_SUBST(PYTHON_PREFIX) |
---|
32 | PYTHON_EXEC_PREFIX='$(exec_prefix)' |
---|
33 | AC_SUBST(PYTHON_EXEC_PREFIX) |
---|
34 | PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`] |
---|
35 | if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then |
---|
36 | AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"]) |
---|
37 | fi |
---|
38 | AC_SUBST(PYTHON_VERSION) |
---|
39 | PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"` |
---|
40 | AC_SUBST(PYTHON_PLATFORM) |
---|
41 | pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages' |
---|
42 | AC_SUBST(pythondir) |
---|
43 | pkgpythondir='${pythondir}/'$PACKAGE |
---|
44 | AC_SUBST(pkgpythondir) |
---|
45 | pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages' |
---|
46 | AC_SUBST(pyexecdir) |
---|
47 | pkgpyexecdir='${pyexecdir}/'$PACKAGE |
---|
48 | AC_SUBST(pkgpyexecdir) |
---|
49 | fi |
---|
50 | |
---|
51 | # Check for python development environments |
---|
52 | if test -x ${PYTHON}-config; then |
---|
53 | PYTHON_INCLUDES=`${PYTHON}-config --includes` |
---|
54 | |
---|
55 | for flag in `${PYTHON}-config --ldflags`; do |
---|
56 | # add any '-L..." flags to PYTHON_LDFLAGS |
---|
57 | flag=`echo $flag | sed -ne 's/^\(\-L.*\)$/\1/p'` |
---|
58 | if test "X${flag}" != X; then |
---|
59 | PYTHON_LDFLAGS="$PYTHON_LDFLAGS ${flag}" |
---|
60 | fi |
---|
61 | done |
---|
62 | # on some platforms, ${PYTHON}-config --ldflags doesn't provide a -L |
---|
63 | # option while having the library under a non trivial directory. |
---|
64 | # as a workaround we try the "lib" sub directory under the common |
---|
65 | # prefix for this python. |
---|
66 | if test -z "${PYTHON_LDFLAGS}"; then |
---|
67 | PYTHON_LDFLAGS="-L`${PYTHON}-config --prefix`/lib" |
---|
68 | fi |
---|
69 | else |
---|
70 | if test "X$PYTHON_INCLUDES" = X -o "X$PYTHON_LDFLAGS" = X; then |
---|
71 | AC_MSG_WARN([${PYTHON}-config does not exist or is not executable, so we could not detect python development environment. Your system may require an additional package (e.g. "python3-dev"). Alternatively, if you are sure you have python headers and libraries, define PYTHON_INCLUDES and PYTHON_LDFLAGS and run this script.]) |
---|
72 | fi |
---|
73 | fi |
---|
74 | AC_SUBST(PYTHON_INCLUDES) |
---|
75 | AC_SUBST(PYTHON_LDFLAGS) |
---|
76 | |
---|
77 | # We're going to explore various options to build our libraries and executables |
---|
78 | # with boost libraries without requiring the user to do counter-intuitive |
---|
79 | # run time setting. These options include the non-portable -R (rpath) linker |
---|
80 | # flag to embed the path to the boost libraries in our binaries. We first |
---|
81 | # identify the availability of this flag for subsequent checks. |
---|
82 | AC_MSG_CHECKING([whether -R flag is available in linker]) |
---|
83 | LDFLAGS_SAVED="$LDFLAGS" |
---|
84 | LDFLAGS="$LDFLAGS -Wl,-R/usr/lib" |
---|
85 | AC_TRY_LINK([],[], |
---|
86 | [ AC_MSG_RESULT(yes) |
---|
87 | rpath_available=yes |
---|
88 | ],[ AC_MSG_RESULT(no) |
---|
89 | rpath_available=no |
---|
90 | ]) |
---|
91 | LDFLAGS=$LDFLAGS_SAVED |
---|
92 | # Check for Boost.python may require libpython to be linked. Again, it may |
---|
93 | # be installed in a non standard path, which may make the test fail. So we |
---|
94 | # set up the temporary rpath for libpython when it's available. |
---|
95 | if test $rpath_available = yes; then |
---|
96 | for flag in ${PYTHON_LDFLAGS}; do |
---|
97 | python_rpath="${python_rpath} -Wl,`echo $flag | sed -ne 's/^\(\-L\)/-R/p'`" |
---|
98 | done |
---|
99 | fi |
---|
100 | |
---|
101 | # Check for python library (not absolutely mandatory, but needed for |
---|
102 | # Boost.Python when we use it. See below.) |
---|
103 | LDFLAGS_SAVED="$LDFLAGS" |
---|
104 | LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS" |
---|
105 | python_bin="python${PYTHON_VERSION}" |
---|
106 | AC_CHECK_LIB($python_bin, main, python_lib=$python_bin, python_lib=no) |
---|
107 | if test $python_lib != "no"; then |
---|
108 | PYTHON_LIB="-l$python_lib" |
---|
109 | fi |
---|
110 | AC_SUBST(PYTHON_LIB) |
---|
111 | |
---|
112 | # TODO: check for _sqlite3.py module |
---|
113 | |
---|
114 | # |
---|
115 | # B10_CXXFLAGS is the default C++ compiler flags. This will (and should) be |
---|
116 | # used as the default value for each specifc AM_CXXFLAGS: |
---|
117 | # AM_CXXFLAGS = $(B10_CXXFLAGS) |
---|
118 | # AM_CXXFLAGS += ... # add module specific flags |
---|
119 | # We need this so that we can disable some specific compiler warnings per |
---|
120 | # module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since |
---|
121 | # gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot |
---|
122 | # specify the default warning flags in CXXFLAGS and let specific modules |
---|
123 | # "override" the default. |
---|
124 | # |
---|
125 | B10_CXXFLAGS= |
---|
126 | |
---|
127 | if test "X$GCC" = "Xyes"; then |
---|
128 | B10_CXXFLAGS="-g -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare" |
---|
129 | UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))' |
---|
130 | |
---|
131 | # Certain versions of gcc (g++) have a bug that incorrectly warns about |
---|
132 | # the use of anonymous name spaces even if they're closed in a single |
---|
133 | # translation unit. For these versions we have to disable -Werror. |
---|
134 | werror_ok=0 |
---|
135 | CXXFLAGS_SAVED="$CXXFLAGS" |
---|
136 | CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror" |
---|
137 | AC_MSG_CHECKING(for in-TU anonymous namespace breakage) |
---|
138 | AC_TRY_COMPILE([namespace { class Foo {}; } |
---|
139 | namespace isc {class Bar {Foo foo_;};} ],, |
---|
140 | [AC_MSG_RESULT(no) |
---|
141 | werror_ok=1 |
---|
142 | B10_CXXFLAGS="$B10_CXXFLAGS -Werror"], |
---|
143 | [AC_MSG_RESULT(yes)]) |
---|
144 | CXXFLAGS="$CXXFLAGS_SAVED" |
---|
145 | fi dnl GCC = yes |
---|
146 | |
---|
147 | AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1) |
---|
148 | AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused) |
---|
149 | |
---|
150 | # produce PIC unless we disable shared libraries. need this for python bindings. |
---|
151 | if test $enable_shared != "no" -a "X$GCC" = "Xyes"; then |
---|
152 | B10_CXXFLAGS="$B10_CXXFLAGS -fPIC" |
---|
153 | fi |
---|
154 | |
---|
155 | AC_SUBST(B10_CXXFLAGS) |
---|
156 | |
---|
157 | # Checks for libraries. |
---|
158 | |
---|
159 | AC_SEARCH_LIBS(inet_pton, [nsl]) |
---|
160 | AC_SEARCH_LIBS(recvfrom, [socket]) |
---|
161 | |
---|
162 | # Checks for header files. |
---|
163 | |
---|
164 | # Checks for typedefs, structures, and compiler characteristics. |
---|
165 | AC_HEADER_STDBOOL |
---|
166 | AC_TYPE_SIZE_T |
---|
167 | |
---|
168 | |
---|
169 | |
---|
170 | AC_MSG_CHECKING(for sa_len in struct sockaddr) |
---|
171 | AC_TRY_COMPILE([ |
---|
172 | #include <sys/types.h> |
---|
173 | #include <sys/socket.h>], |
---|
174 | [struct sockaddr sa; sa.sa_len = 0; return (0);], |
---|
175 | [AC_MSG_RESULT(yes) |
---|
176 | AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])], |
---|
177 | AC_MSG_RESULT(no)) |
---|
178 | |
---|
179 | AC_ARG_WITH(lcov, |
---|
180 | [ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no") |
---|
181 | |
---|
182 | AC_ARG_WITH(gtest, |
---|
183 | [ --with-gtest=PATH specify a path to gtest header files (PATH/include) and library (PATH/lib)], |
---|
184 | gtest_path="$withval", gtest_path="no") |
---|
185 | |
---|
186 | USE_LCOV="no" |
---|
187 | if test "$lcov" != "no"; then |
---|
188 | # force gtest if not set |
---|
189 | if test "$gtest_path" = "no"; then |
---|
190 | # AC_MSG_ERROR("lcov needs gtest for test coverage report") |
---|
191 | AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests]) |
---|
192 | gtest_path="yes" |
---|
193 | fi |
---|
194 | if test "$lcov" != "yes"; then |
---|
195 | LCOV=$lcov |
---|
196 | else |
---|
197 | AC_PATH_PROG([LCOV], [lcov]) |
---|
198 | fi |
---|
199 | if test -x "${LCOV}"; then |
---|
200 | USE_LCOV="yes" |
---|
201 | else |
---|
202 | AC_MSG_ERROR([Cannot find lcov.]) |
---|
203 | fi |
---|
204 | # is genhtml always in the same directory? |
---|
205 | GENHTML=`echo "$LCOV" | sed s/lcov$/genhtml/` |
---|
206 | if test ! -x $GENHTML; then |
---|
207 | AC_MSG_ERROR([genhtml not found, needed for lcov]) |
---|
208 | fi |
---|
209 | # GCC specific? |
---|
210 | CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" |
---|
211 | LIBS=" $LIBS -lgcov" |
---|
212 | AC_SUBST(CPPFLAGS) |
---|
213 | AC_SUBST(LIBS) |
---|
214 | AC_SUBST(LCOV) |
---|
215 | AC_SUBST(GENHTML) |
---|
216 | fi |
---|
217 | AC_SUBST(USE_LCOV) |
---|
218 | |
---|
219 | AC_ARG_WITH([boost-include], |
---|
220 | AC_HELP_STRING([--with-boost-include=PATH], |
---|
221 | [specify exact directory for Boost headers]), |
---|
222 | [boost_include_path="$withval"]) |
---|
223 | if test "${boost_include_path}" ; then |
---|
224 | BOOST_INCLUDES="-I${boost_include_path}" |
---|
225 | CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES" |
---|
226 | fi |
---|
227 | AC_SUBST(BOOST_INCLUDES) |
---|
228 | |
---|
229 | AC_ARG_WITH([boost-lib], |
---|
230 | AC_HELP_STRING([--with-boost-lib=PATH], |
---|
231 | [specify exact directory for Boost libraries]), |
---|
232 | [if test "$withval" != "yes" -a "$withval" != "no"; then |
---|
233 | BOOST_LDFLAGS="-L$withval" |
---|
234 | boost_rpath_flag="-R$withval" |
---|
235 | boost_library_path=$withval |
---|
236 | fi]) |
---|
237 | |
---|
238 | # We'll substitute BOOST_LDFLAGS later; we first need to check necessary |
---|
239 | # configuration for linking particular boost libraries. In particular, if |
---|
240 | # we end up using an "rpath" linker option, we'll add it to BOOST_LDFLAGS |
---|
241 | # then substitute it. |
---|
242 | use_boost_rflag=no |
---|
243 | |
---|
244 | # Check availability of the Boost Python library |
---|
245 | |
---|
246 | AC_MSG_CHECKING([for boost::python library]) |
---|
247 | AC_ARG_WITH([boost-python], |
---|
248 | AC_HELP_STRING([--with-boost-python], |
---|
249 | [specify whether to use the boost python library]), |
---|
250 | [with_boost_python="$withval"], [with_boost_python="auto"]) |
---|
251 | if test "$with_boost_python" != "no"; then |
---|
252 | if test "$with_boost_python" != "auto" -a "X$PYTHON_LIB" = X; then |
---|
253 | AC_MSG_ERROR([Boost.Python requested but python library is not available]) |
---|
254 | fi |
---|
255 | LDFLAGS_SAVED="$LDFLAGS" |
---|
256 | LIBS_SAVED="$LIBS" |
---|
257 | CPPFLAGS_SAVED="$CPPFLAGS" |
---|
258 | CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" |
---|
259 | |
---|
260 | for BOOST_TRY_LIB in boost_python boost_python-mt; do |
---|
261 | result_msg= |
---|
262 | for mode in with_rflag normal with_static; do |
---|
263 | LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}" |
---|
264 | case "${mode}" in |
---|
265 | normal) |
---|
266 | BOOST_PYTHON_LIB="-l${BOOST_TRY_LIB}" |
---|
267 | ;; |
---|
268 | with_rflag) |
---|
269 | if test $rpath_available = no; then |
---|
270 | continue |
---|
271 | fi |
---|
272 | LDFLAGS="$LDFLAGS -Wl,${boost_rpath_flag}" |
---|
273 | BOOST_PYTHON_LIB="-l${BOOST_TRY_LIB}" |
---|
274 | result_msg=" (using rpath)" |
---|
275 | ;; |
---|
276 | with_static) |
---|
277 | if test -z "${boost_library_path}"; then |
---|
278 | continue |
---|
279 | fi |
---|
280 | BOOST_PYTHON_LIB="${boost_library_path}/lib${BOOST_TRY_LIB}.a" |
---|
281 | result_msg=" (using static library)" |
---|
282 | ;; |
---|
283 | esac |
---|
284 | LIBS="$LIBS_SAVED ${BOOST_PYTHON_LIB} ${PYTHON_LIB}" |
---|
285 | LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS ${python_rpath}" |
---|
286 | AC_TRY_RUN([ |
---|
287 | #include <boost/python/module.hpp> |
---|
288 | using namespace boost::python; |
---|
289 | BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; } |
---|
290 | int main() { |
---|
291 | return 0; |
---|
292 | } |
---|
293 | ], |
---|
294 | [ AC_MSG_RESULT(yes${result_msg}) |
---|
295 | if test $mode = "with_rflag"; then |
---|
296 | use_boost_rflag=yes |
---|
297 | fi |
---|
298 | break |
---|
299 | ],[BOOST_PYTHON_LIB=""]) |
---|
300 | done |
---|
301 | if test "X${BOOST_PYTHON_LIB}" != X; then |
---|
302 | break |
---|
303 | fi |
---|
304 | done |
---|
305 | |
---|
306 | LDFLAGS="$LDFLAGS_SAVED" |
---|
307 | CPPFLAGS="$CPPFLAGS_SAVED" |
---|
308 | LIBS="$LIBS_SAVED" |
---|
309 | fi |
---|
310 | |
---|
311 | if test "X${BOOST_PYTHON_LIB}" = X; then |
---|
312 | AC_MSG_RESULT(no) |
---|
313 | if test "X$boost_library_path" != X; then |
---|
314 | AC_MSG_WARN([Could not find boost python library in $boost_library_path. If it is a shared library in a non standard path, retry with specifying the run time load path (such as LD_LIBRARY_PATH). Note also that this test requires libpython. If it is installed in a non standard path the test may fail even if the build option for Boost.python is correct. In that case make sure the shared library configuration is correct for libpython. You only need to configure it for this script; at run time the built binaries will be run on the python interpreter, which should know the location of libpython.]) |
---|
315 | fi |
---|
316 | if test "$with_boost_python" = "yes"; then |
---|
317 | AC_MSG_ERROR([boost python library is requested but not found]) |
---|
318 | fi |
---|
319 | else |
---|
320 | AC_DEFINE(HAVE_BOOST_PYTHON, 1, Define to 1 if boost python library is available) |
---|
321 | fi |
---|
322 | |
---|
323 | AM_CONDITIONAL(HAVE_BOOST_PYTHON, test "X${BOOST_PYTHON_LIB}" != X) |
---|
324 | AC_SUBST(BOOST_PYTHON_LIB) |
---|
325 | |
---|
326 | if test $use_boost_rflag = "yes"; then |
---|
327 | BOOST_LDFLAGS="$BOOST_LDFLAGS $boost_rpath_flag" |
---|
328 | fi |
---|
329 | AC_SUBST(BOOST_LDFLAGS) |
---|
330 | |
---|
331 | # |
---|
332 | # Check availability of gtest, which will be used for unit tests. |
---|
333 | # |
---|
334 | if test "$gtest_path" != "no" |
---|
335 | then |
---|
336 | if test "$gtest_path" != "yes"; then |
---|
337 | GTEST_PATHS=$gtest_path |
---|
338 | if test -x "${gtest_path}/bin/gtest-config" ; then |
---|
339 | GTEST_CONFIG="${gtest_path}/bin/gtest-config" |
---|
340 | fi |
---|
341 | else |
---|
342 | AC_PATH_PROG([GTEST_CONFIG], [gtest-config]) |
---|
343 | fi |
---|
344 | if test -x "${GTEST_CONFIG}" ; then : |
---|
345 | # using cppflags instead of cxxflags |
---|
346 | GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags` |
---|
347 | GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags` |
---|
348 | GTEST_LDADD=`${GTEST_CONFIG} --libs` |
---|
349 | GTEST_FOUND="true" |
---|
350 | else |
---|
351 | AC_MSG_WARN([Unable to locate Google Test gtest-config.]) |
---|
352 | if test -z "${GTEST_PATHS}" ; then |
---|
353 | GTEST_PATHS="/usr /usr/local" |
---|
354 | fi |
---|
355 | GTEST_FOUND="false" |
---|
356 | fi |
---|
357 | if test "${GTEST_FOUND}" != "true"; then |
---|
358 | GTEST_FOUND="false" |
---|
359 | for dir in $GTEST_PATHS; do |
---|
360 | if test -f "$dir/include/gtest/gtest.h"; then |
---|
361 | GTEST_INCLUDES="-I$dir/include" |
---|
362 | GTEST_LDFLAGS="-L$dir/lib" |
---|
363 | GTEST_LDADD="-lgtest" |
---|
364 | GTEST_FOUND="true" |
---|
365 | break |
---|
366 | fi |
---|
367 | done |
---|
368 | fi |
---|
369 | if test "${GTEST_FOUND}" != "true"; then |
---|
370 | AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS]) |
---|
371 | fi |
---|
372 | else |
---|
373 | GTEST_INCLUDES= |
---|
374 | GTEST_LDFLAGS= |
---|
375 | GTEST_LDADD= |
---|
376 | fi |
---|
377 | AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no") |
---|
378 | AC_SUBST(GTEST_INCLUDES) |
---|
379 | AC_SUBST(GTEST_LDFLAGS) |
---|
380 | AC_SUBST(GTEST_LDADD) |
---|
381 | |
---|
382 | PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.3.9, enable_features="$enable_features SQLite3") |
---|
383 | |
---|
384 | # I can't get some of the #include <asio.hpp> right without this |
---|
385 | # TODO: find the real cause of asio/boost wanting pthreads |
---|
386 | # (this currently only occurs for src/lib/cc/session_unittests) |
---|
387 | PTHREAD_LDFLAGS= |
---|
388 | AC_CHECK_LIB(pthread, pthread_create,[ PTHREAD_LDFLAGS=-lpthread ], []) |
---|
389 | AC_SUBST(PTHREAD_LDFLAGS) |
---|
390 | |
---|
391 | # |
---|
392 | # ASIO: we extensively use it as the C++ event management module. |
---|
393 | # |
---|
394 | # Use local ASIO headers from ext |
---|
395 | # |
---|
396 | CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/asio" |
---|
397 | # |
---|
398 | # kqueue portability: ASIO uses kqueue by default if it's available (it's |
---|
399 | # generally available in BSD variants). Unfortunately, some public |
---|
400 | # implementation of kqueue forces a conversion from a pointer to an integer, |
---|
401 | # which is prohibited in C++ unless reinterpret_cast, C++'s most evil beast |
---|
402 | # (and ASIO doesn't use it anyway) is used. This will cause build error for |
---|
403 | # some of our C++ files including ASIO header files. The following check |
---|
404 | # detects such cases and tells ASIO not to use kqueue if so. |
---|
405 | AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no) |
---|
406 | if test "X$ac_cv_have_kqueue" = "Xyes"; then |
---|
407 | AC_MSG_CHECKING([whether kqueue EV_SET compiles in C++]) |
---|
408 | AC_TRY_COMPILE([ |
---|
409 | #include <sys/types.h> |
---|
410 | #include <sys/param.h> |
---|
411 | #include <sys/event.h>], |
---|
412 | [char* udata; |
---|
413 | EV_SET(NULL, 0, 0, 0, 0, 0, udata);], |
---|
414 | [AC_MSG_RESULT(yes)], |
---|
415 | [AC_MSG_RESULT([no, disable kqueue for ASIO]) |
---|
416 | CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_KQUEUE=1" |
---|
417 | ]) |
---|
418 | fi |
---|
419 | |
---|
420 | # /dev/poll issue: ASIO uses /dev/poll by default if it's available (generally |
---|
421 | # the case with Solaris). Unfortunately its /dev/poll specific code would |
---|
422 | # trigger the gcc's "missing-field-initializers" warning, which would |
---|
423 | # subsequently make the build fail with -Werror. Further, older versions of |
---|
424 | # gcc don't provide an option to selectively suppress this warning. |
---|
425 | # So, for the moment, we simply disable the use of /dev/poll. Unless we |
---|
426 | # implement recursive DNS server with randomized ports, we don't need the |
---|
427 | # scalability that /dev/poll can provide, so this decision wouldn't affect |
---|
428 | # run time performance. Hpefully we can find a better solution or the ASIO |
---|
429 | # code will be updated by the time we really need it. |
---|
430 | AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no) |
---|
431 | if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GCC" = "Xyes"; then |
---|
432 | CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_DEV_POLL=1" |
---|
433 | fi |
---|
434 | |
---|
435 | # Check for headers from required devel kits. |
---|
436 | AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp],, |
---|
437 | AC_MSG_ERROR([Missing required header files.])) |
---|
438 | |
---|
439 | AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man], |
---|
440 | [regenerate man pages [default=no]])] ,enable_man=yes, enable_man=no) |
---|
441 | |
---|
442 | AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) |
---|
443 | |
---|
444 | AC_ARG_ENABLE(install-configurations, |
---|
445 | [AC_HELP_STRING([--disable-install-configurations], |
---|
446 | [do not install configuration])], install_configurations=$enableval, install_configurations=yes) |
---|
447 | |
---|
448 | AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue) |
---|
449 | |
---|
450 | AC_CONFIG_FILES([Makefile |
---|
451 | src/Makefile |
---|
452 | src/bin/Makefile |
---|
453 | src/bin/bind10/Makefile |
---|
454 | src/bin/bind10/tests/Makefile |
---|
455 | src/bin/cmdctl/Makefile |
---|
456 | src/bin/cmdctl/tests/Makefile |
---|
457 | src/bin/bindctl/Makefile |
---|
458 | src/bin/bindctl/tests/Makefile |
---|
459 | src/bin/cfgmgr/Makefile |
---|
460 | src/bin/host/Makefile |
---|
461 | src/bin/loadzone/Makefile |
---|
462 | src/bin/msgq/Makefile |
---|
463 | src/bin/msgq/tests/Makefile |
---|
464 | src/bin/auth/Makefile |
---|
465 | src/bin/auth/tests/Makefile |
---|
466 | src/bin/xfrin/Makefile |
---|
467 | src/bin/xfrin/tests/Makefile |
---|
468 | src/bin/xfrout/Makefile |
---|
469 | src/bin/xfrout/tests/Makefile |
---|
470 | src/bin/usermgr/Makefile |
---|
471 | src/lib/Makefile |
---|
472 | src/lib/cc/Makefile |
---|
473 | src/lib/python/Makefile |
---|
474 | src/lib/python/isc/Makefile |
---|
475 | src/lib/python/isc/datasrc/Makefile |
---|
476 | src/lib/python/isc/cc/Makefile |
---|
477 | src/lib/python/isc/cc/tests/Makefile |
---|
478 | src/lib/python/isc/config/Makefile |
---|
479 | src/lib/python/isc/config/tests/Makefile |
---|
480 | src/lib/config/Makefile |
---|
481 | src/lib/config/tests/Makefile |
---|
482 | src/lib/dns/Makefile |
---|
483 | src/lib/dns/tests/Makefile |
---|
484 | src/lib/exceptions/Makefile |
---|
485 | src/lib/datasrc/Makefile |
---|
486 | src/lib/datasrc/tests/Makefile |
---|
487 | src/lib/xfr/Makefile |
---|
488 | ]) |
---|
489 | AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py |
---|
490 | src/bin/cmdctl/cmdctl.py |
---|
491 | src/bin/cmdctl/run_b10-cmdctl.sh |
---|
492 | src/bin/cmdctl/tests/cmdctl_test |
---|
493 | src/bin/xfrin/tests/xfrin_test |
---|
494 | src/bin/xfrin/xfrin.py |
---|
495 | src/bin/xfrin/xfrin.spec.pre |
---|
496 | src/bin/xfrin/run_b10-xfrin.sh |
---|
497 | src/bin/xfrout/xfrout.py |
---|
498 | src/bin/xfrout/xfrout.spec.pre |
---|
499 | src/bin/xfrout/tests/xfrout_test |
---|
500 | src/bin/xfrout/run_b10-xfrout.sh |
---|
501 | src/bin/bind10/bind10.py |
---|
502 | src/bin/bind10/tests/bind10_test |
---|
503 | src/bin/bind10/run_bind10.sh |
---|
504 | src/bin/bindctl/run_bindctl.sh |
---|
505 | src/bin/bindctl/bindctl-source.py |
---|
506 | src/bin/bindctl/tests/bindctl_test |
---|
507 | src/bin/loadzone/run_loadzone.sh |
---|
508 | src/bin/loadzone/b10-loadzone.py |
---|
509 | src/bin/usermgr/run_b10-cmdctl-usermgr.sh |
---|
510 | src/bin/usermgr/b10-cmdctl-usermgr.py |
---|
511 | src/bin/msgq/msgq.py |
---|
512 | src/bin/msgq/tests/msgq_test |
---|
513 | src/bin/msgq/run_msgq.sh |
---|
514 | src/bin/auth/auth.spec.pre |
---|
515 | src/bin/auth/spec_config.h.pre |
---|
516 | src/lib/config/tests/data_def_unittests_config.h |
---|
517 | src/lib/python/isc/config/tests/config_test |
---|
518 | src/lib/python/isc/cc/tests/cc_test |
---|
519 | src/lib/dns/gen-rdatacode.py |
---|
520 | src/lib/python/isc/cc/session.py |
---|
521 | src/lib/dns/tests/testdata/gen-wiredata.py |
---|
522 | src/lib/cc/session_config.h.pre |
---|
523 | ], [ |
---|
524 | chmod +x src/bin/cmdctl/run_b10-cmdctl.sh |
---|
525 | chmod +x src/bin/xfrin/run_b10-xfrin.sh |
---|
526 | chmod +x src/bin/xfrout/run_b10-xfrout.sh |
---|
527 | chmod +x src/bin/bind10/run_bind10.sh |
---|
528 | chmod +x src/bin/cmdctl/tests/cmdctl_test |
---|
529 | chmod +x src/bin/xfrin/tests/xfrin_test |
---|
530 | chmod +x src/bin/xfrout/tests/xfrout_test |
---|
531 | chmod +x src/bin/bindctl/tests/bindctl_test |
---|
532 | chmod +x src/bin/bindctl/run_bindctl.sh |
---|
533 | chmod +x src/bin/loadzone/run_loadzone.sh |
---|
534 | chmod +x src/bin/usermgr/run_b10-cmdctl-usermgr.sh |
---|
535 | chmod +x src/bin/msgq/run_msgq.sh |
---|
536 | chmod +x src/bin/msgq/tests/msgq_test |
---|
537 | chmod +x src/lib/dns/gen-rdatacode.py |
---|
538 | chmod +x src/lib/dns/tests/testdata/gen-wiredata.py |
---|
539 | ]) |
---|
540 | AC_OUTPUT |
---|
541 | |
---|
542 | dnl Print the results |
---|
543 | dnl |
---|
544 | |
---|
545 | cat > config.report << END |
---|
546 | |
---|
547 | BIND 10 source configure results: |
---|
548 | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
---|
549 | |
---|
550 | Package: |
---|
551 | Name: $PACKAGE_NAME |
---|
552 | Version: $PACKAGE_VERSION |
---|
553 | |
---|
554 | Flags: |
---|
555 | DEFS: $DEFS |
---|
556 | CPPFLAGS: $CPPFLAGS |
---|
557 | CFLAGS: $CFLAGS |
---|
558 | CXXFLAGS: $CXXFLAGS |
---|
559 | B10_CXXFLAGS: $B10_CXXFLAGS |
---|
560 | dnl includes too |
---|
561 | Boost Python: $BOOST_PYTHON_LIB |
---|
562 | SQLite: $SQLITE_CFLAGS |
---|
563 | $SQLITE_LIBS |
---|
564 | |
---|
565 | Features: |
---|
566 | $enable_features |
---|
567 | |
---|
568 | Developer: |
---|
569 | Google Tests: $gtest_path |
---|
570 | Code Coverage: $USE_LCOV |
---|
571 | Generate Manuals: $enable_man |
---|
572 | |
---|
573 | END |
---|
574 | |
---|
575 | cat config.report |
---|
576 | cat <<EOF |
---|
577 | |
---|
578 | Now you can type "make" to build BIND 10 |
---|
579 | |
---|
580 | EOF |
---|
581 | |
---|