configure.ac 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.59])
  4. AC_INIT(bind10-devel, 20120127, bind10-dev@isc.org)
  5. AC_CONFIG_SRCDIR(README)
  6. AM_INIT_AUTOMAKE
  7. AC_CONFIG_HEADERS([config.h])
  8. # Checks for programs.
  9. AC_PROG_CXX
  10. # Libtool configuration
  11. #
  12. # libtool cannot handle spaces in paths, so exit early if there is one
  13. if [ test `echo $PWD | grep -c ' '` != "0" ]; then
  14. AC_MSG_ERROR([BIND 10 cannot be built in a directory that contains spaces, because of libtool limitations. Please change the directory name, or use a symbolic link that does not contain spaces.])
  15. fi
  16. # On FreeBSD (and probably some others), clang++ does not meet an autoconf
  17. # assumption in identifying libtool configuration regarding shared library:
  18. # the configure script will execute "$CC -shared $CFLAGS/$CXXFLAGS -v" and
  19. # expect the output contains -Lxxx or -Ryyy. This is the case for g++, but
  20. # not for clang++, and, as a result, it will cause various errors in linking
  21. # programs or running them with a shared object (such as some of our python
  22. # scripts).
  23. # To work around this problem we define a temporary variable
  24. # "CXX_LIBTOOL_LDFLAGS". It's expected to be defined as, e.g, "-L/usr/lib"
  25. # to temporarily fake the output so that it will be compatible with that of
  26. # g++.
  27. CFLAGS_SAVED=$CFLAGS
  28. CXXFLAGS_SAVED=$CXXFLAGS
  29. CFLAGS="$CFLAGS $CXX_LIBTOOL_LDFLAGS"
  30. CXXFLAGS="$CXXFLAGS $CXX_LIBTOOL_LDFLAGS"
  31. AC_PROG_LIBTOOL
  32. CFLAGS=$CFLAGS_SAVED
  33. CXXFLAGS=$CXXFLAGS_SAVED
  34. # Use C++ language
  35. AC_LANG([C++])
  36. # Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
  37. AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
  38. AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
  39. AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
  40. AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
  41. # Linker options
  42. # check -R and -Wl,-R rather than gcc specific -rpath to be as portable
  43. # as possible.
  44. AC_MSG_CHECKING([whether -R flag is available in linker])
  45. LDFLAGS_SAVED="$LDFLAGS"
  46. LDFLAGS="$LDFLAGS -R/usr/lib"
  47. AC_TRY_LINK([],[],
  48. [ AC_MSG_RESULT(yes)
  49. rpath_flag=-R
  50. ],[ AC_MSG_RESULT(no)
  51. AC_MSG_CHECKING([whether -Wl,-R flag is available in linker])
  52. LDFLAGS="$LDFLAGS_SAVED -Wl,-R"
  53. AC_TRY_LINK([], [],
  54. [ AC_MSG_RESULT(yes)
  55. rpath_flag=-Wl,-R
  56. ],[ AC_MSG_RESULT(no)
  57. rpath_flag=no
  58. ])
  59. ])
  60. LDFLAGS=$LDFLAGS_SAVED
  61. # allow building programs with static link. we need to make it selective
  62. # because loadable modules cannot be statically linked.
  63. AC_ARG_ENABLE([static-link],
  64. AC_HELP_STRING([--enable-static-link],
  65. [build programs with static link [[default=no]]]),
  66. [enable_static_link=yes], [enable_static_link=no])
  67. AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
  68. # Check validity about some libtool options
  69. if test $enable_static_link = yes -a $enable_static = no; then
  70. AC_MSG_ERROR([--enable-static-link requires --enable-static])
  71. fi
  72. if test $enable_shared = no; then
  73. AC_MSG_ERROR([BIND 10 requires shared libraries to be built])
  74. fi
  75. AC_ARG_ENABLE(boost-threads,
  76. AC_HELP_STRING([--enable-boost-threads],
  77. [use boost threads. Currently this only means using its locks instead of dummy locks, in the cache and NSAS]),
  78. use_boost_threads=$enableval, use_boost_threads=no)
  79. # allow configuring without setproctitle.
  80. AC_ARG_ENABLE(setproctitle-check,
  81. AC_HELP_STRING([--disable-setproctitle-check],
  82. [do not check for python setproctitle module (used to give nice names to python processes)]),
  83. setproctitle_check=$enableval, setproctitle_check=yes)
  84. # OS dependent configuration
  85. SET_ENV_LIBRARY_PATH=no
  86. ENV_LIBRARY_PATH=LD_LIBRARY_PATH
  87. case "$host" in
  88. *-solaris*)
  89. # Solaris requires special definitions to get some standard libraries
  90. # (e.g. getopt(3)) available with common used header files.
  91. CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
  92. # "now" binding is necessary to prevent deadlocks in C++ static initialization code
  93. LDFLAGS="$LDFLAGS -z now"
  94. ;;
  95. *-apple-darwin*)
  96. # libtool doesn't work perfectly with Darwin: libtool embeds the
  97. # final install path in dynamic libraries and our loadable python
  98. # modules always refer to that path even if it's loaded within the
  99. # source tree. This prevents pre-install tests from working.
  100. # To work around this problem we explicitly specify paths to dynamic
  101. # libraries when we use them in the source tree.
  102. SET_ENV_LIBRARY_PATH=yes
  103. ENV_LIBRARY_PATH=DYLD_LIBRARY_PATH
  104. ;;
  105. *-freebsd*)
  106. SET_ENV_LIBRARY_PATH=yes
  107. ;;
  108. *-netbsd*)
  109. SET_ENV_LIBRARY_PATH=yes
  110. ;;
  111. esac
  112. AM_CONDITIONAL(SET_ENV_LIBRARY_PATH, test $SET_ENV_LIBRARY_PATH = yes)
  113. AC_SUBST(SET_ENV_LIBRARY_PATH)
  114. AC_SUBST(ENV_LIBRARY_PATH)
  115. m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1 python3.2])
  116. AC_ARG_WITH([pythonpath],
  117. AC_HELP_STRING([--with-pythonpath=PATH],
  118. [specify an absolute path to python executable when automatic version check (incorrectly) fails]),
  119. [python_path="$withval"], [python_path="auto"])
  120. if test "$python_path" = auto; then
  121. AM_PATH_PYTHON([3.1])
  122. else
  123. # Older versions of automake can't handle python3 well. This is an
  124. # in-house workaround for them.
  125. PYTHON=$python_path
  126. AC_SUBST(PYTHON)
  127. PYTHON_PREFIX='${prefix}'
  128. AC_SUBST(PYTHON_PREFIX)
  129. PYTHON_EXEC_PREFIX='$(exec_prefix)'
  130. AC_SUBST(PYTHON_EXEC_PREFIX)
  131. PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`]
  132. if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then
  133. AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])
  134. fi
  135. AC_SUBST(PYTHON_VERSION)
  136. PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"`
  137. AC_SUBST(PYTHON_PLATFORM)
  138. pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  139. AC_SUBST(pythondir)
  140. pkgpythondir='${pythondir}/'$PACKAGE
  141. AC_SUBST(pkgpythondir)
  142. pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  143. AC_SUBST(pyexecdir)
  144. pkgpyexecdir='${pyexecdir}/'$PACKAGE
  145. AC_SUBST(pkgpyexecdir)
  146. fi
  147. # We need to store the default pyexecdir in a separate variable so that
  148. # we can specify in Makefile.am the install directory of various BIND 10
  149. # python scripts and loadable modules; in Makefile.am we cannot replace
  150. # $(pyexecdir) using itself, e.g, this doesn't work:
  151. # pyexecdir = $(pyexecdir)/isc/some_module
  152. # The separate variable makes this setup possible as follows:
  153. # pyexecdir = $(PYTHON_SITEPKG_DIR)/isc/some_module
  154. PYTHON_SITEPKG_DIR=${pyexecdir}
  155. AC_SUBST(PYTHON_SITEPKG_DIR)
  156. # This will be commonly used in various Makefile.am's that need to generate
  157. # python log messages.
  158. PYTHON_LOGMSGPKG_DIR="\$(top_builddir)/src/lib/python/isc/log_messages"
  159. AC_SUBST(PYTHON_LOGMSGPKG_DIR)
  160. # This is python package paths commonly used in python tests. See
  161. # README of log_messages for why it's included.
  162. COMMON_PYTHON_PATH="\$(abs_top_builddir)/src/lib/python/isc/log_messages:\$(abs_top_srcdir)/src/lib/python:\$(abs_top_builddir)/src/lib/python"
  163. AC_SUBST(COMMON_PYTHON_PATH)
  164. # Check for python development environments
  165. if test -x ${PYTHON}-config; then
  166. PYTHON_INCLUDES=`${PYTHON}-config --includes`
  167. for flag in `${PYTHON}-config --ldflags`; do
  168. # add any '-L..." flags to PYTHON_LDFLAGS
  169. flag=`echo $flag | sed -ne 's/^\(\-L.*\)$/\1/p'`
  170. if test "X${flag}" != X; then
  171. PYTHON_LDFLAGS="$PYTHON_LDFLAGS ${flag}"
  172. fi
  173. done
  174. # on some platforms, ${PYTHON}-config --ldflags doesn't provide a -L
  175. # option while having the library under a non trivial directory.
  176. # as a workaround we try the "lib" sub directory under the common
  177. # prefix for this python.
  178. if test -z "${PYTHON_LDFLAGS}"; then
  179. PYTHON_LDFLAGS="-L`${PYTHON}-config --prefix`/lib"
  180. fi
  181. else
  182. if test "X$PYTHON_INCLUDES" = X -o "X$PYTHON_LDFLAGS" = X; then
  183. 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.])
  184. fi
  185. fi
  186. # Some OSes including NetBSD don't install libpython.so in a well known path.
  187. # To avoid requiring dynamic library path with our python wrapper loadable
  188. # modules, we embed the path to the modules when possible. We do this even
  189. # when the path is known in the common operational environment (e.g. when
  190. # it's stored in a common "hint" file) for simplicity.
  191. if test $rpath_flag != no; then
  192. python_rpath=
  193. for flag in ${PYTHON_LDFLAGS}; do
  194. python_rpath="${python_rpath} `echo $flag | sed -ne "s/^\(\-L\)/${rpath_flag}/p"`"
  195. done
  196. PYTHON_LDFLAGS="${PYTHON_LDFLAGS} ${python_rpath}"
  197. fi
  198. AC_SUBST(PYTHON_INCLUDES)
  199. AC_SUBST(PYTHON_LDFLAGS)
  200. CPPFLAGS_SAVED="$CPPFLAGS"
  201. CPPFLAGS="$CPPFLAGS ${PYTHON_INCLUDES}"
  202. AC_CHECK_HEADERS([Python.h],, AC_MSG_ERROR([Missing Python.h]))
  203. CPPFLAGS="$CPPFLAGS_SAVED"
  204. # Check for python library. Needed for Python-wrapper libraries.
  205. LDFLAGS_SAVED="$LDFLAGS"
  206. LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
  207. python_bin="python${PYTHON_VERSION}"
  208. AC_CHECK_LIB($python_bin, main, python_lib=$python_bin, python_lib=no)
  209. if test $python_lib != "no"; then
  210. PYTHON_LIB="-l$python_lib"
  211. fi
  212. AC_SUBST(PYTHON_LIB)
  213. LDFLAGS=$LDFLAGS_SAVED
  214. # Check for the setproctitle module
  215. if test "$setproctitle_check" = "yes" ; then
  216. AC_MSG_CHECKING(for setproctitle module)
  217. if "$PYTHON" -c 'import setproctitle' 2>/dev/null ; then
  218. AC_MSG_RESULT(ok)
  219. else
  220. AC_MSG_RESULT(missing)
  221. AC_MSG_WARN([Missing setproctitle python module.
  222. Use --disable-setproctitle-check to skip this check.
  223. In this case we will continue, but naming of python processes will not work.])
  224. fi
  225. fi
  226. # TODO: check for _sqlite3.py module
  227. # Compiler dependent settings: define some mandatory CXXFLAGS here.
  228. # We also use a separate variable B10_CXXFLAGS. This will (and should) be
  229. # used as the default value for each specific AM_CXXFLAGS:
  230. # AM_CXXFLAGS = $(B10_CXXFLAGS)
  231. # AM_CXXFLAGS += ... # add module specific flags
  232. # We need this so that we can disable some specific compiler warnings per
  233. # module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
  234. # gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
  235. # specify the default warning flags in CXXFLAGS and let specific modules
  236. # "override" the default.
  237. # This may be used to try linker flags.
  238. AC_DEFUN([BIND10_CXX_TRY_FLAG], [
  239. AC_MSG_CHECKING([whether $CXX supports $1])
  240. bind10_save_CXXFLAGS="$CXXFLAGS"
  241. CXXFLAGS="$CXXFLAGS $1"
  242. AC_LINK_IFELSE([int main(void){ return 0;} ],
  243. [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
  244. CXXFLAGS="$bind10_save_CXXFLAGS"
  245. if test "x$bind10_cxx_flag" = "xyes"; then
  246. ifelse([$2], , :, [$2])
  247. else
  248. ifelse([$3], , :, [$3])
  249. fi
  250. AC_MSG_RESULT([$bind10_cxx_flag])
  251. ])
  252. werror_ok=0
  253. # SunStudio compiler requires special compiler options for boost
  254. # (http://blogs.sun.com/sga/entry/boost_mini_howto)
  255. if test "$SUNCXX" = "yes"; then
  256. CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
  257. MULTITHREADING_FLAG="-mt"
  258. fi
  259. BIND10_CXX_TRY_FLAG(-Wno-missing-field-initializers,
  260. [WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
  261. AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
  262. # gcc specific settings:
  263. if test "X$GXX" = "Xyes"; then
  264. B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
  265. case "$host" in
  266. *-solaris*)
  267. MULTITHREADING_FLAG=-pthreads
  268. # In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
  269. B10_CXXFLAGS="$B10_CXXFLAGS -Wno-missing-braces"
  270. ;;
  271. *)
  272. MULTITHREADING_FLAG=-pthread
  273. ;;
  274. esac
  275. # Certain versions of gcc (g++) have a bug that incorrectly warns about
  276. # the use of anonymous name spaces even if they're closed in a single
  277. # translation unit. For these versions we have to disable -Werror.
  278. CXXFLAGS_SAVED="$CXXFLAGS"
  279. CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
  280. AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
  281. AC_TRY_COMPILE([namespace { class Foo {}; }
  282. namespace isc {class Bar {Foo foo_;};} ],,
  283. [AC_MSG_RESULT(no)
  284. werror_ok=1
  285. B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
  286. [AC_MSG_RESULT(yes)])
  287. CXXFLAGS="$CXXFLAGS_SAVED"
  288. # Python 3.2 has an unused parameter in one of its headers. This
  289. # has been reported, but not fixed as of yet, so we check if we need
  290. # to set -Wno-unused-parameter.
  291. if test $werror_ok = 1; then
  292. CPPFLAGS_SAVED="$CPPFLAGS"
  293. CPPFLAGS=${PYTHON_INCLUDES}
  294. CXXFLAGS_SAVED="$CXXFLAGS"
  295. CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
  296. AC_MSG_CHECKING([whether we need -Wno-unused-parameter for python])
  297. AC_TRY_COMPILE(
  298. [#include <Python.h>],
  299. [],
  300. [AC_MSG_RESULT(no)],
  301. [
  302. CXXFLAGS="$CXXFLAGS -Wno-unused-parameter"
  303. AC_TRY_COMPILE([#include <Python.h>],
  304. [],
  305. [AC_MSG_RESULT(yes)
  306. PYTHON_CXXFLAGS="${PYTHON_CXXFLAGS} -Wno-unused-parameter"
  307. AC_SUBST(PYTHON_CXXFLAGS)
  308. ],
  309. [AC_MSG_ERROR([Can't compile against Python.h])]
  310. )
  311. ]
  312. )
  313. CXXFLAGS="$CXXFLAGS_SAVED"
  314. CPPFLAGS="$CPPFLAGS_SAVED"
  315. fi
  316. fi dnl GXX = yes
  317. AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
  318. # produce PIC unless we disable shared libraries. need this for python bindings.
  319. if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
  320. B10_CXXFLAGS="$B10_CXXFLAGS -fPIC"
  321. fi
  322. AC_SUBST(B10_CXXFLAGS)
  323. # Checks for libraries.
  324. AC_SEARCH_LIBS(inet_pton, [nsl])
  325. AC_SEARCH_LIBS(recvfrom, [socket])
  326. AC_SEARCH_LIBS(nanosleep, [rt])
  327. # Checks for header files.
  328. # Checks for typedefs, structures, and compiler characteristics.
  329. AC_HEADER_STDBOOL
  330. AC_TYPE_SIZE_T
  331. # Detect OS type (it may be used to do OS-specific things, e.g.
  332. # interface detection in DHCP)
  333. AC_MSG_CHECKING(OS family)
  334. system=`uname -s`
  335. case $system in
  336. Linux)
  337. OS_TYPE="Linux"
  338. CPPFLAGS="$CPPFLAGS -DOS_LINUX"
  339. ;;
  340. Darwin | FreeBSD | NetBSD | OpenBSD)
  341. OS_TYPE="BSD"
  342. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  343. ;;
  344. Solaris)
  345. OS_TYPE="Solaris"
  346. CPPFLAGS="$CPPFLAGS -DOS_SOLARIS"
  347. ;;
  348. *)
  349. OS_TYPE="Unknown"
  350. AC_MSG_WARN("Unsupported OS: uname returned $system")
  351. ;;
  352. esac
  353. AC_MSG_RESULT($OS_TYPE)
  354. AM_CONDITIONAL(OS_LINUX, test $OS_TYPE = Linux)
  355. AM_COND_IF([OS_LINUX], [AC_DEFINE([OS_LINUX], [1], [Running on Linux?])])
  356. AM_CONDITIONAL(OS_BSD, test $OS_TYPE = BSD)
  357. AM_COND_IF([OS_BSD], [AC_DEFINE([OS_BSD], [1], [Running on BSD?])])
  358. AM_CONDITIONAL(OS_SOLARIS, test $OS_TYPE = Solaris)
  359. AM_COND_IF([OS_SOLARIS], [AC_DEFINE([OS_SOLARIS], [1], [Running on Solaris?])])
  360. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  361. AC_TRY_COMPILE([
  362. #include <sys/types.h>
  363. #include <sys/socket.h>],
  364. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  365. [AC_MSG_RESULT(yes)
  366. AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
  367. AC_MSG_RESULT(no))
  368. AC_ARG_WITH(pycoverage,
  369. [ --with-pycoverage[=PROGRAM] enable python code coverage using the specified coverage], pycoverage="$withval", pycoverage="no")
  370. if test "$pycoverage" = "no" ; then
  371. # just run the tests normally with python
  372. PYCOVERAGE_RUN="${PYTHON}"
  373. USE_PYCOVERAGE="no"
  374. elif test "$pycoverage" = "yes" ; then
  375. PYCOVERAGE="coverage"
  376. PYCOVERAGE_RUN="${PYCOVERAGE} run --branch --append"
  377. USE_PYCOVERAGE="yes"
  378. else
  379. PYCOVERAGE="$pycoverage"
  380. PYCOVERAGE_RUN="${PYCOVERAGE} run --branch --append"
  381. USE_PYCOVERAGE="yes"
  382. fi
  383. AM_CONDITIONAL(ENABLE_PYTHON_COVERAGE, test x$USE_PYCOVERAGE != xno)
  384. AC_SUBST(PYCOVERAGE)
  385. AC_SUBST(PYCOVERAGE_RUN)
  386. AC_SUBST(USE_PYCOVERAGE)
  387. AC_ARG_WITH(lcov,
  388. [ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
  389. AC_ARG_WITH(gtest,
  390. [ --with-gtest=PATH specify a path to gtest header files (PATH/include) and library (PATH/lib)],
  391. gtest_path="$withval", gtest_path="no")
  392. USE_LCOV="no"
  393. if test "$lcov" != "no"; then
  394. # force gtest if not set
  395. if test "$gtest_path" = "no"; then
  396. # AC_MSG_ERROR("lcov needs gtest for test coverage report")
  397. AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
  398. gtest_path="yes"
  399. fi
  400. if test "$lcov" != "yes"; then
  401. LCOV=$lcov
  402. else
  403. AC_PATH_PROG([LCOV], [lcov])
  404. fi
  405. if test -x "${LCOV}"; then
  406. USE_LCOV="yes"
  407. else
  408. AC_MSG_ERROR([Cannot find lcov.])
  409. fi
  410. # is genhtml always in the same directory?
  411. GENHTML=`echo "$LCOV" | sed s/lcov$/genhtml/`
  412. if test ! -x $GENHTML; then
  413. AC_MSG_ERROR([genhtml not found, needed for lcov])
  414. fi
  415. # GCC specific?
  416. CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
  417. LIBS=" $LIBS -lgcov"
  418. AC_SUBST(CPPFLAGS)
  419. AC_SUBST(LIBS)
  420. AC_SUBST(LCOV)
  421. AC_SUBST(GENHTML)
  422. fi
  423. AC_SUBST(USE_LCOV)
  424. # Check for Botan
  425. botan_path="yes"
  426. AC_ARG_WITH([botan],
  427. AC_HELP_STRING([--with-botan=PATH],
  428. [specify the path to botan-config (PATH/bin/botan-config will be used)]),
  429. [botan_path="$withval"])
  430. if test "${botan_path}" = "no" ; then
  431. AC_MSG_ERROR([Need botan for libcryptolink])
  432. fi
  433. if test "${botan_path}" != "yes" ; then
  434. if test -x "${botan_path}/bin/botan-config" ; then
  435. BOTAN_CONFIG="${botan_path}/bin/botan-config"
  436. else
  437. AC_MSG_ERROR([${botan_path}/bin/botan-config not found])
  438. fi
  439. else
  440. # First see if pkg-config knows of it.
  441. # Unfortunately, the botan.pc files have their minor version in them
  442. # too, so we need to try them one by one
  443. BOTAN_CONFIG=""
  444. AC_PATH_PROG([PKG_CONFIG], [pkg-config])
  445. if test "$PKG_CONFIG" != "" ; then
  446. BOTAN_VERSIONS="botan-1.10 botan-1.9 botan-1.8"
  447. for version in $BOTAN_VERSIONS; do
  448. AC_MSG_CHECKING([Checking botan version with pkg-config $version])
  449. if [ $PKG_CONFIG --exists ${version} ]; then
  450. AC_MSG_RESULT([found])
  451. BOTAN_CONFIG="$PKG_CONFIG ${version}"
  452. break
  453. else
  454. AC_MSG_RESULT([not found])
  455. fi
  456. done
  457. fi
  458. # If we had no pkg-config, or it didn't know about botan, use botan-config
  459. if test "$BOTAN_CONFIG" = "" ; then
  460. AC_PATH_PROG([BOTAN_CONFIG], [botan-config])
  461. fi
  462. fi
  463. BOTAN_LIBS=`${BOTAN_CONFIG} --libs`
  464. BOTAN_INCLUDES=`${BOTAN_CONFIG} --cflags`
  465. # We expect botan-config --libs to contain -L<path_to_libbotan>, but
  466. # this is not always the case. As a heuristics workaround we add
  467. # -L`botan-config --prefix/lib` in this case (if not present already).
  468. # Same for BOTAN_INCLUDES (but using include instead of lib) below.
  469. if [ $BOTAN_CONFIG --prefix >/dev/null 2>&1 ] ; then
  470. echo ${BOTAN_LIBS} | grep -- -L > /dev/null || \
  471. BOTAN_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${BOTAN_LIBS}"
  472. echo ${BOTAN_INCLUDES} | grep -- -I > /dev/null || \
  473. BOTAN_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${BOTAN_INCLUDES}"
  474. fi
  475. # botan-config script (and the way we call pkg-config) returns -L and -l
  476. # as one string, but we need them in separate values
  477. BOTAN_LDFLAGS=
  478. BOTAN_NEWLIBS=
  479. for flag in ${BOTAN_LIBS}; do
  480. BOTAN_LDFLAGS="${BOTAN_LDFLAGS} `echo $flag | sed -ne '/^\(\-L\)/p'`"
  481. BOTAN_LIBS="${BOTAN_LIBS} `echo $flag | sed -ne '/^\(\-l\)/p'`"
  482. done
  483. # See python_rpath for some info on why we do this
  484. if test $rpath_flag != no; then
  485. BOTAN_RPATH=
  486. for flag in ${BOTAN_LIBS}; do
  487. BOTAN_RPATH="${BOTAN_RPATH} `echo $flag | sed -ne "s/^\(\-L\)/${rpath_flag}/p"`"
  488. done
  489. AC_SUBST(BOTAN_RPATH)
  490. # According to the libtool manual, it should be sufficient if we
  491. # specify the "-R libdir" in our wrapper library of botan (no other
  492. # programs will need libbotan directly); "libdir" should be added to
  493. # the program's binary image. But we've seen in our build environments
  494. # that (some versions of?) libtool doesn't propagate -R as documented,
  495. # and it caused a linker error at run time. To work around this, we
  496. # also add the rpath to the global LDFLAGS.
  497. LDFLAGS="$BOTAN_RPATH $LDFLAGS"
  498. fi
  499. AC_SUBST(BOTAN_LDFLAGS)
  500. AC_SUBST(BOTAN_LIBS)
  501. AC_SUBST(BOTAN_INCLUDES)
  502. CPPFLAGS_SAVED=$CPPFLAGS
  503. CPPFLAGS="$BOTAN_INCLUDES $CPPFLAGS"
  504. LIBS_SAVED="$LIBS"
  505. LIBS="$LIBS $BOTAN_LIBS"
  506. AC_CHECK_HEADERS([botan/botan.h],,AC_MSG_ERROR([Missing required header files.]))
  507. AC_LINK_IFELSE(
  508. [AC_LANG_PROGRAM([#include <botan/botan.h>
  509. #include <botan/hash.h>
  510. ],
  511. [using namespace Botan;
  512. LibraryInitializer::initialize();
  513. HashFunction *h = get_hash("MD5");
  514. ])],
  515. [AC_MSG_RESULT([checking for Botan library... yes])],
  516. [AC_MSG_RESULT([checking for Botan library... no])
  517. AC_MSG_ERROR([Needs Botan library 1.8 or higher])]
  518. )
  519. CPPFLAGS=$CPPFLAGS_SAVED
  520. LIBS=$LIBS_SAVED
  521. # Check for log4cplus
  522. log4cplus_path="yes"
  523. AC_ARG_WITH([log4cplus],
  524. AC_HELP_STRING([--with-log4cplus=PATH],
  525. [specify exact directory of log4cplus library and headers]),
  526. [log4cplus_path="$withval"])
  527. if test "${log4cplus_path}" = "no" ; then
  528. AC_MSG_ERROR([Need log4cplus])
  529. elif test "${log4cplus_path}" != "yes" ; then
  530. LOG4CPLUS_INCLUDES="-I${log4cplus_path}/include"
  531. LOG4CPLUS_LIBS="-L${log4cplus_path}/lib"
  532. else
  533. # If not specified, try some common paths.
  534. log4cplusdirs="/usr/local /usr/pkg /opt /opt/local"
  535. for d in $log4cplusdirs
  536. do
  537. if test -f $d/include/log4cplus/logger.h; then
  538. LOG4CPLUS_INCLUDES="-I$d/include"
  539. LOG4CPLUS_LIBS="-L$d/lib"
  540. break
  541. fi
  542. done
  543. fi
  544. LOG4CPLUS_LIBS="$LOG4CPLUS_LIBS -llog4cplus $MULTITHREADING_FLAG"
  545. AC_SUBST(LOG4CPLUS_LIBS)
  546. AC_SUBST(LOG4CPLUS_INCLUDES)
  547. CPPFLAGS_SAVED=$CPPFLAGS
  548. CPPFLAGS="$LOG4CPLUS_INCLUDES $CPPFLAGS"
  549. LIBS_SAVED="$LIBS"
  550. LIBS="$LOG4CPLUS_LIBS $LIBS"
  551. AC_CHECK_HEADERS([log4cplus/logger.h],,AC_MSG_ERROR([Missing required header files.]))
  552. AC_LINK_IFELSE(
  553. [AC_LANG_PROGRAM([#include <log4cplus/logger.h>
  554. ],
  555. [using namespace log4cplus;
  556. Logger logger = Logger::getInstance("main");
  557. ])],
  558. [AC_MSG_RESULT([checking for log4cplus library... yes])],
  559. [AC_MSG_RESULT([checking for log4cplus library... no])
  560. AC_MSG_ERROR([Needs log4cplus library])]
  561. )
  562. CPPFLAGS=$CPPFLAGS_SAVED
  563. LIBS=$LIBS_SAVED
  564. #
  565. # Configure Boost header path
  566. #
  567. # If explicitly specified, use it.
  568. AC_ARG_WITH([boost-include],
  569. AC_HELP_STRING([--with-boost-include=PATH],
  570. [specify exact directory for Boost headers]),
  571. [boost_include_path="$withval"])
  572. # If not specified, try some common paths.
  573. if test -z "$with_boost_include"; then
  574. boostdirs="/usr/local /usr/pkg /opt /opt/local"
  575. for d in $boostdirs
  576. do
  577. if test -f $d/include/boost/shared_ptr.hpp; then
  578. boost_include_path=$d/include
  579. break
  580. fi
  581. done
  582. fi
  583. CPPFLAGS_SAVES="$CPPFLAGS"
  584. if test "${boost_include_path}" ; then
  585. BOOST_INCLUDES="-I${boost_include_path}"
  586. CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
  587. fi
  588. AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync/interprocess_upgradable_mutex.hpp boost/date_time/posix_time/posix_time_types.hpp boost/bind.hpp boost/function.hpp],,
  589. AC_MSG_ERROR([Missing required header files.]))
  590. CPPFLAGS="$CPPFLAGS_SAVES"
  591. AC_SUBST(BOOST_INCLUDES)
  592. if test "${use_boost_threads}" = "yes" ; then
  593. AC_DEFINE([USE_BOOST_THREADS], [], [Use boost threads])
  594. # Using boost::mutex can result in requiring libboost_thread with older
  595. # versions of Boost. We'd like to avoid relying on a compiled Boost library
  596. # whenever possible, so we need to check for it step by step.
  597. #
  598. # NOTE: another fix of this problem is to simply require newer versions of
  599. # boost. If we choose that solution we should simplify the following tricky
  600. # checks accordingly and all Makefile.am's that refer to NEED_LIBBOOST_THREAD.
  601. AC_MSG_CHECKING(for boost::mutex)
  602. CPPFLAGS_SAVES="$CPPFLAGS"
  603. LIBS_SAVES="$LIBS"
  604. CPPFLAGS="$BOOST_INCLUDES $CPPFLAGS $MULTITHREADING_FLAG"
  605. need_libboost_thread=0
  606. need_sunpro_workaround=0
  607. AC_TRY_LINK([
  608. #include <boost/thread.hpp>
  609. ],[
  610. boost::mutex m;
  611. ],
  612. [ AC_MSG_RESULT(yes (without libboost_thread)) ],
  613. # there is one specific problem with SunStudio 5.10
  614. # where including boost/thread causes a compilation failure
  615. # There is a workaround in boost but it checks the version not being 5.10
  616. # This will probably be fixed in the future, in which case this
  617. # is only a temporary workaround
  618. [ AC_TRY_LINK([
  619. #if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
  620. #undef __SUNPRO_CC
  621. #define __SUNPRO_CC 0x5090
  622. #endif
  623. #include <boost/thread.hpp>
  624. ],[
  625. boost::mutex m;
  626. ],
  627. [ AC_MSG_RESULT(yes (with SUNOS workaround))
  628. need_sunpro_workaround=1 ],
  629. [ LIBS=" $LIBS -lboost_thread"
  630. AC_TRY_LINK([
  631. #include <boost/thread.hpp>
  632. ],[
  633. boost::mutex m;
  634. ],
  635. [ AC_MSG_RESULT(yes (with libboost_thread))
  636. need_libboost_thread=1 ],
  637. [ AC_MSG_RESULT(no)
  638. AC_MSG_ERROR([boost::mutex cannot be linked in this build environment.
  639. Perhaps you are using an older version of Boost that requires libboost_thread for the mutex support, which does not appear to be available.
  640. You may want to check the availability of the library or to upgrade Boost.])
  641. ])])])
  642. CPPFLAGS="$CPPFLAGS_SAVES"
  643. LIBS="$LIBS_SAVES"
  644. AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test $need_libboost_thread = 1)
  645. if test $need_sunpro_workaround = 1; then
  646. AC_DEFINE([NEED_SUNPRO_WORKAROUND], [], [Need boost sunstudio workaround])
  647. fi
  648. else
  649. AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test "${use_boost_threads}" = "yes")
  650. fi
  651. # I can't get some of the #include <asio.hpp> right without this
  652. # TODO: find the real cause of asio/boost wanting pthreads
  653. # (this currently only occurs for src/lib/cc/session_unittests)
  654. PTHREAD_LDFLAGS=
  655. AC_CHECK_LIB(pthread, pthread_create,[ PTHREAD_LDFLAGS=-lpthread ], [])
  656. AC_SUBST(PTHREAD_LDFLAGS)
  657. AC_SUBST(MULTITHREADING_FLAG)
  658. #
  659. # Check availability of gtest, which will be used for unit tests.
  660. #
  661. if test "$gtest_path" != "no"
  662. then
  663. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=\"$gtest_path\""
  664. if test "$gtest_path" != "yes"; then
  665. GTEST_PATHS=$gtest_path
  666. if test -x "${gtest_path}/bin/gtest-config" ; then
  667. GTEST_CONFIG="${gtest_path}/bin/gtest-config"
  668. fi
  669. else
  670. AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
  671. fi
  672. if test -x "${GTEST_CONFIG}" ; then :
  673. # using cppflags instead of cxxflags
  674. GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
  675. GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
  676. GTEST_LDADD=`${GTEST_CONFIG} --libs`
  677. GTEST_FOUND="true"
  678. else
  679. AC_MSG_WARN([Unable to locate Google Test gtest-config.])
  680. if test -z "${GTEST_PATHS}" ; then
  681. GTEST_PATHS="/usr /usr/local"
  682. fi
  683. GTEST_FOUND="false"
  684. fi
  685. if test "${GTEST_FOUND}" != "true"; then
  686. GTEST_FOUND="false"
  687. for dir in $GTEST_PATHS; do
  688. if test -f "$dir/include/gtest/gtest.h"; then
  689. GTEST_INCLUDES="-I$dir/include"
  690. GTEST_LDFLAGS="-L$dir/lib"
  691. GTEST_LDADD="-lgtest"
  692. GTEST_FOUND="true"
  693. # There is no gtest-config script on this
  694. # system, which is supposed to inform us
  695. # whether we need pthreads as well (a
  696. # gtest compile-time option). So we still
  697. # need to test that manually.
  698. CPPFLAGS_SAVED="$CPPFLAGS"
  699. CPPFLAGS="$CPPFLAGS $GTEST_INCLUDES"
  700. LDFLAGS_SAVED="$LDFLAGS"
  701. LDFLAGS="$LDFLAGS $GTEST_LDFLAGS"
  702. LIBS_SAVED=$LIBS
  703. LIBS="$LIBS $GTEST_LDADD"
  704. AC_MSG_CHECKING([Checking whether gtest tests need pthreads])
  705. # First try to compile without pthreads
  706. AC_TRY_LINK([
  707. #include <gtest/gtest.h>
  708. ],[
  709. int i = 0;
  710. char* c = NULL;
  711. ::testing::InitGoogleTest(&i, &c);
  712. return (0);
  713. ],
  714. [ AC_MSG_RESULT(no) ],
  715. [
  716. LIBS="$SAVED_LIBS $GTEST_LDADD $PTHREAD_LDFLAGS"
  717. # Now try to compile with pthreads
  718. AC_TRY_LINK([
  719. #include <gtest/gtest.h>
  720. ],[
  721. int i = 0;
  722. char* c = NULL;
  723. ::testing::InitGoogleTest(&i, &c);
  724. return (0);
  725. ],
  726. [ AC_MSG_RESULT(yes)
  727. GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
  728. ],
  729. # Apparently we can't compile it at all
  730. [ AC_MSG_ERROR(unable to compile with gtest) ])
  731. ])
  732. CPPFLAGS=$CPPFLAGS_SAVED
  733. LDFLAGS=$LDFLAGS_SAVED
  734. LIBS=$LIBS_SAVED
  735. break
  736. fi
  737. done
  738. fi
  739. if test "${GTEST_FOUND}" != "true"; then
  740. AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
  741. fi
  742. else
  743. GTEST_INCLUDES=
  744. GTEST_LDFLAGS=
  745. GTEST_LDADD=
  746. DISTCHECK_GTEST_CONFIGURE_FLAG=
  747. fi
  748. AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
  749. AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG)
  750. AC_SUBST(GTEST_INCLUDES)
  751. AC_SUBST(GTEST_LDFLAGS)
  752. AC_SUBST(GTEST_LDADD)
  753. dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
  754. AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes, no)
  755. if test "x$HAVE_PKG_CONFIG" = "xno" ; then
  756. AC_MSG_ERROR(Please install pkg-config)
  757. fi
  758. PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.3.9, enable_features="$enable_features SQLite3")
  759. #
  760. # ASIO: we extensively use it as the C++ event management module.
  761. #
  762. # Use local ASIO headers from ext
  763. #
  764. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/asio"
  765. #
  766. # Use our 'coroutine' header from ext
  767. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
  768. #
  769. # Disable threads: Currently we don't use them.
  770. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_THREADS=1"
  771. #
  772. # kqueue portability: ASIO uses kqueue by default if it's available (it's
  773. # generally available in BSD variants). Unfortunately, some public
  774. # implementation of kqueue forces a conversion from a pointer to an integer,
  775. # which is prohibited in C++ unless reinterpret_cast, C++'s most evil beast
  776. # (and ASIO doesn't use it anyway) is used. This will cause build error for
  777. # some of our C++ files including ASIO header files. The following check
  778. # detects such cases and tells ASIO not to use kqueue if so.
  779. AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
  780. if test "X$ac_cv_have_kqueue" = "Xyes"; then
  781. AC_MSG_CHECKING([whether kqueue EV_SET compiles in C++])
  782. AC_TRY_COMPILE([
  783. #include <sys/types.h>
  784. #include <sys/param.h>
  785. #include <sys/event.h>],
  786. [char* udata;
  787. EV_SET(NULL, 0, 0, 0, 0, 0, udata);],
  788. [AC_MSG_RESULT(yes)],
  789. [AC_MSG_RESULT([no, disable kqueue for ASIO])
  790. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_KQUEUE=1"
  791. ])
  792. fi
  793. # perfdhcp: If the clock_gettime() function does not exist on the system,
  794. # use an alternative supplied in the code based on gettimeofday().
  795. CLOCK_GETTIME_LDFLAGS=
  796. AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_GETTIME_LDFLAGS=-lrt], [])
  797. AC_SUBST([CLOCK_GETTIME_LDFLAGS])
  798. # perfdhcp: if getifaddrs() does not exist, have the code output a message
  799. # that it can't be run on this version of the operating system. For the
  800. # systems on which BIND 10 is built, this means Solaris 10. (Replacements
  801. # for this function are long and involved, and the function is reported present
  802. # on Solaris 11 and later, either in the libsocket or libnsl libraries.)
  803. AC_SEARCH_LIBS([getifaddrs], [socket nsl],
  804. [AC_DEFINE([HAVE_GETIFADDRS], [1], [getifaddrs() present])])
  805. # /dev/poll issue: ASIO uses /dev/poll by default if it's available (generally
  806. # the case with Solaris). Unfortunately its /dev/poll specific code would
  807. # trigger the gcc's "missing-field-initializers" warning, which would
  808. # subsequently make the build fail with -Werror. Further, older versions of
  809. # gcc don't provide an option to selectively suppress this warning.
  810. # So, for the moment, we simply disable the use of /dev/poll. Unless we
  811. # implement recursive DNS server with randomized ports, we don't need the
  812. # scalability that /dev/poll can provide, so this decision wouldn't affect
  813. # run time performance. Hopefully we can find a better solution or the ASIO
  814. # code will be updated by the time we really need it.
  815. AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
  816. if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
  817. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_DEV_POLL=1"
  818. fi
  819. #
  820. # Perl is optional; it is used only by some of the system test scripts.
  821. #
  822. AC_PATH_PROGS(PERL, perl5 perl)
  823. AC_SUBST(PERL)
  824. AC_PATH_PROGS(AWK, gawk awk)
  825. AC_SUBST(AWK)
  826. AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man],
  827. [regenerate man pages [default=no]])], enable_man=yes, enable_man=no)
  828. AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
  829. AC_ARG_ENABLE(install-configurations,
  830. [AC_HELP_STRING([--disable-install-configurations],
  831. [do not install configuration])], install_configurations=$enableval, install_configurations=yes)
  832. AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue)
  833. AC_CONFIG_FILES([Makefile
  834. doc/Makefile
  835. doc/guide/Makefile
  836. compatcheck/Makefile
  837. src/Makefile
  838. src/bin/Makefile
  839. src/bin/bind10/Makefile
  840. src/bin/bind10/tests/Makefile
  841. src/bin/cmdctl/Makefile
  842. src/bin/cmdctl/tests/Makefile
  843. src/bin/bindctl/Makefile
  844. src/bin/bindctl/tests/Makefile
  845. src/bin/cfgmgr/Makefile
  846. src/bin/cfgmgr/plugins/Makefile
  847. src/bin/cfgmgr/plugins/tests/Makefile
  848. src/bin/cfgmgr/tests/Makefile
  849. src/bin/host/Makefile
  850. src/bin/loadzone/Makefile
  851. src/bin/loadzone/tests/correct/Makefile
  852. src/bin/loadzone/tests/error/Makefile
  853. src/bin/msgq/Makefile
  854. src/bin/msgq/tests/Makefile
  855. src/bin/auth/Makefile
  856. src/bin/auth/tests/Makefile
  857. src/bin/auth/benchmarks/Makefile
  858. src/bin/ddns/Makefile
  859. src/bin/ddns/tests/Makefile
  860. src/bin/dhcp6/Makefile
  861. src/bin/dhcp6/tests/Makefile
  862. src/bin/dhcp4/Makefile
  863. src/bin/dhcp4/tests/Makefile
  864. src/bin/resolver/Makefile
  865. src/bin/resolver/tests/Makefile
  866. src/bin/sockcreator/Makefile
  867. src/bin/sockcreator/tests/Makefile
  868. src/bin/xfrin/Makefile
  869. src/bin/xfrin/tests/Makefile
  870. src/bin/xfrin/tests/testdata/Makefile
  871. src/bin/xfrout/Makefile
  872. src/bin/xfrout/tests/Makefile
  873. src/bin/zonemgr/Makefile
  874. src/bin/zonemgr/tests/Makefile
  875. src/bin/stats/Makefile
  876. src/bin/stats/tests/Makefile
  877. src/bin/usermgr/Makefile
  878. src/bin/tests/Makefile
  879. src/lib/Makefile
  880. src/lib/asiolink/Makefile
  881. src/lib/asiolink/tests/Makefile
  882. src/lib/asiodns/Makefile
  883. src/lib/asiodns/tests/Makefile
  884. src/lib/bench/Makefile
  885. src/lib/bench/example/Makefile
  886. src/lib/bench/tests/Makefile
  887. src/lib/cc/Makefile
  888. src/lib/cc/tests/Makefile
  889. src/lib/python/Makefile
  890. src/lib/python/isc/Makefile
  891. src/lib/python/isc/acl/Makefile
  892. src/lib/python/isc/acl/tests/Makefile
  893. src/lib/python/isc/util/Makefile
  894. src/lib/python/isc/util/tests/Makefile
  895. src/lib/python/isc/util/cio/Makefile
  896. src/lib/python/isc/util/cio/tests/Makefile
  897. src/lib/python/isc/datasrc/Makefile
  898. src/lib/python/isc/datasrc/tests/Makefile
  899. src/lib/python/isc/dns/Makefile
  900. src/lib/python/isc/cc/Makefile
  901. src/lib/python/isc/cc/tests/Makefile
  902. src/lib/python/isc/config/Makefile
  903. src/lib/python/isc/config/tests/Makefile
  904. src/lib/python/isc/log/Makefile
  905. src/lib/python/isc/log/tests/Makefile
  906. src/lib/python/isc/log_messages/Makefile
  907. src/lib/python/isc/log_messages/work/Makefile
  908. src/lib/python/isc/net/Makefile
  909. src/lib/python/isc/net/tests/Makefile
  910. src/lib/python/isc/notify/Makefile
  911. src/lib/python/isc/notify/tests/Makefile
  912. src/lib/python/isc/testutils/Makefile
  913. src/lib/python/isc/bind10/Makefile
  914. src/lib/python/isc/bind10/tests/Makefile
  915. src/lib/python/isc/xfrin/Makefile
  916. src/lib/python/isc/xfrin/tests/Makefile
  917. src/lib/config/Makefile
  918. src/lib/config/tests/Makefile
  919. src/lib/config/tests/testdata/Makefile
  920. src/lib/cryptolink/Makefile
  921. src/lib/cryptolink/tests/Makefile
  922. src/lib/dns/Makefile
  923. src/lib/dns/tests/Makefile
  924. src/lib/dns/tests/testdata/Makefile
  925. src/lib/dns/python/Makefile
  926. src/lib/dns/python/tests/Makefile
  927. src/lib/dns/benchmarks/Makefile
  928. src/lib/dhcp/Makefile
  929. src/lib/dhcp/tests/Makefile
  930. src/lib/exceptions/Makefile
  931. src/lib/exceptions/tests/Makefile
  932. src/lib/datasrc/Makefile
  933. src/lib/datasrc/tests/Makefile
  934. src/lib/datasrc/tests/testdata/Makefile
  935. src/lib/xfr/Makefile
  936. src/lib/xfr/tests/Makefile
  937. src/lib/log/Makefile
  938. src/lib/log/compiler/Makefile
  939. src/lib/log/tests/Makefile
  940. src/lib/resolve/Makefile
  941. src/lib/resolve/tests/Makefile
  942. src/lib/testutils/Makefile
  943. src/lib/testutils/testdata/Makefile
  944. src/lib/nsas/Makefile
  945. src/lib/nsas/tests/Makefile
  946. src/lib/cache/Makefile
  947. src/lib/cache/tests/Makefile
  948. src/lib/server_common/Makefile
  949. src/lib/server_common/tests/Makefile
  950. src/lib/util/Makefile
  951. src/lib/util/io/Makefile
  952. src/lib/util/unittests/Makefile
  953. src/lib/util/python/Makefile
  954. src/lib/util/pyunittests/Makefile
  955. src/lib/util/tests/Makefile
  956. src/lib/acl/Makefile
  957. src/lib/acl/tests/Makefile
  958. src/lib/statistics/Makefile
  959. src/lib/statistics/tests/Makefile
  960. tests/Makefile
  961. tests/system/Makefile
  962. tests/tools/Makefile
  963. tests/tools/badpacket/Makefile
  964. tests/tools/badpacket/tests/Makefile
  965. tests/tools/perfdhcp/Makefile
  966. ])
  967. AC_OUTPUT([doc/version.ent
  968. compatcheck/sqlite3-difftbl-check.py
  969. src/bin/cfgmgr/b10-cfgmgr.py
  970. src/bin/cfgmgr/tests/b10-cfgmgr_test.py
  971. src/bin/cmdctl/cmdctl.py
  972. src/bin/cmdctl/run_b10-cmdctl.sh
  973. src/bin/cmdctl/tests/cmdctl_test
  974. src/bin/cmdctl/cmdctl.spec.pre
  975. src/bin/ddns/ddns.py
  976. src/bin/xfrin/tests/xfrin_test
  977. src/bin/xfrin/xfrin.py
  978. src/bin/xfrin/run_b10-xfrin.sh
  979. src/bin/xfrout/xfrout.py
  980. src/bin/xfrout/xfrout.spec.pre
  981. src/bin/xfrout/tests/xfrout_test
  982. src/bin/xfrout/tests/xfrout_test.py
  983. src/bin/xfrout/run_b10-xfrout.sh
  984. src/bin/resolver/resolver.spec.pre
  985. src/bin/resolver/spec_config.h.pre
  986. src/bin/zonemgr/zonemgr.py
  987. src/bin/zonemgr/zonemgr.spec.pre
  988. src/bin/zonemgr/tests/zonemgr_test
  989. src/bin/zonemgr/run_b10-zonemgr.sh
  990. src/bin/stats/stats.py
  991. src/bin/stats/stats_httpd.py
  992. src/bin/bind10/bind10_src.py
  993. src/bin/bind10/run_bind10.sh
  994. src/bin/bind10/tests/bind10_test.py
  995. src/bin/bindctl/run_bindctl.sh
  996. src/bin/bindctl/bindctl_main.py
  997. src/bin/bindctl/tests/bindctl_test
  998. src/bin/loadzone/run_loadzone.sh
  999. src/bin/loadzone/tests/correct/correct_test.sh
  1000. src/bin/loadzone/tests/error/error_test.sh
  1001. src/bin/loadzone/b10-loadzone.py
  1002. src/bin/usermgr/run_b10-cmdctl-usermgr.sh
  1003. src/bin/usermgr/b10-cmdctl-usermgr.py
  1004. src/bin/msgq/msgq.py
  1005. src/bin/msgq/tests/msgq_test
  1006. src/bin/msgq/run_msgq.sh
  1007. src/bin/auth/auth.spec.pre
  1008. src/bin/auth/spec_config.h.pre
  1009. src/bin/dhcp4/spec_config.h.pre
  1010. src/bin/dhcp6/spec_config.h.pre
  1011. src/bin/tests/process_rename_test.py
  1012. src/lib/config/tests/data_def_unittests_config.h
  1013. src/lib/python/isc/config/tests/config_test
  1014. src/lib/python/isc/cc/tests/cc_test
  1015. src/lib/python/isc/notify/tests/notify_out_test
  1016. src/lib/python/isc/log/tests/log_console.py
  1017. src/lib/python/isc/log_messages/work/__init__.py
  1018. src/lib/dns/gen-rdatacode.py
  1019. src/lib/python/bind10_config.py
  1020. src/lib/cc/session_config.h.pre
  1021. src/lib/cc/tests/session_unittests_config.h
  1022. src/lib/datasrc/datasrc_config.h.pre
  1023. src/lib/log/tests/console_test.sh
  1024. src/lib/log/tests/destination_test.sh
  1025. src/lib/log/tests/init_logger_test.sh
  1026. src/lib/log/tests/local_file_test.sh
  1027. src/lib/log/tests/severity_test.sh
  1028. src/lib/log/tests/tempdir.h
  1029. src/lib/util/python/mkpywrapper.py
  1030. src/lib/util/python/gen_wiredata.py
  1031. src/lib/server_common/tests/data_path.h
  1032. tests/lettuce/setup_intree_bind10.sh
  1033. tests/system/conf.sh
  1034. tests/system/run.sh
  1035. tests/system/glue/setup.sh
  1036. tests/system/glue/nsx1/b10-config.db
  1037. tests/system/bindctl/nsx1/b10-config.db.template
  1038. tests/system/ixfr/db.example.n0
  1039. tests/system/ixfr/db.example.n2
  1040. tests/system/ixfr/db.example.n2.refresh
  1041. tests/system/ixfr/db.example.n4
  1042. tests/system/ixfr/db.example.n6
  1043. tests/system/ixfr/ixfr_init.sh
  1044. tests/system/ixfr/b10-config.db
  1045. tests/system/ixfr/common_tests.sh
  1046. tests/system/ixfr/in-1/setup.sh
  1047. tests/system/ixfr/in-2/setup.sh
  1048. tests/system/ixfr/in-3/setup.sh
  1049. tests/system/ixfr/in-4/setup.sh
  1050. ], [
  1051. chmod +x compatcheck/sqlite3-difftbl-check.py
  1052. chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
  1053. chmod +x src/bin/xfrin/run_b10-xfrin.sh
  1054. chmod +x src/bin/xfrout/run_b10-xfrout.sh
  1055. chmod +x src/bin/zonemgr/run_b10-zonemgr.sh
  1056. chmod +x src/bin/bind10/run_bind10.sh
  1057. chmod +x src/bin/cmdctl/tests/cmdctl_test
  1058. chmod +x src/bin/xfrin/tests/xfrin_test
  1059. chmod +x src/bin/xfrout/tests/xfrout_test
  1060. chmod +x src/bin/zonemgr/tests/zonemgr_test
  1061. chmod +x src/bin/bindctl/tests/bindctl_test
  1062. chmod +x src/bin/bindctl/run_bindctl.sh
  1063. chmod +x src/bin/loadzone/run_loadzone.sh
  1064. chmod +x src/bin/loadzone/tests/correct/correct_test.sh
  1065. chmod +x src/bin/loadzone/tests/error/error_test.sh
  1066. chmod +x src/bin/usermgr/run_b10-cmdctl-usermgr.sh
  1067. chmod +x src/bin/msgq/run_msgq.sh
  1068. chmod +x src/bin/msgq/tests/msgq_test
  1069. chmod +x src/lib/dns/gen-rdatacode.py
  1070. chmod +x src/lib/log/tests/console_test.sh
  1071. chmod +x src/lib/log/tests/destination_test.sh
  1072. chmod +x src/lib/log/tests/init_logger_test.sh
  1073. chmod +x src/lib/log/tests/local_file_test.sh
  1074. chmod +x src/lib/log/tests/severity_test.sh
  1075. chmod +x src/lib/util/python/mkpywrapper.py
  1076. chmod +x src/lib/util/python/gen_wiredata.py
  1077. chmod +x src/lib/python/isc/log/tests/log_console.py
  1078. chmod +x tests/system/conf.sh
  1079. chmod +x tests/system/run.sh
  1080. chmod +x tests/system/ixfr/ixfr_init.sh
  1081. chmod +x tests/system/ixfr/common_tests.sh
  1082. chmod +x tests/system/ixfr/in-1/setup.sh
  1083. chmod +x tests/system/ixfr/in-2/setup.sh
  1084. chmod +x tests/system/ixfr/in-3/setup.sh
  1085. chmod +x tests/system/ixfr/in-4/setup.sh
  1086. ])
  1087. AC_OUTPUT
  1088. dnl Print the results
  1089. dnl
  1090. cat > config.report << END
  1091. BIND 10 source configure results:
  1092. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1093. Package:
  1094. Name: $PACKAGE_NAME
  1095. Version: $PACKAGE_VERSION
  1096. C++ Compiler: $CXX
  1097. Flags:
  1098. DEFS: $DEFS
  1099. CPPFLAGS: $CPPFLAGS
  1100. CXXFLAGS: $CXXFLAGS
  1101. LDFLAGS: $LDFLAGS
  1102. B10_CXXFLAGS: $B10_CXXFLAGS
  1103. OS Family: $OS_TYPE
  1104. dnl includes too
  1105. Python: ${PYTHON_INCLUDES}
  1106. ${PYTHON_CXXFLAGS}
  1107. ${PYTHON_LDFLAGS}
  1108. ${PYTHON_LIB}
  1109. Boost: ${BOOST_INCLUDES}
  1110. Botan: ${BOTAN_INCLUDES}
  1111. ${BOTAN_LDFLAGS}
  1112. ${BOTAN_LIBS}
  1113. Log4cplus: ${LOG4CPLUS_INCLUDES}
  1114. ${LOG4CPLUS_LIBS}
  1115. SQLite: $SQLITE_CFLAGS
  1116. $SQLITE_LIBS
  1117. Features:
  1118. $enable_features
  1119. Developer:
  1120. Google Tests: $gtest_path
  1121. C++ Code Coverage: $USE_LCOV
  1122. Python Code Coverage: $USE_PYCOVERAGE
  1123. Generate Manuals: $enable_man
  1124. END
  1125. cat config.report
  1126. cat <<EOF
  1127. Now you can type "make" to build BIND 10
  1128. EOF