configure.ac 44 KB

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