configure.ac 44 KB

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