configure.ac 58 KB

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