configure.ac 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559
  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.3.0-beta-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. DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=
  359. PKGPYTHONDIR=
  360. m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
  361. [python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 dnl
  362. python3.3 python3.2 python3.1 python3.0 python python2 python2.7])
  363. if test "x$enable_shell" != xno ; then
  364. # If kea-shell is enabled, we really need python. 2.7 or anything newer will do.
  365. # We try to find 3.x first. If not found, we can do with 2.7.
  366. AM_PATH_PYTHON([2.7])
  367. # pkgpythondir needs to be expanded
  368. saved_prefix="$prefix"
  369. if test "$prefix" = "NONE"; then
  370. prefix=$ac_default_prefix
  371. fi
  372. PKGPYTHONDIR="$pkgpythondir"
  373. OLD=
  374. while test "x$OLD" != "x$PKGPYTHONDIR"; do
  375. OLD="$PKGPYTHONDIR"
  376. eval PKGPYTHONDIR="\"$OLD\""
  377. done
  378. prefix="$saved_prefix"
  379. DISTCHECK_KEA_SHELL_CONFIGURE_FLAG="--enable-shell"
  380. else
  381. PYTHON=no
  382. fi
  383. # Export to makefiles the info whether we have shell enabled or not
  384. AM_CONDITIONAL(KEA_SHELL, test x$enable_shell != xno)
  385. AC_SUBST(DISTCHECK_KEA_SHELL_CONFIGURE_FLAG)
  386. AC_SUBST(PKGPYTHONDIR)
  387. # produce PIC unless we disable shared libraries. need this for python bindings.
  388. if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
  389. KEA_CXXFLAGS="$KEA_CXXFLAGS -fPIC"
  390. fi
  391. # Look for glib static libs if they're trying to do static builds
  392. if test $enable_static_link != "no"; then
  393. CXX_SAVED=$CXX
  394. CXX="$CXX -static"
  395. AC_LINK_IFELSE(
  396. [AC_LANG_PROGRAM([#include <math.h>],[(void)sqrt(-1.0);])],
  397. [AC_MSG_RESULT([checking for static glib libraries... yes])],
  398. [AC_MSG_RESULT([checking for static glib libraries... no])
  399. AC_MSG_ERROR([Building with --enable-static-link does not work. You appear to be missing glib static libraries. Check config.log for details.])])
  400. CXX=$CXX_SAVED
  401. fi
  402. AC_SUBST(KEA_CXXFLAGS)
  403. # Checks for libraries.
  404. AC_SEARCH_LIBS(inet_pton, [nsl])
  405. AC_SEARCH_LIBS(recvfrom, [socket])
  406. AC_SEARCH_LIBS(nanosleep, [rt])
  407. AC_SEARCH_LIBS(dlsym, [dl])
  408. # Checks for header files.
  409. # Checks for typedefs, structures, and compiler characteristics.
  410. AC_HEADER_STDBOOL
  411. AC_TYPE_SIZE_T
  412. # Detect OS type (it may be used to do OS-specific things, e.g.
  413. # interface detection in DHCP)
  414. AC_MSG_CHECKING(OS type)
  415. BSD_TYPE="notaBSD"
  416. case $host in
  417. *-linux*)
  418. AC_DEFINE([OS_LINUX], [1], [Running on Linux?])
  419. OS_TYPE="Linux"
  420. CPPFLAGS="$CPPFLAGS -DOS_LINUX"
  421. ;;
  422. *-apple-darwin*)
  423. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  424. AC_DEFINE([OS_OSX], [1], [Running on OSX?])
  425. OS_TYPE="BSD"
  426. BSD_TYPE="OSX"
  427. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  428. ;;
  429. *-freebsd*)
  430. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  431. AC_DEFINE([OS_FREEBSD], [1], [Running on FreeBSD?])
  432. OS_TYPE="BSD"
  433. BSD_TYPE="FreeBSD"
  434. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  435. ;;
  436. *-netbsd*)
  437. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  438. AC_DEFINE([OS_NETBSD], [1], [Running on NetBSD?])
  439. OS_TYPE="BSD"
  440. BSD_TYPE="NetBSD"
  441. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  442. ;;
  443. *-openbsd*)
  444. AC_DEFINE([OS_BSD], [1], [Running on BSD?])
  445. AC_DEFINE([OS_OPENBSD], [1], [Running on OpenBSD?])
  446. OS_TYPE="BSD"
  447. BSD_TYPE="OpenBSD"
  448. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  449. ;;
  450. *-solaris*)
  451. AC_DEFINE([OS_SOLARIS], [1], [Running on Solaris?])
  452. OS_TYPE="Solaris"
  453. CPPFLAGS="$CPPFLAGS -DOS_SUN"
  454. ;;
  455. *)
  456. OS_TYPE="Unknown"
  457. # $host_os is more user friendly than full $host
  458. AC_MSG_WARN("Unsupported OS: $host_os")
  459. ;;
  460. esac
  461. AC_MSG_RESULT($OS_TYPE)
  462. AM_CONDITIONAL(OS_LINUX, test $OS_TYPE = Linux)
  463. AM_CONDITIONAL(OS_BSD, test $OS_TYPE = BSD)
  464. AM_CONDITIONAL(OS_SOLARIS, test $OS_TYPE = Solaris)
  465. AM_CONDITIONAL(OS_OSX, test $BSD_TYPE = OSX)
  466. AM_CONDITIONAL(OS_FREEBSD, test $BSD_TYPE = FreeBSD)
  467. AM_CONDITIONAL(OS_NETBSD, test $BSD_TYPE = NetBSD)
  468. AM_CONDITIONAL(OS_OPENBSD, test $BSD_TYPE = OpenBSD)
  469. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  470. AC_TRY_COMPILE([
  471. #include <sys/types.h>
  472. #include <sys/socket.h>],
  473. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  474. [AC_MSG_RESULT(yes)
  475. AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
  476. AC_MSG_RESULT(no))
  477. enable_gtest="no"
  478. GTEST_INCLUDES=
  479. AC_ARG_WITH([gtest-source],
  480. [AS_HELP_STRING([--with-gtest-source=PATH],
  481. [location of the Googletest source])],
  482. [enable_gtest="yes" ; GTEST_SOURCE="$withval"])
  483. AC_ARG_WITH([gtest],
  484. [AS_HELP_STRING([--with-gtest=PATH],
  485. [specify a path to gtest header files (PATH/include) and library (PATH/lib)])],
  486. [gtest_path="$withval"; enable_gtest="yes"], [gtest_path="no"])
  487. AC_ARG_WITH(lcov,
  488. [ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
  489. USE_LCOV="no"
  490. if test "$lcov" != "no"; then
  491. # force gtest if not set
  492. if test "$enable_gtest" = "no"; then
  493. # AC_MSG_ERROR("lcov needs gtest for test coverage report")
  494. AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
  495. enable_gtest="yes"
  496. fi
  497. if test "$lcov" != "yes"; then
  498. LCOV=$lcov
  499. else
  500. AC_PATH_PROG([LCOV], [lcov])
  501. fi
  502. if test -x "${LCOV}"; then
  503. USE_LCOV="yes"
  504. else
  505. AC_MSG_ERROR([Cannot find lcov.])
  506. fi
  507. # is genhtml always in the same directory?
  508. GENHTML=`echo "$LCOV" | ${SED} s/lcov$/genhtml/`
  509. if test ! -x $GENHTML; then
  510. AC_MSG_ERROR([genhtml not found, needed for lcov])
  511. fi
  512. # GCC specific?
  513. CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
  514. LIBS=" $LIBS -lgcov"
  515. AC_SUBST(CPPFLAGS)
  516. AC_SUBST(LIBS)
  517. AC_SUBST(LCOV)
  518. AC_SUBST(GENHTML)
  519. fi
  520. AC_SUBST(USE_LCOV)
  521. # Sets up for use of botan unless openssl is specified
  522. # sets variables CRYPTO_*
  523. AX_CRYPTO
  524. # Check for MySql. The path to the mysql_config program is given with
  525. # the --with-mysql-config (default to /usr/bin/mysql-config). By default,
  526. # the software is not built with MySQL support enabled.
  527. mysql_config="no"
  528. AC_ARG_WITH([dhcp-mysql],
  529. AC_HELP_STRING([--with-dhcp-mysql=PATH],
  530. [path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
  531. [mysql_config="$withval"])
  532. if test "${mysql_config}" = "yes" ; then
  533. MYSQL_CONFIG="/usr/bin/mysql_config"
  534. elif test "${mysql_config}" != "no" ; then
  535. MYSQL_CONFIG="${withval}"
  536. fi
  537. if test "$MYSQL_CONFIG" != "" ; then
  538. if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
  539. AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
  540. fi
  541. MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
  542. MYSQL_LIBS=`$MYSQL_CONFIG --libs`
  543. MYSQL_VERSION=`$MYSQL_CONFIG --version`
  544. AC_SUBST(MYSQL_CPPFLAGS)
  545. AC_SUBST(MYSQL_LIBS)
  546. # Check that a simple program using MySQL functions can compile and link.
  547. CPPFLAGS_SAVED="$CPPFLAGS"
  548. LIBS_SAVED="$LIBS"
  549. CPPFLAGS="$MYSQL_CPPFLAGS $CPPFLAGS"
  550. LIBS="$MYSQL_LIBS $LIBS"
  551. AC_LINK_IFELSE(
  552. [AC_LANG_PROGRAM([#include <mysql.h>],
  553. [MYSQL mysql_handle;
  554. (void) mysql_init(&mysql_handle);
  555. ])],
  556. [AC_MSG_RESULT([checking for MySQL headers and library... yes])],
  557. [AC_MSG_RESULT([checking for MySQL headers and library... no])
  558. AC_MSG_ERROR([Needs MySQL library])]
  559. )
  560. CPPFLAGS=$CPPFLAGS_SAVED
  561. LIBS=$LIBS_SAVED
  562. # Note that MYSQL is present in the config.h file
  563. AC_DEFINE([HAVE_MYSQL], [1], [MySQL is present])
  564. fi
  565. # Solaris puts FIONREAD in filio.h
  566. AC_CHECK_HEADERS(sys/filio.h,,,)
  567. # ... and at the shell level, so Makefile.am can take action depending on this.
  568. AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
  569. pg_config="no"
  570. AC_ARG_WITH([dhcp-pgsql],
  571. AC_HELP_STRING([--with-dhcp-pgsql=PATH],
  572. [path to the PostgreSQL 'pg_config' script]),
  573. [pg_config="$withval"])
  574. if test "${pg_config}" = "yes" ; then
  575. PG_CONFIG="/usr/bin/pg_config"
  576. elif test "${pg_config}" != "no" ; then
  577. PG_CONFIG="${withval}"
  578. fi
  579. if test "$PG_CONFIG" != "" ; then
  580. if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
  581. AC_MSG_ERROR([--with-dhcp-pgsql should point to a pg_config program])
  582. fi
  583. PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
  584. PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir`
  585. PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server`
  586. PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$PGSQL_INCLUDEDIR -I$PGSQL_INCLUDEDIR_SERVER"
  587. PGSQL_LIBS=`$PG_CONFIG --libdir`
  588. PGSQL_LIBS="-L$PGSQL_LIBS -lpq"
  589. PGSQL_VERSION=`$PG_CONFIG --version`
  590. AC_SUBST(PGSQL_CPPFLAGS)
  591. AC_SUBST(PGSQL_LIBS)
  592. # Check that a simple program using PostgreSQL functions can compile and link.
  593. CPPFLAGS_SAVED="$CPPFLAGS"
  594. LIBS_SAVED="$LIBS"
  595. CPPFLAGS="$PGSQL_CPPFLAGS $CPPFLAGS"
  596. LIBS="$PGSQL_LIBS $LIBS"
  597. AC_LINK_IFELSE(
  598. [AC_LANG_PROGRAM([#include <libpq-fe.h>],
  599. [PGconn * c = PQconnectdb("dbname = 'postgres'");
  600. PQfinish(c);])],
  601. [AC_MSG_RESULT([checking for PostgreSQL headers and library... yes])],
  602. [AC_MSG_RESULT([checking for PostgreSQL headers and library... no])
  603. AC_MSG_ERROR([Needs PostgreSQL library])]
  604. )
  605. AC_CHECK_HEADERS([utils/errcodes.h],,
  606. AC_MSG_ERROR([Missing required header file (errcodes.h) from PostgreSQL server-development package]))
  607. CPPFLAGS=$CPPFLAGS_SAVED
  608. LIBS=$LIBS_SAVED
  609. # Note that PostgreSQL is present in the config.h file
  610. AC_DEFINE([HAVE_PGSQL], [1], [PostgreSQL is present])
  611. fi
  612. # ... and at the shell level, so Makefile.am can take action depending on this.
  613. AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
  614. cql_config="no"
  615. AC_ARG_WITH([cql],
  616. AC_HELP_STRING([--with-cql=PATH],
  617. [path to the Cassandra CQL 'cql_config' script]),
  618. [cql_config="$withval"])
  619. if test "${cql_config}" = "yes" ; then
  620. CQL_CONFIG="/usr/bin/cql_config"
  621. elif test "${cql_config}" != "no" ; then
  622. CQL_CONFIG="${cql_config}"
  623. fi
  624. if test "$CQL_CONFIG" != "" ; then
  625. if test -d "$CQL_CONFIG" -o ! -x "$CQL_CONFIG" ; then
  626. AC_MSG_ERROR([--with-cql should point to a cql_config program])
  627. fi
  628. CQL_INCLUDEDIR=`$CQL_CONFIG --includedir`
  629. CQL_CPPFLAGS="`$CQL_CONFIG --cppflags` -I$CQL_INCLUDEDIR"
  630. CQL_LIBS="-L`$CQL_CONFIG --libdir` -lcassandra_static -luv"
  631. CQL_VERSION=`$CQL_CONFIG --version`
  632. AC_SUBST(CQL_CPPFLAGS)
  633. AC_SUBST(CQL_LIBS)
  634. # Check that a simple program using CQL functions can compile and link.
  635. CPPFLAGS_SAVED="$CPPFLAGS"
  636. LIBS_SAVED="$LIBS"
  637. CPPFLAGS="$CQL_CPPFLAGS $CPPFLAGS"
  638. LIBS="$CQL_LIBS $LIBS"
  639. AC_LINK_IFELSE(
  640. [AC_LANG_PROGRAM([#include <cassandra.h>],
  641. [CassCluster* cluster = cass_cluster_new();
  642. cass_cluster_free(cluster);])],
  643. [AC_MSG_RESULT([checking for Cassandra CQL headers and library... yes])],
  644. [AC_MSG_RESULT([checking for Cassandra CQL headers and library... no])
  645. AC_MSG_ERROR([Needs Cassandra CQL library])]
  646. )
  647. CPPFLAGS=$CPPFLAGS_SAVED
  648. LIBS=$LIBS_SAVED
  649. # Note that CQL is present in the config.h file
  650. AC_DEFINE([HAVE_CQL], [1], [CQL is present])
  651. fi
  652. # ... and at the shell level, so Makefile.am can take action depending on this.
  653. AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "")
  654. # Check for log4cplus
  655. DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=
  656. log4cplus_path="yes"
  657. AC_ARG_WITH([log4cplus],
  658. AC_HELP_STRING([--with-log4cplus=PATH],
  659. [specify exact directory of log4cplus library and headers]),
  660. [log4cplus_path="$withval"])
  661. if test "${log4cplus_path}" = "no" ; then
  662. AC_MSG_ERROR([Need log4cplus])
  663. elif test "${log4cplus_path}" != "yes" ; then
  664. DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG="-with-log4cplus=${log4cplus_path}"
  665. LOG4CPLUS_INCLUDES="-I${log4cplus_path}/include"
  666. LOG4CPLUS_LIBS="-L${log4cplus_path}/lib"
  667. else
  668. # If not specified, try some common paths.
  669. log4cplusdirs="/usr /usr/local /usr/pkg /opt /opt/local"
  670. for d in $log4cplusdirs
  671. do
  672. if test -f $d/include/log4cplus/logger.h; then
  673. LOG4CPLUS_INCLUDES="-I$d/include"
  674. LOG4CPLUS_LIBS="-L$d/lib -L$d/lib64"
  675. break
  676. fi
  677. done
  678. DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG="-with-log4cplus"
  679. fi
  680. LOG4CPLUS_LIBS="$LOG4CPLUS_LIBS -llog4cplus"
  681. AC_SUBST(DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG)
  682. AC_SUBST(LOG4CPLUS_LIBS)
  683. AC_SUBST(LOG4CPLUS_INCLUDES)
  684. CPPFLAGS_SAVED=$CPPFLAGS
  685. CPPFLAGS="$LOG4CPLUS_INCLUDES $CPPFLAGS"
  686. LIBS_SAVED="$LIBS"
  687. LIBS="$LOG4CPLUS_LIBS $MULTITHREADING_FLAG $LIBS"
  688. AC_CHECK_HEADERS([log4cplus/logger.h],,AC_MSG_ERROR([Missing required header files.]))
  689. AC_LINK_IFELSE(
  690. [AC_LANG_PROGRAM([#include <log4cplus/logger.h>
  691. ],
  692. [using namespace log4cplus;
  693. Logger logger = Logger::getInstance("main");
  694. ])],
  695. [AC_MSG_RESULT([checking for log4cplus library... yes])],
  696. [AC_MSG_RESULT([checking for log4cplus library... no])
  697. AC_MSG_ERROR([Needs log4cplus library])]
  698. )
  699. dnl Determine the log4cplus version, used mainly for config.report.
  700. AC_MSG_CHECKING([log4cplus version])
  701. cat > conftest.cpp << EOF
  702. #include <log4cplus/version.h>
  703. AUTOCONF_LOG4CPLUS_VERSION=LOG4CPLUS_VERSION_STR
  704. EOF
  705. 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`
  706. if test -z "$LOG4CPLUS_VERSION"; then
  707. LOG4CPLUS_VERSION="unknown"
  708. fi
  709. $RM -f conftest.cpp
  710. AC_MSG_RESULT([$LOG4CPLUS_VERSION])
  711. CPPFLAGS=$CPPFLAGS_SAVED
  712. LIBS=$LIBS_SAVED
  713. #
  714. # Configure Boost header path
  715. #
  716. AX_BOOST_FOR_KEA
  717. # Boost offset_ptr is required in one library and not optional right now, so
  718. # we unconditionally fail here if it doesn't work.
  719. if test "$BOOST_OFFSET_PTR_WOULDFAIL" = "yes" -a X"$werror_ok" = X1; then
  720. 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.])
  721. fi
  722. if test "$BOOST_STATIC_ASSERT_WOULDFAIL" = "yes" -a X"$werror_ok" = X1; then
  723. 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.])
  724. fi
  725. # There's a known bug in FreeBSD ports for Boost that would trigger a false
  726. # warning in build with g++ and -Werror (we exclude clang++ explicitly to
  727. # avoid unexpected false positives).
  728. if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes" -a X"$werror_ok" = X1 -a $CLANGPP = "no"; then
  729. 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.])
  730. fi
  731. # Add some default CPP flags needed for Boost, identified by the AX macro.
  732. CPPFLAGS="$CPPFLAGS $CPPFLAGS_BOOST_THREADCONF"
  733. # Can be required by gtest, boost and perhaps still asio
  734. AC_CHECK_LIB(pthread, pthread_create,[ LDFLAGS="$LDFLAGS -lpthread" ], [])
  735. #
  736. # Check availability of gtest, which will be used for unit tests.
  737. #
  738. GTEST_LDFLAGS=
  739. GTEST_LDADD=
  740. DISTCHECK_GTEST_CONFIGURE_FLAG=
  741. GTEST_VERSION="unknown"
  742. if test "x$enable_gtest" = "xyes" ; then
  743. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=$gtest_path"
  744. if test -n "$with_gtest_source" ; then
  745. if test "x$GTEST_SOURCE" = "xyes" ; then
  746. AC_MSG_CHECKING([for gtest source])
  747. # If not specified, try some common paths.
  748. GTEST_SOURCE=
  749. for d in /usr/src/gtest /usr/local /usr/pkg /opt /opt/local ; do
  750. if test -f $d/src/gtest-all.cc -a $d/src/gtest_main.cc; then
  751. GTEST_SOURCE=$d
  752. AC_MSG_RESULT([$GTEST_SOURCE])
  753. break
  754. fi
  755. done
  756. if test -z $GTEST_SOURCE ; then
  757. AC_MSG_ERROR([no gtest source but it was selected])
  758. fi
  759. else
  760. if test ! -d $GTEST_SOURCE/src -a -d $GTEST_SOURCE/googletest; then
  761. GTEST_SOURCE=$GTEST_SOURCE/googletest
  762. fi
  763. AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
  764. [$GTEST_SOURCE/src/gtest_main.cc],
  765. [have_gtest_source=yes],
  766. [AC_MSG_ERROR([no gtest source at $GTEST_SOURCE])])
  767. fi
  768. have_gtest_source=yes
  769. GTEST_LDADD="\$(top_builddir)/ext/gtest/libgtest.a"
  770. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest-source=$GTEST_SOURCE"
  771. GTEST_INCLUDES="-I$GTEST_SOURCE -I$GTEST_SOURCE/include"
  772. GTEST_VERSION="`basename $GTEST_SOURCE`"
  773. fi
  774. if test "$gtest_path" != "no" ; then
  775. if test "$gtest_path" != "yes"; then
  776. GTEST_PATHS=$gtest_path
  777. if test -x "${gtest_path}/bin/gtest-config" ; then
  778. GTEST_CONFIG="${gtest_path}/bin/gtest-config"
  779. fi
  780. else
  781. AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
  782. fi
  783. if test -x "${GTEST_CONFIG}" ; then :
  784. # using cppflags instead of cxxflags
  785. GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
  786. GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
  787. GTEST_LDADD=`${GTEST_CONFIG} --libs`
  788. GTEST_VERSION=`${GTEST_CONFIG} --version`
  789. GTEST_FOUND="true"
  790. else
  791. AC_MSG_WARN([Unable to locate Google Test gtest-config.])
  792. if test -z "${GTEST_PATHS}" ; then
  793. GTEST_PATHS="/usr /usr/local"
  794. fi
  795. GTEST_FOUND="false"
  796. fi
  797. if test "${GTEST_FOUND}" != "true"; then
  798. GTEST_FOUND="false"
  799. for dir in $GTEST_PATHS; do
  800. if test -f "$dir/include/gtest/gtest.h"; then
  801. if ! test -f "$dir/lib/libgtests.a"; then
  802. AC_MSG_WARN([Found Google Test include but not the library in $dir.])
  803. continue
  804. fi
  805. GTEST_INCLUDES="-I$dir/include"
  806. GTEST_LDFLAGS="-L$dir/lib"
  807. GTEST_LDADD="-lgtest"
  808. GTEST_FOUND="true"
  809. break
  810. fi
  811. done
  812. fi
  813. if test "${GTEST_FOUND}" != "true"; then
  814. AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
  815. fi
  816. fi
  817. fi
  818. AM_CONDITIONAL(HAVE_GTEST, test $enable_gtest != "no")
  819. AM_CONDITIONAL(HAVE_GTEST_SOURCE, test "X$have_gtest_source" = "Xyes")
  820. AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG)
  821. AC_SUBST(GTEST_INCLUDES)
  822. AC_SUBST(GTEST_LDFLAGS)
  823. AC_SUBST(GTEST_LDADD)
  824. AC_SUBST(GTEST_SOURCE)
  825. #
  826. # Some Googletest versions bug with C++11 compilers
  827. #
  828. if test $enable_gtest != "no"; then
  829. AC_MSG_CHECKING([if Google Test is compatible with the compiler])
  830. CPPFLAGS_SAVED=$CPPFLAGS
  831. CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES $GTEST_INCLUDES"
  832. AC_COMPILE_IFELSE(
  833. [AC_LANG_PROGRAM(
  834. [#include <boost/shared_ptr.hpp>
  835. #include <gtest/gtest.h>
  836. void foo() {
  837. boost::shared_ptr<int> bar;
  838. ASSERT_TRUE(bar);
  839. }],
  840. [return 0;])],
  841. [AC_MSG_RESULT(yes)],
  842. [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])])
  843. CPPFLAGS=$CPPFLAGS_SAVED
  844. fi
  845. # Check for CreateUnifiedDiff from gtest >= 1.8.0
  846. if test $enable_gtest != "no"; then
  847. AC_MSG_CHECKING([for CreateUnifiedDiff in $GTEST_INCLUDES/gtest.h])
  848. CPPFLAGS_SAVED=$CPPFLAGS
  849. CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES $GTEST_INCLUDES"
  850. AC_COMPILE_IFELSE(
  851. [AC_LANG_PROGRAM(
  852. [#include <boost/algorithm/string.hpp>
  853. #include <gtest/gtest.h>
  854. #include <string>
  855. #include <vector>
  856. std::string nodiff(std::string text) {
  857. std::vector<std::string> lines;
  858. boost::split(lines, text, boost::is_any_of("\n"));
  859. using namespace testing::internal;
  860. return (edit_distance::CreateUnifiedDiff(lines, lines));
  861. }],
  862. [return 0;])],
  863. [AC_MSG_RESULT(yes)
  864. AC_DEFINE([HAVE_CREATE_UNIFIED_DIFF], [1],
  865. [Define to 1 if gtest defines edit_distance::CreateUnifiedDiff])],
  866. [AC_MSG_RESULT(no)])
  867. CPPFLAGS=$CPPFLAGS_SAVED
  868. fi
  869. #
  870. # ASIO: we extensively use it as the C++ event management module.
  871. #
  872. # Use our 'coroutine' header from ext
  873. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
  874. #
  875. # Doesn't seem to be required?
  876. CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_HEADER_ONLY"
  877. #
  878. # Disable threads: they seems to break things on some systems
  879. CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_DISABLE_THREADS=1"
  880. # We tried to stay header only
  881. if test "x${BOOST_LIBS}" = "x"; then
  882. # Don't want boost system library
  883. CPPFLAGS="$CPPFLAGS -DBOOST_ERROR_CODE_HEADER_ONLY"
  884. # Avoid boost::system::throws multiple defines
  885. CPPFLAGS="$CPPFLAGS -DBOOST_SYSTEM_NO_DEPRECATED"
  886. fi
  887. # Check for functions that are not available on all platforms
  888. AC_CHECK_FUNCS([pselect])
  889. # /dev/poll issue: ASIO uses /dev/poll by default if it's available (generally
  890. # the case with Solaris). Unfortunately its /dev/poll specific code would
  891. # trigger the gcc's "missing-field-initializers" warning, which would
  892. # subsequently make the build fail with -Werror. Further, older versions of
  893. # gcc don't provide an option to selectively suppress this warning.
  894. # So, for the moment, we simply disable the use of /dev/poll. Unless we
  895. # implement recursive DNS server with randomized ports, we don't need the
  896. # scalability that /dev/poll can provide, so this decision wouldn't affect
  897. # run time performance. Hopefully we can find a better solution or the ASIO
  898. # code will be updated by the time we really need it.
  899. AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
  900. if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
  901. CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_DISABLE_DEV_POLL=1"
  902. fi
  903. #
  904. # Perl is optional; it is used only by some of the system test scripts.
  905. #
  906. AC_PATH_PROGS(PERL, perl5 perl)
  907. AC_SUBST(PERL)
  908. AC_PATH_PROGS(AWK, gawk awk)
  909. AC_SUBST(AWK)
  910. AC_ARG_ENABLE(generate_parser, [AC_HELP_STRING([--enable-generate-parser],
  911. [indicates that the parsers will be regenerated. This implies that the
  912. bison and flex are required [default=no]])],
  913. enable_generate_parser=$enableval, enable_generate_parser=no)
  914. # Check if flex is available. Flex is not needed for building Kea sources,
  915. # unless you want to regenerate grammars
  916. AC_PROG_LEX
  917. # Check if bison is available. Bison is not needed for building Kea sources,
  918. # unless you want to regenerate grammars
  919. AC_PROG_YACC
  920. if test "x$enable_generate_parser" != "xno"; then
  921. if test "x$LEX" == "x"; then
  922. AC_MSG_ERROR([Flex is required for enable-generate-parser, but was not found])
  923. fi
  924. if test "x$YACC" == "x"; then
  925. AC_MSG_ERROR([Bison is required for enable-generate-parser, but was not found])
  926. fi
  927. # Ok, let's check if we have at least 3.0.0 version of the bison. The code used
  928. # to generate parsers is roughly based on bison 3.0 examples.
  929. cat > bisontest.y << EOF
  930. %require "3.0.0"
  931. %token X
  932. %%
  933. %start Y;
  934. Y: X;
  935. EOF
  936. # Try to compile.
  937. $YACC bisontest.y -o bisontest.cc
  938. if test $? -ne 0 ; then
  939. $YACC -V
  940. $RM -f bisontest.y bisontest.cc
  941. AC_MSG_ERROR("Error with $YACC. Possibly incorrect version? Required at least 3.0.0.")
  942. fi
  943. $RM -f bisontest.y bisontest.cc
  944. fi
  945. AM_CONDITIONAL([GENERATE_PARSER], [test x$enable_generate_parser != xno])
  946. AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
  947. [regenerate documentation using Docbook [default=no]])],
  948. enable_generate_docs=$enableval, enable_generate_docs=no)
  949. if test "x$enable_generate_docs" != xno ; then
  950. # Check for xsltproc
  951. AC_PATH_PROG([XSLTPROC], [xsltproc])
  952. if test -z "$XSLTPROC"; then
  953. AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
  954. else
  955. AC_MSG_CHECKING([if $XSLTPROC works])
  956. # run xsltproc to see if works
  957. $XSLTPROC --novalid --xinclude http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
  958. if test $? -ne 0 ; then
  959. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
  960. fi
  961. $XSLTPROC --novalid --xinclude http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
  962. if test $? -ne 0 ; then
  963. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
  964. fi
  965. AC_MSG_RESULT(yes)
  966. fi
  967. AC_PATH_PROG([ELINKS], [elinks])
  968. if test -z "$ELINKS"; then
  969. AC_MSG_ERROR("elinks not found; it is required for --enable-generate-docs")
  970. fi
  971. fi
  972. # Don't fail here if not found, used to generate PDF documentation.
  973. AC_PATH_PROG([DBLATEX], [dblatex])
  974. AM_CONDITIONAL(HAVE_DBLATEX, test "x$DBLATEX" != "x")
  975. AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
  976. AC_ARG_ENABLE(install-configurations,
  977. [AC_HELP_STRING([--disable-install-configurations],
  978. [do not install configuration])], install_configurations=$enableval, install_configurations=yes)
  979. AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue)
  980. AC_ARG_ENABLE(logger-checks, [AC_HELP_STRING([--enable-logger-checks],
  981. [check logger messages [default=no]])], enable_logger_checks=$enableval, enable_logger_checks=no)
  982. AM_CONDITIONAL(ENABLE_LOGGER_CHECKS, test x$enable_logger_checks != xno)
  983. AM_COND_IF([ENABLE_LOGGER_CHECKS], [AC_DEFINE([ENABLE_LOGGER_CHECKS], [1], [Check logger messages?])])
  984. # Check for asciidoc
  985. AC_PATH_PROG(ASCIIDOC, asciidoc, no)
  986. AM_CONDITIONAL(HAVE_ASCIIDOC, test "x$ASCIIDOC" != "xno")
  987. # Check for plantuml
  988. AC_PATH_PROG(PLANTUML, plantuml, no)
  989. AM_CONDITIONAL(HAVE_PLANTUML, test "x$PLANTUML" != "xno")
  990. # Check for valgrind
  991. AC_PATH_PROG(VALGRIND, valgrind, no)
  992. AM_CONDITIONAL(HAVE_VALGRIND, test "x$VALGRIND" != "xno")
  993. # Also check for valgrind headers
  994. # We could consider adding them to the source code tree, as this
  995. # is the encouraged method of using them; they are BSD-licensed.
  996. # However, until we find that this is a problem, we just use
  997. # the system-provided ones, if available
  998. AC_CHECK_HEADERS(valgrind/valgrind.h, [AC_DEFINE([HAVE_VALGRIND_HEADERS], [1], [Check valgrind headers])])
  999. found_valgrind="not found"
  1000. if test "x$VALGRIND" != "xno"; then
  1001. found_valgrind="found"
  1002. fi
  1003. # Check for optreset in unistd.h. On BSD systems the optreset is
  1004. # used to reset the state of getopt() function. Resetting its state
  1005. # is required if command line arguments are parsed multiple times
  1006. # during a program. On Linux this variable will not exist because
  1007. # getopt() reset is performed by setting optind = 0. On Operating
  1008. # Systems where optreset is defined use optreset = 1 and optind = 1
  1009. # to reset internal state of getopt(). Failing to do so will result
  1010. # in unpredictable output from getopt().
  1011. AC_MSG_CHECKING([whether optreset variable is defined in unistd.h])
  1012. AC_TRY_LINK(
  1013. [#include <unistd.h>],
  1014. [extern int optreset; optreset=1;],
  1015. [ AC_MSG_RESULT(yes)
  1016. var_optreset_exists=yes],
  1017. [ AC_MSG_RESULT(no)
  1018. var_optreset_exists=no]
  1019. )
  1020. AM_CONDITIONAL(HAVE_OPTRESET, test "x$var_optreset_exists" != "xno")
  1021. AM_COND_IF([HAVE_OPTRESET], [AC_DEFINE([HAVE_OPTRESET], [1], [Check for optreset?])])
  1022. AC_DEFINE([CONFIG_H_WAS_INCLUDED], [1], [config.h inclusion marker])
  1023. AC_CONFIG_FILES([Makefile
  1024. compatcheck/Makefile
  1025. dns++.pc
  1026. doc/Makefile
  1027. doc/design/Makefile
  1028. doc/design/datasrc/Makefile
  1029. doc/guide/Makefile
  1030. doc/version.ent
  1031. ext/Makefile
  1032. ext/coroutine/Makefile
  1033. ext/gtest/Makefile
  1034. m4macros/Makefile
  1035. src/Makefile
  1036. src/bin/Makefile
  1037. src/bin/admin/Makefile
  1038. src/bin/admin/kea-admin
  1039. src/bin/admin/tests/Makefile
  1040. src/bin/admin/tests/cql_tests.sh
  1041. src/bin/admin/tests/data/Makefile
  1042. src/bin/admin/tests/memfile_tests.sh
  1043. src/bin/admin/tests/mysql_tests.sh
  1044. src/bin/admin/tests/pgsql_tests.sh
  1045. src/bin/agent/Makefile
  1046. src/bin/agent/tests/Makefile
  1047. src/bin/agent/tests/ca_process_tests.sh
  1048. src/bin/agent/tests/test_data_files_config.h
  1049. src/bin/agent/tests/test_libraries.h
  1050. src/bin/d2/Makefile
  1051. src/bin/d2/tests/Makefile
  1052. src/bin/d2/tests/d2_process_tests.sh
  1053. src/bin/d2/tests/test_data_files_config.h
  1054. src/bin/dhcp4/Makefile
  1055. src/bin/dhcp4/spec_config.h.pre
  1056. src/bin/dhcp4/tests/Makefile
  1057. src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1058. src/bin/dhcp4/tests/marker_file.h
  1059. src/bin/dhcp4/tests/test_data_files_config.h
  1060. src/bin/dhcp4/tests/test_libraries.h
  1061. src/bin/dhcp6/Makefile
  1062. src/bin/dhcp6/spec_config.h.pre
  1063. src/bin/dhcp6/tests/Makefile
  1064. src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1065. src/bin/dhcp6/tests/marker_file.h
  1066. src/bin/dhcp6/tests/test_data_files_config.h
  1067. src/bin/dhcp6/tests/test_libraries.h
  1068. src/bin/keactrl/Makefile
  1069. src/bin/keactrl/keactrl
  1070. src/bin/keactrl/keactrl.conf
  1071. src/bin/keactrl/tests/Makefile
  1072. src/bin/keactrl/tests/keactrl_tests.sh
  1073. src/bin/lfc/Makefile
  1074. src/bin/lfc/tests/Makefile
  1075. src/bin/perfdhcp/Makefile
  1076. src/bin/perfdhcp/tests/Makefile
  1077. src/bin/perfdhcp/tests/testdata/Makefile
  1078. src/bin/shell/Makefile
  1079. src/bin/shell/kea-shell
  1080. src/bin/shell/tests/Makefile
  1081. src/bin/shell/tests/shell_process_tests.sh
  1082. src/bin/shell/tests/shell_unittest.py
  1083. src/hooks/Makefile
  1084. src/hooks/dhcp/Makefile
  1085. src/hooks/dhcp/lease_cmds/Makefile
  1086. src/hooks/dhcp/lease_cmds/tests/Makefile
  1087. src/hooks/dhcp/user_chk/Makefile
  1088. src/hooks/dhcp/user_chk/tests/Makefile
  1089. src/hooks/dhcp/user_chk/tests/test_data_files_config.h
  1090. src/lib/Makefile
  1091. src/lib/asiodns/Makefile
  1092. src/lib/asiodns/tests/Makefile
  1093. src/lib/asiolink/Makefile
  1094. src/lib/asiolink/testutils/Makefile
  1095. src/lib/asiolink/tests/Makefile
  1096. src/lib/cc/Makefile
  1097. src/lib/cc/tests/Makefile
  1098. src/lib/cfgrpt/Makefile
  1099. src/lib/cfgrpt/tests/Makefile
  1100. src/lib/config/Makefile
  1101. src/lib/config/tests/Makefile
  1102. src/lib/config/tests/data_def_unittests_config.h
  1103. src/lib/config/tests/testdata/Makefile
  1104. src/lib/cryptolink/Makefile
  1105. src/lib/cryptolink/tests/Makefile
  1106. src/lib/dhcp/Makefile
  1107. src/lib/dhcp/tests/Makefile
  1108. src/lib/dhcp_ddns/Makefile
  1109. src/lib/dhcp_ddns/tests/Makefile
  1110. src/lib/dhcpsrv/Makefile
  1111. src/lib/dhcpsrv/tests/Makefile
  1112. src/lib/dhcpsrv/tests/test_libraries.h
  1113. src/lib/dhcpsrv/testutils/Makefile
  1114. src/lib/dns/Makefile
  1115. src/lib/dns/gen-rdatacode.py
  1116. src/lib/dns/tests/Makefile
  1117. src/lib/dns/tests/testdata/Makefile
  1118. src/lib/eval/Makefile
  1119. src/lib/eval/tests/Makefile
  1120. src/lib/exceptions/Makefile
  1121. src/lib/exceptions/tests/Makefile
  1122. src/lib/hooks/Makefile
  1123. src/lib/hooks/tests/Makefile
  1124. src/lib/hooks/tests/marker_file.h
  1125. src/lib/hooks/tests/test_libraries.h
  1126. src/lib/http/Makefile
  1127. src/lib/http/tests/Makefile
  1128. src/lib/log/Makefile
  1129. src/lib/log/compiler/Makefile
  1130. src/lib/log/interprocess/Makefile
  1131. src/lib/log/interprocess/tests/Makefile
  1132. src/lib/log/tests/Makefile
  1133. src/lib/log/tests/buffer_logger_test.sh
  1134. src/lib/log/tests/console_test.sh
  1135. src/lib/log/tests/destination_test.sh
  1136. src/lib/log/tests/init_logger_test.sh
  1137. src/lib/log/tests/local_file_test.sh
  1138. src/lib/log/tests/logger_lock_test.sh
  1139. src/lib/log/tests/severity_test.sh
  1140. src/lib/log/tests/tempdir.h
  1141. src/lib/process/Makefile
  1142. src/lib/process/spec_config.h.pre
  1143. src/lib/process/tests/Makefile
  1144. src/lib/process/testutils/Makefile
  1145. src/lib/stats/Makefile
  1146. src/lib/stats/tests/Makefile
  1147. src/lib/testutils/Makefile
  1148. src/lib/testutils/dhcp_test_lib.sh
  1149. src/lib/util/Makefile
  1150. src/lib/util/io/Makefile
  1151. src/lib/util/python/Makefile
  1152. src/lib/util/python/gen_wiredata.py
  1153. src/lib/util/tests/Makefile
  1154. src/lib/util/tests/process_spawn_app.sh
  1155. src/lib/util/threads/Makefile
  1156. src/lib/util/threads/tests/Makefile
  1157. src/lib/util/unittests/Makefile
  1158. src/share/Makefile
  1159. src/share/database/Makefile
  1160. src/share/database/scripts/Makefile
  1161. src/share/database/scripts/cql/Makefile
  1162. src/share/database/scripts/mysql/Makefile
  1163. src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh
  1164. src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh
  1165. src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh
  1166. src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh
  1167. src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh
  1168. src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh
  1169. src/share/database/scripts/pgsql/Makefile
  1170. src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh
  1171. src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
  1172. src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh
  1173. tools/Makefile
  1174. tools/path_replacer.sh
  1175. ])
  1176. AC_CONFIG_COMMANDS([permissions], [
  1177. chmod +x src/bin/admin/kea-admin
  1178. chmod +x src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1179. chmod +x src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1180. chmod +x src/bin/keactrl/keactrl
  1181. chmod +x src/bin/keactrl/tests/keactrl_tests.sh
  1182. chmod +x src/bin/shell/kea-shell
  1183. chmod +x src/bin/shell/tests/shell_process_tests.sh
  1184. chmod +x src/bin/shell/tests/shell_unittest.py
  1185. chmod +x src/lib/dns/gen-rdatacode.py
  1186. chmod +x src/lib/log/tests/console_test.sh
  1187. chmod +x src/lib/log/tests/destination_test.sh
  1188. chmod +x src/lib/log/tests/init_logger_test.sh
  1189. chmod +x src/lib/log/tests/local_file_test.sh
  1190. chmod +x src/lib/log/tests/logger_lock_test.sh
  1191. chmod +x src/lib/log/tests/severity_test.sh
  1192. chmod +x src/lib/util/python/gen_wiredata.py
  1193. chmod +x src/lib/util/tests/process_spawn_app.sh
  1194. chmod +x tools/path_replacer.sh
  1195. ])
  1196. AM_CONDITIONAL(PREMIUM, test -d "$srcdir/premium/src")
  1197. AC_MSG_CHECKING([if premium package is available])
  1198. if test -d "$srcdir/premium/src"; then
  1199. # Define it in the config.h, so C++ code could use it.
  1200. AC_DEFINE([PREMIUM], [1], [Kea-premium package found])
  1201. # Export it here, so code in configure could use it.
  1202. PREMIUM=1
  1203. AC_MSG_RESULT(yes)
  1204. else
  1205. AC_MSG_RESULT(no)
  1206. fi
  1207. AC_OUTPUT
  1208. dnl Print the results
  1209. dnl
  1210. EXTENDED_VERSION=${PACKAGE_VERSION}
  1211. if test "$KEA_SRCID" != ""; then
  1212. EXTENDED_VERSION="${EXTENDED_VERSION} ($KEA_SRCID)"
  1213. fi
  1214. cat > config.report << END
  1215. Kea source configure results:
  1216. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1217. Package:
  1218. Name: ${PACKAGE_NAME}
  1219. Version: ${PACKAGE_VERSION}
  1220. Extended version:${EXTENDED_VERSION}
  1221. OS Family: ${OS_TYPE}
  1222. Using GNU sed: ${GNU_SED}
  1223. END
  1224. if test "$PREMIUM" != ""; then
  1225. cat >> config.report << END
  1226. Premium package: yes
  1227. END
  1228. else
  1229. cat >> config.report << END
  1230. Premium package: no
  1231. END
  1232. fi
  1233. cat >> config.report << END
  1234. C++ Compiler:
  1235. CXX: ${CXX}
  1236. CXX_VERSION: ${CXX_VERSION}
  1237. CXX_STANDARD: ${CXX_STANDARD}
  1238. DEFS: ${DEFS}
  1239. CPPFLAGS: ${CPPFLAGS}
  1240. CXXFLAGS: ${CXXFLAGS}
  1241. LDFLAGS: ${LDFLAGS}
  1242. KEA_CXXFLAGS: ${KEA_CXXFLAGS}
  1243. END
  1244. if test "$PYTHON" != "no" ; then
  1245. cat >> config.report << END
  1246. Python:
  1247. PYTHON: ${PYTHON}
  1248. PYTHON_VERSION: ${PYTHON_VERSION}
  1249. END
  1250. else
  1251. cat >> config.report << END
  1252. Python:
  1253. PYTHON_VERSION: not needed (because kea-shell is disabled)
  1254. END
  1255. fi
  1256. cat >> config.report << END
  1257. Boost:
  1258. BOOST_VERSION: ${BOOST_VERSION}
  1259. BOOST_INCLUDES: ${BOOST_INCLUDES}
  1260. BOOST_LIBS: ${BOOST_LIBS}
  1261. END
  1262. if test x"$BOOST_LIBS" = "x"; then
  1263. cat >> config.report << END
  1264. WARNING: You will be building with boost headers only rather
  1265. than linking with boost_system library. This is NOT recommended as
  1266. it may result in non-optimized code on some platforms and
  1267. introduce runtime errors on others.
  1268. END
  1269. fi
  1270. cat >> config.report << END
  1271. ${CRYPTO_NAME}:
  1272. CRYPTO_VERSION: ${CRYPTO_VERSION}
  1273. CRYPTO_CFLAGS: ${CRYPTO_CFLAGS}
  1274. CRYPTO_INCLUDES: ${CRYPTO_INCLUDES}
  1275. CRYPTO_LDFLAGS: ${CRYPTO_LDFLAGS}
  1276. CRYPTO_LIBS: ${CRYPTO_LIBS}
  1277. ${DISABLED_CRYPTO}: no
  1278. Log4cplus:
  1279. LOG4CPLUS_VERSION: ${LOG4CPLUS_VERSION}
  1280. LOG4CPLUS_INCLUDES: ${LOG4CPLUS_INCLUDES}
  1281. LOG4CPLUS_LIBS: ${LOG4CPLUS_LIBS}
  1282. Flex/bison:
  1283. FLEX: ${LEX}
  1284. BISON: ${YACC}
  1285. END
  1286. # Avoid confusion on DNS/DHCP and only mention MySQL if it
  1287. # were specified on the command line.
  1288. if test "$MYSQL_CPPFLAGS" != "" ; then
  1289. cat >> config.report << END
  1290. MySQL:
  1291. MYSQL_VERSION: ${MYSQL_VERSION}
  1292. MYSQL_CPPFLAGS: ${MYSQL_CPPFLAGS}
  1293. MYSQL_LIBS: ${MYSQL_LIBS}
  1294. END
  1295. else
  1296. cat >> config.report << END
  1297. MySQL:
  1298. no
  1299. END
  1300. fi
  1301. if test "$PGSQL_CPPFLAGS" != "" ; then
  1302. cat >> config.report << END
  1303. PostgreSQL:
  1304. PGSQL_VERSION: ${PGSQL_VERSION}
  1305. PGSQL_CPPFLAGS: ${PGSQL_CPPFLAGS}
  1306. PGSQL_LIBS: ${PGSQL_LIBS}
  1307. END
  1308. else
  1309. cat >> config.report << END
  1310. PostgreSQL:
  1311. no
  1312. END
  1313. fi
  1314. if test "$CQL_CPPFLAGS" != "" ; then
  1315. cat >> config.report << END
  1316. Cassandra CQL:
  1317. CQL_VERSION: ${CQL_VERSION}
  1318. CQL_CPPFLAGS: ${CQL_CPPFLAGS}
  1319. CQL_LIBS: ${CQL_LIBS}
  1320. END
  1321. else
  1322. cat >> config.report << END
  1323. Cassandra CQL:
  1324. no
  1325. END
  1326. fi
  1327. if test "$enable_gtest" != "no"; then
  1328. cat >> config.report << END
  1329. GTest:
  1330. GTEST_VERSION: ${GTEST_VERSION}
  1331. GTEST_INCLUDES: ${GTEST_INCLUDES}
  1332. GTEST_LDFLAGS: ${GTEST_LDFLAGS}
  1333. GTEST_LDADD: ${GTEST_LDADD}
  1334. GTEST_SOURCE: ${GTEST_SOURCE}
  1335. END
  1336. fi
  1337. cat >> config.report << END
  1338. Developer:
  1339. Enable Debugging: $debug_enabled
  1340. Google Tests: $enable_gtest
  1341. Valgrind: $found_valgrind
  1342. C++ Code Coverage: $USE_LCOV
  1343. Logger checks: $enable_logger_checks
  1344. Generate Documentation: $enable_generate_docs
  1345. Parser Generation: $enable_generate_parser
  1346. Kea-shell: $enable_shell
  1347. END
  1348. cat config.report
  1349. cat <<EOF
  1350. Now you can type "make" to build Kea. Note that if you intend to
  1351. run "make check", you must run "make" first as some files need to be
  1352. generated by "make" before "make check" can be run.
  1353. When running "make install" do not use any form of parallel or job
  1354. server options (such as GNU make's -j option). Doing so may cause
  1355. errors.
  1356. EOF