configure.ac 70 KB

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