configure.ac 68 KB

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