configure.ac 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.59])
  4. # For released versions, this is in x.y.z format.
  5. # For GIT versions, this is x.y.z-git, where x.y.z denotes the software
  6. # version that was used as a base + changes that were made later, but
  7. # are not released yet.
  8. AC_INIT(bind10, 0.8.0-git, kea-dev@isc.org)
  9. AC_CONFIG_SRCDIR(README)
  10. # serial-tests is not available in automake version before 1.13, so
  11. # we'll check that and conditionally use serial-tests. This check is
  12. # adopted from code by Richard W.M. Jones:
  13. # https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html
  14. m4_define([serial_tests], [
  15. m4_esyscmd([automake --version |
  16. head -1 |
  17. awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
  18. ])
  19. ])
  20. AM_INIT_AUTOMAKE(foreign serial_tests)
  21. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])dnl be backward compatible
  22. AC_CONFIG_HEADERS([config.h])
  23. AC_CONFIG_MACRO_DIR([m4macros])
  24. # Checks for programs.
  25. AC_PROG_CXX
  26. # Enable low-performing debugging facilities? This option optionally
  27. # enables some debugging aids that perform slowly and hence aren't built
  28. # by default.
  29. AC_ARG_ENABLE([debug],
  30. AS_HELP_STRING([--enable-debug],
  31. [enable debugging (default is no)]),
  32. [case "${enableval}" in
  33. yes) debug_enabled=yes ;;
  34. no) debug_enabled=no ;;
  35. *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  36. esac],[debug_enabled=no])
  37. AM_CONDITIONAL([DEBUG_ENABLED], [test x$debug_enabled = xyes])
  38. AM_COND_IF([DEBUG_ENABLED], [AC_DEFINE([ENABLE_DEBUG], [1], [Enable low-performing debugging facilities?])])
  39. # Libtool configuration
  40. #
  41. # libtool cannot handle spaces in paths, so exit early if there is one
  42. if [ test `echo $PWD | grep -c ' '` != "0" ]; then
  43. 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.])
  44. fi
  45. # On FreeBSD (and probably some others), clang++ does not meet an autoconf
  46. # assumption in identifying libtool configuration regarding shared library:
  47. # the configure script will execute "$CC -shared $CFLAGS/$CXXFLAGS -v" and
  48. # expect the output contains -Lxxx or -Ryyy. This is the case for g++, but
  49. # not for clang++, and, as a result, it will cause various errors in linking
  50. # programs or running them with a shared object (such as some of our python
  51. # scripts).
  52. # To work around this problem we define a temporary variable
  53. # "CXX_LIBTOOL_LDFLAGS". It's expected to be defined as, e.g, "-L/usr/lib"
  54. # to temporarily fake the output so that it will be compatible with that of
  55. # g++.
  56. CFLAGS_SAVED=$CFLAGS
  57. CXXFLAGS_SAVED=$CXXFLAGS
  58. CFLAGS="$CFLAGS $CXX_LIBTOOL_LDFLAGS"
  59. CXXFLAGS="$CXXFLAGS $CXX_LIBTOOL_LDFLAGS"
  60. AC_PROG_LIBTOOL
  61. CFLAGS=$CFLAGS_SAVED
  62. CXXFLAGS=$CXXFLAGS_SAVED
  63. # Use C++ language
  64. AC_LANG([C++])
  65. # Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
  66. AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
  67. AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
  68. AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
  69. AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
  70. dnl Determine if weare using GNU sed
  71. GNU_SED=no
  72. $SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
  73. if test $? -eq 0; then
  74. GNU_SED=yes
  75. fi
  76. # Linker options
  77. # check -R, "-Wl,-R" or -rpath (we share the AX function defined in
  78. # examples/m4)
  79. AX_ISC_RPATH
  80. # Compiler dependent settings: define some mandatory CXXFLAGS here.
  81. # We also use a separate variable B10_CXXFLAGS. This will (and should) be
  82. # used as the default value for each specific AM_CXXFLAGS:
  83. # AM_CXXFLAGS = $(B10_CXXFLAGS)
  84. # AM_CXXFLAGS += ... # add module specific flags
  85. # We need this so that we can disable some specific compiler warnings per
  86. # module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
  87. # gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
  88. # specify the default warning flags in CXXFLAGS and let specific modules
  89. # "override" the default.
  90. # This may be used to try linker flags.
  91. AC_DEFUN([BIND10_CXX_TRY_FLAG], [
  92. AC_MSG_CHECKING([whether $CXX supports $1])
  93. bind10_save_CXXFLAGS="$CXXFLAGS"
  94. CXXFLAGS="$CXXFLAGS $1"
  95. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void){ return 0;}])],
  96. [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
  97. CXXFLAGS="$bind10_save_CXXFLAGS"
  98. if test "x$bind10_cxx_flag" = "xyes"; then
  99. ifelse([$2], , :, [$2])
  100. else
  101. ifelse([$3], , :, [$3])
  102. fi
  103. AC_MSG_RESULT([$bind10_cxx_flag])
  104. ])
  105. CXX_VERSION="unknown"
  106. # SunStudio compiler requires special compiler options for boost
  107. # (http://blogs.sun.com/sga/entry/boost_mini_howto)
  108. if test "$SUNCXX" = "yes"; then
  109. CXX_VERSION=`$CXX -V 2> /dev/null | head -1`
  110. CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
  111. MULTITHREADING_FLAG="-mt"
  112. fi
  113. # Newer versions of clang++ promotes "unused driver arguments" warnings to
  114. # a fatal error with -Werror, causing build failure. Since we use multiple
  115. # compilers on multiple systems, this can easily happen due to settings for
  116. # non clang++ environments that could be just ignored otherwise. It can also
  117. # happen if clang++ is used via ccache. So, although probably suboptimal,
  118. # we suppress this particular warning. Note that it doesn't weaken checks
  119. # on the source code.
  120. if test "$CLANGPP" = "yes"; then
  121. CXX_VERSION=`$CXX --version 2> /dev/null | head -1`
  122. B10_CXXFLAGS="$B10_CXXFLAGS -Qunused-arguments"
  123. fi
  124. BIND10_CXX_TRY_FLAG([-Wno-missing-field-initializers],
  125. [WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
  126. AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
  127. # gcc specific settings:
  128. if test "X$GXX" = "Xyes"; then
  129. CXX_VERSION=`$CXX --version 2> /dev/null | head -1`
  130. B10_CXXFLAGS="$B10_CXXFLAGS -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
  131. case "$host" in
  132. *-solaris*)
  133. MULTITHREADING_FLAG=-pthreads
  134. # In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
  135. B10_CXXFLAGS="$B10_CXXFLAGS -Wno-missing-braces"
  136. ;;
  137. *)
  138. MULTITHREADING_FLAG=-pthread
  139. ;;
  140. esac
  141. # Don't use -Werror if configured not to
  142. AC_ARG_WITH(werror,
  143. AC_HELP_STRING([--with-werror], [Compile using -Werror (default=yes)]),
  144. [
  145. case "${withval}" in
  146. yes) with_werror=1 ;;
  147. no) with_werror=0 ;;
  148. *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
  149. esac],
  150. [with_werror=1])
  151. werror_ok=0
  152. # Certain versions of gcc (g++) have a bug that incorrectly warns about
  153. # the use of anonymous name spaces even if they're closed in a single
  154. # translation unit. For these versions we have to disable -Werror.
  155. if test $with_werror = 1; then
  156. CXXFLAGS_SAVED="$CXXFLAGS"
  157. CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
  158. AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
  159. # We use struct, not class, here, because some compilers complain about
  160. # "unused private members", causing a false positive.
  161. AC_TRY_COMPILE([namespace { struct Foo {}; }
  162. namespace isc {struct Bar {Foo foo_;};} ],,
  163. [AC_MSG_RESULT(no)
  164. werror_ok=1
  165. B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
  166. [AC_MSG_RESULT(yes)])
  167. CXXFLAGS="$CXXFLAGS_SAVED"
  168. fi
  169. fi dnl GXX = yes
  170. # allow building programs with static link. we need to make it selective
  171. # because loadable modules cannot be statically linked.
  172. AC_ARG_ENABLE([static-link],
  173. AC_HELP_STRING([--enable-static-link],
  174. [build programs with static link [[default=no]]]),
  175. [enable_static_link=yes], [enable_static_link=no])
  176. AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
  177. AM_COND_IF([USE_STATIC_LINK], [AC_DEFINE([USE_STATIC_LINK], [1], [BIND 10 was statically linked?])])
  178. # Check validity about some libtool options
  179. if test $enable_static_link = yes -a $enable_static = no; then
  180. AC_MSG_ERROR([--enable-static-link requires --enable-static])
  181. fi
  182. if test $enable_shared = no; then
  183. AC_MSG_ERROR([BIND 10 requires shared libraries to be built])
  184. fi
  185. # allow configuring without setproctitle.
  186. AC_ARG_ENABLE(setproctitle-check,
  187. AC_HELP_STRING([--disable-setproctitle-check],
  188. [do not check for python setproctitle module (used to give nice names to python processes)]),
  189. setproctitle_check=$enableval, setproctitle_check=yes)
  190. # OS dependent configuration
  191. SET_ENV_LIBRARY_PATH=no
  192. ENV_LIBRARY_PATH=LD_LIBRARY_PATH
  193. bind10_undefined_pthread_behavior=no
  194. case "$host" in
  195. *-solaris*)
  196. # Solaris requires special definitions to get some standard libraries
  197. # (e.g. getopt(3)) available with common used header files.
  198. CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
  199. # "now" binding is necessary to prevent deadlocks in C++ static initialization code
  200. LDFLAGS="$LDFLAGS -z now"
  201. # Destroying locked mutexes, condition variables being waited
  202. # on, etc. are undefined behavior on Solaris, so we set it as
  203. # such here.
  204. bind10_undefined_pthread_behavior=yes
  205. ;;
  206. *-apple-darwin*)
  207. # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use
  208. # (RFC2292 or RFC3542).
  209. CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
  210. # In OS X 10.9 (and possibly any future versions?) pthread_cond_destroy
  211. # doesn't work as documented, which makes some of unit tests fail.
  212. # Testing a specific system and version is not a good practice, but
  213. # identifying this behavior would be too heavy (running a program
  214. # with multiple threads), so this is a compromise. In general,
  215. # it should be avoided to rely on 'osx_version' unless there's no
  216. # viable alternative.
  217. osx_version=`/usr/bin/sw_vers -productVersion`
  218. if [ test $osx_version = "10.9" \
  219. -o $osx_version = "10.9.1" \
  220. -o $osx_version = "10.9.2" \
  221. -o $osx_version = "10.9.3" ]; then
  222. bind10_undefined_pthread_behavior=yes
  223. fi
  224. # libtool doesn't work perfectly with Darwin: libtool embeds the
  225. # final install path in dynamic libraries and our loadable python
  226. # modules always refer to that path even if it's loaded within the
  227. # source tree. This prevents pre-install tests from working.
  228. # To work around this problem we explicitly specify paths to dynamic
  229. # libraries when we use them in the source tree.
  230. SET_ENV_LIBRARY_PATH=yes
  231. ENV_LIBRARY_PATH=DYLD_LIBRARY_PATH
  232. ;;
  233. *-freebsd*)
  234. SET_ENV_LIBRARY_PATH=yes
  235. ;;
  236. *-netbsd*)
  237. SET_ENV_LIBRARY_PATH=yes
  238. ;;
  239. *-openbsd*)
  240. SET_ENV_LIBRARY_PATH=yes
  241. ;;
  242. esac
  243. AM_CONDITIONAL(SET_ENV_LIBRARY_PATH, test $SET_ENV_LIBRARY_PATH = yes)
  244. AC_SUBST(SET_ENV_LIBRARY_PATH)
  245. AC_SUBST(ENV_LIBRARY_PATH)
  246. if [ test $bind10_undefined_pthread_behavior = "yes" ]; then
  247. AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
  248. fi
  249. # Our experiments have shown Solaris 10 has broken support for the
  250. # IPV6_USE_MIN_MTU socket option for getsockopt(); it doesn't return the value
  251. # previously set via setsockopt(). We know it doesn't happen on one instance
  252. # on Solaris 11, but we don't know whether it happens for any Solaris 10
  253. # implementations or for earlier versions of Solaris. In any case, at the
  254. # moment this matters for only one unittest case, so we'll simply disable
  255. # the affected test using the following definition with the specific hardcoding
  256. # of that version of Solaris.
  257. case "$host" in
  258. *-solaris2.10)
  259. AC_DEFINE([HAVE_BROKEN_GET_IPV6_USE_MIN_MTU], [1],
  260. [Define to 1 if getsockopt(IPV6_USE_MIN_MTU) does not work])
  261. ;;
  262. esac
  263. m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3.4 python3.3 python3.2 python3.1 python3])
  264. AC_ARG_WITH([pythonpath],
  265. AC_HELP_STRING([--with-pythonpath=PATH],
  266. [specify an absolute path to python executable when automatic version check (incorrectly) fails]),
  267. [python_path="$withval"], [python_path="auto"])
  268. if test "$python_path" = auto; then
  269. AM_PATH_PYTHON([3.1])
  270. else
  271. # Older versions of automake can't handle python3 well. This is an
  272. # in-house workaround for them.
  273. PYTHON=$python_path
  274. AC_SUBST(PYTHON)
  275. PYTHON_PREFIX='${prefix}'
  276. AC_SUBST(PYTHON_PREFIX)
  277. PYTHON_EXEC_PREFIX='$(exec_prefix)'
  278. AC_SUBST(PYTHON_EXEC_PREFIX)
  279. PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`]
  280. if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then
  281. AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])
  282. fi
  283. AC_SUBST(PYTHON_VERSION)
  284. PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"`
  285. AC_SUBST(PYTHON_PLATFORM)
  286. pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  287. AC_SUBST(pythondir)
  288. pkgpythondir='${pythondir}/'$PACKAGE
  289. AC_SUBST(pkgpythondir)
  290. pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  291. AC_SUBST(pyexecdir)
  292. pkgpyexecdir='${pyexecdir}/'$PACKAGE
  293. AC_SUBST(pkgpyexecdir)
  294. fi
  295. # We need to store the default pyexecdir in a separate variable so that
  296. # we can specify in Makefile.am the install directory of various BIND 10
  297. # python scripts and loadable modules; in Makefile.am we cannot replace
  298. # $(pyexecdir) using itself, e.g, this doesn't work:
  299. # pyexecdir = $(pyexecdir)/isc/some_module
  300. # The separate variable makes this setup possible as follows:
  301. # pyexecdir = $(PYTHON_SITEPKG_DIR)/isc/some_module
  302. PYTHON_SITEPKG_DIR=${pyexecdir}
  303. AC_SUBST(PYTHON_SITEPKG_DIR)
  304. # This will be commonly used in various Makefile.am's that need to generate
  305. # python log messages.
  306. PYTHON_LOGMSGPKG_DIR="\$(top_builddir)/src/lib/python/isc/log_messages"
  307. AC_SUBST(PYTHON_LOGMSGPKG_DIR)
  308. # This is python package paths commonly used in python tests. See
  309. # README of log_messages for why it's included.
  310. # lib/dns/python/.libs is necessary because __init__.py of isc package
  311. # automatically imports isc.datasrc, which then requires the DNS loadable
  312. # module. #2145 should eliminate the need for it.
  313. COMMON_PYTHON_PATH="\$(abs_top_builddir)/src/lib/python/isc/log_messages:\$(abs_top_builddir)/src/lib/python/isc/cc:\$(abs_top_srcdir)/src/lib/python:\$(abs_top_builddir)/src/lib/python:\$(abs_top_builddir)/src/lib/dns/python/.libs"
  314. AC_SUBST(COMMON_PYTHON_PATH)
  315. # Check for python development environments
  316. if test -x ${PYTHON}-config; then
  317. PYTHON_INCLUDES=`${PYTHON}-config --includes`
  318. # Add any '-L..." flags to PYTHON_LDFLAGS. We first make a copy of
  319. # python-config --ldflags, removing any spaces and tabs
  320. # between "-L" and its argument (some instances of python-config
  321. # insert a space, which would confuse the code below).
  322. # Notes: if -L isn't contained at all we can simply skip this process,
  323. # so we only go through the flag if it's contained; also, protecting
  324. # the output with [] seems necessary for environment to avoid getting
  325. # an empty output accidentally.
  326. python_config_ldflags=[`${PYTHON}-config --ldflags | ${SED} -ne 's/\([ \t]*-L\)[ ]*\([^ \t]*[ \t]*\)/\1\2/gp'`]
  327. for flag in $python_config_ldflags; do
  328. flag=`echo $flag | ${SED} -ne 's/^\(\-L.*\)$/\1/p'`
  329. if test "X${flag}" != X; then
  330. PYTHON_LDFLAGS="$PYTHON_LDFLAGS ${flag}"
  331. fi
  332. done
  333. # on some platforms, ${PYTHON}-config --ldflags doesn't provide a -L
  334. # option while having the library under a non trivial directory.
  335. # as a workaround we try the "lib" sub directory under the common
  336. # prefix for this python.
  337. if test -z "${PYTHON_LDFLAGS}"; then
  338. PYTHON_LDFLAGS="-L`${PYTHON}-config --prefix`/lib"
  339. fi
  340. else
  341. if test "X$PYTHON_INCLUDES" = X -o "X$PYTHON_LDFLAGS" = X; then
  342. 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.])
  343. fi
  344. fi
  345. # Some OSes including NetBSD don't install libpython.so in a well known path.
  346. # To avoid requiring dynamic library path with our python wrapper loadable
  347. # modules, we embed the path to the modules when possible. We do this even
  348. # when the path is known in the common operational environment (e.g. when
  349. # it's stored in a common "hint" file) for simplicity.
  350. if test "x$ISC_RPATH_FLAG" != "x"; then
  351. python_rpath=
  352. for flag in ${PYTHON_LDFLAGS}; do
  353. python_rpath="${python_rpath} `echo $flag | ${SED} -ne "s/^\(\-L\)/${ISC_RPATH_FLAG}/p"`"
  354. done
  355. PYTHON_LDFLAGS="${PYTHON_LDFLAGS} ${python_rpath}"
  356. fi
  357. AC_SUBST(PYTHON_INCLUDES)
  358. AC_SUBST(PYTHON_LDFLAGS)
  359. CPPFLAGS_SAVED="$CPPFLAGS"
  360. CPPFLAGS="$CPPFLAGS ${PYTHON_INCLUDES}"
  361. AC_CHECK_HEADERS([Python.h],, AC_MSG_ERROR([Missing Python.h]))
  362. CPPFLAGS="$CPPFLAGS_SAVED"
  363. # Check for python library. Needed for Python-wrapper libraries.
  364. LDFLAGS_SAVED="$LDFLAGS"
  365. LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
  366. python_bin="python${PYTHON_VERSION}"
  367. AC_CHECK_LIB($python_bin, main, python_lib=$python_bin, python_lib=no)
  368. if test $python_lib != "no"; then
  369. PYTHON_LIB="-l$python_lib"
  370. fi
  371. AC_SUBST(PYTHON_LIB)
  372. LDFLAGS=$LDFLAGS_SAVED
  373. # Python 3.2 changed the return type of internal hash function to
  374. # Py_hash_t and some platforms (such as Solaris) strictly check for long
  375. # vs Py_hash_t. So we detect and use the appropriate return type.
  376. # Remove this test (and associated changes in pydnspp_config.h.in) when
  377. # we require Python 3.2.
  378. have_py_hash_t=0
  379. CPPFLAGS_SAVED="$CPPFLAGS"
  380. CPPFLAGS=${PYTHON_INCLUDES}
  381. AC_MSG_CHECKING(for Py_hash_t)
  382. AC_TRY_COMPILE([#include <Python.h>
  383. Py_hash_t h;],,
  384. [AC_MSG_RESULT(yes)
  385. have_py_hash_t=1],
  386. [AC_MSG_RESULT(no)])
  387. CPPFLAGS="$CPPFLAGS_SAVED"
  388. HAVE_PY_HASH_T=$have_py_hash_t
  389. AC_SUBST(HAVE_PY_HASH_T)
  390. # Check for the setproctitle module
  391. if test "$setproctitle_check" = "yes" ; then
  392. AC_MSG_CHECKING(for setproctitle module)
  393. if "$PYTHON" -c 'import setproctitle' 2>/dev/null ; then
  394. AC_MSG_RESULT(ok)
  395. else
  396. AC_MSG_RESULT(missing)
  397. AC_MSG_WARN([Missing setproctitle python module.
  398. Use --disable-setproctitle-check to skip this check.
  399. In this case we will continue, but naming of python processes will not work.])
  400. fi
  401. fi
  402. # (g++ only check)
  403. # Python 3.2 has an unused parameter in one of its headers. This
  404. # has been reported, but not fixed as of yet, so we check if we need
  405. # to set -Wno-unused-parameter.
  406. if test "X$GXX" = "Xyes" -a "$werror_ok" = 1; then
  407. CPPFLAGS_SAVED="$CPPFLAGS"
  408. CPPFLAGS=${PYTHON_INCLUDES}
  409. CXXFLAGS_SAVED="$CXXFLAGS"
  410. CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
  411. AC_MSG_CHECKING([whether we need -Wno-unused-parameter for python])
  412. AC_TRY_COMPILE(
  413. [#include <Python.h>],
  414. [],
  415. [AC_MSG_RESULT(no)],
  416. [
  417. CXXFLAGS="$CXXFLAGS -Wno-unused-parameter"
  418. AC_TRY_COMPILE([#include <Python.h>],
  419. [],
  420. [AC_MSG_RESULT(yes)
  421. PYTHON_CXXFLAGS="${PYTHON_CXXFLAGS} -Wno-unused-parameter"
  422. AC_SUBST(PYTHON_CXXFLAGS)
  423. ],
  424. [AC_MSG_ERROR([Can't compile against Python.h. If you're using MacOS X and have installed Python with Homebrew, see http://kea.isc.org/wiki/SystemNotesMacOSX])]
  425. )
  426. ]
  427. )
  428. CXXFLAGS="$CXXFLAGS_SAVED"
  429. CPPFLAGS="$CPPFLAGS_SAVED"
  430. fi
  431. # produce PIC unless we disable shared libraries. need this for python bindings.
  432. if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
  433. B10_CXXFLAGS="$B10_CXXFLAGS -fPIC"
  434. fi
  435. AC_SUBST(B10_CXXFLAGS)
  436. # Checks for libraries.
  437. AC_SEARCH_LIBS(inet_pton, [nsl])
  438. AC_SEARCH_LIBS(recvfrom, [socket])
  439. AC_SEARCH_LIBS(nanosleep, [rt])
  440. AC_SEARCH_LIBS(dlsym, [dl])
  441. # Checks for header files.
  442. # Checks for typedefs, structures, and compiler characteristics.
  443. AC_HEADER_STDBOOL
  444. AC_TYPE_SIZE_T
  445. # Detect OS type (it may be used to do OS-specific things, e.g.
  446. # interface detection in DHCP)
  447. AC_MSG_CHECKING(OS family)
  448. system=`uname -s`
  449. case $system in
  450. Linux)
  451. OS_TYPE="Linux"
  452. CPPFLAGS="$CPPFLAGS -DOS_LINUX"
  453. ;;
  454. Darwin | FreeBSD | NetBSD | OpenBSD)
  455. OS_TYPE="BSD"
  456. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  457. ;;
  458. SunOS)
  459. OS_TYPE="Solaris"
  460. CPPFLAGS="$CPPFLAGS -DOS_SUN"
  461. ;;
  462. *)
  463. OS_TYPE="Unknown"
  464. AC_MSG_WARN("Unsupported OS: uname returned $system")
  465. ;;
  466. esac
  467. AC_MSG_RESULT($OS_TYPE)
  468. AM_CONDITIONAL(OS_LINUX, test $OS_TYPE = Linux)
  469. AM_COND_IF([OS_LINUX], [AC_DEFINE([OS_LINUX], [1], [Running on Linux?])])
  470. AM_CONDITIONAL(OS_BSD, test $OS_TYPE = BSD)
  471. AM_COND_IF([OS_BSD], [AC_DEFINE([OS_BSD], [1], [Running on BSD?])])
  472. AM_CONDITIONAL(OS_SOLARIS, test $OS_TYPE = Solaris)
  473. AM_COND_IF([OS_SOLARIS], [AC_DEFINE([OS_SOLARIS], [1], [Running on Solaris?])])
  474. # Deal with variants
  475. AM_CONDITIONAL(OS_FREEBSD, test $system = FreeBSD)
  476. AM_COND_IF([OS_FREEBSD], [AC_DEFINE([OS_FREEBSD], [1], [Running on FreeBSD?])])
  477. AM_CONDITIONAL(OS_NETBSD, test $system = NetBSD)
  478. AM_COND_IF([OS_NETBSD], [AC_DEFINE([OS_NETBSD], [1], [Running on NetBSD?])])
  479. AM_CONDITIONAL(OS_OPENBSD, test $system = OpenBSD)
  480. AM_COND_IF([OS_OPENBSD], [AC_DEFINE([OS_OPENBSD], [1], [Running on OpenBSD?])])
  481. AM_CONDITIONAL(OS_OSX, test $system = Darwin)
  482. AM_COND_IF([OS_OSX], [AC_DEFINE([OS_OSX], [1], [Running on OSX?])])
  483. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  484. AC_TRY_COMPILE([
  485. #include <sys/types.h>
  486. #include <sys/socket.h>],
  487. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  488. [AC_MSG_RESULT(yes)
  489. AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
  490. AC_MSG_RESULT(no))
  491. AC_ARG_WITH(pycoverage,
  492. [ --with-pycoverage[=PROGRAM] enable python code coverage using the specified coverage], pycoverage="$withval", pycoverage="no")
  493. if test "$pycoverage" = "no" ; then
  494. # just run the tests normally with python
  495. PYCOVERAGE_RUN="${PYTHON}"
  496. USE_PYCOVERAGE="no"
  497. elif test "$pycoverage" = "yes" ; then
  498. PYCOVERAGE="coverage"
  499. PYCOVERAGE_RUN="${PYCOVERAGE} run --branch --append"
  500. USE_PYCOVERAGE="yes"
  501. else
  502. PYCOVERAGE="$pycoverage"
  503. PYCOVERAGE_RUN="${PYCOVERAGE} run --branch --append"
  504. USE_PYCOVERAGE="yes"
  505. fi
  506. AM_CONDITIONAL(ENABLE_PYTHON_COVERAGE, test x$USE_PYCOVERAGE != xno)
  507. AC_SUBST(PYCOVERAGE)
  508. AC_SUBST(PYCOVERAGE_RUN)
  509. AC_SUBST(USE_PYCOVERAGE)
  510. enable_gtest="no"
  511. GTEST_INCLUDES=
  512. AC_ARG_WITH([gtest-source],
  513. [AS_HELP_STRING([--with-gtest-source=PATH],
  514. [location of the Googletest source, defaults to /usr/src/gtest])],
  515. [enable_gtest="yes" ; GTEST_SOURCE="$withval"],
  516. [GTEST_SOURCE="/usr/src/gtest"])
  517. AC_ARG_WITH([gtest],
  518. [AS_HELP_STRING([--with-gtest=PATH],
  519. [specify a path to gtest header files (PATH/include) and library (PATH/lib)])],
  520. [gtest_path="$withval"; enable_gtest="yes"], [gtest_path="no"])
  521. AC_ARG_WITH(lcov,
  522. [ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
  523. USE_LCOV="no"
  524. if test "$lcov" != "no"; then
  525. # force gtest if not set
  526. if test "$enable_gtest" = "no"; then
  527. # AC_MSG_ERROR("lcov needs gtest for test coverage report")
  528. AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
  529. enable_gtest="yes"
  530. fi
  531. if test "$lcov" != "yes"; then
  532. LCOV=$lcov
  533. else
  534. AC_PATH_PROG([LCOV], [lcov])
  535. fi
  536. if test -x "${LCOV}"; then
  537. USE_LCOV="yes"
  538. else
  539. AC_MSG_ERROR([Cannot find lcov.])
  540. fi
  541. # is genhtml always in the same directory?
  542. GENHTML=`echo "$LCOV" | ${SED} s/lcov$/genhtml/`
  543. if test ! -x $GENHTML; then
  544. AC_MSG_ERROR([genhtml not found, needed for lcov])
  545. fi
  546. # GCC specific?
  547. CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
  548. LIBS=" $LIBS -lgcov"
  549. AC_SUBST(CPPFLAGS)
  550. AC_SUBST(LIBS)
  551. AC_SUBST(LCOV)
  552. AC_SUBST(GENHTML)
  553. fi
  554. AC_SUBST(USE_LCOV)
  555. # Simplified, non-caching AC_CHECK_PROG
  556. # Searches $PATH for the existence of argument 2,
  557. # and sets the full path to the variable in argument 1.
  558. # if not found, and a third argument is given, the value
  559. # is set to that. If not, the value is untouched.
  560. # Does not take absolute paths into account at this point,
  561. # and also works for single files only (arguments are not
  562. # stripped like in AC_CHECK_PROG)
  563. AC_DEFUN([ACX_CHECK_PROG_NONCACHE], [
  564. RESULT=""
  565. IFS_SAVED="$IFS"
  566. IFS=${PATH_SEPARATOR}
  567. for cur_path in ${PATH} ; do
  568. if test -e "${cur_path}/$2" ; then
  569. RESULT="${cur_path}/$2"
  570. fi
  571. done
  572. if test "$RESULT" = "" ; then
  573. :
  574. m4_ifvaln([$3], [$1=$3])
  575. else
  576. $1=$RESULT
  577. fi
  578. IFS="$IFS_SAVED"
  579. ])
  580. # Avoid checking Botan if OpenSSL is wanted
  581. AC_ARG_WITH([openssl],
  582. [AS_HELP_STRING([--with-openssl[[=PATH]]], [Enables OpenSSL,
  583. location can be specified optionally])],
  584. [use_openssl="$withval"],
  585. [use_openssl="auto"])
  586. # Botan helper test function
  587. # Tries to compile a botan program, given the output of the given
  588. # config tool
  589. # Arguments:
  590. # - name of tool (checked for path), must support --libs and --cflags
  591. # - fixed argument(s) for tool
  592. # - action if successful
  593. AC_DEFUN([ACX_TRY_BOTAN_TOOL], [
  594. TOOL=$1
  595. TOOL_ARG=$2
  596. BOTAN_TOOL=""
  597. ACX_CHECK_PROG_NONCACHE([BOTAN_TOOL], [${TOOL}])
  598. AC_MSG_CHECKING([usability of ${TOOL} ${TOOL_ARG}])
  599. if test "$BOTAN_TOOL" != "" ; then
  600. if test -x ${BOTAN_TOOL}; then
  601. CRYPTO_LIBS=`$BOTAN_TOOL $TOOL_ARG --libs`
  602. LIBS_SAVED=${LIBS}
  603. LIBS="$LIBS $CRYPTO_LIBS"
  604. CRYPTO_INCLUDES=`$BOTAN_TOOL $TOOL_ARG --cflags`
  605. CPPFLAGS_SAVED=${CPPFLAGS}
  606. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  607. #AC_MSG_RESULT([found])
  608. AC_LINK_IFELSE(
  609. [AC_LANG_PROGRAM([#include <botan/botan.h>
  610. #include <botan/hash.h>
  611. ],
  612. [using namespace Botan;
  613. LibraryInitializer::initialize();
  614. HashFunction *h = get_hash("MD5");
  615. ])],
  616. [ AC_MSG_RESULT([ok])
  617. $3
  618. ],
  619. [ AC_MSG_RESULT([not usable]) ]
  620. )
  621. LIBS=${LIBS_SAVED}
  622. CPPFLAGS=${CPPFLAGS_SAVED}
  623. else
  624. AC_MSG_RESULT([not executable])
  625. fi
  626. else
  627. AC_MSG_RESULT([not found])
  628. fi
  629. BOTAN_TOOL=""
  630. AC_SUBST(BOTAN_TOOL)
  631. ]
  632. )
  633. # Check for Botan
  634. #
  635. # Unless --with-botan-config is given, we first try to find these config
  636. # scripts ourselves. Unfortunately, on some systems, these scripts do not
  637. # provide the correct implementation, so for each script found, we try
  638. # a compilation test (ACX_TRY_BOTAN_TOOL). If none are found, or none of
  639. # them work, we see if pkg-config is available. If so, we try the several
  640. # potential pkg-config .pc files. Again, on some systems, these can return
  641. # incorrect information as well, so the try-compile test is repeated for
  642. # each.
  643. #
  644. # If a working config script or pkgconfig file is found, we then munge its
  645. # output for use in our Makefiles, and to make sure it works, another header
  646. # and compilation test is done (this should also check whether we can compile
  647. # against botan should neither -config scripts nor pkgconfig data exist).
  648. #
  649. botan_config="yes"
  650. if test "${use_openssl}" != "auto" -a "${use_openssl}" != "no" ; then
  651. botan_config="no"
  652. fi
  653. AC_ARG_WITH([botan-config],
  654. AC_HELP_STRING([--with-botan-config=PATH],
  655. [specify the path to the botan-config script]),
  656. [botan_config="$withval"])
  657. if test "${botan_config}" = "no" ; then
  658. if test "${use_openssl}" = "no" ; then
  659. AC_MSG_ERROR([Need Botan or OpenSSL for libcryptolink])
  660. fi
  661. elif test "${botan_config}" != "yes" ; then
  662. if test -x "${botan_config}" ; then
  663. if test -d "${botan_config}" ; then
  664. AC_MSG_ERROR([${botan_config} is a directory])
  665. else
  666. BOTAN_CONFIG="${botan_config}"
  667. fi
  668. else
  669. AC_MSG_ERROR([--with-botan-config should point to a botan-config program and not a directory (${botan_config})])
  670. fi
  671. else
  672. BOTAN_CONFIG=""
  673. # first try several possible names of the config script
  674. # (botan-config-1.8 is there just in case, the official name change
  675. # came later)
  676. BOTAN_CONFIG_VERSIONS="botan-config-1.10 botan-config-1.9 botan-config-1.8 botan-config"
  677. for botan_config in $BOTAN_CONFIG_VERSIONS; do
  678. ACX_TRY_BOTAN_TOOL([$botan_config],,
  679. [ BOTAN_CONFIG="$botan_config" ]
  680. )
  681. if test "$BOTAN_CONFIG" != "" ; then
  682. break
  683. fi
  684. done
  685. if test "$BOTAN_CONFIG" = "" ; then
  686. AC_PATH_PROG([PKG_CONFIG], [pkg-config])
  687. if test "$PKG_CONFIG" != "" ; then
  688. # Ok so no script found, see if pkg-config knows of it.
  689. # Unfortunately, the botan.pc files also have their minor version
  690. # in their name, so we need to try them one by one
  691. BOTAN_VERSIONS="botan-1.10 botan-1.9 botan-1.8"
  692. for version in $BOTAN_VERSIONS; do
  693. ACX_TRY_BOTAN_TOOL([pkg-config], ["$version --silence-errors"],
  694. [ BOTAN_CONFIG="$PKG_CONFIG $version" ]
  695. )
  696. if test "$BOTAN_CONFIG" != "" ; then
  697. break
  698. fi
  699. done
  700. fi
  701. fi
  702. fi
  703. if test "x${BOTAN_CONFIG}" != "x"
  704. then
  705. CRYPTO_LIBS=`${BOTAN_CONFIG} --libs`
  706. CRYPTO_INCLUDES=`${BOTAN_CONFIG} --cflags`
  707. # We expect botan-config --libs to contain -L<path_to_libbotan>, but
  708. # this is not always the case. As a heuristics workaround we add
  709. # -L`botan-config --prefix/lib` in this case (if not present already).
  710. # Same for CRYPTO_INCLUDES (but using include instead of lib) below.
  711. if [ ${BOTAN_CONFIG} --prefix >/dev/null 2>&1 ] ; then
  712. echo ${CRYPTO_LIBS} | grep -- -L > /dev/null || \
  713. CRYPTO_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${CRYPTO_LIBS}"
  714. echo ${CRYPTO_INCLUDES} | grep -- -I > /dev/null || \
  715. CRYPTO_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${CRYPTO_INCLUDES}"
  716. fi
  717. fi
  718. if test "x${CRYPTO_LIBS}" != "x"
  719. then
  720. dnl Determine the Botan version
  721. AC_MSG_CHECKING([Botan version])
  722. cat > conftest.cpp << EOF
  723. #include <botan/version.h>
  724. AUTOCONF_BOTAN_VERSION=BOTAN_VERSION_MAJOR . BOTAN_VERSION_MINOR . BOTAN_VERSION_PATCH
  725. EOF
  726. CRYPTO_VERSION=`$CPP $CPPFLAGS $CRYPTO_INCLUDES conftest.cpp | grep '^AUTOCONF_BOTAN_VERSION=' | $SED -e 's/^AUTOCONF_BOTAN_VERSION=//' -e 's/[[ ]]//g' -e 's/"//g' 2> /dev/null`
  727. if test -z "$CRYPTO_VERSION"; then
  728. CRYPTO_VERSION="unknown"
  729. fi
  730. $RM -f conftest.cpp
  731. AC_MSG_RESULT([$CRYPTO_VERSION])
  732. # botan-config script (and the way we call pkg-config) returns -L and -l
  733. # as one string, but we need them in separate values
  734. CRYPTO_LDFLAGS=
  735. for flag in ${CRYPTO_LIBS}; do
  736. CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} `echo $flag | ${SED} -ne '/^\(\-L\)/p'`"
  737. CRYPTO_LIBS="${CRYPTO_LIBS} `echo $flag | ${SED} -ne '/^\(\-l\)/p'`"
  738. done
  739. # See crypto_rpath for some info on why we do this
  740. if test "x$ISC_RPATH_FLAG" != "x"; then
  741. CRYPTO_RPATH=
  742. for flag in ${CRYPTO_LIBS}; do
  743. CRYPTO_RPATH="${CRYPTO_RPATH} `echo $flag | ${SED} -ne "s/^\(\-L\)/${ISC_RPATH_FLAG}/p"`"
  744. done
  745. # According to the libtool manual, it should be sufficient if we
  746. # specify the "-R libdir" in our wrapper library of botan (no other
  747. # programs will need libbotan directly); "libdir" should be added to
  748. # the program's binary image. But we've seen in our build environments
  749. # that (some versions of?) libtool doesn't propagate -R as documented,
  750. # and it caused a linker error at run time. To work around this, we
  751. # also add the rpath to the global LDFLAGS.
  752. LDFLAGS="$CRYPTO_RPATH $LDFLAGS"
  753. fi
  754. # Even though chances are high we already performed a real compilation check
  755. # in the search for the right (pkg)config data, we try again here, to
  756. # be sure.
  757. CPPFLAGS_SAVED=$CPPFLAGS
  758. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  759. LIBS_SAVED="$LIBS"
  760. LIBS="$LIBS $CRYPTO_LIBS"
  761. # ac_header_preproc is an autoconf symbol (undocumented but stable) that
  762. # is set if the pre-processor phase passes. Thus by adding a custom
  763. # failure handler we can detect the difference between a header not existing
  764. # (or not even passing the pre-processor phase) and a header file resulting
  765. # in compilation failures.
  766. AC_CHECK_HEADERS([botan/botan.h],,[
  767. CRYPTO_INCLUDES=""
  768. CRYPTO_LIBS=""
  769. CRYPTO_LDFLAGS=""
  770. CRYPTO_RPATH=""
  771. if test "x$ac_header_preproc" = "xyes"; then
  772. AC_MSG_RESULT([
  773. botan/botan.h was found but is unusable. The most common cause of this problem
  774. is attempting to use an updated C++ compiler with older C++ libraries, such as
  775. the version of Botan that comes with your distribution. If you have updated
  776. your C++ compiler we highly recommend that you use support libraries such as
  777. Boost and Botan that were compiled with the same compiler version.])
  778. else
  779. AC_MSG_RESULT([Missing required header files.])
  780. fi]
  781. )
  782. CPPFLAGS=$CPPFLAGS_SAVED
  783. LIBS=$LIBS_SAVED
  784. fi
  785. if test "x${CRYPTO_LIBS}" != "x"
  786. then
  787. CPPFLAGS_SAVED=$CPPFLAGS
  788. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  789. LIBS_SAVED="$LIBS"
  790. LIBS="$LIBS $CRYPTO_LIBS"
  791. AC_LINK_IFELSE(
  792. [AC_LANG_PROGRAM([#include <botan/botan.h>
  793. #include <botan/hash.h>
  794. ],
  795. [using namespace Botan;
  796. LibraryInitializer::initialize();
  797. HashFunction *h = get_hash("MD5");
  798. ])],
  799. [AC_MSG_RESULT([checking for Botan library... yes])],
  800. [AC_MSG_RESULT([checking for Botan library... no])
  801. CRYPTO_INCLUDES=""
  802. CRYPTO_LIBS=""
  803. CRYPTO_LDFLAGS=""
  804. CRYPTO_RPATH=""
  805. AC_MSG_RESULT([Needs Botan library 1.8 or higher. On some systems,
  806. the botan package has a few missing dependencies (libbz2 and
  807. libgmp), if libbotan has been installed and you see this message,
  808. try upgrading to a higher version of botan or installing libbz2
  809. and libgmp.])]
  810. )
  811. CPPFLAGS=$CPPFLAGS_SAVED
  812. LIBS=$LIBS_SAVED
  813. fi
  814. if test "x${CRYPTO_LIBS}" != "x"
  815. then
  816. CRYPTO_NAME="Botan"
  817. DISABLED_CRYPTO="OpenSSL"
  818. CRYPTO_PACKAGE="botan-1.8"
  819. CRYPTO_CFLAGS=""
  820. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-botan=$botan_config"
  821. AC_DEFINE_UNQUOTED([WITH_BOTAN], [], [Compile with Botan crypto])
  822. else
  823. CRYPTO_NAME="OpenSSL"
  824. DISABLED_CRYPTO="Botan"
  825. CRYPTO_PACKAGE="openssl-1.0.0"
  826. AC_DEFINE_UNQUOTED([WITH_OPENSSL], [], [Compile with OpenSSL crypto])
  827. AC_MSG_CHECKING(for OpenSSL library)
  828. # from bind9
  829. if test "${use_openssl}" = "auto" ; then
  830. use_openssl="yes"
  831. fi
  832. if test "${use_openssl}" = "yes" ; then
  833. for d in /usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw; do
  834. if test -f $d/include/openssl/opensslv.h; then
  835. use_openssl=$d; break
  836. fi
  837. done
  838. fi
  839. if test "${use_openssl}" = "yes" ; then
  840. AC_MSG_ERROR([OpenSSL auto detection failed])
  841. fi
  842. if ! test -f "${use_openssl}"/include/openssl/opensslv.h ; then
  843. AC_MSG_ERROR([OpenSSL not found at ${use_openssl}])
  844. fi
  845. AC_MSG_RESULT(yes)
  846. if test "${use_openssl}" = "/usr" ; then
  847. CRYPTO_INCLUDES=""
  848. CRYPTO_LIBS="-lcrypto"
  849. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-openssl"
  850. case "$host" in
  851. *-apple-darwin*)
  852. # Starting with OSX 10.7 (Lion) OpenSSL is deprecated
  853. CRYPTO_CFLAGS="-Wno-deprecated-declarations"
  854. ;;
  855. *)
  856. CRYPTO_CFLAGS=""
  857. ;;
  858. esac
  859. else
  860. CRYPTO_CFLAGS=""
  861. CRYPTO_INCLUDES="-I${use_openssl}/include"
  862. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-openssl=${use_openssl}"
  863. case $host in
  864. *-solaris*)
  865. CRYPTO_LIBS="-L${use_openssl}/lib -R${use_openssl}/lib -lcrypto"
  866. ;;
  867. *-hp-hpux*)
  868. CRYPTO_LIBS="-L${use_openssl}/lib -Wl,+b: -lcrypto"
  869. ;;
  870. *-apple-darwin*)
  871. if test -f "${use_openssl}/lib/libcrypto.dylib" ; then
  872. CRYPTO_LIBS="-L${use_openssl}/lib -lcrypto"
  873. else
  874. CRYPTO_LIBS="${use_openssl}/lib/libcrypto.a"
  875. fi
  876. ;;
  877. *)
  878. CRYPTO_LIBS="-L${use_openssl}/lib -lcrypto"
  879. ;;
  880. esac
  881. fi
  882. dnl Determine the OpenSSL version
  883. AC_MSG_CHECKING([OpenSSL version])
  884. cat > conftest.cpp << EOF
  885. #include <openssl/opensslv.h>
  886. AUTOCONF_OPENSSL_VERSION=OPENSSL_VERSION_TEXT
  887. EOF
  888. CRYPTO_VERSION=`$CPP $CPPFLAGS $CRYPTO_INCLUDES conftest.cpp | grep '^AUTOCONF_OPENSSL_VERSION=' | $SED -e 's/^AUTOCONF_OPENSSL_VERSION=//' -e 's/"//g' 2> /dev/null`
  889. if test -z "$CRYPTO_VERSION" ; then
  890. CRYPTO_VERSION="unknown"
  891. fi
  892. $RM -f conftest.cpp
  893. AC_MSG_RESULT([$CRYPTO_VERSION])
  894. #CRYPTO_LDFLAGS="-ldl"
  895. CRYPTO_LDFLAGS=""
  896. CRYPTO_RPATH=""
  897. fi
  898. AM_CONDITIONAL(HAVE_BOTAN, test "$CRYPTO_NAME" = "Botan")
  899. AM_CONDITIONAL(HAVE_OPENSSL, test "$CRYPTO_NAME" = "OpenSSL")
  900. AC_SUBST(CRYPTO_INCLUDES)
  901. AC_SUBST(CRYPTO_CFLAGS)
  902. AC_SUBST(CRYPTO_LIBS)
  903. AC_SUBST(CRYPTO_LDFLAGS)
  904. AC_SUBST(CRYPTO_PACKAGE)
  905. AC_SUBST(CRYPTO_RPATH)
  906. AC_SUBST(DISTCHECK_CRYPTO_CONFIGURE_FLAG)
  907. # Check for MySql. The path to the mysql_config program is given with
  908. # the --with-mysql-config (default to /usr/bin/mysql-config). By default,
  909. # the software is not built with MySQL support enabled.
  910. mysql_config="no"
  911. AC_ARG_WITH([dhcp-mysql],
  912. AC_HELP_STRING([--with-dhcp-mysql=PATH],
  913. [path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
  914. [mysql_config="$withval"])
  915. if test "${mysql_config}" = "yes" ; then
  916. MYSQL_CONFIG="/usr/bin/mysql_config"
  917. elif test "${mysql_config}" != "no" ; then
  918. MYSQL_CONFIG="${withval}"
  919. fi
  920. if test "$MYSQL_CONFIG" != "" ; then
  921. if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
  922. AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
  923. fi
  924. MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
  925. MYSQL_LIBS=`$MYSQL_CONFIG --libs`
  926. MYSQL_VERSION=`$MYSQL_CONFIG --version`
  927. AC_SUBST(MYSQL_CPPFLAGS)
  928. AC_SUBST(MYSQL_LIBS)
  929. # Check that a simple program using MySQL functions can compile and link.
  930. CPPFLAGS_SAVED="$CPPFLAGS"
  931. LIBS_SAVED="$LIBS"
  932. CPPFLAGS="$MYSQL_CPPFLAGS $CPPFLAGS"
  933. LIBS="$MYSQL_LIBS $LIBS"
  934. AC_LINK_IFELSE(
  935. [AC_LANG_PROGRAM([#include <mysql.h>],
  936. [MYSQL mysql_handle;
  937. (void) mysql_init(&mysql_handle);
  938. ])],
  939. [AC_MSG_RESULT([checking for MySQL headers and library... yes])],
  940. [AC_MSG_RESULT([checking for MySQL headers and library... no])
  941. AC_MSG_ERROR([Needs MySQL library])]
  942. )
  943. CPPFLAGS=$CPPFLAGS_SAVED
  944. LIBS=$LIBS_SAVED
  945. # Note that MYSQL is present in the config.h file
  946. AC_DEFINE([HAVE_MYSQL], [1], [MySQL is present])
  947. fi
  948. # Solaris puts FIONREAD in filio.h
  949. AC_CHECK_HEADERS(sys/filio.h,,,)
  950. # ... and at the shell level, so Makefile.am can take action depending on this.
  951. AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
  952. pg_config="no"
  953. AC_ARG_WITH([dhcp-pgsql],
  954. AC_HELP_STRING([--with-dhcp-pgsql=PATH],
  955. [path to the PostgreSQL 'pg_config' script]),
  956. [pg_config="$withval"])
  957. if test "${pg_config}" = "yes" ; then
  958. PG_CONFIG="/usr/bin/pg_config"
  959. elif test "${pg_config}" != "no" ; then
  960. PG_CONFIG="${withval}"
  961. fi
  962. if test "$PG_CONFIG" != "" ; then
  963. if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
  964. AC_MSG_ERROR([--with-dhcp-pgsql should point to a pg_config program])
  965. fi
  966. PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
  967. PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir`
  968. PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server`
  969. PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$PGSQL_INCLUDEDIR -I$PGSQL_INCLUDEDIR_SERVER"
  970. PGSQL_LIBS=`$PG_CONFIG --libdir`
  971. PGSQL_LIBS="-L$PGSQL_LIBS -lpq"
  972. PGSQL_VERSION=`$PG_CONFIG --version`
  973. AC_SUBST(PGSQL_CPPFLAGS)
  974. AC_SUBST(PGSQL_LIBS)
  975. # Check that a simple program using PostgreSQL functions can compile and link.
  976. CPPFLAGS_SAVED="$CPPFLAGS"
  977. LIBS_SAVED="$LIBS"
  978. CPPFLAGS="$PGSQL_CPPFLAGS $CPPFLAGS"
  979. LIBS="$PGSQL_LIBS $LIBS"
  980. AC_LINK_IFELSE(
  981. [AC_LANG_PROGRAM([#include <libpq-fe.h>],
  982. [PGconn * c = PQconnectdb("dbname = 'postgres'");
  983. PQfinish(c);])],
  984. [AC_MSG_RESULT([checking for PostgreSQL headers and library... yes])],
  985. [AC_MSG_RESULT([checking for PostgreSQL headers and library... no])
  986. AC_MSG_ERROR([Needs PostgreSQL library])]
  987. )
  988. CPPFLAGS=$CPPFLAGS_SAVED
  989. LIBS=$LIBS_SAVED
  990. # Note that PostgreSQL is present in the config.h file
  991. AC_DEFINE([HAVE_PGSQL], [1], [PostgreSQL is present])
  992. fi
  993. # ... and at the shell level, so Makefile.am can take action depending on this.
  994. AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
  995. # Check for log4cplus
  996. log4cplus_path="yes"
  997. AC_ARG_WITH([log4cplus],
  998. AC_HELP_STRING([--with-log4cplus=PATH],
  999. [specify exact directory of log4cplus library and headers]),
  1000. [log4cplus_path="$withval"])
  1001. if test "${log4cplus_path}" = "no" ; then
  1002. AC_MSG_ERROR([Need log4cplus])
  1003. elif test "${log4cplus_path}" != "yes" ; then
  1004. LOG4CPLUS_INCLUDES="-I${log4cplus_path}/include"
  1005. LOG4CPLUS_LIBS="-L${log4cplus_path}/lib"
  1006. else
  1007. # If not specified, try some common paths.
  1008. log4cplusdirs="/usr/local /usr/pkg /opt /opt/local"
  1009. for d in $log4cplusdirs
  1010. do
  1011. if test -f $d/include/log4cplus/logger.h; then
  1012. LOG4CPLUS_INCLUDES="-I$d/include"
  1013. LOG4CPLUS_LIBS="-L$d/lib"
  1014. break
  1015. fi
  1016. done
  1017. fi
  1018. LOG4CPLUS_LIBS="$LOG4CPLUS_LIBS -llog4cplus $MULTITHREADING_FLAG"
  1019. AC_SUBST(LOG4CPLUS_LIBS)
  1020. AC_SUBST(LOG4CPLUS_INCLUDES)
  1021. CPPFLAGS_SAVED=$CPPFLAGS
  1022. CPPFLAGS="$LOG4CPLUS_INCLUDES $CPPFLAGS"
  1023. LIBS_SAVED="$LIBS"
  1024. LIBS="$LOG4CPLUS_LIBS $LIBS"
  1025. AC_CHECK_HEADERS([log4cplus/logger.h],,AC_MSG_ERROR([Missing required header files.]))
  1026. AC_LINK_IFELSE(
  1027. [AC_LANG_PROGRAM([#include <log4cplus/logger.h>
  1028. ],
  1029. [using namespace log4cplus;
  1030. Logger logger = Logger::getInstance("main");
  1031. ])],
  1032. [AC_MSG_RESULT([checking for log4cplus library... yes])],
  1033. [AC_MSG_RESULT([checking for log4cplus library... no])
  1034. AC_MSG_ERROR([Needs log4cplus library])]
  1035. )
  1036. dnl Determine the log4cplus version, used mainly for config.report.
  1037. AC_MSG_CHECKING([log4cplus version])
  1038. cat > conftest.cpp << EOF
  1039. #include <log4cplus/version.h>
  1040. AUTOCONF_LOG4CPLUS_VERSION=LOG4CPLUS_VERSION_STR
  1041. EOF
  1042. LOG4CPLUS_VERSION=`$CPP $CPPFLAGS conftest.cpp | grep '^AUTOCONF_LOG4CPLUS_VERSION=' | $SED -e 's/^AUTOCONF_LOG4CPLUS_VERSION=//' -e 's/[[ ]]//g' -e 's/"//g' 2> /dev/null`
  1043. if test -z "$LOG4CPLUS_VERSION"; then
  1044. LOG4CPLUS_VERSION="unknown"
  1045. fi
  1046. $RM -f conftest.cpp
  1047. AC_MSG_RESULT([$LOG4CPLUS_VERSION])
  1048. CPPFLAGS=$CPPFLAGS_SAVED
  1049. LIBS=$LIBS_SAVED
  1050. #
  1051. # Configure Boost header path
  1052. #
  1053. AX_BOOST_FOR_BIND10
  1054. # Boost offset_ptr is required in one library and not optional right now, so
  1055. # we unconditionally fail here if it doesn't work.
  1056. if test "$BOOST_OFFSET_PTR_WOULDFAIL" = "yes" -a "$werror_ok" = 1; then
  1057. AC_MSG_ERROR([Failed to compile a required header file. Try upgrading Boost to 1.44 or higher (when using clang++) or specifying --without-werror. See the ChangeLog entry for Trac no. 2147 for more details.])
  1058. fi
  1059. if test "$BOOST_STATIC_ASSERT_WOULDFAIL" = "yes" -a X"$werror_ok" = X1; then
  1060. AC_MSG_ERROR([Failed to use Boost static assertions. Try upgrading Boost to 1.54 or higher (when using GCC 4.8) or specifying --without-werror. See trac ticket no. 3039 for more details.])
  1061. fi
  1062. # There's a known bug in FreeBSD ports for Boost that would trigger a false
  1063. # warning in build with g++ and -Werror (we exclude clang++ explicitly to
  1064. # avoid unexpected false positives).
  1065. if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes" -a X"$werror_ok" = X1 -a $CLANGPP = "no"; then
  1066. AC_MSG_ERROR([Failed to compile a required header file. If you are using FreeBSD and Boost installed via ports, retry with specifying --without-werror. See the ChangeLog entry for Trac no. 1991 for more details.])
  1067. fi
  1068. use_shared_memory=yes
  1069. AC_ARG_WITH(shared-memory,
  1070. AC_HELP_STRING([--with-shared-memory],
  1071. [Build with Boost shared memory support; for large scale authoritative DNS servers]),
  1072. [use_shared_memory=$withval])
  1073. if test X$use_shared_memory = Xyes -a "$BOOST_MAPPED_FILE_WOULDFAIL" = "yes" -a "$want_dns" = "yes"; then
  1074. AC_MSG_ERROR([Boost shared memory does not compile on this system. If you don't need it (most normal users won't) build without it by rerunning this script with --without-shared-memory; using a different compiler or a different version of Boost may also help.])
  1075. fi
  1076. AM_CONDITIONAL([USE_SHARED_MEMORY], [test x$use_shared_memory = xyes])
  1077. if test "x$use_shared_memory" = "xyes"; then
  1078. AC_DEFINE(USE_SHARED_MEMORY, 1, [Define to 1 if shared memory support is enabled])
  1079. fi
  1080. AC_SUBST(BOOST_MAPPED_FILE_CXXFLAG)
  1081. if test "$BOOST_OFFSET_PTR_OLD" = "yes" -a "$use_shared_memory" = "yes" -a "$want_dns" = "yes"; then
  1082. AC_MSG_ERROR([You're trying to compile against boost older than 1.48 with
  1083. shared memory. Older versions of boost have a bug which causes segfaults in
  1084. offset_ptr implementation when compiled by GCC with optimisations enabled.
  1085. See ticket no. 3025 for details.
  1086. Either update boost to newer version or use --without-shared-memory.
  1087. Note that most users likely don't need shared memory support.
  1088. ])
  1089. fi
  1090. # Add some default CPP flags needed for Boost, identified by the AX macro.
  1091. CPPFLAGS="$CPPFLAGS $CPPFLAGS_BOOST_THREADCONF"
  1092. # I can't get some of the #include <asio.hpp> right without this
  1093. # TODO: find the real cause of asio/boost wanting pthreads
  1094. # (this currently only occurs for src/lib/cc/session_unittests)
  1095. PTHREAD_LDFLAGS=
  1096. AC_CHECK_LIB(pthread, pthread_create,[ PTHREAD_LDFLAGS=-lpthread ], [])
  1097. AC_SUBST(PTHREAD_LDFLAGS)
  1098. AC_SUBST(MULTITHREADING_FLAG)
  1099. #
  1100. # Check availability of gtest, which will be used for unit tests.
  1101. #
  1102. GTEST_LDFLAGS=
  1103. GTEST_LDADD=
  1104. DISTCHECK_GTEST_CONFIGURE_FLAG=
  1105. GTEST_VERSION="unknown"
  1106. if test "x$enable_gtest" = "xyes" ; then
  1107. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=$gtest_path"
  1108. if test -n "$with_gtest_source" ; then
  1109. if test "x$GTEST_SOURCE" = "xyes" ; then
  1110. AC_MSG_CHECKING([for gtest source])
  1111. # If not specified, try some common paths.
  1112. GTEST_SOURCE=
  1113. for d in /usr/src/gtest /usr/local /usr/pkg /opt /opt/local ; do
  1114. if test -f $d/src/gtest-all.cc -a $d/src/gtest_main.cc; then
  1115. GTEST_SOURCE=$d
  1116. AC_MSG_RESULT([$GTEST_SOURCE])
  1117. break
  1118. fi
  1119. done
  1120. if test -z $GTEST_SOURCE ; then
  1121. AC_MSG_ERROR([no gtest source but it was selected])
  1122. fi
  1123. else
  1124. AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
  1125. [$GTEST_SOURCE/src/gtest_main.cc],
  1126. [have_gtest_source=yes],
  1127. [AC_MSG_ERROR([no gtest source at $GTEST_SOURCE])])
  1128. fi
  1129. have_gtest_source=yes
  1130. GTEST_LDFLAGS="\$(top_builddir)/libgtest.a"
  1131. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest-source=$GTEST_SOURCE"
  1132. GTEST_INCLUDES="-I$GTEST_SOURCE -I$GTEST_SOURCE/include"
  1133. # See $GTEST_SOURCE/include/gtest/internal/gtest-port.h
  1134. # about GTEST_HAS_PTHREAD.
  1135. case "$host" in
  1136. *-solaris*|*-linux*|*-hpux*)
  1137. GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
  1138. ;;
  1139. esac
  1140. fi
  1141. if test "$gtest_path" != "no" ; then
  1142. if test "$gtest_path" != "yes"; then
  1143. GTEST_PATHS=$gtest_path
  1144. if test -x "${gtest_path}/bin/gtest-config" ; then
  1145. GTEST_CONFIG="${gtest_path}/bin/gtest-config"
  1146. fi
  1147. else
  1148. AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
  1149. fi
  1150. if test -x "${GTEST_CONFIG}" ; then :
  1151. # using cppflags instead of cxxflags
  1152. GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
  1153. GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
  1154. GTEST_LDADD=`${GTEST_CONFIG} --libs`
  1155. GTEST_VERSION=`${GTEST_CONFIG} --version`
  1156. GTEST_FOUND="true"
  1157. else
  1158. AC_MSG_WARN([Unable to locate Google Test gtest-config.])
  1159. if test -z "${GTEST_PATHS}" ; then
  1160. GTEST_PATHS="/usr /usr/local"
  1161. fi
  1162. GTEST_FOUND="false"
  1163. fi
  1164. if test "${GTEST_FOUND}" != "true"; then
  1165. GTEST_FOUND="false"
  1166. for dir in $GTEST_PATHS; do
  1167. if test -f "$dir/include/gtest/gtest.h"; then
  1168. GTEST_INCLUDES="-I$dir/include"
  1169. GTEST_LDFLAGS="-L$dir/lib"
  1170. GTEST_LDADD="-lgtest"
  1171. GTEST_FOUND="true"
  1172. # There is no gtest-config script on this
  1173. # system, which is supposed to inform us
  1174. # whether we need pthreads as well (a
  1175. # gtest compile-time option). So we still
  1176. # need to test that manually.
  1177. CPPFLAGS_SAVED="$CPPFLAGS"
  1178. CPPFLAGS="$CPPFLAGS $GTEST_INCLUDES"
  1179. LDFLAGS_SAVED="$LDFLAGS"
  1180. LDFLAGS="$LDFLAGS $GTEST_LDFLAGS"
  1181. LIBS_SAVED=$LIBS
  1182. LIBS="$LIBS $GTEST_LDADD"
  1183. AC_MSG_CHECKING([Checking whether gtest tests need pthreads])
  1184. # First try to compile without pthreads
  1185. AC_TRY_LINK([
  1186. #include <gtest/gtest.h>
  1187. ],[
  1188. int i = 0;
  1189. char* c = NULL;
  1190. ::testing::InitGoogleTest(&i, &c);
  1191. return (0);
  1192. ],
  1193. [ AC_MSG_RESULT(no) ],
  1194. [
  1195. LIBS="$SAVED_LIBS $GTEST_LDADD $PTHREAD_LDFLAGS"
  1196. # Now try to compile with pthreads
  1197. AC_TRY_LINK([
  1198. #include <gtest/gtest.h>
  1199. ],[
  1200. int i = 0;
  1201. char* c = NULL;
  1202. ::testing::InitGoogleTest(&i, &c);
  1203. return (0);
  1204. ],
  1205. [ AC_MSG_RESULT(yes)
  1206. GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
  1207. ],
  1208. # Apparently we can't compile it at all
  1209. [ AC_MSG_ERROR(unable to compile with gtest) ])
  1210. ])
  1211. CPPFLAGS=$CPPFLAGS_SAVED
  1212. LDFLAGS=$LDFLAGS_SAVED
  1213. LIBS=$LIBS_SAVED
  1214. break
  1215. fi
  1216. done
  1217. fi
  1218. if test "${GTEST_FOUND}" != "true"; then
  1219. AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
  1220. fi
  1221. fi
  1222. fi
  1223. AM_CONDITIONAL(HAVE_GTEST, test $enable_gtest != "no")
  1224. AM_CONDITIONAL(HAVE_GTEST_SOURCE, test "X$have_gtest_source" = "Xyes")
  1225. AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG)
  1226. AC_SUBST(GTEST_INCLUDES)
  1227. AC_SUBST(GTEST_LDFLAGS)
  1228. AC_SUBST(GTEST_LDADD)
  1229. AC_SUBST(GTEST_SOURCE)
  1230. dnl check for pkg-config itself
  1231. AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes, no)
  1232. if test "x$HAVE_PKG_CONFIG" = "xno" ; then
  1233. AC_MSG_ERROR(Please install pkg-config)
  1234. fi
  1235. AX_SQLITE3_FOR_BIND10
  1236. if test "x$have_sqlite" = "xyes" ; then
  1237. enable_features="$enable_features SQLite3"
  1238. AX_PYTHON_SQLITE3
  1239. fi
  1240. #
  1241. # ASIO: we extensively use it as the C++ event management module.
  1242. #
  1243. # Use local ASIO headers from ext
  1244. #
  1245. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/asio"
  1246. #
  1247. # Use our 'coroutine' header from ext
  1248. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
  1249. #
  1250. # Disable threads: Currently we don't use them.
  1251. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_THREADS=1"
  1252. # Check for functions that are not available on all platforms
  1253. AC_CHECK_FUNCS([pselect])
  1254. # /dev/poll issue: ASIO uses /dev/poll by default if it's available (generally
  1255. # the case with Solaris). Unfortunately its /dev/poll specific code would
  1256. # trigger the gcc's "missing-field-initializers" warning, which would
  1257. # subsequently make the build fail with -Werror. Further, older versions of
  1258. # gcc don't provide an option to selectively suppress this warning.
  1259. # So, for the moment, we simply disable the use of /dev/poll. Unless we
  1260. # implement recursive DNS server with randomized ports, we don't need the
  1261. # scalability that /dev/poll can provide, so this decision wouldn't affect
  1262. # run time performance. Hopefully we can find a better solution or the ASIO
  1263. # code will be updated by the time we really need it.
  1264. AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
  1265. if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
  1266. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_DEV_POLL=1"
  1267. fi
  1268. #
  1269. # Perl is optional; it is used only by some of the system test scripts.
  1270. #
  1271. AC_PATH_PROGS(PERL, perl5 perl)
  1272. AC_SUBST(PERL)
  1273. AC_PATH_PROGS(AWK, gawk awk)
  1274. AC_SUBST(AWK)
  1275. # Kea configuration backend section
  1276. # Currently there are 2 backends available: BUNDY and JSON
  1277. # It is possible that we may extend this to accept additional backends.
  1278. AC_ARG_WITH(kea-config,
  1279. AC_HELP_STRING([--with-kea-config],
  1280. [Selects configuration backend; currently available options are: BUNDY (default,
  1281. Kea reads configuration and commands from Bundy framework) or JSON (Kea reads
  1282. configuration from a JSON file from disk)]),
  1283. [CONFIG_BACKEND="$withval"],
  1284. [CONFIG_BACKEND=BUNDY])
  1285. AM_CONDITIONAL(CONFIG_BACKEND_BUNDY, test "x$CONFIG_BACKEND" = "xBUNDY")
  1286. AM_CONDITIONAL(CONFIG_BACKEND_JSON, test "x$CONFIG_BACKEND" = "xJSON")
  1287. if test "x$CONFIG_BACKEND" = "xBUNDY"; then
  1288. AC_DEFINE(CONFIG_BACKEND_BUNDY, 1, [Define to 1 if Kea config was set to BUNDY])
  1289. fi
  1290. if test "x$CONFIG_BACKEND" = "xJSON"; then
  1291. AC_DEFINE(CONFIG_BACKEND_JSON, 1, [Define to 1 if Kea config was set to JSON])
  1292. fi
  1293. # Let's sanity check if the specified backend value is allowed
  1294. if test "x$CONFIG_BACKEND" != "xBUNDY" && test "x$CONFIG_BACKEND" != "xJSON"; then
  1295. AC_MSG_ERROR("Invalid configuration backend specified: $CONFIG_BACKEND. The only supported are: BUNDY JSON")
  1296. fi
  1297. AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
  1298. [regenerate documentation using Docbook [default=no]])],
  1299. enable_generate_docs=$enableval, enable_generate_docs=no)
  1300. # Check for xsltproc
  1301. if test "x$enable_generate_docs" != xno ; then
  1302. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1303. if test -z "$XSLTPROC"; then
  1304. AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
  1305. else
  1306. AC_MSG_CHECKING([if $XSLTPROC works])
  1307. # run xsltproc to see if works
  1308. $XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
  1309. if test $? -ne 0 ; then
  1310. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
  1311. fi
  1312. $XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
  1313. if test $? -ne 0 ; then
  1314. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
  1315. fi
  1316. AC_MSG_RESULT(yes)
  1317. fi
  1318. AC_PATH_PROG([ELINKS], [elinks])
  1319. if test -z "$ELINKS"; then
  1320. AC_MSG_ERROR("elinks not found; it is required for --enable-generate-docs")
  1321. fi
  1322. fi
  1323. AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
  1324. AC_ARG_ENABLE(install-configurations,
  1325. [AC_HELP_STRING([--disable-install-configurations],
  1326. [do not install configuration])], install_configurations=$enableval, install_configurations=yes)
  1327. AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue)
  1328. AC_ARG_ENABLE(logger-checks, [AC_HELP_STRING([--enable-logger-checks],
  1329. [check logger messages [default=no]])], enable_logger_checks=$enableval, enable_logger_checks=no)
  1330. AM_CONDITIONAL(ENABLE_LOGGER_CHECKS, test x$enable_logger_checks != xno)
  1331. AM_COND_IF([ENABLE_LOGGER_CHECKS], [AC_DEFINE([ENABLE_LOGGER_CHECKS], [1], [Check logger messages?])])
  1332. # Check for asciidoc
  1333. AC_PATH_PROG(ASCIIDOC, asciidoc, no)
  1334. AM_CONDITIONAL(HAVE_ASCIIDOC, test "x$ASCIIDOC" != "xno")
  1335. # Check for plantuml
  1336. AC_PATH_PROG(PLANTUML, plantuml, no)
  1337. AM_CONDITIONAL(HAVE_PLANTUML, test "x$PLANTUML" != "xno")
  1338. # Check for valgrind
  1339. AC_PATH_PROG(VALGRIND, valgrind, no)
  1340. AM_CONDITIONAL(HAVE_VALGRIND, test "x$VALGRIND" != "xno")
  1341. # Also check for valgrind headers
  1342. # We could consider adding them to the source code tree, as this
  1343. # is the encouraged method of using them; they are BSD-licensed.
  1344. # However, until we find that this is a problem, we just use
  1345. # the system-provided ones, if available
  1346. AC_CHECK_HEADERS(valgrind/valgrind.h, [AC_DEFINE([HAVE_VALGRIND_HEADERS], [1], [Check valgrind headers])])
  1347. found_valgrind="not found"
  1348. if test "x$VALGRIND" != "xno"; then
  1349. found_valgrind="found"
  1350. fi
  1351. # Check for optreset in unistd.h. On BSD systems the optreset is
  1352. # used to reset the state of getopt() function. Resetting its state
  1353. # is required if command line arguments are parsed multiple times
  1354. # during a program. On Linux this variable will not exist because
  1355. # getopt() reset is performed by setting optind = 0. On Operating
  1356. # Systems where optreset is defined use optreset = 1 and optind = 1
  1357. # to reset internal state of getopt(). Failing to do so will result
  1358. # in unpredictable output from getopt().
  1359. AC_MSG_CHECKING([whether optreset variable is defined in unistd.h])
  1360. AC_TRY_LINK(
  1361. [#include <unistd.h>],
  1362. [extern int optreset; optreset=1;],
  1363. [ AC_MSG_RESULT(yes)
  1364. var_optreset_exists=yes],
  1365. [ AC_MSG_RESULT(no)
  1366. var_optreset_exists=no]
  1367. )
  1368. AM_CONDITIONAL(HAVE_OPTRESET, test "x$var_optreset_exists" != "xno")
  1369. AM_COND_IF([HAVE_OPTRESET], [AC_DEFINE([HAVE_OPTRESET], [1], [Check for optreset?])])
  1370. AC_CONFIG_FILES([compatcheck/Makefile
  1371. dns++.pc
  1372. doc/design/datasrc/Makefile
  1373. doc/design/Makefile
  1374. doc/guide/Makefile
  1375. doc/Makefile
  1376. doc/version.ent
  1377. ext/asio/asio/Makefile
  1378. ext/asio/Makefile
  1379. ext/Makefile
  1380. m4macros/Makefile
  1381. Makefile
  1382. src/bin/bind10/bind10
  1383. src/bin/bind10/init.py
  1384. src/bin/bind10/Makefile
  1385. src/bin/bind10/run_bind10.sh
  1386. src/bin/bind10/tests/init_test.py
  1387. src/bin/bind10/tests/Makefile
  1388. src/bin/bindctl/bindctl_main.py
  1389. src/bin/bindctl/Makefile
  1390. src/bin/bindctl/run_bindctl.sh
  1391. src/bin/bindctl/tests/bindctl_test
  1392. src/bin/bindctl/tests/Makefile
  1393. src/bin/cfgmgr/b10-cfgmgr.py
  1394. src/bin/cfgmgr/local_plugins/Makefile
  1395. src/bin/cfgmgr/Makefile
  1396. src/bin/cfgmgr/plugins/datasrc.spec.pre
  1397. src/bin/cfgmgr/plugins/Makefile
  1398. src/bin/cfgmgr/plugins/tests/Makefile
  1399. src/bin/cfgmgr/tests/b10-cfgmgr_test.py
  1400. src/bin/cfgmgr/tests/Makefile
  1401. src/bin/cmdctl/cmdctl.py
  1402. src/bin/cmdctl/cmdctl.spec.pre
  1403. src/bin/cmdctl/Makefile
  1404. src/bin/cmdctl/run_b10-cmdctl.sh
  1405. src/bin/cmdctl/tests/cmdctl_test
  1406. src/bin/cmdctl/tests/Makefile
  1407. src/bin/d2/Makefile
  1408. src/bin/d2/spec_config.h.pre
  1409. src/bin/d2/tests/Makefile
  1410. src/bin/d2/tests/d2_process_tests.sh
  1411. src/bin/d2/tests/test_data_files_config.h
  1412. src/bin/dhcp4/Makefile
  1413. src/bin/dhcp4/spec_config.h.pre
  1414. src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1415. src/bin/dhcp4/tests/Makefile
  1416. src/bin/dhcp4/tests/marker_file.h
  1417. src/bin/dhcp4/tests/test_data_files_config.h
  1418. src/bin/dhcp4/tests/test_libraries.h
  1419. src/bin/dhcp6/Makefile
  1420. src/bin/dhcp6/spec_config.h.pre
  1421. src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1422. src/bin/dhcp6/tests/Makefile
  1423. src/bin/dhcp6/tests/marker_file.h
  1424. src/bin/dhcp6/tests/test_data_files_config.h
  1425. src/bin/dhcp6/tests/test_libraries.h
  1426. src/bin/keactrl/keactrl
  1427. src/bin/keactrl/kea.conf
  1428. src/bin/keactrl/keactrl.conf
  1429. src/bin/keactrl/Makefile
  1430. src/bin/keactrl/tests/keactrl_tests.sh
  1431. src/bin/keactrl/tests/Makefile
  1432. src/bin/Makefile
  1433. src/bin/msgq/Makefile
  1434. src/bin/msgq/msgq.py
  1435. src/bin/msgq/run_msgq.sh
  1436. src/bin/msgq/tests/Makefile
  1437. src/bin/sockcreator/Makefile
  1438. src/bin/sockcreator/tests/Makefile
  1439. src/bin/stats/Makefile
  1440. src/bin/stats/stats_httpd.py
  1441. src/bin/stats/stats.py
  1442. src/bin/stats/tests/Makefile
  1443. src/bin/stats/tests/testdata/Makefile
  1444. src/bin/sysinfo/Makefile
  1445. src/bin/sysinfo/run_sysinfo.sh
  1446. src/bin/sysinfo/sysinfo.py
  1447. src/bin/tests/Makefile
  1448. src/bin/tests/process_rename_test.py
  1449. src/bin/usermgr/b10-cmdctl-usermgr.py
  1450. src/bin/usermgr/Makefile
  1451. src/bin/usermgr/run_b10-cmdctl-usermgr.sh
  1452. src/bin/usermgr/tests/Makefile
  1453. src/hooks/dhcp/Makefile
  1454. src/hooks/dhcp/user_chk/Makefile
  1455. src/hooks/dhcp/user_chk/tests/Makefile
  1456. src/hooks/dhcp/user_chk/tests/test_data_files_config.h
  1457. src/hooks/Makefile
  1458. src/lib/asiodns/Makefile
  1459. src/lib/asiodns/tests/Makefile
  1460. src/lib/asiolink/Makefile
  1461. src/lib/asiolink/tests/Makefile
  1462. src/lib/cc/Makefile
  1463. src/lib/cc/session_config.h.pre
  1464. src/lib/cc/tests/Makefile
  1465. src/lib/cc/tests/session_unittests_config.h
  1466. src/lib/config/Makefile
  1467. src/lib/config/tests/data_def_unittests_config.h
  1468. src/lib/config/tests/Makefile
  1469. src/lib/config/tests/testdata/Makefile
  1470. src/lib/cryptolink/Makefile
  1471. src/lib/cryptolink/tests/Makefile
  1472. src/lib/dhcp_ddns/Makefile
  1473. src/lib/dhcp_ddns/tests/Makefile
  1474. src/lib/dhcp/Makefile
  1475. src/lib/dhcpsrv/Makefile
  1476. src/lib/dhcpsrv/testutils/Makefile
  1477. src/lib/dhcpsrv/tests/Makefile
  1478. src/lib/dhcpsrv/tests/test_libraries.h
  1479. src/lib/dhcp/tests/Makefile
  1480. src/lib/dns/gen-rdatacode.py
  1481. src/lib/dns/Makefile
  1482. src/lib/dns/python/Makefile
  1483. src/lib/dns/python/pydnspp_config.h
  1484. src/lib/dns/python/tests/Makefile
  1485. src/lib/dns/tests/Makefile
  1486. src/lib/dns/tests/testdata/Makefile
  1487. src/lib/exceptions/Makefile
  1488. src/lib/exceptions/tests/Makefile
  1489. src/lib/hooks/Makefile
  1490. src/lib/hooks/tests/Makefile
  1491. src/lib/hooks/tests/marker_file.h
  1492. src/lib/hooks/tests/test_libraries.h
  1493. src/lib/log/compiler/Makefile
  1494. src/lib/log/interprocess/Makefile
  1495. src/lib/log/interprocess/tests/Makefile
  1496. src/lib/log/Makefile
  1497. src/lib/log/tests/buffer_logger_test.sh
  1498. src/lib/log/tests/console_test.sh
  1499. src/lib/log/tests/destination_test.sh
  1500. src/lib/log/tests/init_logger_test.sh
  1501. src/lib/log/tests/local_file_test.sh
  1502. src/lib/log/tests/logger_lock_test.sh
  1503. src/lib/log/tests/Makefile
  1504. src/lib/log/tests/severity_test.sh
  1505. src/lib/log/tests/tempdir.h
  1506. src/lib/Makefile
  1507. src/lib/python/bind10_config.py
  1508. src/lib/python/isc/bind10/Makefile
  1509. src/lib/python/isc/bind10/tests/Makefile
  1510. src/lib/python/isc/cc/cc_generated/Makefile
  1511. src/lib/python/isc/cc/Makefile
  1512. src/lib/python/isc/cc/tests/cc_test
  1513. src/lib/python/isc/cc/tests/Makefile
  1514. src/lib/python/isc/config/Makefile
  1515. src/lib/python/isc/config/tests/config_test
  1516. src/lib/python/isc/config/tests/Makefile
  1517. src/lib/python/isc/dns/Makefile
  1518. src/lib/python/isc/log/Makefile
  1519. src/lib/python/isc/log_messages/Makefile
  1520. src/lib/python/isc/log_messages/work/__init__.py
  1521. src/lib/python/isc/log_messages/work/Makefile
  1522. src/lib/python/isc/log/tests/log_console.py
  1523. src/lib/python/isc/log/tests/Makefile
  1524. src/lib/python/isc/Makefile
  1525. src/lib/python/isc/net/Makefile
  1526. src/lib/python/isc/net/tests/Makefile
  1527. src/lib/python/isc/sysinfo/Makefile
  1528. src/lib/python/isc/sysinfo/tests/Makefile
  1529. src/lib/python/isc/testutils/Makefile
  1530. src/lib/python/isc/util/cio/Makefile
  1531. src/lib/python/isc/util/cio/tests/Makefile
  1532. src/lib/python/isc/util/Makefile
  1533. src/lib/python/isc/util/tests/Makefile
  1534. src/lib/python/Makefile
  1535. src/lib/testutils/dhcp_test_lib.sh
  1536. src/lib/testutils/Makefile
  1537. src/lib/testutils/testdata/Makefile
  1538. src/lib/util/io/Makefile
  1539. src/lib/util/Makefile
  1540. src/lib/util/python/doxygen2pydoc.py
  1541. src/lib/util/python/gen_wiredata.py
  1542. src/lib/util/python/Makefile
  1543. src/lib/util/python/mkpywrapper.py
  1544. src/lib/util/pyunittests/Makefile
  1545. src/lib/util/tests/Makefile
  1546. src/lib/util/threads/Makefile
  1547. src/lib/util/threads/tests/Makefile
  1548. src/lib/util/unittests/Makefile
  1549. src/Makefile
  1550. tests/Makefile
  1551. tests/tools/Makefile
  1552. tests/tools/perfdhcp/Makefile
  1553. tests/tools/perfdhcp/tests/Makefile
  1554. tests/tools/perfdhcp/tests/testdata/Makefile
  1555. ])
  1556. AC_CONFIG_COMMANDS([permissions], [
  1557. chmod +x src/bin/bind10/bind10
  1558. chmod +x src/bin/bind10/run_bind10.sh
  1559. chmod +x src/bin/bindctl/run_bindctl.sh
  1560. chmod +x src/bin/bindctl/tests/bindctl_test
  1561. chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
  1562. chmod +x src/bin/cmdctl/tests/cmdctl_test
  1563. chmod +x src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1564. chmod +x src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1565. chmod +x src/bin/keactrl/keactrl
  1566. chmod +x src/bin/keactrl/tests/keactrl_tests.sh
  1567. chmod +x src/bin/msgq/run_msgq.sh
  1568. chmod +x src/bin/sysinfo/run_sysinfo.sh
  1569. chmod +x src/bin/usermgr/run_b10-cmdctl-usermgr.sh
  1570. chmod +x src/lib/dns/gen-rdatacode.py
  1571. chmod +x src/lib/log/tests/console_test.sh
  1572. chmod +x src/lib/log/tests/destination_test.sh
  1573. chmod +x src/lib/log/tests/init_logger_test.sh
  1574. chmod +x src/lib/log/tests/local_file_test.sh
  1575. chmod +x src/lib/log/tests/logger_lock_test.sh
  1576. chmod +x src/lib/log/tests/severity_test.sh
  1577. chmod +x src/lib/python/isc/log/tests/log_console.py
  1578. chmod +x src/lib/util/python/doxygen2pydoc.py
  1579. chmod +x src/lib/util/python/gen_wiredata.py
  1580. chmod +x src/lib/util/python/mkpywrapper.py
  1581. ])
  1582. AC_OUTPUT
  1583. dnl Print the results
  1584. dnl
  1585. cat > config.report << END
  1586. Kea source configure results:
  1587. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1588. Package:
  1589. Name: ${PACKAGE_NAME}
  1590. Version: ${PACKAGE_VERSION}
  1591. OS Family: ${OS_TYPE}
  1592. Using GNU sed: ${GNU_SED}
  1593. C++ Compiler:
  1594. CXX: ${CXX}
  1595. CXX_VERSION: ${CXX_VERSION}
  1596. DEFS: ${DEFS}
  1597. CPPFLAGS: ${CPPFLAGS}
  1598. CXXFLAGS: ${CXXFLAGS}
  1599. LDFLAGS: ${LDFLAGS}
  1600. B10_CXXFLAGS: ${B10_CXXFLAGS}
  1601. Python:
  1602. PYTHON_VERSION: ${PYTHON_VERSION}
  1603. PYTHON_INCLUDES: ${PYTHON_INCLUDES}
  1604. PYTHON_CXXFLAGS: ${PYTHON_CXXFLAGS}
  1605. PYTHON_LDFLAGS: ${PYTHON_LDFLAGS}
  1606. PYTHON_LIB: ${PYTHON_LIB}
  1607. Boost:
  1608. BOOST_VERSION: ${BOOST_VERSION}
  1609. BOOST_INCLUDES: ${BOOST_INCLUDES}
  1610. ${CRYPTO_NAME}:
  1611. CRYPTO_VERSION: ${CRYPTO_VERSION}
  1612. CRYPTO_CFLAGS: ${CRYPTO_CFLAGS}
  1613. CRYPTO_INCLUDES: ${CRYPTO_INCLUDES}
  1614. CRYPTO_LDFLAGS: ${CRYPTO_LDFLAGS}
  1615. CRYPTO_LIBS: ${CRYPTO_LIBS}
  1616. ${DISABLED_CRYPTO}: no
  1617. Log4cplus:
  1618. LOG4CPLUS_VERSION: ${LOG4CPLUS_VERSION}
  1619. LOG4CPLUS_INCLUDES: ${LOG4CPLUS_INCLUDES}
  1620. LOG4CPLUS_LIBS: ${LOG4CPLUS_LIBS}
  1621. SQLite:
  1622. SQLITE_VERSION: ${SQLITE_VERSION}
  1623. SQLITE_CFLAGS: ${SQLITE_CFLAGS}
  1624. SQLITE_LIBS: ${SQLITE_LIBS}
  1625. Kea config backend:
  1626. CONFIG_BACKEND: ${CONFIG_BACKEND}
  1627. END
  1628. # Avoid confusion on DNS/DHCP and only mention MySQL if it
  1629. # were specified on the command line.
  1630. if test "$MYSQL_CPPFLAGS" != "" ; then
  1631. cat >> config.report << END
  1632. MySQL:
  1633. MYSQL_VERSION: ${MYSQL_VERSION}
  1634. MYSQL_CPPFLAGS: ${MYSQL_CPPFLAGS}
  1635. MYSQL_LIBS: ${MYSQL_LIBS}
  1636. END
  1637. else
  1638. cat >> config.report << END
  1639. MySQL: no
  1640. END
  1641. fi
  1642. if test "$PGSQL_CPPFLAGS" != "" ; then
  1643. cat >> config.report << END
  1644. PostgreSQL:
  1645. PGSQL_VERSION: ${PGSQL_VERSION}
  1646. PGSQL_CPPFLAGS: ${PGSQL_CPPFLAGS}
  1647. PGSQL_LIBS: ${PGSQL_LIBS}
  1648. END
  1649. else
  1650. cat >> config.report << END
  1651. PostgreSQL: no
  1652. END
  1653. fi
  1654. if test "$enable_gtest" != "no"; then
  1655. cat >> config.report << END
  1656. GTest:
  1657. GTEST_VERSION: ${GTEST_VERSION}
  1658. GTEST_INCLUDES: ${GTEST_INCLUDES}
  1659. GTEST_LDFLAGS: ${GTEST_LDFLAGS}
  1660. GTEST_LDADD: ${GTEST_LDADD}
  1661. GTEST_SOURCE: ${GTEST_SOURCE}
  1662. END
  1663. fi
  1664. cat >> config.report << END
  1665. Features:
  1666. $enable_features
  1667. Developer:
  1668. Enable Debugging: $debug_enabled
  1669. Google Tests: $enable_gtest
  1670. Valgrind: $found_valgrind
  1671. C++ Code Coverage: $USE_LCOV
  1672. Python Code Coverage: $USE_PYCOVERAGE
  1673. Logger checks: $enable_logger_checks
  1674. Generate Documentation: $enable_generate_docs
  1675. END
  1676. cat config.report
  1677. cat <<EOF
  1678. Now you can type "make" to build BIND 10. Note that if you intend to
  1679. run "make check", you must run "make" first as some files need to be
  1680. generated by "make" before "make check" can be run.
  1681. When running "make install" do not use any form of parallel or job
  1682. server options (such as GNU make's -j option). Doing so may cause
  1683. errors.
  1684. EOF