configure.ac 68 KB

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