configure.ac 68 KB

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