configure.ac 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.59])
  4. # For released versions, this is in x.y.z format.
  5. # For GIT versions, this is x.y.z-git, where x.y.z denotes the software
  6. # version that was used as a base + changes that were made later, but
  7. # are not released yet.
  8. AC_INIT(kea,1.2.0-git, kea-dev@lists.isc.org)
  9. AC_CONFIG_SRCDIR(README)
  10. # serial-tests is not available in automake version before 1.13, so
  11. # we'll check that and conditionally use serial-tests. This check is
  12. # adopted from code by Richard W.M. Jones:
  13. # https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html
  14. m4_define([serial_tests], [
  15. m4_esyscmd([automake --version |
  16. head -1 |
  17. awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
  18. ])
  19. ])
  20. AM_INIT_AUTOMAKE(foreign serial_tests)
  21. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])dnl be backward compatible
  22. AC_CONFIG_HEADERS([config.h])
  23. AC_CONFIG_MACRO_DIR([m4macros])
  24. AC_CANONICAL_HOST
  25. # Checks for programs.
  26. AC_PROG_CXX
  27. # Check for exact Kea version.
  28. AC_MSG_CHECKING(whether this is a tarball or git source)
  29. if test -d "${srcdir}/.git"; then
  30. KEA_SRCID="git `(cd "${top_srcdir}";git rev-parse HEAD)`"
  31. AC_MSG_RESULT("git")
  32. else
  33. KEA_SRCID="tarball"
  34. AC_MSG_RESULT("tarball")
  35. fi
  36. # Export EXTENDED_VERSION to config.h
  37. # This will be either "tarball" or "git abcd".
  38. AC_DEFINE_UNQUOTED([EXTENDED_VERSION], ["${KEA_SRCID}"], [Extended Kea version])
  39. # Find a separator for path_replacer
  40. for sep in "+" "," ";" "&" "__NONE__"; do
  41. if `pwd | grep -q $sep`; then continue; fi
  42. if `echo ${prefix} | grep -q $sep`; then continue; fi
  43. if `echo ${sysconfdir} | grep -q $sep`; then continue; fi
  44. if `echo ${localstatedir} | grep -q $sep`; then continue; fi
  45. SEP=$sep
  46. break
  47. done
  48. if test "$sep" = "__NONE__"; then
  49. AC_MSG_ERROR([can't find a separator character in '+,;&' for the path_replacer shell script])
  50. fi
  51. AC_SUBST(SEP)
  52. # Enable low-performing debugging facilities? This option optionally
  53. # enables some debugging aids that perform slowly and hence aren't built
  54. # by default.
  55. AC_ARG_ENABLE([debug],
  56. AS_HELP_STRING([--enable-debug],
  57. [enable debugging (default is no)]),
  58. [case "${enableval}" in
  59. yes) debug_enabled=yes ;;
  60. no) debug_enabled=no ;;
  61. *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  62. esac],[debug_enabled=no])
  63. AM_CONDITIONAL([DEBUG_ENABLED], [test x$debug_enabled = xyes])
  64. AM_COND_IF([DEBUG_ENABLED], [AC_DEFINE([ENABLE_DEBUG], [1], [Enable low-performing debugging facilities?])])
  65. PREMIUM_DIR=
  66. if test -d "${srcdir}/premium"; then
  67. PREMIUM_DIR=premium
  68. AC_CONFIG_SUBDIRS([premium])
  69. fi
  70. AC_SUBST(PREMIUM_DIR)
  71. # Libtool configuration
  72. #
  73. # libtool cannot handle spaces in paths, so exit early if there is one
  74. if [ test `echo $PWD | grep -c ' '` != "0" ]; then
  75. AC_MSG_ERROR([Kea cannot be built in a directory that contains spaces, because of libtool limitations. Please change the directory name, or use a symbolic link that does not contain spaces.])
  76. fi
  77. # On FreeBSD (and probably some others), clang++ does not meet an autoconf
  78. # assumption in identifying libtool configuration regarding shared library:
  79. # the configure script will execute "$CC -shared $CFLAGS/$CXXFLAGS -v" and
  80. # expect the output contains -Lxxx or -Ryyy. This is the case for g++, but
  81. # not for clang++, and, as a result, it will cause various errors in linking
  82. # programs or running them with a shared object (such as some of our python
  83. # scripts).
  84. # To work around this problem we define a temporary variable
  85. # "CXX_LIBTOOL_LDFLAGS". It's expected to be defined as, e.g, "-L/usr/lib"
  86. # to temporarily fake the output so that it will be compatible with that of
  87. # g++.
  88. CFLAGS_SAVED=$CFLAGS
  89. CXXFLAGS_SAVED=$CXXFLAGS
  90. CFLAGS="$CFLAGS $CXX_LIBTOOL_LDFLAGS"
  91. CXXFLAGS="$CXXFLAGS $CXX_LIBTOOL_LDFLAGS"
  92. LT_INIT
  93. CFLAGS=$CFLAGS_SAVED
  94. CXXFLAGS=$CXXFLAGS_SAVED
  95. # Use C++ language
  96. AC_LANG([C++])
  97. # Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
  98. AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
  99. AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
  100. AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
  101. # USE_CLANGPP is no longer used, keep it by symmetry with USE_GXX?
  102. AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
  103. # Check for C++11 features support
  104. AX_ISC_CPP11
  105. # Check for std::is_base_of support
  106. AC_MSG_CHECKING([for std::is_base_of])
  107. AC_COMPILE_IFELSE(
  108. [AC_LANG_PROGRAM(
  109. [#include <type_traits>
  110. class A {};
  111. class B : A {};]
  112. [static_assert(std::is_base_of<A, B>::value, "");])],
  113. [AC_MSG_RESULT(yes)
  114. AC_DEFINE([HAVE_IS_BASE_OF], [1],
  115. [Define to 1 if std::is_base_of is available])],
  116. [AC_MSG_RESULT(no)])
  117. dnl Determine if we are using GNU sed
  118. GNU_SED=no
  119. $SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
  120. if test $? -eq 0; then
  121. GNU_SED=yes
  122. fi
  123. # Display the C++ version
  124. AC_MSG_CHECKING([C++ version])
  125. cat > conftest.cpp << EOF
  126. long v = __cplusplus;
  127. EOF
  128. CXX_STANDARD=`$CXX $CXXFLAGS -E -o - conftest.cpp | grep '^long v = ' | $SED -e 's/^long v = //' -e 's/[[^0-9]]*$//' 2> /dev/null`
  129. if test -z "$CXX_STANDARD"; then
  130. CXX_STANDARD="unknown"
  131. fi
  132. AC_MSG_RESULT([$CXX_STANDARD])
  133. # Linker options
  134. # check -R, "-Wl,-R" or -rpath
  135. AX_ISC_RPATH
  136. # Compiler dependent settings: define some mandatory CXXFLAGS here.
  137. # We also use a separate variable KEA_CXXFLAGS. This will (and should) be
  138. # used as the default value for each specific AM_CXXFLAGS:
  139. # AM_CXXFLAGS = $(KEA_CXXFLAGS)
  140. # AM_CXXFLAGS += ... # add module specific flags
  141. # We need this so that we can disable some specific compiler warnings per
  142. # module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
  143. # gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
  144. # specify the default warning flags in CXXFLAGS and let specific modules
  145. # "override" the default.
  146. # This may be used to try linker flags.
  147. AC_DEFUN([KEA_CXX_TRY_FLAG], [
  148. AC_MSG_CHECKING([whether $CXX supports $1])
  149. kea_save_CXXFLAGS="$CXXFLAGS"
  150. CXXFLAGS="$CXXFLAGS -Werror $1"
  151. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){ return 0;}])],
  152. [kea_cxx_flag=yes], [kea_cxx_flag=no])
  153. CXXFLAGS="$kea_save_CXXFLAGS"
  154. if test "x$kea_cxx_flag" = "xyes"; then
  155. ifelse([$2], , :, [$2])
  156. else
  157. ifelse([$3], , :, [$3])
  158. fi
  159. AC_MSG_RESULT([$kea_cxx_flag])
  160. ])
  161. CXX_VERSION="unknown"
  162. # SunStudio compiler requires special compiler options for boost
  163. # (http://blogs.sun.com/sga/entry/boost_mini_howto)
  164. if test "$SUNCXX" = "yes"; then
  165. CXX_VERSION=`$CXX -V 2> /dev/null | head -1`
  166. CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
  167. KEA_CXXFLAGS="$KEA_CXXFLAGS -mt"
  168. MULTITHREADING_FLAG="-mt"
  169. fi
  170. # Newer versions of clang++ promotes "unused driver arguments" warnings to
  171. # a fatal error with -Werror, causing build failure. Since we use multiple
  172. # compilers on multiple systems, this can easily happen due to settings for
  173. # non clang++ environments that could be just ignored otherwise. It can also
  174. # happen if clang++ is used via ccache. So, although probably suboptimal,
  175. # we suppress this particular warning. Note that it doesn't weaken checks
  176. # on the source code.
  177. if test "X$CLANGPP" = "Xyes"; then
  178. CXX_VERSION=`$CXX --version 2> /dev/null | head -1`
  179. KEA_CXXFLAGS="$KEA_CXXFLAGS -Qunused-arguments"
  180. fi
  181. # gcc/clang specific settings:
  182. if test "X$GXX" = "Xyes"; then
  183. CXX_VERSION=`$CXX --version 2> /dev/null | head -1`
  184. KEA_CXXFLAGS="$KEA_CXXFLAGS -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
  185. # gcc 4.4 would emit warnings about breaking strict aliasing rules.
  186. # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41874
  187. CXX_DUMP_VERSION=`$CXX -dumpversion | cut -f1-2 -d.`
  188. if expr "$CXX_DUMP_VERSION" \< "4.5" > /dev/null; then
  189. WARNING_GCC_44_STRICT_ALIASING_CFLAG="-fno-strict-aliasing"
  190. fi
  191. AC_SUBST(WARNING_GCC_44_STRICT_ALIASING_CFLAG)
  192. CPPP="$CPP"
  193. # gcc 5 preprocessor requires -P for checking its output
  194. if test "$CXX_DUMP_VERSION" \> "5"; then
  195. CPPP="$CPP -P"
  196. fi
  197. case "$host" in
  198. *-solaris*)
  199. MULTITHREADING_FLAG=-pthreads
  200. # In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
  201. KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-missing-braces"
  202. ;;
  203. *-apple-darwin*)
  204. MULTITHREADING_FLAG=
  205. ;;
  206. *)
  207. MULTITHREADING_FLAG=-pthread
  208. ;;
  209. esac
  210. KEA_CXXFLAGS="$KEA_CXXFLAGS $MULTITHREADING_FLAG"
  211. # Disable -Werror by default. Only use it if specifically enabled.
  212. # The usage of this flag is:
  213. #
  214. # No flag: -Werror is disabled
  215. # --with-werror: -Werror is enabled
  216. # --with-werror=yes: -Werror is enabled
  217. # --with-werror=no: -Werror is disabled
  218. # --with-werror=value -Werror is enabled and "value" is included in the compiler flags
  219. #
  220. # In the last case, "value" may be one or more compiler flags, e.g.
  221. # --with-werror=-Wundef
  222. # --with-werror='-Wundef -Wconversion'
  223. werror_extras=
  224. AC_ARG_WITH(werror,
  225. AC_HELP_STRING([--with-werror], [Compile using -Werror (default=no)]),
  226. [
  227. case "${withval}" in
  228. yes) with_werror=1 ;;
  229. no) with_werror=0 ;;
  230. -*) with_werror=1; werror_extras=${withval} ;;
  231. *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
  232. esac],
  233. [with_werror=0])
  234. werror_ok=0
  235. # Certain versions of gcc (g++) have a bug that incorrectly warns about
  236. # the use of anonymous name spaces even if they're closed in a single
  237. # translation unit. For these versions we have to disable -Werror.
  238. if test $with_werror = 1; then
  239. CXXFLAGS_SAVED="$CXXFLAGS"
  240. CXXFLAGS="$CXXFLAGS $KEA_CXXFLAGS -Werror"
  241. AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
  242. # We use struct, not class, here, because some compilers complain about
  243. # "unused private members", causing a false positive.
  244. AC_TRY_COMPILE([namespace { struct Foo {}; }
  245. namespace isc {struct Bar {Foo foo_;};} ],,
  246. [AC_MSG_RESULT(no)
  247. werror_ok=1
  248. KEA_CXXFLAGS="$KEA_CXXFLAGS -Werror"],
  249. [AC_MSG_RESULT(yes)])
  250. CXXFLAGS="$CXXFLAGS_SAVED"
  251. fi
  252. # Added flags after -Werror
  253. # Some versions of GCC warn about some versions of Boost regarding
  254. # missing initializer for members in its posix_time.
  255. # https://svn.boost.org/trac/boost/ticket/3477
  256. # But older GCC compilers don't have the flag.
  257. KEA_CXX_TRY_FLAG([-Wno-missing-field-initializers],
  258. [KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-missing-field-initializers"])
  259. if test "X$CLANGPP" = "Xyes"; then
  260. # This is to workaround unused variables tcout and tcerr in
  261. # log4cplus's streams.h and unused parameters from some of the
  262. # Boost headers.
  263. KEA_CXXFLAGS="$KEA_CXXFLAGS -Wno-unused-variable -Wno-unused-parameter"
  264. fi
  265. # Add the extras at the very last
  266. # Note it can be used to re-enable a (fatal) warning
  267. for extra in $werror_extras; do
  268. KEA_CXX_TRY_FLAG([$extra],
  269. [KEA_CXXFLAGS="$KEA_CXXFLAGS $extra"],
  270. [AC_MSG_ERROR([$CXX does not support $extra"])])
  271. done
  272. fi dnl GXX = yes
  273. # allow building programs with static link. we need to make it selective
  274. # because loadable modules cannot be statically linked.
  275. AC_ARG_ENABLE([static-link],
  276. AC_HELP_STRING([--enable-static-link],
  277. [build programs with static link [[default=no]]]),
  278. [enable_static_link=yes], [enable_static_link=no])
  279. AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
  280. AM_COND_IF([USE_STATIC_LINK], [AC_DEFINE([USE_STATIC_LINK], [1], [Was Kea statically linked?])])
  281. # Check validity about some libtool options
  282. if test $enable_static_link = yes -a $enable_static = no; then
  283. AC_MSG_ERROR([--enable-static-link requires --enable-static])
  284. fi
  285. if test $enable_static_link = no -a $enable_shared = no; then
  286. AC_MSG_ERROR([--disable-static-link requires --enable-shared])
  287. fi
  288. # OS dependent configuration
  289. kea_undefined_pthread_behavior=no
  290. case "$host" in
  291. *-solaris*)
  292. # Solaris requires special definitions to get some standard libraries
  293. # (e.g. getopt(3)) available with common used header files.
  294. CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
  295. # "now" binding is necessary to prevent deadlocks in C++ static initialization code
  296. LDFLAGS="$LDFLAGS -z now"
  297. # Destroying locked mutexes, condition variables being waited
  298. # on, etc. are undefined behavior on Solaris, so we set it as
  299. # such here.
  300. kea_undefined_pthread_behavior=yes
  301. ;;
  302. *-apple-darwin*)
  303. # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use
  304. # (RFC2292 or RFC3542).
  305. CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
  306. # In OS X 10.9 (and possibly any future versions?) pthread_cond_destroy
  307. # doesn't work as documented, which makes some of unit tests fail.
  308. AC_MSG_CHECKING([OS X versions where destroying locked locks do not fail])
  309. AC_TRY_COMPILE(
  310. [#include <Availability.h>],
  311. [#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
  312. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  313. #error " OS X >= 10.9"
  314. #endif
  315. #endif
  316. return 1;],
  317. [AC_MSG_RESULT([OS X < 10.9])],
  318. [AC_MSG_RESULT([OS X >= 10.9])
  319. kea_undefined_pthread_behavior=yes])
  320. ;;
  321. *-freebsd*)
  322. # On FreeBSD10.1 pthread_cond_destroy doesn't work as documented, which
  323. # causes the CondVarTest.destroyWhileWait test to fail. According to the
  324. # pthread_cond_destroy documentation for FreeBSD, this function should
  325. # return EBUSY error when there is a thread waiting for the conditional
  326. # variable, whereas this function returned success code. We treat it here
  327. # as an undefined behavior. Also note that this issue was only visible
  328. # when gtest 1.7 was in use, because the previous versions of gtest
  329. # didn't seem to have support for the death tests on FreeBSD. As a
  330. # result, the test was not executed and the error didn't occur.
  331. kea_undefined_pthread_behavior=yes
  332. ;;
  333. esac
  334. if [ test $kea_undefined_pthread_behavior = "yes" ]; then
  335. AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
  336. fi
  337. # Our experiments have shown Solaris 10 has broken support for the
  338. # IPV6_USE_MIN_MTU socket option for getsockopt(); it doesn't return the value
  339. # previously set via setsockopt(). We know it doesn't happen on one instance
  340. # on Solaris 11, but we don't know whether it happens for any Solaris 10
  341. # implementations or for earlier versions of Solaris. In any case, at the
  342. # moment this matters for only one unittest case, so we'll simply disable
  343. # the affected test using the following definition with the specific hardcoding
  344. # of that version of Solaris.
  345. case "$host" in
  346. *-solaris2.10)
  347. AC_DEFINE([HAVE_BROKEN_GET_IPV6_USE_MIN_MTU], [1],
  348. [Define to 1 if getsockopt(IPV6_USE_MIN_MTU) does not work])
  349. ;;
  350. esac
  351. # Kea-shell is written in python. It can work with python 2.7 or any 3.x.
  352. # It may likely work with earlier versions, but 2.7 was the oldest one we tested
  353. # it with. We require python only if kea-shell was enabled. It is disabled
  354. # by default to not introduce hard dependency on python.
  355. AC_ARG_ENABLE(shell, [AC_HELP_STRING([--enable-shell],
  356. [enable kea-shell, a text management client for Control Agent [default=no]])],
  357. enable_shell=$enableval, enable_shell=no)
  358. PKGPYTHONDIR=
  359. m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
  360. [python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 dnl
  361. python3.3 python3.2 python3.1 python3.0 python python2 python2.7])
  362. if test "x$enable_shell" != xno ; then
  363. # If kea-shell is enabled, we really need python. 2.7 or anything newer will do.
  364. # We try to find 3.x first. If not found, we can do with 2.7.
  365. AM_PATH_PYTHON([2.7])
  366. # pkgpythondir needs to be expanded
  367. saved_prefix="$prefix"
  368. if test "$prefix" = "NONE"; then
  369. prefix=$ac_default_prefix
  370. fi
  371. PKGPYTHONDIR="$pkgpythondir"
  372. OLD=
  373. while test "x$OLD" != "x$PKGPYTHONDIR"; do
  374. OLD="$PKGPYTHONDIR"
  375. eval PKGPYTHONDIR="\"$OLD\""
  376. done
  377. prefix="$saved_prefix"
  378. else
  379. PYTHON=no
  380. fi
  381. # Export to makefiles the info whether we have shell enabled or not
  382. AM_CONDITIONAL(KEA_SHELL, test x$enable_shell != xno)
  383. AC_SUBST(PKGPYTHONDIR)
  384. # produce PIC unless we disable shared libraries. need this for python bindings.
  385. if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
  386. KEA_CXXFLAGS="$KEA_CXXFLAGS -fPIC"
  387. fi
  388. # Look for glib static libs if they're trying to do static builds
  389. if test $enable_static_link != "no"; then
  390. CXX_SAVED=$CXX
  391. CXX="$CXX -static"
  392. AC_LINK_IFELSE(
  393. [AC_LANG_PROGRAM([#include <math.h>],[(void)sqrt(-1.0);])],
  394. [AC_MSG_RESULT([checking for static glib libraries... yes])],
  395. [AC_MSG_RESULT([checking for static glib libraries... no])
  396. AC_MSG_ERROR([Building with --enable-static-link does not work. You appear to be missing glib static libraries. Check config.log for details.])])
  397. CXX=$CXX_SAVED
  398. fi
  399. AC_SUBST(KEA_CXXFLAGS)
  400. # Checks for libraries.
  401. AC_SEARCH_LIBS(inet_pton, [nsl])
  402. AC_SEARCH_LIBS(recvfrom, [socket])
  403. AC_SEARCH_LIBS(nanosleep, [rt])
  404. AC_SEARCH_LIBS(dlsym, [dl])
  405. # Checks for header files.
  406. # Checks for typedefs, structures, and compiler characteristics.
  407. AC_HEADER_STDBOOL
  408. AC_TYPE_SIZE_T
  409. # Detect OS type (it may be used to do OS-specific things, e.g.
  410. # interface detection in DHCP)
  411. AC_MSG_CHECKING(OS type)
  412. BSD_TYPE="notaBSD"
  413. case $host in
  414. *-linux*)
  415. AC_DEFINE([OS_LINUX], [1], [Running on Linux?])
  416. OS_TYPE="Linux"
  417. CPPFLAGS="$CPPFLAGS -DOS_LINUX"
  418. ;;
  419. *-apple-darwin*)
  420. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  421. AC_DEFINE([OS_OSX], [1], [Running on OSX?])
  422. OS_TYPE="BSD"
  423. BSD_TYPE="OSX"
  424. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  425. ;;
  426. *-freebsd*)
  427. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  428. AC_DEFINE([OS_FREEBSD], [1], [Running on FreeBSD?])
  429. OS_TYPE="BSD"
  430. BSD_TYPE="FreeBSD"
  431. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  432. ;;
  433. *-netbsd*)
  434. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  435. AC_DEFINE([OS_NETBSD], [1], [Running on NetBSD?])
  436. OS_TYPE="BSD"
  437. BSD_TYPE="NetBSD"
  438. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  439. ;;
  440. *-openbsd*)
  441. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  442. AC_DEFINE([OS_OPENBSD], [1], [Running on OpenBSD?])
  443. OS_TYPE="BSD"
  444. BSD_TYPE="OpenBSD"
  445. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  446. ;;
  447. *-solaris*)
  448. AC_DEFINE([OS_SOLARIS], [1], [Running on Solaris?])
  449. OS_TYPE="Solaris"
  450. CPPFLAGS="$CPPFLAGS -DOS_SUN"
  451. ;;
  452. *)
  453. OS_TYPE="Unknown"
  454. # $host_os is more user friendly than full $host
  455. AC_MSG_WARN("Unsupported OS: $host_os")
  456. ;;
  457. esac
  458. AC_MSG_RESULT($OS_TYPE)
  459. AM_CONDITIONAL(OS_LINUX, test $OS_TYPE = Linux)
  460. AM_CONDITIONAL(OS_BSD, test $OS_TYPE = BSD)
  461. AM_CONDITIONAL(OS_SOLARIS, test $OS_TYPE = Solaris)
  462. AM_CONDITIONAL(OS_OSX, test $BSD_TYPE = OSX)
  463. AM_CONDITIONAL(OS_FREEBSD, test $BSD_TYPE = FreeBSD)
  464. AM_CONDITIONAL(OS_NETBSD, test $BSD_TYPE = NetBSD)
  465. AM_CONDITIONAL(OS_OPENBSD, test $BSD_TYPE = OpenBSD)
  466. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  467. AC_TRY_COMPILE([
  468. #include <sys/types.h>
  469. #include <sys/socket.h>],
  470. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  471. [AC_MSG_RESULT(yes)
  472. AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
  473. AC_MSG_RESULT(no))
  474. enable_gtest="no"
  475. GTEST_INCLUDES=
  476. AC_ARG_WITH([gtest-source],
  477. [AS_HELP_STRING([--with-gtest-source=PATH],
  478. [location of the Googletest source])],
  479. [enable_gtest="yes" ; GTEST_SOURCE="$withval"])
  480. AC_ARG_WITH([gtest],
  481. [AS_HELP_STRING([--with-gtest=PATH],
  482. [specify a path to gtest header files (PATH/include) and library (PATH/lib)])],
  483. [gtest_path="$withval"; enable_gtest="yes"], [gtest_path="no"])
  484. AC_ARG_WITH(lcov,
  485. [ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
  486. USE_LCOV="no"
  487. if test "$lcov" != "no"; then
  488. # force gtest if not set
  489. if test "$enable_gtest" = "no"; then
  490. # AC_MSG_ERROR("lcov needs gtest for test coverage report")
  491. AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
  492. enable_gtest="yes"
  493. fi
  494. if test "$lcov" != "yes"; then
  495. LCOV=$lcov
  496. else
  497. AC_PATH_PROG([LCOV], [lcov])
  498. fi
  499. if test -x "${LCOV}"; then
  500. USE_LCOV="yes"
  501. else
  502. AC_MSG_ERROR([Cannot find lcov.])
  503. fi
  504. # is genhtml always in the same directory?
  505. GENHTML=`echo "$LCOV" | ${SED} s/lcov$/genhtml/`
  506. if test ! -x $GENHTML; then
  507. AC_MSG_ERROR([genhtml not found, needed for lcov])
  508. fi
  509. # GCC specific?
  510. CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
  511. LIBS=" $LIBS -lgcov"
  512. AC_SUBST(CPPFLAGS)
  513. AC_SUBST(LIBS)
  514. AC_SUBST(LCOV)
  515. AC_SUBST(GENHTML)
  516. fi
  517. AC_SUBST(USE_LCOV)
  518. # Sets up for use of botan unless openssl is specified
  519. # sets variables CRYPTO_*
  520. AX_CRYPTO
  521. # Check for MySql. The path to the mysql_config program is given with
  522. # the --with-mysql-config (default to /usr/bin/mysql-config). By default,
  523. # the software is not built with MySQL support enabled.
  524. mysql_config="no"
  525. AC_ARG_WITH([dhcp-mysql],
  526. AC_HELP_STRING([--with-dhcp-mysql=PATH],
  527. [path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
  528. [mysql_config="$withval"])
  529. if test "${mysql_config}" = "yes" ; then
  530. MYSQL_CONFIG="/usr/bin/mysql_config"
  531. elif test "${mysql_config}" != "no" ; then
  532. MYSQL_CONFIG="${withval}"
  533. fi
  534. if test "$MYSQL_CONFIG" != "" ; then
  535. if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
  536. AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
  537. fi
  538. MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
  539. MYSQL_LIBS=`$MYSQL_CONFIG --libs`
  540. MYSQL_VERSION=`$MYSQL_CONFIG --version`
  541. AC_SUBST(MYSQL_CPPFLAGS)
  542. AC_SUBST(MYSQL_LIBS)
  543. # Check that a simple program using MySQL functions can compile and link.
  544. CPPFLAGS_SAVED="$CPPFLAGS"
  545. LIBS_SAVED="$LIBS"
  546. CPPFLAGS="$MYSQL_CPPFLAGS $CPPFLAGS"
  547. LIBS="$MYSQL_LIBS $LIBS"
  548. AC_LINK_IFELSE(
  549. [AC_LANG_PROGRAM([#include <mysql.h>],
  550. [MYSQL mysql_handle;
  551. (void) mysql_init(&mysql_handle);
  552. ])],
  553. [AC_MSG_RESULT([checking for MySQL headers and library... yes])],
  554. [AC_MSG_RESULT([checking for MySQL headers and library... no])
  555. AC_MSG_ERROR([Needs MySQL library])]
  556. )
  557. CPPFLAGS=$CPPFLAGS_SAVED
  558. LIBS=$LIBS_SAVED
  559. # Note that MYSQL is present in the config.h file
  560. AC_DEFINE([HAVE_MYSQL], [1], [MySQL is present])
  561. fi
  562. # Solaris puts FIONREAD in filio.h
  563. AC_CHECK_HEADERS(sys/filio.h,,,)
  564. # ... and at the shell level, so Makefile.am can take action depending on this.
  565. AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
  566. pg_config="no"
  567. AC_ARG_WITH([dhcp-pgsql],
  568. AC_HELP_STRING([--with-dhcp-pgsql=PATH],
  569. [path to the PostgreSQL 'pg_config' script]),
  570. [pg_config="$withval"])
  571. if test "${pg_config}" = "yes" ; then
  572. PG_CONFIG="/usr/bin/pg_config"
  573. elif test "${pg_config}" != "no" ; then
  574. PG_CONFIG="${withval}"
  575. fi
  576. if test "$PG_CONFIG" != "" ; then
  577. if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
  578. AC_MSG_ERROR([--with-dhcp-pgsql should point to a pg_config program])
  579. fi
  580. PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
  581. PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir`
  582. PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server`
  583. PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$PGSQL_INCLUDEDIR -I$PGSQL_INCLUDEDIR_SERVER"
  584. PGSQL_LIBS=`$PG_CONFIG --libdir`
  585. PGSQL_LIBS="-L$PGSQL_LIBS -lpq"
  586. PGSQL_VERSION=`$PG_CONFIG --version`
  587. AC_SUBST(PGSQL_CPPFLAGS)
  588. AC_SUBST(PGSQL_LIBS)
  589. # Check that a simple program using PostgreSQL functions can compile and link.
  590. CPPFLAGS_SAVED="$CPPFLAGS"
  591. LIBS_SAVED="$LIBS"
  592. CPPFLAGS="$PGSQL_CPPFLAGS $CPPFLAGS"
  593. LIBS="$PGSQL_LIBS $LIBS"
  594. AC_LINK_IFELSE(
  595. [AC_LANG_PROGRAM([#include <libpq-fe.h>],
  596. [PGconn * c = PQconnectdb("dbname = 'postgres'");
  597. PQfinish(c);])],
  598. [AC_MSG_RESULT([checking for PostgreSQL headers and library... yes])],
  599. [AC_MSG_RESULT([checking for PostgreSQL headers and library... no])
  600. AC_MSG_ERROR([Needs PostgreSQL library])]
  601. )
  602. AC_CHECK_HEADERS([utils/errcodes.h],,
  603. AC_MSG_ERROR([Missing required header file (errcodes.h) from PostgreSQL server-development package]))
  604. CPPFLAGS=$CPPFLAGS_SAVED
  605. LIBS=$LIBS_SAVED
  606. # Note that PostgreSQL is present in the config.h file
  607. AC_DEFINE([HAVE_PGSQL], [1], [PostgreSQL is present])
  608. fi
  609. # ... and at the shell level, so Makefile.am can take action depending on this.
  610. AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
  611. cql_config="no"
  612. AC_ARG_WITH([cql],
  613. AC_HELP_STRING([--with-cql=PATH],
  614. [path to the Cassandra CQL 'cql_config' script]),
  615. [cql_config="$withval"])
  616. if test "${cql_config}" = "yes" ; then
  617. CQL_CONFIG="/usr/bin/cql_config"
  618. elif test "${cql_config}" != "no" ; then
  619. CQL_CONFIG="${cql_config}"
  620. fi
  621. if test "$CQL_CONFIG" != "" ; then
  622. if test -d "$CQL_CONFIG" -o ! -x "$CQL_CONFIG" ; then
  623. AC_MSG_ERROR([--with-cql should point to a cql_config program])
  624. fi
  625. CQL_INCLUDEDIR=`$CQL_CONFIG --includedir`
  626. CQL_CPPFLAGS="`$CQL_CONFIG --cppflags` -I$CQL_INCLUDEDIR"
  627. CQL_LIBS="-L`$CQL_CONFIG --libdir` -lcassandra_static -luv"
  628. CQL_VERSION=`$CQL_CONFIG --version`
  629. AC_SUBST(CQL_CPPFLAGS)
  630. AC_SUBST(CQL_LIBS)
  631. # Check that a simple program using CQL functions can compile and link.
  632. CPPFLAGS_SAVED="$CPPFLAGS"
  633. LIBS_SAVED="$LIBS"
  634. CPPFLAGS="$CQL_CPPFLAGS $CPPFLAGS"
  635. LIBS="$CQL_LIBS $LIBS"
  636. AC_LINK_IFELSE(
  637. [AC_LANG_PROGRAM([#include <cassandra.h>],
  638. [CassCluster* cluster = cass_cluster_new();
  639. cass_cluster_free(cluster);])],
  640. [AC_MSG_RESULT([checking for Cassandra CQL headers and library... yes])],
  641. [AC_MSG_RESULT([checking for Cassandra CQL headers and library... no])
  642. AC_MSG_ERROR([Needs Cassandra CQL library])]
  643. )
  644. CPPFLAGS=$CPPFLAGS_SAVED
  645. LIBS=$LIBS_SAVED
  646. # Note that CQL is present in the config.h file
  647. AC_DEFINE([HAVE_CQL], [1], [CQL is present])
  648. fi
  649. # ... and at the shell level, so Makefile.am can take action depending on this.
  650. AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "")
  651. # Check for log4cplus
  652. log4cplus_path="yes"
  653. AC_ARG_WITH([log4cplus],
  654. AC_HELP_STRING([--with-log4cplus=PATH],
  655. [specify exact directory of log4cplus library and headers]),
  656. [log4cplus_path="$withval"])
  657. if test "${log4cplus_path}" = "no" ; then
  658. AC_MSG_ERROR([Need log4cplus])
  659. elif test "${log4cplus_path}" != "yes" ; then
  660. LOG4CPLUS_INCLUDES="-I${log4cplus_path}/include"
  661. LOG4CPLUS_LIBS="-L${log4cplus_path}/lib"
  662. else
  663. # If not specified, try some common paths.
  664. log4cplusdirs="/usr /usr/local /usr/pkg /opt /opt/local"
  665. for d in $log4cplusdirs
  666. do
  667. if test -f $d/include/log4cplus/logger.h; then
  668. LOG4CPLUS_INCLUDES="-I$d/include"
  669. LOG4CPLUS_LIBS="-L$d/lib -L$d/lib64"
  670. break
  671. fi
  672. done
  673. fi
  674. LOG4CPLUS_LIBS="$LOG4CPLUS_LIBS -llog4cplus"
  675. AC_SUBST(LOG4CPLUS_LIBS)
  676. AC_SUBST(LOG4CPLUS_INCLUDES)
  677. CPPFLAGS_SAVED=$CPPFLAGS
  678. CPPFLAGS="$LOG4CPLUS_INCLUDES $CPPFLAGS"
  679. LIBS_SAVED="$LIBS"
  680. LIBS="$LOG4CPLUS_LIBS $MULTITHREADING_FLAG $LIBS"
  681. AC_CHECK_HEADERS([log4cplus/logger.h],,AC_MSG_ERROR([Missing required header files.]))
  682. AC_LINK_IFELSE(
  683. [AC_LANG_PROGRAM([#include <log4cplus/logger.h>
  684. ],
  685. [using namespace log4cplus;
  686. Logger logger = Logger::getInstance("main");
  687. ])],
  688. [AC_MSG_RESULT([checking for log4cplus library... yes])],
  689. [AC_MSG_RESULT([checking for log4cplus library... no])
  690. AC_MSG_ERROR([Needs log4cplus library])]
  691. )
  692. dnl Determine the log4cplus version, used mainly for config.report.
  693. AC_MSG_CHECKING([log4cplus version])
  694. cat > conftest.cpp << EOF
  695. #include <log4cplus/version.h>
  696. AUTOCONF_LOG4CPLUS_VERSION=LOG4CPLUS_VERSION_STR
  697. EOF
  698. LOG4CPLUS_VERSION=`$CPPP $CPPFLAGS conftest.cpp | grep '^AUTOCONF_LOG4CPLUS_VERSION=' | $SED -e 's/^AUTOCONF_LOG4CPLUS_VERSION=//' -e 's/[[ ]]//g' -e 's/"//g' 2> /dev/null`
  699. if test -z "$LOG4CPLUS_VERSION"; then
  700. LOG4CPLUS_VERSION="unknown"
  701. fi
  702. $RM -f conftest.cpp
  703. AC_MSG_RESULT([$LOG4CPLUS_VERSION])
  704. CPPFLAGS=$CPPFLAGS_SAVED
  705. LIBS=$LIBS_SAVED
  706. #
  707. # Configure Boost header path
  708. #
  709. AX_BOOST_FOR_KEA
  710. # Boost offset_ptr is required in one library and not optional right now, so
  711. # we unconditionally fail here if it doesn't work.
  712. if test "$BOOST_OFFSET_PTR_WOULDFAIL" = "yes" -a X"$werror_ok" = X1; then
  713. 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.])
  714. fi
  715. if test "$BOOST_STATIC_ASSERT_WOULDFAIL" = "yes" -a X"$werror_ok" = X1; then
  716. 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.])
  717. fi
  718. # There's a known bug in FreeBSD ports for Boost that would trigger a false
  719. # warning in build with g++ and -Werror (we exclude clang++ explicitly to
  720. # avoid unexpected false positives).
  721. if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes" -a X"$werror_ok" = X1 -a $CLANGPP = "no"; then
  722. 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.])
  723. fi
  724. # Add some default CPP flags needed for Boost, identified by the AX macro.
  725. CPPFLAGS="$CPPFLAGS $CPPFLAGS_BOOST_THREADCONF"
  726. # Can be required by gtest, boost and perhaps still asio
  727. AC_CHECK_LIB(pthread, pthread_create,[ LDFLAGS="$LDFLAGS -lpthread" ], [])
  728. #
  729. # Check availability of gtest, which will be used for unit tests.
  730. #
  731. GTEST_LDFLAGS=
  732. GTEST_LDADD=
  733. DISTCHECK_GTEST_CONFIGURE_FLAG=
  734. GTEST_VERSION="unknown"
  735. if test "x$enable_gtest" = "xyes" ; then
  736. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=$gtest_path"
  737. if test -n "$with_gtest_source" ; then
  738. if test "x$GTEST_SOURCE" = "xyes" ; then
  739. AC_MSG_CHECKING([for gtest source])
  740. # If not specified, try some common paths.
  741. GTEST_SOURCE=
  742. for d in /usr/src/gtest /usr/local /usr/pkg /opt /opt/local ; do
  743. if test -f $d/src/gtest-all.cc -a $d/src/gtest_main.cc; then
  744. GTEST_SOURCE=$d
  745. AC_MSG_RESULT([$GTEST_SOURCE])
  746. break
  747. fi
  748. done
  749. if test -z $GTEST_SOURCE ; then
  750. AC_MSG_ERROR([no gtest source but it was selected])
  751. fi
  752. else
  753. if test ! -d $GTEST_SOURCE/src -a -d $GTEST_SOURCE/googletest; then
  754. GTEST_SOURCE=$GTEST_SOURCE/googletest
  755. fi
  756. AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
  757. [$GTEST_SOURCE/src/gtest_main.cc],
  758. [have_gtest_source=yes],
  759. [AC_MSG_ERROR([no gtest source at $GTEST_SOURCE])])
  760. fi
  761. have_gtest_source=yes
  762. GTEST_LDADD="\$(top_builddir)/ext/gtest/libgtest.a"
  763. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest-source=$GTEST_SOURCE"
  764. GTEST_INCLUDES="-I$GTEST_SOURCE -I$GTEST_SOURCE/include"
  765. GTEST_VERSION="`basename $GTEST_SOURCE`"
  766. fi
  767. if test "$gtest_path" != "no" ; then
  768. if test "$gtest_path" != "yes"; then
  769. GTEST_PATHS=$gtest_path
  770. if test -x "${gtest_path}/bin/gtest-config" ; then
  771. GTEST_CONFIG="${gtest_path}/bin/gtest-config"
  772. fi
  773. else
  774. AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
  775. fi
  776. if test -x "${GTEST_CONFIG}" ; then :
  777. # using cppflags instead of cxxflags
  778. GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
  779. GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
  780. GTEST_LDADD=`${GTEST_CONFIG} --libs`
  781. GTEST_VERSION=`${GTEST_CONFIG} --version`
  782. GTEST_FOUND="true"
  783. else
  784. AC_MSG_WARN([Unable to locate Google Test gtest-config.])
  785. if test -z "${GTEST_PATHS}" ; then
  786. GTEST_PATHS="/usr /usr/local"
  787. fi
  788. GTEST_FOUND="false"
  789. fi
  790. if test "${GTEST_FOUND}" != "true"; then
  791. GTEST_FOUND="false"
  792. for dir in $GTEST_PATHS; do
  793. if test -f "$dir/include/gtest/gtest.h"; then
  794. if ! test -f "$dir/lib/libgtests.a"; then
  795. AC_MSG_WARN([Found Google Test include but not the library in $dir.])
  796. continue
  797. fi
  798. GTEST_INCLUDES="-I$dir/include"
  799. GTEST_LDFLAGS="-L$dir/lib"
  800. GTEST_LDADD="-lgtest"
  801. GTEST_FOUND="true"
  802. break
  803. fi
  804. done
  805. fi
  806. if test "${GTEST_FOUND}" != "true"; then
  807. AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
  808. fi
  809. fi
  810. fi
  811. AM_CONDITIONAL(HAVE_GTEST, test $enable_gtest != "no")
  812. AM_CONDITIONAL(HAVE_GTEST_SOURCE, test "X$have_gtest_source" = "Xyes")
  813. AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG)
  814. AC_SUBST(GTEST_INCLUDES)
  815. AC_SUBST(GTEST_LDFLAGS)
  816. AC_SUBST(GTEST_LDADD)
  817. AC_SUBST(GTEST_SOURCE)
  818. #
  819. # Some Googletest versions bug with C++11 compilers
  820. #
  821. if test $enable_gtest != "no"; then
  822. AC_MSG_CHECKING([if Google Test is compatible with the compiler])
  823. CPPFLAGS_SAVED=$CPPFLAGS
  824. CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES $GTEST_INCLUDES"
  825. AC_COMPILE_IFELSE(
  826. [AC_LANG_PROGRAM(
  827. [#include <boost/shared_ptr.hpp>
  828. #include <gtest/gtest.h>
  829. void foo() {
  830. boost::shared_ptr<int> bar;
  831. ASSERT_TRUE(bar);
  832. }],
  833. [return 0;])],
  834. [AC_MSG_RESULT(yes)],
  835. [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])])
  836. CPPFLAGS=$CPPFLAGS_SAVED
  837. fi
  838. # Check for CreateUnifiedDiff from gtest >= 1.8.0
  839. if test $enable_gtest != "no"; then
  840. AC_MSG_CHECKING([for CreateUnifiedDiff in $GTEST_INCLUDES/gtest.h])
  841. CPPFLAGS_SAVED=$CPPFLAGS
  842. CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES $GTEST_INCLUDES"
  843. AC_COMPILE_IFELSE(
  844. [AC_LANG_PROGRAM(
  845. [#include <boost/algorithm/string.hpp>
  846. #include <gtest/gtest.h>
  847. #include <string>
  848. #include <vector>
  849. std::string nodiff(std::string text) {
  850. std::vector<std::string> lines;
  851. boost::split(lines, text, boost::is_any_of("\n"));
  852. using namespace testing::internal;
  853. return (edit_distance::CreateUnifiedDiff(lines, lines));
  854. }],
  855. [return 0;])],
  856. [AC_MSG_RESULT(yes)
  857. AC_DEFINE([HAVE_CREATE_UNIFIED_DIFF], [1],
  858. [Define to 1 if gtest defines edit_distance::CreateUnifiedDiff])],
  859. [AC_MSG_RESULT(no)])
  860. CPPFLAGS=$CPPFLAGS_SAVED
  861. fi
  862. #
  863. # ASIO: we extensively use it as the C++ event management module.
  864. #
  865. # Use our 'coroutine' header from ext
  866. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
  867. #
  868. # Doesn't seem to be required?
  869. CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_HEADER_ONLY"
  870. #
  871. # Disable threads: they seems to break things on some systems
  872. CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_DISABLE_THREADS=1"
  873. # We tried to stay header only
  874. if test "x${BOOST_LIBS}" = "x"; then
  875. # Don't want boost system library
  876. CPPFLAGS="$CPPFLAGS -DBOOST_ERROR_CODE_HEADER_ONLY"
  877. # Avoid boost::system::throws multiple defines
  878. CPPFLAGS="$CPPFLAGS -DBOOST_SYSTEM_NO_DEPRECATED"
  879. fi
  880. # Check for functions that are not available on all platforms
  881. AC_CHECK_FUNCS([pselect])
  882. # /dev/poll issue: ASIO uses /dev/poll by default if it's available (generally
  883. # the case with Solaris). Unfortunately its /dev/poll specific code would
  884. # trigger the gcc's "missing-field-initializers" warning, which would
  885. # subsequently make the build fail with -Werror. Further, older versions of
  886. # gcc don't provide an option to selectively suppress this warning.
  887. # So, for the moment, we simply disable the use of /dev/poll. Unless we
  888. # implement recursive DNS server with randomized ports, we don't need the
  889. # scalability that /dev/poll can provide, so this decision wouldn't affect
  890. # run time performance. Hopefully we can find a better solution or the ASIO
  891. # code will be updated by the time we really need it.
  892. AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
  893. if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
  894. CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_DISABLE_DEV_POLL=1"
  895. fi
  896. #
  897. # Perl is optional; it is used only by some of the system test scripts.
  898. #
  899. AC_PATH_PROGS(PERL, perl5 perl)
  900. AC_SUBST(PERL)
  901. AC_PATH_PROGS(AWK, gawk awk)
  902. AC_SUBST(AWK)
  903. AC_ARG_ENABLE(generate_parser, [AC_HELP_STRING([--enable-generate-parser],
  904. [indicates that the parsers will be regenerated. This implies that the
  905. bison and flex are required [default=no]])],
  906. enable_generate_parser=$enableval, enable_generate_parser=no)
  907. # Check if flex is available. Flex is not needed for building Kea sources,
  908. # unless you want to regenerate grammars
  909. AC_PROG_LEX
  910. # Check if bison is available. Bison is not needed for building Kea sources,
  911. # unless you want to regenerate grammars
  912. AC_PROG_YACC
  913. if test "x$enable_generate_parser" != "xno"; then
  914. if test "x$LEX" == "x"; then
  915. AC_MSG_ERROR([Flex is required for enable-generate-parser, but was not found])
  916. fi
  917. if test "x$YACC" == "x"; then
  918. AC_MSG_ERROR([Bison is required for enable-generate-parser, but was not found])
  919. fi
  920. # Ok, let's check if we have at least 3.0.0 version of the bison. The code used
  921. # to generate parsers is roughly based on bison 3.0 examples.
  922. cat > bisontest.y << EOF
  923. %require "3.0.0"
  924. %token X
  925. %%
  926. %start Y;
  927. Y: X;
  928. EOF
  929. # Try to compile.
  930. $YACC bisontest.y -o bisontest.cc
  931. if test $? -ne 0 ; then
  932. $YACC -V
  933. $RM -f bisontest.y bisontest.cc
  934. AC_MSG_ERROR("Error with $YACC. Possibly incorrect version? Required at least 3.0.0.")
  935. fi
  936. $RM -f bisontest.y bisontest.cc
  937. fi
  938. AM_CONDITIONAL([GENERATE_PARSER], [test x$enable_generate_parser != xno])
  939. AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
  940. [regenerate documentation using Docbook [default=no]])],
  941. enable_generate_docs=$enableval, enable_generate_docs=no)
  942. if test "x$enable_generate_docs" != xno ; then
  943. # Check for xsltproc
  944. AC_PATH_PROG([XSLTPROC], [xsltproc])
  945. if test -z "$XSLTPROC"; then
  946. AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
  947. else
  948. AC_MSG_CHECKING([if $XSLTPROC works])
  949. # run xsltproc to see if works
  950. $XSLTPROC --novalid --xinclude http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
  951. if test $? -ne 0 ; then
  952. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
  953. fi
  954. $XSLTPROC --novalid --xinclude http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
  955. if test $? -ne 0 ; then
  956. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
  957. fi
  958. AC_MSG_RESULT(yes)
  959. fi
  960. AC_PATH_PROG([ELINKS], [elinks])
  961. if test -z "$ELINKS"; then
  962. AC_MSG_ERROR("elinks not found; it is required for --enable-generate-docs")
  963. fi
  964. fi
  965. # Don't fail here if not found, used to generate PDF documentation.
  966. AC_PATH_PROG([DBLATEX], [dblatex])
  967. AM_CONDITIONAL(HAVE_DBLATEX, test "x$DBLATEX" != "x")
  968. AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
  969. AC_ARG_ENABLE(install-configurations,
  970. [AC_HELP_STRING([--disable-install-configurations],
  971. [do not install configuration])], install_configurations=$enableval, install_configurations=yes)
  972. AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue)
  973. AC_ARG_ENABLE(logger-checks, [AC_HELP_STRING([--enable-logger-checks],
  974. [check logger messages [default=no]])], enable_logger_checks=$enableval, enable_logger_checks=no)
  975. AM_CONDITIONAL(ENABLE_LOGGER_CHECKS, test x$enable_logger_checks != xno)
  976. AM_COND_IF([ENABLE_LOGGER_CHECKS], [AC_DEFINE([ENABLE_LOGGER_CHECKS], [1], [Check logger messages?])])
  977. # Check for asciidoc
  978. AC_PATH_PROG(ASCIIDOC, asciidoc, no)
  979. AM_CONDITIONAL(HAVE_ASCIIDOC, test "x$ASCIIDOC" != "xno")
  980. # Check for plantuml
  981. AC_PATH_PROG(PLANTUML, plantuml, no)
  982. AM_CONDITIONAL(HAVE_PLANTUML, test "x$PLANTUML" != "xno")
  983. # Check for valgrind
  984. AC_PATH_PROG(VALGRIND, valgrind, no)
  985. AM_CONDITIONAL(HAVE_VALGRIND, test "x$VALGRIND" != "xno")
  986. # Also check for valgrind headers
  987. # We could consider adding them to the source code tree, as this
  988. # is the encouraged method of using them; they are BSD-licensed.
  989. # However, until we find that this is a problem, we just use
  990. # the system-provided ones, if available
  991. AC_CHECK_HEADERS(valgrind/valgrind.h, [AC_DEFINE([HAVE_VALGRIND_HEADERS], [1], [Check valgrind headers])])
  992. found_valgrind="not found"
  993. if test "x$VALGRIND" != "xno"; then
  994. found_valgrind="found"
  995. fi
  996. # Check for optreset in unistd.h. On BSD systems the optreset is
  997. # used to reset the state of getopt() function. Resetting its state
  998. # is required if command line arguments are parsed multiple times
  999. # during a program. On Linux this variable will not exist because
  1000. # getopt() reset is performed by setting optind = 0. On Operating
  1001. # Systems where optreset is defined use optreset = 1 and optind = 1
  1002. # to reset internal state of getopt(). Failing to do so will result
  1003. # in unpredictable output from getopt().
  1004. AC_MSG_CHECKING([whether optreset variable is defined in unistd.h])
  1005. AC_TRY_LINK(
  1006. [#include <unistd.h>],
  1007. [extern int optreset; optreset=1;],
  1008. [ AC_MSG_RESULT(yes)
  1009. var_optreset_exists=yes],
  1010. [ AC_MSG_RESULT(no)
  1011. var_optreset_exists=no]
  1012. )
  1013. AM_CONDITIONAL(HAVE_OPTRESET, test "x$var_optreset_exists" != "xno")
  1014. AM_COND_IF([HAVE_OPTRESET], [AC_DEFINE([HAVE_OPTRESET], [1], [Check for optreset?])])
  1015. AC_DEFINE([CONFIG_H_WAS_INCLUDED], [1], [config.h inclusion marker])
  1016. AC_CONFIG_FILES([Makefile
  1017. compatcheck/Makefile
  1018. dns++.pc
  1019. doc/Makefile
  1020. doc/design/Makefile
  1021. doc/design/datasrc/Makefile
  1022. doc/guide/Makefile
  1023. doc/version.ent
  1024. ext/Makefile
  1025. ext/coroutine/Makefile
  1026. ext/gtest/Makefile
  1027. m4macros/Makefile
  1028. src/Makefile
  1029. src/bin/Makefile
  1030. src/bin/admin/Makefile
  1031. src/bin/admin/kea-admin
  1032. src/bin/admin/tests/Makefile
  1033. src/bin/admin/tests/cql_tests.sh
  1034. src/bin/admin/tests/data/Makefile
  1035. src/bin/admin/tests/memfile_tests.sh
  1036. src/bin/admin/tests/mysql_tests.sh
  1037. src/bin/admin/tests/pgsql_tests.sh
  1038. src/bin/agent/Makefile
  1039. src/bin/agent/tests/Makefile
  1040. src/bin/agent/tests/ca_process_tests.sh
  1041. src/bin/agent/tests/test_data_files_config.h
  1042. src/bin/agent/tests/test_libraries.h
  1043. src/bin/d2/Makefile
  1044. src/bin/d2/tests/Makefile
  1045. src/bin/d2/tests/d2_process_tests.sh
  1046. src/bin/d2/tests/test_data_files_config.h
  1047. src/bin/dhcp4/Makefile
  1048. src/bin/dhcp4/spec_config.h.pre
  1049. src/bin/dhcp4/tests/Makefile
  1050. src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1051. src/bin/dhcp4/tests/marker_file.h
  1052. src/bin/dhcp4/tests/test_data_files_config.h
  1053. src/bin/dhcp4/tests/test_libraries.h
  1054. src/bin/dhcp6/Makefile
  1055. src/bin/dhcp6/spec_config.h.pre
  1056. src/bin/dhcp6/tests/Makefile
  1057. src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1058. src/bin/dhcp6/tests/marker_file.h
  1059. src/bin/dhcp6/tests/test_data_files_config.h
  1060. src/bin/dhcp6/tests/test_libraries.h
  1061. src/bin/keactrl/Makefile
  1062. src/bin/keactrl/keactrl
  1063. src/bin/keactrl/keactrl.conf
  1064. src/bin/keactrl/tests/Makefile
  1065. src/bin/keactrl/tests/keactrl_tests.sh
  1066. src/bin/lfc/Makefile
  1067. src/bin/lfc/tests/Makefile
  1068. src/bin/perfdhcp/Makefile
  1069. src/bin/perfdhcp/tests/Makefile
  1070. src/bin/perfdhcp/tests/testdata/Makefile
  1071. src/bin/shell/Makefile
  1072. src/bin/shell/kea-shell
  1073. src/bin/shell/tests/Makefile
  1074. src/bin/shell/tests/shell_process_tests.sh
  1075. src/bin/shell/tests/shell_unittest.py
  1076. src/hooks/Makefile
  1077. src/hooks/dhcp/Makefile
  1078. src/hooks/dhcp/lease_cmds/Makefile
  1079. src/hooks/dhcp/lease_cmds/tests/Makefile
  1080. src/hooks/dhcp/user_chk/Makefile
  1081. src/hooks/dhcp/user_chk/tests/Makefile
  1082. src/hooks/dhcp/user_chk/tests/test_data_files_config.h
  1083. src/lib/Makefile
  1084. src/lib/asiodns/Makefile
  1085. src/lib/asiodns/tests/Makefile
  1086. src/lib/asiolink/Makefile
  1087. src/lib/asiolink/testutils/Makefile
  1088. src/lib/asiolink/tests/Makefile
  1089. src/lib/cc/Makefile
  1090. src/lib/cc/tests/Makefile
  1091. src/lib/cfgrpt/Makefile
  1092. src/lib/cfgrpt/tests/Makefile
  1093. src/lib/config/Makefile
  1094. src/lib/config/tests/Makefile
  1095. src/lib/config/tests/data_def_unittests_config.h
  1096. src/lib/config/tests/testdata/Makefile
  1097. src/lib/cryptolink/Makefile
  1098. src/lib/cryptolink/tests/Makefile
  1099. src/lib/dhcp/Makefile
  1100. src/lib/dhcp/tests/Makefile
  1101. src/lib/dhcp_ddns/Makefile
  1102. src/lib/dhcp_ddns/tests/Makefile
  1103. src/lib/dhcpsrv/Makefile
  1104. src/lib/dhcpsrv/tests/Makefile
  1105. src/lib/dhcpsrv/tests/test_libraries.h
  1106. src/lib/dhcpsrv/testutils/Makefile
  1107. src/lib/dns/Makefile
  1108. src/lib/dns/gen-rdatacode.py
  1109. src/lib/dns/tests/Makefile
  1110. src/lib/dns/tests/testdata/Makefile
  1111. src/lib/eval/Makefile
  1112. src/lib/eval/tests/Makefile
  1113. src/lib/exceptions/Makefile
  1114. src/lib/exceptions/tests/Makefile
  1115. src/lib/hooks/Makefile
  1116. src/lib/hooks/tests/Makefile
  1117. src/lib/hooks/tests/marker_file.h
  1118. src/lib/hooks/tests/test_libraries.h
  1119. src/lib/http/Makefile
  1120. src/lib/http/tests/Makefile
  1121. src/lib/log/Makefile
  1122. src/lib/log/compiler/Makefile
  1123. src/lib/log/interprocess/Makefile
  1124. src/lib/log/interprocess/tests/Makefile
  1125. src/lib/log/tests/Makefile
  1126. src/lib/log/tests/buffer_logger_test.sh
  1127. src/lib/log/tests/console_test.sh
  1128. src/lib/log/tests/destination_test.sh
  1129. src/lib/log/tests/init_logger_test.sh
  1130. src/lib/log/tests/local_file_test.sh
  1131. src/lib/log/tests/logger_lock_test.sh
  1132. src/lib/log/tests/severity_test.sh
  1133. src/lib/log/tests/tempdir.h
  1134. src/lib/process/Makefile
  1135. src/lib/process/spec_config.h.pre
  1136. src/lib/process/tests/Makefile
  1137. src/lib/process/testutils/Makefile
  1138. src/lib/stats/Makefile
  1139. src/lib/stats/tests/Makefile
  1140. src/lib/testutils/Makefile
  1141. src/lib/testutils/dhcp_test_lib.sh
  1142. src/lib/util/Makefile
  1143. src/lib/util/io/Makefile
  1144. src/lib/util/python/Makefile
  1145. src/lib/util/python/gen_wiredata.py
  1146. src/lib/util/tests/Makefile
  1147. src/lib/util/tests/process_spawn_app.sh
  1148. src/lib/util/threads/Makefile
  1149. src/lib/util/threads/tests/Makefile
  1150. src/lib/util/unittests/Makefile
  1151. src/share/Makefile
  1152. src/share/database/Makefile
  1153. src/share/database/scripts/Makefile
  1154. src/share/database/scripts/cql/Makefile
  1155. src/share/database/scripts/mysql/Makefile
  1156. src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh
  1157. src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh
  1158. src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh
  1159. src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh
  1160. src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh
  1161. src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh
  1162. src/share/database/scripts/pgsql/Makefile
  1163. src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh
  1164. src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
  1165. src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh
  1166. tools/Makefile
  1167. tools/path_replacer.sh
  1168. ])
  1169. AC_CONFIG_COMMANDS([permissions], [
  1170. chmod +x src/bin/admin/kea-admin
  1171. chmod +x src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1172. chmod +x src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1173. chmod +x src/bin/keactrl/keactrl
  1174. chmod +x src/bin/keactrl/tests/keactrl_tests.sh
  1175. chmod +x src/bin/shell/kea-shell
  1176. chmod +x src/bin/shell/tests/shell_process_tests.sh
  1177. chmod +x src/bin/shell/tests/shell_unittest.py
  1178. chmod +x src/lib/dns/gen-rdatacode.py
  1179. chmod +x src/lib/log/tests/console_test.sh
  1180. chmod +x src/lib/log/tests/destination_test.sh
  1181. chmod +x src/lib/log/tests/init_logger_test.sh
  1182. chmod +x src/lib/log/tests/local_file_test.sh
  1183. chmod +x src/lib/log/tests/logger_lock_test.sh
  1184. chmod +x src/lib/log/tests/severity_test.sh
  1185. chmod +x src/lib/util/python/gen_wiredata.py
  1186. chmod +x src/lib/util/tests/process_spawn_app.sh
  1187. chmod +x tools/path_replacer.sh
  1188. ])
  1189. AM_CONDITIONAL(PREMIUM, test -d "$srcdir/premium/src")
  1190. AC_MSG_CHECKING([if premium package is available])
  1191. if test -d "$srcdir/premium/src"; then
  1192. # Define it in the config.h, so C++ code could use it.
  1193. AC_DEFINE([PREMIUM], [1], [Kea-premium package found])
  1194. # Export it here, so code in configure could use it.
  1195. PREMIUM=1
  1196. AC_MSG_RESULT(yes)
  1197. else
  1198. AC_MSG_RESULT(no)
  1199. fi
  1200. AC_OUTPUT
  1201. dnl Print the results
  1202. dnl
  1203. EXTENDED_VERSION=${PACKAGE_VERSION}
  1204. if test "$KEA_SRCID" != ""; then
  1205. EXTENDED_VERSION="${EXTENDED_VERSION} ($KEA_SRCID)"
  1206. fi
  1207. cat > config.report << END
  1208. Kea source configure results:
  1209. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1210. Package:
  1211. Name: ${PACKAGE_NAME}
  1212. Version: ${PACKAGE_VERSION}
  1213. Extended version:${EXTENDED_VERSION}
  1214. OS Family: ${OS_TYPE}
  1215. Using GNU sed: ${GNU_SED}
  1216. END
  1217. if test "$PREMIUM" != ""; then
  1218. cat >> config.report << END
  1219. Premium package: yes
  1220. END
  1221. else
  1222. cat >> config.report << END
  1223. Premium package: no
  1224. END
  1225. fi
  1226. cat >> config.report << END
  1227. C++ Compiler:
  1228. CXX: ${CXX}
  1229. CXX_VERSION: ${CXX_VERSION}
  1230. CXX_STANDARD: ${CXX_STANDARD}
  1231. DEFS: ${DEFS}
  1232. CPPFLAGS: ${CPPFLAGS}
  1233. CXXFLAGS: ${CXXFLAGS}
  1234. LDFLAGS: ${LDFLAGS}
  1235. KEA_CXXFLAGS: ${KEA_CXXFLAGS}
  1236. END
  1237. if test "$PYTHON" != "no" ; then
  1238. cat >> config.report << END
  1239. Python:
  1240. PYTHON: ${PYTHON}
  1241. PYTHON_VERSION: ${PYTHON_VERSION}
  1242. END
  1243. else
  1244. cat >> config.report << END
  1245. Python:
  1246. PYTHON_VERSION: not needed (because kea-shell is disabled)
  1247. END
  1248. fi
  1249. cat >> config.report << END
  1250. Boost:
  1251. BOOST_VERSION: ${BOOST_VERSION}
  1252. BOOST_INCLUDES: ${BOOST_INCLUDES}
  1253. BOOST_LIBS: ${BOOST_LIBS}
  1254. END
  1255. if test x"$BOOST_LIBS" = "x"; then
  1256. cat >> config.report << END
  1257. WARNING: You will be building with boost headers only rather
  1258. than linking with boost_system library. This is NOT recommended as
  1259. it may result in non-optimized code on some platforms and
  1260. introduce runtime errors on others.
  1261. END
  1262. fi
  1263. cat >> config.report << END
  1264. ${CRYPTO_NAME}:
  1265. CRYPTO_VERSION: ${CRYPTO_VERSION}
  1266. CRYPTO_CFLAGS: ${CRYPTO_CFLAGS}
  1267. CRYPTO_INCLUDES: ${CRYPTO_INCLUDES}
  1268. CRYPTO_LDFLAGS: ${CRYPTO_LDFLAGS}
  1269. CRYPTO_LIBS: ${CRYPTO_LIBS}
  1270. ${DISABLED_CRYPTO}: no
  1271. Log4cplus:
  1272. LOG4CPLUS_VERSION: ${LOG4CPLUS_VERSION}
  1273. LOG4CPLUS_INCLUDES: ${LOG4CPLUS_INCLUDES}
  1274. LOG4CPLUS_LIBS: ${LOG4CPLUS_LIBS}
  1275. Flex/bison:
  1276. FLEX: ${LEX}
  1277. BISON: ${YACC}
  1278. END
  1279. # Avoid confusion on DNS/DHCP and only mention MySQL if it
  1280. # were specified on the command line.
  1281. if test "$MYSQL_CPPFLAGS" != "" ; then
  1282. cat >> config.report << END
  1283. MySQL:
  1284. MYSQL_VERSION: ${MYSQL_VERSION}
  1285. MYSQL_CPPFLAGS: ${MYSQL_CPPFLAGS}
  1286. MYSQL_LIBS: ${MYSQL_LIBS}
  1287. END
  1288. else
  1289. cat >> config.report << END
  1290. MySQL:
  1291. no
  1292. END
  1293. fi
  1294. if test "$PGSQL_CPPFLAGS" != "" ; then
  1295. cat >> config.report << END
  1296. PostgreSQL:
  1297. PGSQL_VERSION: ${PGSQL_VERSION}
  1298. PGSQL_CPPFLAGS: ${PGSQL_CPPFLAGS}
  1299. PGSQL_LIBS: ${PGSQL_LIBS}
  1300. END
  1301. else
  1302. cat >> config.report << END
  1303. PostgreSQL:
  1304. no
  1305. END
  1306. fi
  1307. if test "$CQL_CPPFLAGS" != "" ; then
  1308. cat >> config.report << END
  1309. Cassandra CQL:
  1310. CQL_VERSION: ${CQL_VERSION}
  1311. CQL_CPPFLAGS: ${CQL_CPPFLAGS}
  1312. CQL_LIBS: ${CQL_LIBS}
  1313. END
  1314. else
  1315. cat >> config.report << END
  1316. Cassandra CQL:
  1317. no
  1318. END
  1319. fi
  1320. if test "$enable_gtest" != "no"; then
  1321. cat >> config.report << END
  1322. GTest:
  1323. GTEST_VERSION: ${GTEST_VERSION}
  1324. GTEST_INCLUDES: ${GTEST_INCLUDES}
  1325. GTEST_LDFLAGS: ${GTEST_LDFLAGS}
  1326. GTEST_LDADD: ${GTEST_LDADD}
  1327. GTEST_SOURCE: ${GTEST_SOURCE}
  1328. END
  1329. fi
  1330. cat >> config.report << END
  1331. Developer:
  1332. Enable Debugging: $debug_enabled
  1333. Google Tests: $enable_gtest
  1334. Valgrind: $found_valgrind
  1335. C++ Code Coverage: $USE_LCOV
  1336. Logger checks: $enable_logger_checks
  1337. Generate Documentation: $enable_generate_docs
  1338. Parser Generation: $enable_generate_parser
  1339. Kea-shell: $enable_shell
  1340. END
  1341. cat config.report
  1342. cat <<EOF
  1343. Now you can type "make" to build Kea. Note that if you intend to
  1344. run "make check", you must run "make" first as some files need to be
  1345. generated by "make" before "make check" can be run.
  1346. When running "make install" do not use any form of parallel or job
  1347. server options (such as GNU make's -j option). Doing so may cause
  1348. errors.
  1349. EOF