configure.ac 69 KB

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