configure.ac 57 KB

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