configure.ac 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925
  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. fi
  115. AC_MSG_CHECKING(std::unique_ptr support)
  116. feature="std::unique_ptr"
  117. AC_COMPILE_IFELSE(
  118. [AC_LANG_PROGRAM(
  119. [#include <memory>],
  120. [std::unique_ptr<int> a;])],
  121. [AC_MSG_RESULT([yes])],
  122. [AC_MSG_RESULT([no])
  123. continue])
  124. AC_MSG_CHECKING(cbegin/cend support)
  125. feature="cbegin/cend"
  126. AC_COMPILE_IFELSE(
  127. [AC_LANG_PROGRAM(
  128. [#include <string>],
  129. [const std::string& s = "abcd";
  130. unsigned count = 0;
  131. for (std::string::const_iterator i = s.cbegin();
  132. i != s.cend(); ++i)
  133. if (*i == 'b')
  134. ++count;])],
  135. [AC_MSG_RESULT([yes])],
  136. [AC_MSG_RESULT([no])
  137. continue])
  138. AC_MSG_CHECKING(final method support)
  139. feature="final method"
  140. AC_COMPILE_IFELSE(
  141. [AC_LANG_PROGRAM(
  142. [],
  143. [class Foo {
  144. public:
  145. virtual ~Foo() {};
  146. virtual void bar() final;
  147. }])],
  148. [AC_MSG_RESULT([yes])],
  149. [AC_MSG_RESULT([no])
  150. continue])
  151. AC_MSG_CHECKING(aggregate initialization support)
  152. feature="aggregate initialization"
  153. AC_COMPILE_IFELSE(
  154. [AC_LANG_PROGRAM(
  155. [#include <vector>],
  156. [std::vector<int> foo = { 1, 2, 3};])],
  157. [AC_MSG_RESULT([yes])],
  158. [AC_MSG_RESULT([no])
  159. continue])
  160. AC_MSG_CHECKING(lambda support)
  161. feature="lambda"
  162. AC_COMPILE_IFELSE(
  163. [AC_LANG_PROGRAM(
  164. [],
  165. [auto incr = [[]](int x) { return x + 1; };])],
  166. [AC_MSG_RESULT([yes])
  167. break],
  168. [AC_MSG_RESULT([no])
  169. continue])
  170. done
  171. dnl Determine if we are using GNU sed
  172. GNU_SED=no
  173. $SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
  174. if test $? -eq 0; then
  175. GNU_SED=yes
  176. fi
  177. # Display the C++ version
  178. AC_MSG_CHECKING([C++ version])
  179. cat > conftest.cpp << EOF
  180. long v = __cplusplus;
  181. EOF
  182. CXX_STANDARD=`$CXX $CXXFLAGS -E -o - conftest.cpp | grep '^long v = ' | $SED -e 's/^long v = //' -e 's/[[^0-9]]*$//' 2> /dev/null`
  183. if test -z "$CXX_STANDARD"; then
  184. CXX_STANDARD="unknown"
  185. fi
  186. AC_MSG_RESULT([$CXX_STANDARD])
  187. # Linker options
  188. # check -R, "-Wl,-R" or -rpath
  189. AX_ISC_RPATH
  190. # Compiler dependent settings: define some mandatory CXXFLAGS here.
  191. # We also use a separate variable KEA_CXXFLAGS. This will (and should) be
  192. # used as the default value for each specific AM_CXXFLAGS:
  193. # AM_CXXFLAGS = $(KEA_CXXFLAGS)
  194. # AM_CXXFLAGS += ... # add module specific flags
  195. # We need this so that we can disable some specific compiler warnings per
  196. # module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
  197. # gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
  198. # specify the default warning flags in CXXFLAGS and let specific modules
  199. # "override" the default.
  200. # This may be used to try linker flags.
  201. AC_DEFUN([KEA_CXX_TRY_FLAG], [
  202. AC_MSG_CHECKING([whether $CXX supports $1])
  203. kea_save_CXXFLAGS="$CXXFLAGS"
  204. CXXFLAGS="$CXXFLAGS -Werror $1"
  205. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){ return 0;}])],
  206. [kea_cxx_flag=yes], [kea_cxx_flag=no])
  207. CXXFLAGS="$kea_save_CXXFLAGS"
  208. if test "x$kea_cxx_flag" = "xyes"; then
  209. ifelse([$2], , :, [$2])
  210. else
  211. ifelse([$3], , :, [$3])
  212. fi
  213. AC_MSG_RESULT([$kea_cxx_flag])
  214. ])
  215. CXX_VERSION="unknown"
  216. # SunStudio compiler requires special compiler options for boost
  217. # (http://blogs.sun.com/sga/entry/boost_mini_howto)
  218. if test "$SUNCXX" = "yes"; then
  219. CXX_VERSION=`$CXX -V 2> /dev/null | head -1`
  220. CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
  221. KEA_CXXFLAGS="$KEA_CXXFLAGS -mt"
  222. MULTITHREADING_FLAG="-mt"
  223. fi
  224. # Newer versions of clang++ promotes "unused driver arguments" warnings to
  225. # a fatal error with -Werror, causing build failure. Since we use multiple
  226. # compilers on multiple systems, this can easily happen due to settings for
  227. # non clang++ environments that could be just ignored otherwise. It can also
  228. # happen if clang++ is used via ccache. So, although probably suboptimal,
  229. # we suppress this particular warning. Note that it doesn't weaken checks
  230. # on the source code.
  231. if test "X$CLANGPP" = "Xyes"; then
  232. CXX_VERSION=`$CXX --version 2> /dev/null | head -1`
  233. KEA_CXXFLAGS="$KEA_CXXFLAGS -Qunused-arguments"
  234. fi
  235. # gcc/clang specific settings:
  236. if test "X$GXX" = "Xyes"; then
  237. CXX_VERSION=`$CXX --version 2> /dev/null | head -1`
  238. KEA_CXXFLAGS="$KEA_CXXFLAGS -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
  239. # gcc 4.4 would emit warnings about breaking strict aliasing rules.
  240. # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41874
  241. CXX_DUMP_VERSION=`$CXX -dumpversion | cut -f1-2 -d.`
  242. if expr "$CXX_DUMP_VERSION" \< "4.5" > /dev/null; then
  243. WARNING_GCC_44_STRICT_ALIASING_CFLAG="-fno-strict-aliasing"
  244. fi
  245. AC_SUBST(WARNING_GCC_44_STRICT_ALIASING_CFLAG)
  246. case "$host" in
  247. *-solaris*)
  248. MULTITHREADING_FLAG=-pthreads
  249. # In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
  250. KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-missing-braces"
  251. ;;
  252. *-apple-darwin*)
  253. MULTITHREADING_FLAG=
  254. ;;
  255. *)
  256. MULTITHREADING_FLAG=-pthread
  257. ;;
  258. esac
  259. KEA_CXXFLAGS="$KEA_CXXFLAGS $MULTITHREADING_FLAG"
  260. # Disable -Werror by default. Only use it if specifically enabled.
  261. # The usage of this flag is:
  262. #
  263. # No flag: -Werror is disabled
  264. # --with-werror: -Werror is enabled
  265. # --with-werror=yes: -Werror is enabled
  266. # --with-werror=no: -Werror is disabled
  267. # --with-werror=value -Werror is enabled and "value" is included in the compiler flags
  268. #
  269. # In the last case, "value" may be one or more compiler flags, e.g.
  270. # --with-werror=-Wundef
  271. # --with-werror='-Wundef -Wconversion'
  272. werror_extras=
  273. AC_ARG_WITH(werror,
  274. AC_HELP_STRING([--with-werror], [Compile using -Werror (default=no)]),
  275. [
  276. case "${withval}" in
  277. yes) with_werror=1 ;;
  278. no) with_werror=0 ;;
  279. -*) with_werror=1; werror_extras=${withval} ;;
  280. *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
  281. esac],
  282. [with_werror=0])
  283. werror_ok=0
  284. # Certain versions of gcc (g++) have a bug that incorrectly warns about
  285. # the use of anonymous name spaces even if they're closed in a single
  286. # translation unit. For these versions we have to disable -Werror.
  287. if test $with_werror = 1; then
  288. CXXFLAGS_SAVED="$CXXFLAGS"
  289. CXXFLAGS="$CXXFLAGS $KEA_CXXFLAGS -Werror"
  290. AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
  291. # We use struct, not class, here, because some compilers complain about
  292. # "unused private members", causing a false positive.
  293. AC_TRY_COMPILE([namespace { struct Foo {}; }
  294. namespace isc {struct Bar {Foo foo_;};} ],,
  295. [AC_MSG_RESULT(no)
  296. werror_ok=1
  297. KEA_CXXFLAGS="$KEA_CXXFLAGS -Werror"],
  298. [AC_MSG_RESULT(yes)])
  299. CXXFLAGS="$CXXFLAGS_SAVED"
  300. fi
  301. # Added flags after -Werror
  302. # Some versions of GCC warn about some versions of Boost regarding
  303. # missing initializer for members in its posix_time.
  304. # https://svn.boost.org/trac/boost/ticket/3477
  305. # But older GCC compilers don't have the flag.
  306. KEA_CXX_TRY_FLAG([-Wno-missing-field-initializers],
  307. [KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-missing-field-initializers"])
  308. if test "X$CLANGPP" = "Xyes"; then
  309. # This is to workaround unused variables tcout and tcerr in
  310. # log4cplus's streams.h and unused parameters from some of the
  311. # Boost headers.
  312. KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-unused-variable -Wno-unused-parameter"
  313. fi
  314. # Add the extras at the very last
  315. # Note it can be used to re-enable a (fatal) warning
  316. for extra in $werror_extras; do
  317. KEA_CXX_TRY_FLAG([$extra],
  318. [KEA_CXXFLAGS="$KEA_CXXFLAGS $extra"],
  319. [AC_MSG_ERROR([$CXX does not support $extra"])])
  320. done
  321. fi dnl GXX = yes
  322. # allow building programs with static link. we need to make it selective
  323. # because loadable modules cannot be statically linked.
  324. AC_ARG_ENABLE([static-link],
  325. AC_HELP_STRING([--enable-static-link],
  326. [build programs with static link [[default=no]]]),
  327. [enable_static_link=yes], [enable_static_link=no])
  328. AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
  329. AM_COND_IF([USE_STATIC_LINK], [AC_DEFINE([USE_STATIC_LINK], [1], [Was Kea statically linked?])])
  330. # Check validity about some libtool options
  331. if test $enable_static_link = yes -a $enable_static = no; then
  332. AC_MSG_ERROR([--enable-static-link requires --enable-static])
  333. fi
  334. if test $enable_static_link = no -a $enable_shared = no; then
  335. AC_MSG_ERROR([--disable-static-link requires --enable-shared])
  336. fi
  337. # OS dependent configuration
  338. kea_undefined_pthread_behavior=no
  339. case "$host" in
  340. *-solaris*)
  341. # Solaris requires special definitions to get some standard libraries
  342. # (e.g. getopt(3)) available with common used header files.
  343. CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
  344. # "now" binding is necessary to prevent deadlocks in C++ static initialization code
  345. LDFLAGS="$LDFLAGS -z now"
  346. # Destroying locked mutexes, condition variables being waited
  347. # on, etc. are undefined behavior on Solaris, so we set it as
  348. # such here.
  349. kea_undefined_pthread_behavior=yes
  350. ;;
  351. *-apple-darwin*)
  352. # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use
  353. # (RFC2292 or RFC3542).
  354. CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
  355. # In OS X 10.9 (and possibly any future versions?) pthread_cond_destroy
  356. # doesn't work as documented, which makes some of unit tests fail.
  357. AC_MSG_CHECKING([OS X versions where destroying locked locks do not fail])
  358. AC_TRY_COMPILE(
  359. [#include <Availability.h>],
  360. [#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
  361. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  362. #error " OS X >= 10.9"
  363. #endif
  364. #endif
  365. return 1;],
  366. [AC_MSG_RESULT([OS X < 10.9])],
  367. [AC_MSG_RESULT([OS X >= 10.9])
  368. kea_undefined_pthread_behavior=yes])
  369. ;;
  370. *-freebsd*)
  371. # On FreeBSD10.1 pthread_cond_destroy doesn't work as documented, which
  372. # causes the CondVarTest.destroyWhileWait test to fail. According to the
  373. # pthread_cond_destroy documentation for FreeBSD, this function should
  374. # return EBUSY error when there is a thread waiting for the conditional
  375. # variable, whereas this function returned success code. We treat it here
  376. # as an undefined behavior. Also note that this issue was only visible
  377. # when gtest 1.7 was in use, because the previous versions of gtest
  378. # didn't seem to have support for the death tests on FreeBSD. As a
  379. # result, the test was not executed and the error didn't occur.
  380. kea_undefined_pthread_behavior=yes
  381. ;;
  382. esac
  383. if [ test $kea_undefined_pthread_behavior = "yes" ]; then
  384. AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
  385. fi
  386. # Our experiments have shown Solaris 10 has broken support for the
  387. # IPV6_USE_MIN_MTU socket option for getsockopt(); it doesn't return the value
  388. # previously set via setsockopt(). We know it doesn't happen on one instance
  389. # on Solaris 11, but we don't know whether it happens for any Solaris 10
  390. # implementations or for earlier versions of Solaris. In any case, at the
  391. # moment this matters for only one unittest case, so we'll simply disable
  392. # the affected test using the following definition with the specific hardcoding
  393. # of that version of Solaris.
  394. case "$host" in
  395. *-solaris2.10)
  396. AC_DEFINE([HAVE_BROKEN_GET_IPV6_USE_MIN_MTU], [1],
  397. [Define to 1 if getsockopt(IPV6_USE_MIN_MTU) does not work])
  398. ;;
  399. esac
  400. m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3.4 python3.3 python3.2 python3.1 python3])
  401. AC_ARG_WITH([pythonpath],
  402. AC_HELP_STRING([--with-pythonpath=PATH],
  403. [specify an absolute path to python executable when automatic version check (incorrectly) fails]),
  404. [python_path="$withval"], [python_path="auto"])
  405. if test "$python_path" = auto; then
  406. AM_PATH_PYTHON([3.1],,[PYTHON=no])
  407. else
  408. # Older versions of automake can't handle python3 well. This is an
  409. # in-house workaround for them.
  410. PYTHON=$python_path
  411. AC_SUBST(PYTHON)
  412. PYTHON_PREFIX='${prefix}'
  413. AC_SUBST(PYTHON_PREFIX)
  414. PYTHON_EXEC_PREFIX='$(exec_prefix)'
  415. AC_SUBST(PYTHON_EXEC_PREFIX)
  416. PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`]
  417. if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then
  418. AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])
  419. fi
  420. AC_SUBST(PYTHON_VERSION)
  421. PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"`
  422. AC_SUBST(PYTHON_PLATFORM)
  423. pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  424. AC_SUBST(pythondir)
  425. pkgpythondir='${pythondir}/'$PACKAGE
  426. AC_SUBST(pkgpythondir)
  427. pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  428. AC_SUBST(pyexecdir)
  429. pkgpyexecdir='${pyexecdir}/'$PACKAGE
  430. AC_SUBST(pkgpyexecdir)
  431. fi
  432. # produce PIC unless we disable shared libraries. need this for python bindings.
  433. if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
  434. KEA_CXXFLAGS="$KEA_CXXFLAGS -fPIC"
  435. fi
  436. AC_SUBST(KEA_CXXFLAGS)
  437. # Checks for libraries.
  438. AC_SEARCH_LIBS(inet_pton, [nsl])
  439. AC_SEARCH_LIBS(recvfrom, [socket])
  440. AC_SEARCH_LIBS(nanosleep, [rt])
  441. AC_SEARCH_LIBS(dlsym, [dl])
  442. # Checks for header files.
  443. # Checks for typedefs, structures, and compiler characteristics.
  444. AC_HEADER_STDBOOL
  445. AC_TYPE_SIZE_T
  446. # Detect OS type (it may be used to do OS-specific things, e.g.
  447. # interface detection in DHCP)
  448. AC_MSG_CHECKING(OS type)
  449. BSD_TYPE="notaBSD"
  450. case $host in
  451. *-linux*)
  452. AC_DEFINE([OS_LINUX], [1], [Running on Linux?])
  453. OS_TYPE="Linux"
  454. CPPFLAGS="$CPPFLAGS -DOS_LINUX"
  455. ;;
  456. *-apple-darwin*)
  457. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  458. AC_DEFINE([OS_OSX], [1], [Running on OSX?])
  459. OS_TYPE="BSD"
  460. BSD_TYPE="OSX"
  461. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  462. ;;
  463. *-freebsd*)
  464. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  465. AC_DEFINE([OS_FREEBSD], [1], [Running on FreeBSD?])
  466. OS_TYPE="BSD"
  467. BSD_TYPE="FreeBSD"
  468. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  469. ;;
  470. *-netbsd*)
  471. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  472. AC_DEFINE([OS_NETBSD], [1], [Running on NetBSD?])
  473. OS_TYPE="BSD"
  474. BSD_TYPE="NetBSD"
  475. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  476. ;;
  477. *-openbsd*)
  478. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  479. AC_DEFINE([OS_OPENBSD], [1], [Running on OpenBSD?])
  480. OS_TYPE="BSD"
  481. BSD_TYPE="OpenBSD"
  482. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  483. ;;
  484. *-solaris*)
  485. AC_DEFINE([OS_SOLARIS], [1], [Running on Solaris?])
  486. OS_TYPE="Solaris"
  487. CPPFLAGS="$CPPFLAGS -DOS_SUN"
  488. ;;
  489. *)
  490. OS_TYPE="Unknown"
  491. # $host_os is more user friendly than full $host
  492. AC_MSG_WARN("Unsupported OS: $host_os")
  493. ;;
  494. esac
  495. AC_MSG_RESULT($OS_TYPE)
  496. AM_CONDITIONAL(OS_LINUX, test $OS_TYPE = Linux)
  497. AM_CONDITIONAL(OS_BSD, test $OS_TYPE = BSD)
  498. AM_CONDITIONAL(OS_SOLARIS, test $OS_TYPE = Solaris)
  499. AM_CONDITIONAL(OS_OSX, test $BSD_TYPE = OSX)
  500. AM_CONDITIONAL(OS_FREEBSD, test $BSD_TYPE = FreeBSD)
  501. AM_CONDITIONAL(OS_NETBSD, test $BSD_TYPE = NetBSD)
  502. AM_CONDITIONAL(OS_OPENBSD, test $BSD_TYPE = OpenBSD)
  503. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  504. AC_TRY_COMPILE([
  505. #include <sys/types.h>
  506. #include <sys/socket.h>],
  507. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  508. [AC_MSG_RESULT(yes)
  509. AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
  510. AC_MSG_RESULT(no))
  511. enable_gtest="no"
  512. GTEST_INCLUDES=
  513. AC_ARG_WITH([gtest-source],
  514. [AS_HELP_STRING([--with-gtest-source=PATH],
  515. [location of the Googletest source])],
  516. [enable_gtest="yes" ; GTEST_SOURCE="$withval"])
  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. distcheck_botan="--with-botan-config=$botan_config"
  658. if test "${botan_config}" = "no" ; then
  659. if test "${use_openssl}" = "no" ; then
  660. AC_MSG_ERROR([Need Botan or OpenSSL for libcryptolink])
  661. fi
  662. elif test "${botan_config}" != "yes" ; then
  663. if test -x "${botan_config}" ; then
  664. if test -d "${botan_config}" ; then
  665. AC_MSG_ERROR([${botan_config} is a directory])
  666. else
  667. BOTAN_CONFIG="${botan_config}"
  668. fi
  669. else
  670. AC_MSG_ERROR([--with-botan-config should point to a botan-config program and not a directory (${botan_config})])
  671. fi
  672. else
  673. BOTAN_CONFIG=""
  674. # first try several possible names of the config script
  675. # (botan-config-1.8 is there just in case, the official name change
  676. # came later)
  677. BOTAN_CONFIG_VERSIONS="botan-config-1.10 botan-config-1.9 botan-config-1.8 botan-config"
  678. for botan_config in $BOTAN_CONFIG_VERSIONS; do
  679. ACX_TRY_BOTAN_TOOL([$botan_config],,
  680. [ BOTAN_CONFIG="$botan_config" ]
  681. )
  682. if test "$BOTAN_CONFIG" != "" ; then
  683. break
  684. fi
  685. done
  686. if test "$BOTAN_CONFIG" = "" ; then
  687. AC_PATH_PROG([PKG_CONFIG], [pkg-config])
  688. if test "$PKG_CONFIG" != "" ; then
  689. # Ok so no script found, see if pkg-config knows of it.
  690. # Unfortunately, the botan.pc files also have their minor version
  691. # in their name, so we need to try them one by one
  692. BOTAN_VERSIONS="botan-1.10 botan-1.9 botan-1.8"
  693. for version in $BOTAN_VERSIONS; do
  694. ACX_TRY_BOTAN_TOOL([pkg-config], ["$version --silence-errors"],
  695. [ BOTAN_CONFIG="$PKG_CONFIG $version" ]
  696. )
  697. if test "$BOTAN_CONFIG" != "" ; then
  698. break
  699. fi
  700. done
  701. fi
  702. fi
  703. fi
  704. if test "x${BOTAN_CONFIG}" != "x"
  705. then
  706. CRYPTO_LIBS=`${BOTAN_CONFIG} --libs`
  707. CRYPTO_INCLUDES=`${BOTAN_CONFIG} --cflags`
  708. # We expect botan-config --libs to contain -L<path_to_libbotan>, but
  709. # this is not always the case. As a heuristics workaround we add
  710. # -L`botan-config --prefix/lib` in this case (if not present already).
  711. # Same for CRYPTO_INCLUDES (but using include instead of lib) below.
  712. if [ ${BOTAN_CONFIG} --prefix >/dev/null 2>&1 ] ; then
  713. echo ${CRYPTO_LIBS} | grep -- -L > /dev/null || \
  714. CRYPTO_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${CRYPTO_LIBS}"
  715. echo ${CRYPTO_INCLUDES} | grep -- -I > /dev/null || \
  716. CRYPTO_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${CRYPTO_INCLUDES}"
  717. fi
  718. fi
  719. if test "x${CRYPTO_LIBS}" != "x"
  720. then
  721. dnl Determine the Botan version
  722. AC_MSG_CHECKING([Botan version])
  723. cat > conftest.cpp << EOF
  724. #include <botan/version.h>
  725. AUTOCONF_BOTAN_VERSION=BOTAN_VERSION_MAJOR . BOTAN_VERSION_MINOR . BOTAN_VERSION_PATCH
  726. EOF
  727. 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`
  728. if test -z "$CRYPTO_VERSION"; then
  729. CRYPTO_VERSION="unknown"
  730. fi
  731. $RM -f conftest.cpp
  732. AC_MSG_RESULT([$CRYPTO_VERSION])
  733. # botan-config script (and the way we call pkg-config) returns -L and -l
  734. # as one string, but we need them in separate values
  735. CRYPTO_LDFLAGS=
  736. for flag in ${CRYPTO_LIBS}; do
  737. CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} `echo $flag | ${SED} -ne '/^\(\-L\)/p'`"
  738. CRYPTO_LIBS="${CRYPTO_LIBS} `echo $flag | ${SED} -ne '/^\(\-l\)/p'`"
  739. done
  740. # See crypto_rpath for some info on why we do this
  741. if test "x$ISC_RPATH_FLAG" != "x"; then
  742. CRYPTO_RPATH=
  743. for flag in ${CRYPTO_LIBS}; do
  744. CRYPTO_RPATH="${CRYPTO_RPATH} `echo $flag | ${SED} -ne "s/^\(\-L\)/${ISC_RPATH_FLAG}/p"`"
  745. done
  746. # According to the libtool manual, it should be sufficient if we
  747. # specify the "-R libdir" in our wrapper library of botan (no other
  748. # programs will need libbotan directly); "libdir" should be added to
  749. # the program's binary image. But we've seen in our build environments
  750. # that (some versions of?) libtool doesn't propagate -R as documented,
  751. # and it caused a linker error at run time. To work around this, we
  752. # also add the rpath to the global LDFLAGS.
  753. LDFLAGS="$CRYPTO_RPATH $LDFLAGS"
  754. fi
  755. # Even though chances are high we already performed a real compilation check
  756. # in the search for the right (pkg)config data, we try again here, to
  757. # be sure.
  758. CPPFLAGS_SAVED=$CPPFLAGS
  759. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  760. LIBS_SAVED="$LIBS"
  761. LIBS="$LIBS $CRYPTO_LIBS"
  762. # ac_header_preproc is an autoconf symbol (undocumented but stable) that
  763. # is set if the pre-processor phase passes. Thus by adding a custom
  764. # failure handler we can detect the difference between a header not existing
  765. # (or not even passing the pre-processor phase) and a header file resulting
  766. # in compilation failures.
  767. AC_CHECK_HEADERS([botan/botan.h],,[
  768. CRYPTO_INCLUDES=""
  769. CRYPTO_LIBS=""
  770. CRYPTO_LDFLAGS=""
  771. CRYPTO_RPATH=""
  772. if test "x$ac_header_preproc" = "xyes"; then
  773. AC_MSG_RESULT([
  774. botan/botan.h was found but is unusable. The most common cause of this problem
  775. is attempting to use an updated C++ compiler with older C++ libraries, such as
  776. the version of Botan that comes with your distribution. If you have updated
  777. your C++ compiler we highly recommend that you use support libraries such as
  778. Boost and Botan that were compiled with the same compiler version.])
  779. else
  780. AC_MSG_RESULT([Missing required header files.])
  781. fi]
  782. )
  783. CPPFLAGS=$CPPFLAGS_SAVED
  784. LIBS=$LIBS_SAVED
  785. fi
  786. if test "x${CRYPTO_LIBS}" != "x"
  787. then
  788. CPPFLAGS_SAVED=$CPPFLAGS
  789. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  790. LIBS_SAVED="$LIBS"
  791. LIBS="$LIBS $CRYPTO_LIBS"
  792. AC_LINK_IFELSE(
  793. [AC_LANG_PROGRAM([#include <botan/botan.h>
  794. #include <botan/hash.h>
  795. ],
  796. [using namespace Botan;
  797. LibraryInitializer::initialize();
  798. HashFunction *h = get_hash("MD5");
  799. ])],
  800. [AC_MSG_RESULT([checking for Botan library... yes])],
  801. [AC_MSG_RESULT([checking for Botan library... no])
  802. CRYPTO_INCLUDES=""
  803. CRYPTO_LIBS=""
  804. CRYPTO_LDFLAGS=""
  805. CRYPTO_RPATH=""
  806. AC_MSG_RESULT([Needs Botan library 1.8 or higher. On some systems,
  807. the botan package has a few missing dependencies (libbz2 and
  808. libgmp), if libbotan has been installed and you see this message,
  809. try upgrading to a higher version of botan or installing libbz2
  810. and libgmp.])]
  811. )
  812. CPPFLAGS=$CPPFLAGS_SAVED
  813. LIBS=$LIBS_SAVED
  814. fi
  815. if test "x${CRYPTO_LIBS}" != "x"
  816. then
  817. CRYPTO_NAME="Botan"
  818. DISABLED_CRYPTO="OpenSSL"
  819. CRYPTO_PACKAGE="botan-1.8"
  820. CRYPTO_CFLAGS=""
  821. DISTCHECK_CRYPTO_CONFIGURE_FLAG="$distcheck_botan"
  822. AC_DEFINE_UNQUOTED([WITH_BOTAN], [], [Compile with Botan crypto])
  823. else
  824. CRYPTO_NAME="OpenSSL"
  825. DISABLED_CRYPTO="Botan"
  826. CRYPTO_PACKAGE="openssl-1.0.1"
  827. AC_DEFINE_UNQUOTED([WITH_OPENSSL], [], [Compile with OpenSSL crypto])
  828. AC_MSG_CHECKING(for OpenSSL library)
  829. # from bind9
  830. if test "${use_openssl}" = "auto" ; then
  831. use_openssl="yes"
  832. fi
  833. if test "${use_openssl}" = "yes" ; then
  834. for d in /usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw; do
  835. if test -f $d/include/openssl/opensslv.h; then
  836. use_openssl=$d; break
  837. fi
  838. done
  839. fi
  840. if test "${use_openssl}" = "yes" ; then
  841. AC_MSG_ERROR([OpenSSL auto detection failed])
  842. fi
  843. if ! test -f "${use_openssl}"/include/openssl/opensslv.h ; then
  844. AC_MSG_ERROR([OpenSSL not found at ${use_openssl}])
  845. fi
  846. AC_MSG_RESULT(yes)
  847. if test "${use_openssl}" = "/usr" ; then
  848. CRYPTO_CFLAGS=""
  849. CRYPTO_INCLUDES=""
  850. CRYPTO_LIBS="-lcrypto"
  851. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-openssl"
  852. else
  853. CRYPTO_CFLAGS=""
  854. CRYPTO_INCLUDES="-I${use_openssl}/include"
  855. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-openssl=${use_openssl}"
  856. case $host in
  857. *-solaris*)
  858. CRYPTO_LIBS="-L${use_openssl}/lib -R${use_openssl}/lib -lcrypto"
  859. ;;
  860. *-hp-hpux*)
  861. CRYPTO_LIBS="-L${use_openssl}/lib -Wl,+b: -lcrypto"
  862. ;;
  863. *-apple-darwin*)
  864. if test -f "${use_openssl}/lib/libcrypto.dylib" ; then
  865. CRYPTO_LIBS="-L${use_openssl}/lib -lcrypto"
  866. else
  867. CRYPTO_LIBS="${use_openssl}/lib/libcrypto.a"
  868. fi
  869. ;;
  870. *)
  871. CRYPTO_LIBS="-L${use_openssl}/lib -lcrypto"
  872. ;;
  873. esac
  874. fi
  875. dnl Determine the OpenSSL version
  876. # Officially we support >= 1.0.1, 0.9.8 should fail the HMAC API,
  877. # 1.0.0 could work but is not recommended.
  878. AC_MSG_CHECKING([OpenSSL version])
  879. cat > conftest.cpp << EOF
  880. #include <openssl/opensslv.h>
  881. AUTOCONF_OPENSSL_VERSION=OPENSSL_VERSION_TEXT
  882. EOF
  883. CRYPTO_VERSION=`$CPP $CPPFLAGS $CRYPTO_INCLUDES conftest.cpp | grep '^AUTOCONF_OPENSSL_VERSION=' | $SED -e 's/^AUTOCONF_OPENSSL_VERSION=//' -e 's/"//g' 2> /dev/null`
  884. if test -z "$CRYPTO_VERSION" ; then
  885. CRYPTO_VERSION="unknown"
  886. fi
  887. $RM -f conftest.cpp
  888. AC_MSG_RESULT([$CRYPTO_VERSION])
  889. #CRYPTO_LDFLAGS="-ldl"
  890. CRYPTO_LDFLAGS=""
  891. CRYPTO_RPATH=""
  892. dnl Check avaibility of SHA-2
  893. AC_MSG_CHECKING([support of SHA-2])
  894. LIBS_SAVED=${LIBS}
  895. LIBS="$LIBS $CRYPTO_LIBS"
  896. CPPFLAGS_SAVED=${CPPFLAGS}
  897. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  898. AC_LINK_IFELSE(
  899. [AC_LANG_PROGRAM([#include <openssl/evp.h>],
  900. [const EVP_MD* h224 = EVP_sha224();
  901. const EVP_MD* h256 = EVP_sha256();
  902. const EVP_MD* h384 = EVP_sha384();
  903. const EVP_MD* h512 = EVP_sha512();
  904. ])],
  905. [AC_MSG_RESULT([yes])],
  906. [AC_MSG_ERROR([missing EVP entry for SHA-2])])
  907. dnl Check HMAC API
  908. AC_MSG_CHECKING([HMAC functions returning ints])
  909. AC_LINK_IFELSE(
  910. [AC_LANG_PROGRAM([#include <openssl/hmac.h>],
  911. [HMAC_CTX ctx, tmp;
  912. int n = HMAC_Init(&ctx, NULL, 0, NULL);
  913. n += HMAC_Update(&ctx, NULL, 0);
  914. n += HMAC_CTX_copy(&tmp, &ctx);
  915. n += HMAC_Final(&tmp, NULL, NULL);
  916. ])],
  917. [AC_MSG_RESULT([yes])],
  918. [AC_MSG_ERROR([HMAC functions return void: the OpenSSL version should be too old, please change for >= 1.0.1])])
  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_LDFLAGS="\$(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/ctrl_agent_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/hooks/Makefile
  1455. src/hooks/dhcp/Makefile
  1456. src/hooks/dhcp/user_chk/Makefile
  1457. src/hooks/dhcp/user_chk/tests/Makefile
  1458. src/hooks/dhcp/user_chk/tests/test_data_files_config.h
  1459. src/lib/Makefile
  1460. src/lib/asiodns/Makefile
  1461. src/lib/asiodns/tests/Makefile
  1462. src/lib/asiolink/Makefile
  1463. src/lib/asiolink/tests/Makefile
  1464. src/lib/cc/Makefile
  1465. src/lib/cc/tests/Makefile
  1466. src/lib/cfgrpt/Makefile
  1467. src/lib/cfgrpt/tests/Makefile
  1468. src/lib/config/Makefile
  1469. src/lib/config/tests/Makefile
  1470. src/lib/config/tests/data_def_unittests_config.h
  1471. src/lib/config/tests/testdata/Makefile
  1472. src/lib/cryptolink/Makefile
  1473. src/lib/cryptolink/tests/Makefile
  1474. src/lib/dhcp/Makefile
  1475. src/lib/dhcp/tests/Makefile
  1476. src/lib/dhcp_ddns/Makefile
  1477. src/lib/dhcp_ddns/tests/Makefile
  1478. src/lib/dhcpsrv/Makefile
  1479. src/lib/dhcpsrv/tests/Makefile
  1480. src/lib/dhcpsrv/tests/test_libraries.h
  1481. src/lib/dhcpsrv/testutils/Makefile
  1482. src/lib/dns/Makefile
  1483. src/lib/dns/gen-rdatacode.py
  1484. src/lib/dns/tests/Makefile
  1485. src/lib/dns/tests/testdata/Makefile
  1486. src/lib/exceptions/Makefile
  1487. src/lib/exceptions/tests/Makefile
  1488. src/lib/hooks/Makefile
  1489. src/lib/hooks/tests/Makefile
  1490. src/lib/hooks/tests/marker_file.h
  1491. src/lib/hooks/tests/test_libraries.h
  1492. src/lib/http/Makefile
  1493. src/lib/http/tests/Makefile
  1494. src/lib/log/Makefile
  1495. src/lib/log/compiler/Makefile
  1496. src/lib/log/interprocess/Makefile
  1497. src/lib/log/interprocess/tests/Makefile
  1498. src/lib/log/tests/Makefile
  1499. src/lib/log/tests/buffer_logger_test.sh
  1500. src/lib/log/tests/console_test.sh
  1501. src/lib/log/tests/destination_test.sh
  1502. src/lib/log/tests/init_logger_test.sh
  1503. src/lib/log/tests/local_file_test.sh
  1504. src/lib/log/tests/logger_lock_test.sh
  1505. src/lib/log/tests/severity_test.sh
  1506. src/lib/log/tests/tempdir.h
  1507. src/lib/process/Makefile
  1508. src/lib/process/spec_config.h.pre
  1509. src/lib/process/tests/Makefile
  1510. src/lib/process/testutils/Makefile
  1511. src/lib/testutils/Makefile
  1512. src/lib/testutils/dhcp_test_lib.sh
  1513. src/lib/stats/Makefile
  1514. src/lib/stats/tests/Makefile
  1515. src/lib/util/Makefile
  1516. src/lib/util/io/Makefile
  1517. src/lib/util/python/Makefile
  1518. src/lib/util/python/gen_wiredata.py
  1519. src/lib/util/tests/Makefile
  1520. src/lib/util/tests/process_spawn_app.sh
  1521. src/lib/util/threads/Makefile
  1522. src/lib/util/threads/tests/Makefile
  1523. src/lib/util/unittests/Makefile
  1524. src/lib/eval/Makefile
  1525. src/lib/eval/tests/Makefile
  1526. src/share/Makefile
  1527. src/share/database/Makefile
  1528. src/share/database/scripts/Makefile
  1529. src/share/database/scripts/mysql/Makefile
  1530. src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh
  1531. src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh
  1532. src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh
  1533. src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh
  1534. src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh
  1535. src/share/database/scripts/pgsql/Makefile
  1536. src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh
  1537. src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
  1538. src/share/database/scripts/cql/Makefile
  1539. tools/Makefile
  1540. tools/path_replacer.sh
  1541. ])
  1542. AC_CONFIG_COMMANDS([permissions], [
  1543. chmod +x src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1544. chmod +x src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1545. chmod +x src/bin/keactrl/keactrl
  1546. chmod +x src/bin/keactrl/tests/keactrl_tests.sh
  1547. chmod +x src/bin/admin/kea-admin
  1548. chmod +x src/lib/dns/gen-rdatacode.py
  1549. chmod +x src/lib/log/tests/console_test.sh
  1550. chmod +x src/lib/log/tests/destination_test.sh
  1551. chmod +x src/lib/log/tests/init_logger_test.sh
  1552. chmod +x src/lib/log/tests/local_file_test.sh
  1553. chmod +x src/lib/log/tests/logger_lock_test.sh
  1554. chmod +x src/lib/log/tests/severity_test.sh
  1555. chmod +x src/lib/util/python/gen_wiredata.py
  1556. chmod +x src/lib/util/tests/process_spawn_app.sh
  1557. chmod +x tools/path_replacer.sh
  1558. ])
  1559. AM_CONDITIONAL(PREMIUM, test -d "$srcdir/premium/src")
  1560. AC_MSG_CHECKING([if premium package is available])
  1561. if test -d "$srcdir/premium/src"; then
  1562. # Define it in the config.h, so C++ code could use it.
  1563. AC_DEFINE([PREMIUM], [1], [Kea-premium package found])
  1564. # Export it here, so code in configure could use it.
  1565. PREMIUM=1
  1566. AC_MSG_RESULT(yes)
  1567. else
  1568. AC_MSG_RESULT(no)
  1569. fi
  1570. AC_OUTPUT
  1571. dnl Print the results
  1572. dnl
  1573. EXTENDED_VERSION=${PACKAGE_VERSION}
  1574. if test "$KEA_SRCID" != ""; then
  1575. EXTENDED_VERSION="${EXTENDED_VERSION} ($KEA_SRCID)"
  1576. fi
  1577. cat > config.report << END
  1578. Kea source configure results:
  1579. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1580. Package:
  1581. Name: ${PACKAGE_NAME}
  1582. Version: ${PACKAGE_VERSION}
  1583. Extended version:${EXTENDED_VERSION}
  1584. OS Family: ${OS_TYPE}
  1585. Using GNU sed: ${GNU_SED}
  1586. END
  1587. if test "$PREMIUM" != ""; then
  1588. cat >> config.report << END
  1589. Premium package: yes
  1590. END
  1591. else
  1592. cat >> config.report << END
  1593. Premium package: no
  1594. END
  1595. fi
  1596. cat >> config.report << END
  1597. C++ Compiler:
  1598. CXX: ${CXX}
  1599. CXX_VERSION: ${CXX_VERSION}
  1600. CXX_STANDARD: ${CXX_STANDARD}
  1601. DEFS: ${DEFS}
  1602. CPPFLAGS: ${CPPFLAGS}
  1603. CXXFLAGS: ${CXXFLAGS}
  1604. LDFLAGS: ${LDFLAGS}
  1605. KEA_CXXFLAGS: ${KEA_CXXFLAGS}
  1606. END
  1607. if test "$PYTHON" != "no" ; then
  1608. cat >> config.report << END
  1609. Python3:
  1610. PYTHON_VERSION: ${PYTHON_VERSION}
  1611. PYTHON_INCLUDES: ${PYTHON_INCLUDES}
  1612. PYTHON_CXXFLAGS: ${PYTHON_CXXFLAGS}
  1613. PYTHON_LDFLAGS: ${PYTHON_LDFLAGS}
  1614. PYTHON_LIB: ${PYTHON_LIB}
  1615. END
  1616. else
  1617. cat >> config.report << END
  1618. Python3:
  1619. not installed
  1620. END
  1621. fi
  1622. cat >> config.report << END
  1623. Boost:
  1624. BOOST_VERSION: ${BOOST_VERSION}
  1625. BOOST_INCLUDES: ${BOOST_INCLUDES}
  1626. BOOST_LIBS: ${BOOST_LIBS}
  1627. ${CRYPTO_NAME}:
  1628. CRYPTO_VERSION: ${CRYPTO_VERSION}
  1629. CRYPTO_CFLAGS: ${CRYPTO_CFLAGS}
  1630. CRYPTO_INCLUDES: ${CRYPTO_INCLUDES}
  1631. CRYPTO_LDFLAGS: ${CRYPTO_LDFLAGS}
  1632. CRYPTO_LIBS: ${CRYPTO_LIBS}
  1633. ${DISABLED_CRYPTO}: no
  1634. Log4cplus:
  1635. LOG4CPLUS_VERSION: ${LOG4CPLUS_VERSION}
  1636. LOG4CPLUS_INCLUDES: ${LOG4CPLUS_INCLUDES}
  1637. LOG4CPLUS_LIBS: ${LOG4CPLUS_LIBS}
  1638. Flex/bison:
  1639. FLEX: ${LEX}
  1640. BISON: ${YACC}
  1641. END
  1642. # Avoid confusion on DNS/DHCP and only mention MySQL if it
  1643. # were specified on the command line.
  1644. if test "$MYSQL_CPPFLAGS" != "" ; then
  1645. cat >> config.report << END
  1646. MySQL:
  1647. MYSQL_VERSION: ${MYSQL_VERSION}
  1648. MYSQL_CPPFLAGS: ${MYSQL_CPPFLAGS}
  1649. MYSQL_LIBS: ${MYSQL_LIBS}
  1650. END
  1651. else
  1652. cat >> config.report << END
  1653. MySQL:
  1654. no
  1655. END
  1656. fi
  1657. if test "$PGSQL_CPPFLAGS" != "" ; then
  1658. cat >> config.report << END
  1659. PostgreSQL:
  1660. PGSQL_VERSION: ${PGSQL_VERSION}
  1661. PGSQL_CPPFLAGS: ${PGSQL_CPPFLAGS}
  1662. PGSQL_LIBS: ${PGSQL_LIBS}
  1663. END
  1664. else
  1665. cat >> config.report << END
  1666. PostgreSQL:
  1667. no
  1668. END
  1669. fi
  1670. if test "$CQL_CPPFLAGS" != "" ; then
  1671. cat >> config.report << END
  1672. Cassandra CQL:
  1673. CQL_VERSION: ${CQL_VERSION}
  1674. CQL_CPPFLAGS: ${CQL_CPPFLAGS}
  1675. CQL_LIBS: ${CQL_LIBS}
  1676. END
  1677. else
  1678. cat >> config.report << END
  1679. Cassandra CQL:
  1680. no
  1681. END
  1682. fi
  1683. if test "$enable_gtest" != "no"; then
  1684. cat >> config.report << END
  1685. GTest:
  1686. GTEST_VERSION: ${GTEST_VERSION}
  1687. GTEST_INCLUDES: ${GTEST_INCLUDES}
  1688. GTEST_LDFLAGS: ${GTEST_LDFLAGS}
  1689. GTEST_LDADD: ${GTEST_LDADD}
  1690. GTEST_SOURCE: ${GTEST_SOURCE}
  1691. END
  1692. fi
  1693. cat >> config.report << END
  1694. Developer:
  1695. Enable Debugging: $debug_enabled
  1696. Google Tests: $enable_gtest
  1697. Valgrind: $found_valgrind
  1698. C++ Code Coverage: $USE_LCOV
  1699. Logger checks: $enable_logger_checks
  1700. Generate Documentation: $enable_generate_docs
  1701. Parser Generation: $enable_generate_parser
  1702. END
  1703. cat config.report
  1704. cat <<EOF
  1705. Now you can type "make" to build Kea. Note that if you intend to
  1706. run "make check", you must run "make" first as some files need to be
  1707. generated by "make" before "make check" can be run.
  1708. When running "make install" do not use any form of parallel or job
  1709. server options (such as GNU make's -j option). Doing so may cause
  1710. errors.
  1711. EOF