configure.ac 58 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([BIND 10 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], [BIND 10 was 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. # Testing a specific system and version is not a good practice, but
  208. # identifying this behavior would be too heavy (running a program
  209. # with multiple threads), so this is a compromise. In general,
  210. # it should be avoided to rely on 'osx_version' unless there's no
  211. # viable alternative.
  212. osx_version=`/usr/bin/sw_vers -productVersion`
  213. if [ test $osx_version = "10.9" \
  214. -o $osx_version = "10.9.1" \
  215. -o $osx_version = "10.9.2" \
  216. -o $osx_version = "10.9.3" ]; then
  217. bind10_undefined_pthread_behavior=yes
  218. fi
  219. # libtool doesn't work perfectly with Darwin: libtool embeds the
  220. # final install path in dynamic libraries and our loadable python
  221. # modules always refer to that path even if it's loaded within the
  222. # source tree. This prevents pre-install tests from working.
  223. # To work around this problem we explicitly specify paths to dynamic
  224. # libraries when we use them in the source tree.
  225. SET_ENV_LIBRARY_PATH=yes
  226. ENV_LIBRARY_PATH=DYLD_LIBRARY_PATH
  227. ;;
  228. *-freebsd*)
  229. SET_ENV_LIBRARY_PATH=yes
  230. ;;
  231. *-netbsd*)
  232. SET_ENV_LIBRARY_PATH=yes
  233. ;;
  234. *-openbsd*)
  235. SET_ENV_LIBRARY_PATH=yes
  236. ;;
  237. esac
  238. AM_CONDITIONAL(SET_ENV_LIBRARY_PATH, test $SET_ENV_LIBRARY_PATH = yes)
  239. AC_SUBST(SET_ENV_LIBRARY_PATH)
  240. AC_SUBST(ENV_LIBRARY_PATH)
  241. if [ test $bind10_undefined_pthread_behavior = "yes" ]; then
  242. AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
  243. fi
  244. # Our experiments have shown Solaris 10 has broken support for the
  245. # IPV6_USE_MIN_MTU socket option for getsockopt(); it doesn't return the value
  246. # previously set via setsockopt(). We know it doesn't happen on one instance
  247. # on Solaris 11, but we don't know whether it happens for any Solaris 10
  248. # implementations or for earlier versions of Solaris. In any case, at the
  249. # moment this matters for only one unittest case, so we'll simply disable
  250. # the affected test using the following definition with the specific hardcoding
  251. # of that version of Solaris.
  252. case "$host" in
  253. *-solaris2.10)
  254. AC_DEFINE([HAVE_BROKEN_GET_IPV6_USE_MIN_MTU], [1],
  255. [Define to 1 if getsockopt(IPV6_USE_MIN_MTU) does not work])
  256. ;;
  257. esac
  258. m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3.4 python3.3 python3.2 python3.1 python3])
  259. AC_ARG_WITH([pythonpath],
  260. AC_HELP_STRING([--with-pythonpath=PATH],
  261. [specify an absolute path to python executable when automatic version check (incorrectly) fails]),
  262. [python_path="$withval"], [python_path="auto"])
  263. if test "$python_path" = auto; then
  264. AM_PATH_PYTHON([3.1],,[PYTHON=no])
  265. else
  266. # Older versions of automake can't handle python3 well. This is an
  267. # in-house workaround for them.
  268. PYTHON=$python_path
  269. AC_SUBST(PYTHON)
  270. PYTHON_PREFIX='${prefix}'
  271. AC_SUBST(PYTHON_PREFIX)
  272. PYTHON_EXEC_PREFIX='$(exec_prefix)'
  273. AC_SUBST(PYTHON_EXEC_PREFIX)
  274. PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`]
  275. if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then
  276. AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])
  277. fi
  278. AC_SUBST(PYTHON_VERSION)
  279. PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"`
  280. AC_SUBST(PYTHON_PLATFORM)
  281. pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  282. AC_SUBST(pythondir)
  283. pkgpythondir='${pythondir}/'$PACKAGE
  284. AC_SUBST(pkgpythondir)
  285. pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages'
  286. AC_SUBST(pyexecdir)
  287. pkgpyexecdir='${pyexecdir}/'$PACKAGE
  288. AC_SUBST(pkgpyexecdir)
  289. fi
  290. # produce PIC unless we disable shared libraries. need this for python bindings.
  291. if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
  292. B10_CXXFLAGS="$B10_CXXFLAGS -fPIC"
  293. fi
  294. AC_SUBST(B10_CXXFLAGS)
  295. # Checks for libraries.
  296. AC_SEARCH_LIBS(inet_pton, [nsl])
  297. AC_SEARCH_LIBS(recvfrom, [socket])
  298. AC_SEARCH_LIBS(nanosleep, [rt])
  299. AC_SEARCH_LIBS(dlsym, [dl])
  300. # Checks for header files.
  301. # Checks for typedefs, structures, and compiler characteristics.
  302. AC_HEADER_STDBOOL
  303. AC_TYPE_SIZE_T
  304. # Detect OS type (it may be used to do OS-specific things, e.g.
  305. # interface detection in DHCP)
  306. AC_MSG_CHECKING(OS family)
  307. system=`uname -s`
  308. case $system in
  309. Linux)
  310. OS_TYPE="Linux"
  311. CPPFLAGS="$CPPFLAGS -DOS_LINUX"
  312. ;;
  313. Darwin | FreeBSD | NetBSD | OpenBSD)
  314. OS_TYPE="BSD"
  315. CPPFLAGS="$CPPFLAGS -DOS_BSD"
  316. ;;
  317. SunOS)
  318. OS_TYPE="Solaris"
  319. CPPFLAGS="$CPPFLAGS -DOS_SUN"
  320. ;;
  321. *)
  322. OS_TYPE="Unknown"
  323. AC_MSG_WARN("Unsupported OS: uname returned $system")
  324. ;;
  325. esac
  326. AC_MSG_RESULT($OS_TYPE)
  327. AM_CONDITIONAL(OS_LINUX, test $OS_TYPE = Linux)
  328. AM_COND_IF([OS_LINUX], [AC_DEFINE([OS_LINUX], [1], [Running on Linux?])])
  329. AM_CONDITIONAL(OS_BSD, test $OS_TYPE = BSD)
  330. AM_COND_IF([OS_BSD], [AC_DEFINE([OS_BSD], [1], [Running on BSD?])])
  331. AM_CONDITIONAL(OS_SOLARIS, test $OS_TYPE = Solaris)
  332. AM_COND_IF([OS_SOLARIS], [AC_DEFINE([OS_SOLARIS], [1], [Running on Solaris?])])
  333. # Deal with variants
  334. AM_CONDITIONAL(OS_FREEBSD, test $system = FreeBSD)
  335. AM_COND_IF([OS_FREEBSD], [AC_DEFINE([OS_FREEBSD], [1], [Running on FreeBSD?])])
  336. AM_CONDITIONAL(OS_NETBSD, test $system = NetBSD)
  337. AM_COND_IF([OS_NETBSD], [AC_DEFINE([OS_NETBSD], [1], [Running on NetBSD?])])
  338. AM_CONDITIONAL(OS_OPENBSD, test $system = OpenBSD)
  339. AM_COND_IF([OS_OPENBSD], [AC_DEFINE([OS_OPENBSD], [1], [Running on OpenBSD?])])
  340. AM_CONDITIONAL(OS_OSX, test $system = Darwin)
  341. AM_COND_IF([OS_OSX], [AC_DEFINE([OS_OSX], [1], [Running on OSX?])])
  342. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  343. AC_TRY_COMPILE([
  344. #include <sys/types.h>
  345. #include <sys/socket.h>],
  346. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  347. [AC_MSG_RESULT(yes)
  348. AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
  349. AC_MSG_RESULT(no))
  350. enable_gtest="no"
  351. GTEST_INCLUDES=
  352. AC_ARG_WITH([gtest-source],
  353. [AS_HELP_STRING([--with-gtest-source=PATH],
  354. [location of the Googletest source, defaults to /usr/src/gtest])],
  355. [enable_gtest="yes" ; GTEST_SOURCE="$withval"],
  356. [GTEST_SOURCE="/usr/src/gtest"])
  357. AC_ARG_WITH([gtest],
  358. [AS_HELP_STRING([--with-gtest=PATH],
  359. [specify a path to gtest header files (PATH/include) and library (PATH/lib)])],
  360. [gtest_path="$withval"; enable_gtest="yes"], [gtest_path="no"])
  361. AC_ARG_WITH(lcov,
  362. [ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
  363. USE_LCOV="no"
  364. if test "$lcov" != "no"; then
  365. # force gtest if not set
  366. if test "$enable_gtest" = "no"; then
  367. # AC_MSG_ERROR("lcov needs gtest for test coverage report")
  368. AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
  369. enable_gtest="yes"
  370. fi
  371. if test "$lcov" != "yes"; then
  372. LCOV=$lcov
  373. else
  374. AC_PATH_PROG([LCOV], [lcov])
  375. fi
  376. if test -x "${LCOV}"; then
  377. USE_LCOV="yes"
  378. else
  379. AC_MSG_ERROR([Cannot find lcov.])
  380. fi
  381. # is genhtml always in the same directory?
  382. GENHTML=`echo "$LCOV" | ${SED} s/lcov$/genhtml/`
  383. if test ! -x $GENHTML; then
  384. AC_MSG_ERROR([genhtml not found, needed for lcov])
  385. fi
  386. # GCC specific?
  387. CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
  388. LIBS=" $LIBS -lgcov"
  389. AC_SUBST(CPPFLAGS)
  390. AC_SUBST(LIBS)
  391. AC_SUBST(LCOV)
  392. AC_SUBST(GENHTML)
  393. fi
  394. AC_SUBST(USE_LCOV)
  395. # Simplified, non-caching AC_CHECK_PROG
  396. # Searches $PATH for the existence of argument 2,
  397. # and sets the full path to the variable in argument 1.
  398. # if not found, and a third argument is given, the value
  399. # is set to that. If not, the value is untouched.
  400. # Does not take absolute paths into account at this point,
  401. # and also works for single files only (arguments are not
  402. # stripped like in AC_CHECK_PROG)
  403. AC_DEFUN([ACX_CHECK_PROG_NONCACHE], [
  404. RESULT=""
  405. IFS_SAVED="$IFS"
  406. IFS=${PATH_SEPARATOR}
  407. for cur_path in ${PATH} ; do
  408. if test -e "${cur_path}/$2" ; then
  409. RESULT="${cur_path}/$2"
  410. fi
  411. done
  412. if test "$RESULT" = "" ; then
  413. :
  414. m4_ifvaln([$3], [$1=$3])
  415. else
  416. $1=$RESULT
  417. fi
  418. IFS="$IFS_SAVED"
  419. ])
  420. # Avoid checking Botan if OpenSSL is wanted
  421. AC_ARG_WITH([openssl],
  422. [AS_HELP_STRING([--with-openssl[[=PATH]]], [Enables OpenSSL,
  423. location can be specified optionally])],
  424. [use_openssl="$withval"],
  425. [use_openssl="auto"])
  426. # Botan helper test function
  427. # Tries to compile a botan program, given the output of the given
  428. # config tool
  429. # Arguments:
  430. # - name of tool (checked for path), must support --libs and --cflags
  431. # - fixed argument(s) for tool
  432. # - action if successful
  433. AC_DEFUN([ACX_TRY_BOTAN_TOOL], [
  434. TOOL=$1
  435. TOOL_ARG=$2
  436. BOTAN_TOOL=""
  437. ACX_CHECK_PROG_NONCACHE([BOTAN_TOOL], [${TOOL}])
  438. AC_MSG_CHECKING([usability of ${TOOL} ${TOOL_ARG}])
  439. if test "$BOTAN_TOOL" != "" ; then
  440. if test -x ${BOTAN_TOOL}; then
  441. CRYPTO_LIBS=`$BOTAN_TOOL $TOOL_ARG --libs`
  442. LIBS_SAVED=${LIBS}
  443. LIBS="$LIBS $CRYPTO_LIBS"
  444. CRYPTO_INCLUDES=`$BOTAN_TOOL $TOOL_ARG --cflags`
  445. CPPFLAGS_SAVED=${CPPFLAGS}
  446. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  447. #AC_MSG_RESULT([found])
  448. AC_LINK_IFELSE(
  449. [AC_LANG_PROGRAM([#include <botan/botan.h>
  450. #include <botan/hash.h>
  451. ],
  452. [using namespace Botan;
  453. LibraryInitializer::initialize();
  454. HashFunction *h = get_hash("MD5");
  455. ])],
  456. [ AC_MSG_RESULT([ok])
  457. $3
  458. ],
  459. [ AC_MSG_RESULT([not usable]) ]
  460. )
  461. LIBS=${LIBS_SAVED}
  462. CPPFLAGS=${CPPFLAGS_SAVED}
  463. else
  464. AC_MSG_RESULT([not executable])
  465. fi
  466. else
  467. AC_MSG_RESULT([not found])
  468. fi
  469. BOTAN_TOOL=""
  470. AC_SUBST(BOTAN_TOOL)
  471. ]
  472. )
  473. # Check for Botan
  474. #
  475. # Unless --with-botan-config is given, we first try to find these config
  476. # scripts ourselves. Unfortunately, on some systems, these scripts do not
  477. # provide the correct implementation, so for each script found, we try
  478. # a compilation test (ACX_TRY_BOTAN_TOOL). If none are found, or none of
  479. # them work, we see if pkg-config is available. If so, we try the several
  480. # potential pkg-config .pc files. Again, on some systems, these can return
  481. # incorrect information as well, so the try-compile test is repeated for
  482. # each.
  483. #
  484. # If a working config script or pkgconfig file is found, we then munge its
  485. # output for use in our Makefiles, and to make sure it works, another header
  486. # and compilation test is done (this should also check whether we can compile
  487. # against botan should neither -config scripts nor pkgconfig data exist).
  488. #
  489. botan_config="yes"
  490. if test "${use_openssl}" != "auto" -a "${use_openssl}" != "no" ; then
  491. botan_config="no"
  492. fi
  493. AC_ARG_WITH([botan-config],
  494. AC_HELP_STRING([--with-botan-config=PATH],
  495. [specify the path to the botan-config script]),
  496. [botan_config="$withval"])
  497. if test "${botan_config}" = "no" ; then
  498. if test "${use_openssl}" = "no" ; then
  499. AC_MSG_ERROR([Need Botan or OpenSSL for libcryptolink])
  500. fi
  501. elif test "${botan_config}" != "yes" ; then
  502. if test -x "${botan_config}" ; then
  503. if test -d "${botan_config}" ; then
  504. AC_MSG_ERROR([${botan_config} is a directory])
  505. else
  506. BOTAN_CONFIG="${botan_config}"
  507. fi
  508. else
  509. AC_MSG_ERROR([--with-botan-config should point to a botan-config program and not a directory (${botan_config})])
  510. fi
  511. else
  512. BOTAN_CONFIG=""
  513. # first try several possible names of the config script
  514. # (botan-config-1.8 is there just in case, the official name change
  515. # came later)
  516. BOTAN_CONFIG_VERSIONS="botan-config-1.10 botan-config-1.9 botan-config-1.8 botan-config"
  517. for botan_config in $BOTAN_CONFIG_VERSIONS; do
  518. ACX_TRY_BOTAN_TOOL([$botan_config],,
  519. [ BOTAN_CONFIG="$botan_config" ]
  520. )
  521. if test "$BOTAN_CONFIG" != "" ; then
  522. break
  523. fi
  524. done
  525. if test "$BOTAN_CONFIG" = "" ; then
  526. AC_PATH_PROG([PKG_CONFIG], [pkg-config])
  527. if test "$PKG_CONFIG" != "" ; then
  528. # Ok so no script found, see if pkg-config knows of it.
  529. # Unfortunately, the botan.pc files also have their minor version
  530. # in their name, so we need to try them one by one
  531. BOTAN_VERSIONS="botan-1.10 botan-1.9 botan-1.8"
  532. for version in $BOTAN_VERSIONS; do
  533. ACX_TRY_BOTAN_TOOL([pkg-config], ["$version --silence-errors"],
  534. [ BOTAN_CONFIG="$PKG_CONFIG $version" ]
  535. )
  536. if test "$BOTAN_CONFIG" != "" ; then
  537. break
  538. fi
  539. done
  540. fi
  541. fi
  542. fi
  543. if test "x${BOTAN_CONFIG}" != "x"
  544. then
  545. CRYPTO_LIBS=`${BOTAN_CONFIG} --libs`
  546. CRYPTO_INCLUDES=`${BOTAN_CONFIG} --cflags`
  547. # We expect botan-config --libs to contain -L<path_to_libbotan>, but
  548. # this is not always the case. As a heuristics workaround we add
  549. # -L`botan-config --prefix/lib` in this case (if not present already).
  550. # Same for CRYPTO_INCLUDES (but using include instead of lib) below.
  551. if [ ${BOTAN_CONFIG} --prefix >/dev/null 2>&1 ] ; then
  552. echo ${CRYPTO_LIBS} | grep -- -L > /dev/null || \
  553. CRYPTO_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${CRYPTO_LIBS}"
  554. echo ${CRYPTO_INCLUDES} | grep -- -I > /dev/null || \
  555. CRYPTO_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${CRYPTO_INCLUDES}"
  556. fi
  557. fi
  558. if test "x${CRYPTO_LIBS}" != "x"
  559. then
  560. dnl Determine the Botan version
  561. AC_MSG_CHECKING([Botan version])
  562. cat > conftest.cpp << EOF
  563. #include <botan/version.h>
  564. AUTOCONF_BOTAN_VERSION=BOTAN_VERSION_MAJOR . BOTAN_VERSION_MINOR . BOTAN_VERSION_PATCH
  565. EOF
  566. 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`
  567. if test -z "$CRYPTO_VERSION"; then
  568. CRYPTO_VERSION="unknown"
  569. fi
  570. $RM -f conftest.cpp
  571. AC_MSG_RESULT([$CRYPTO_VERSION])
  572. # botan-config script (and the way we call pkg-config) returns -L and -l
  573. # as one string, but we need them in separate values
  574. CRYPTO_LDFLAGS=
  575. for flag in ${CRYPTO_LIBS}; do
  576. CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} `echo $flag | ${SED} -ne '/^\(\-L\)/p'`"
  577. CRYPTO_LIBS="${CRYPTO_LIBS} `echo $flag | ${SED} -ne '/^\(\-l\)/p'`"
  578. done
  579. # See crypto_rpath for some info on why we do this
  580. if test "x$ISC_RPATH_FLAG" != "x"; then
  581. CRYPTO_RPATH=
  582. for flag in ${CRYPTO_LIBS}; do
  583. CRYPTO_RPATH="${CRYPTO_RPATH} `echo $flag | ${SED} -ne "s/^\(\-L\)/${ISC_RPATH_FLAG}/p"`"
  584. done
  585. # According to the libtool manual, it should be sufficient if we
  586. # specify the "-R libdir" in our wrapper library of botan (no other
  587. # programs will need libbotan directly); "libdir" should be added to
  588. # the program's binary image. But we've seen in our build environments
  589. # that (some versions of?) libtool doesn't propagate -R as documented,
  590. # and it caused a linker error at run time. To work around this, we
  591. # also add the rpath to the global LDFLAGS.
  592. LDFLAGS="$CRYPTO_RPATH $LDFLAGS"
  593. fi
  594. # Even though chances are high we already performed a real compilation check
  595. # in the search for the right (pkg)config data, we try again here, to
  596. # be sure.
  597. CPPFLAGS_SAVED=$CPPFLAGS
  598. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  599. LIBS_SAVED="$LIBS"
  600. LIBS="$LIBS $CRYPTO_LIBS"
  601. # ac_header_preproc is an autoconf symbol (undocumented but stable) that
  602. # is set if the pre-processor phase passes. Thus by adding a custom
  603. # failure handler we can detect the difference between a header not existing
  604. # (or not even passing the pre-processor phase) and a header file resulting
  605. # in compilation failures.
  606. AC_CHECK_HEADERS([botan/botan.h],,[
  607. CRYPTO_INCLUDES=""
  608. CRYPTO_LIBS=""
  609. CRYPTO_LDFLAGS=""
  610. CRYPTO_RPATH=""
  611. if test "x$ac_header_preproc" = "xyes"; then
  612. AC_MSG_RESULT([
  613. botan/botan.h was found but is unusable. The most common cause of this problem
  614. is attempting to use an updated C++ compiler with older C++ libraries, such as
  615. the version of Botan that comes with your distribution. If you have updated
  616. your C++ compiler we highly recommend that you use support libraries such as
  617. Boost and Botan that were compiled with the same compiler version.])
  618. else
  619. AC_MSG_RESULT([Missing required header files.])
  620. fi]
  621. )
  622. CPPFLAGS=$CPPFLAGS_SAVED
  623. LIBS=$LIBS_SAVED
  624. fi
  625. if test "x${CRYPTO_LIBS}" != "x"
  626. then
  627. CPPFLAGS_SAVED=$CPPFLAGS
  628. CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
  629. LIBS_SAVED="$LIBS"
  630. LIBS="$LIBS $CRYPTO_LIBS"
  631. AC_LINK_IFELSE(
  632. [AC_LANG_PROGRAM([#include <botan/botan.h>
  633. #include <botan/hash.h>
  634. ],
  635. [using namespace Botan;
  636. LibraryInitializer::initialize();
  637. HashFunction *h = get_hash("MD5");
  638. ])],
  639. [AC_MSG_RESULT([checking for Botan library... yes])],
  640. [AC_MSG_RESULT([checking for Botan library... no])
  641. CRYPTO_INCLUDES=""
  642. CRYPTO_LIBS=""
  643. CRYPTO_LDFLAGS=""
  644. CRYPTO_RPATH=""
  645. AC_MSG_RESULT([Needs Botan library 1.8 or higher. On some systems,
  646. the botan package has a few missing dependencies (libbz2 and
  647. libgmp), if libbotan has been installed and you see this message,
  648. try upgrading to a higher version of botan or installing libbz2
  649. and libgmp.])]
  650. )
  651. CPPFLAGS=$CPPFLAGS_SAVED
  652. LIBS=$LIBS_SAVED
  653. fi
  654. if test "x${CRYPTO_LIBS}" != "x"
  655. then
  656. CRYPTO_NAME="Botan"
  657. DISABLED_CRYPTO="OpenSSL"
  658. CRYPTO_PACKAGE="botan-1.8"
  659. CRYPTO_CFLAGS=""
  660. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-botan=$botan_config"
  661. AC_DEFINE_UNQUOTED([WITH_BOTAN], [], [Compile with Botan crypto])
  662. else
  663. CRYPTO_NAME="OpenSSL"
  664. DISABLED_CRYPTO="Botan"
  665. CRYPTO_PACKAGE="openssl-1.0.0"
  666. AC_DEFINE_UNQUOTED([WITH_OPENSSL], [], [Compile with OpenSSL crypto])
  667. AC_MSG_CHECKING(for OpenSSL library)
  668. # from bind9
  669. if test "${use_openssl}" = "auto" ; then
  670. use_openssl="yes"
  671. fi
  672. if test "${use_openssl}" = "yes" ; then
  673. for d in /usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw; do
  674. if test -f $d/include/openssl/opensslv.h; then
  675. use_openssl=$d; break
  676. fi
  677. done
  678. fi
  679. if test "${use_openssl}" = "yes" ; then
  680. AC_MSG_ERROR([OpenSSL auto detection failed])
  681. fi
  682. if ! test -f "${use_openssl}"/include/openssl/opensslv.h ; then
  683. AC_MSG_ERROR([OpenSSL not found at ${use_openssl}])
  684. fi
  685. AC_MSG_RESULT(yes)
  686. if test "${use_openssl}" = "/usr" ; then
  687. CRYPTO_INCLUDES=""
  688. CRYPTO_LIBS="-lcrypto"
  689. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-openssl"
  690. case "$host" in
  691. *-apple-darwin*)
  692. # Starting with OSX 10.7 (Lion) OpenSSL is deprecated
  693. CRYPTO_CFLAGS="-Wno-deprecated-declarations"
  694. ;;
  695. *)
  696. CRYPTO_CFLAGS=""
  697. ;;
  698. esac
  699. else
  700. CRYPTO_CFLAGS=""
  701. CRYPTO_INCLUDES="-I${use_openssl}/include"
  702. DISTCHECK_CRYPTO_CONFIGURE_FLAG="--with-openssl=${use_openssl}"
  703. case $host in
  704. *-solaris*)
  705. CRYPTO_LIBS="-L${use_openssl}/lib -R${use_openssl}/lib -lcrypto"
  706. ;;
  707. *-hp-hpux*)
  708. CRYPTO_LIBS="-L${use_openssl}/lib -Wl,+b: -lcrypto"
  709. ;;
  710. *-apple-darwin*)
  711. if test -f "${use_openssl}/lib/libcrypto.dylib" ; then
  712. CRYPTO_LIBS="-L${use_openssl}/lib -lcrypto"
  713. else
  714. CRYPTO_LIBS="${use_openssl}/lib/libcrypto.a"
  715. fi
  716. ;;
  717. *)
  718. CRYPTO_LIBS="-L${use_openssl}/lib -lcrypto"
  719. ;;
  720. esac
  721. fi
  722. dnl Determine the OpenSSL version
  723. AC_MSG_CHECKING([OpenSSL version])
  724. cat > conftest.cpp << EOF
  725. #include <openssl/opensslv.h>
  726. AUTOCONF_OPENSSL_VERSION=OPENSSL_VERSION_TEXT
  727. EOF
  728. CRYPTO_VERSION=`$CPP $CPPFLAGS $CRYPTO_INCLUDES conftest.cpp | grep '^AUTOCONF_OPENSSL_VERSION=' | $SED -e 's/^AUTOCONF_OPENSSL_VERSION=//' -e 's/"//g' 2> /dev/null`
  729. if test -z "$CRYPTO_VERSION" ; then
  730. CRYPTO_VERSION="unknown"
  731. fi
  732. $RM -f conftest.cpp
  733. AC_MSG_RESULT([$CRYPTO_VERSION])
  734. #CRYPTO_LDFLAGS="-ldl"
  735. CRYPTO_LDFLAGS=""
  736. CRYPTO_RPATH=""
  737. fi
  738. AM_CONDITIONAL(HAVE_BOTAN, test "$CRYPTO_NAME" = "Botan")
  739. AM_CONDITIONAL(HAVE_OPENSSL, test "$CRYPTO_NAME" = "OpenSSL")
  740. AC_SUBST(CRYPTO_INCLUDES)
  741. AC_SUBST(CRYPTO_CFLAGS)
  742. AC_SUBST(CRYPTO_LIBS)
  743. AC_SUBST(CRYPTO_LDFLAGS)
  744. AC_SUBST(CRYPTO_PACKAGE)
  745. AC_SUBST(CRYPTO_RPATH)
  746. AC_SUBST(DISTCHECK_CRYPTO_CONFIGURE_FLAG)
  747. # Check for MySql. The path to the mysql_config program is given with
  748. # the --with-mysql-config (default to /usr/bin/mysql-config). By default,
  749. # the software is not built with MySQL support enabled.
  750. mysql_config="no"
  751. AC_ARG_WITH([dhcp-mysql],
  752. AC_HELP_STRING([--with-dhcp-mysql=PATH],
  753. [path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
  754. [mysql_config="$withval"])
  755. if test "${mysql_config}" = "yes" ; then
  756. MYSQL_CONFIG="/usr/bin/mysql_config"
  757. elif test "${mysql_config}" != "no" ; then
  758. MYSQL_CONFIG="${withval}"
  759. fi
  760. if test "$MYSQL_CONFIG" != "" ; then
  761. if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
  762. AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
  763. fi
  764. MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
  765. MYSQL_LIBS=`$MYSQL_CONFIG --libs`
  766. MYSQL_VERSION=`$MYSQL_CONFIG --version`
  767. AC_SUBST(MYSQL_CPPFLAGS)
  768. AC_SUBST(MYSQL_LIBS)
  769. # Check that a simple program using MySQL functions can compile and link.
  770. CPPFLAGS_SAVED="$CPPFLAGS"
  771. LIBS_SAVED="$LIBS"
  772. CPPFLAGS="$MYSQL_CPPFLAGS $CPPFLAGS"
  773. LIBS="$MYSQL_LIBS $LIBS"
  774. AC_LINK_IFELSE(
  775. [AC_LANG_PROGRAM([#include <mysql.h>],
  776. [MYSQL mysql_handle;
  777. (void) mysql_init(&mysql_handle);
  778. ])],
  779. [AC_MSG_RESULT([checking for MySQL headers and library... yes])],
  780. [AC_MSG_RESULT([checking for MySQL headers and library... no])
  781. AC_MSG_ERROR([Needs MySQL library])]
  782. )
  783. CPPFLAGS=$CPPFLAGS_SAVED
  784. LIBS=$LIBS_SAVED
  785. # Note that MYSQL is present in the config.h file
  786. AC_DEFINE([HAVE_MYSQL], [1], [MySQL is present])
  787. fi
  788. # Solaris puts FIONREAD in filio.h
  789. AC_CHECK_HEADERS(sys/filio.h,,,)
  790. # ... and at the shell level, so Makefile.am can take action depending on this.
  791. AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
  792. pg_config="no"
  793. AC_ARG_WITH([dhcp-pgsql],
  794. AC_HELP_STRING([--with-dhcp-pgsql=PATH],
  795. [path to the PostgreSQL 'pg_config' script]),
  796. [pg_config="$withval"])
  797. if test "${pg_config}" = "yes" ; then
  798. PG_CONFIG="/usr/bin/pg_config"
  799. elif test "${pg_config}" != "no" ; then
  800. PG_CONFIG="${withval}"
  801. fi
  802. if test "$PG_CONFIG" != "" ; then
  803. if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
  804. AC_MSG_ERROR([--with-dhcp-pgsql should point to a pg_config program])
  805. fi
  806. PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
  807. PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir`
  808. PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server`
  809. PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$PGSQL_INCLUDEDIR -I$PGSQL_INCLUDEDIR_SERVER"
  810. PGSQL_LIBS=`$PG_CONFIG --libdir`
  811. PGSQL_LIBS="-L$PGSQL_LIBS -lpq"
  812. PGSQL_VERSION=`$PG_CONFIG --version`
  813. AC_SUBST(PGSQL_CPPFLAGS)
  814. AC_SUBST(PGSQL_LIBS)
  815. # Check that a simple program using PostgreSQL functions can compile and link.
  816. CPPFLAGS_SAVED="$CPPFLAGS"
  817. LIBS_SAVED="$LIBS"
  818. CPPFLAGS="$PGSQL_CPPFLAGS $CPPFLAGS"
  819. LIBS="$PGSQL_LIBS $LIBS"
  820. AC_LINK_IFELSE(
  821. [AC_LANG_PROGRAM([#include <libpq-fe.h>],
  822. [PGconn * c = PQconnectdb("dbname = 'postgres'");
  823. PQfinish(c);])],
  824. [AC_MSG_RESULT([checking for PostgreSQL headers and library... yes])],
  825. [AC_MSG_RESULT([checking for PostgreSQL headers and library... no])
  826. AC_MSG_ERROR([Needs PostgreSQL library])]
  827. )
  828. CPPFLAGS=$CPPFLAGS_SAVED
  829. LIBS=$LIBS_SAVED
  830. # Note that PostgreSQL is present in the config.h file
  831. AC_DEFINE([HAVE_PGSQL], [1], [PostgreSQL is present])
  832. fi
  833. # ... and at the shell level, so Makefile.am can take action depending on this.
  834. AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
  835. # Check for log4cplus
  836. log4cplus_path="yes"
  837. AC_ARG_WITH([log4cplus],
  838. AC_HELP_STRING([--with-log4cplus=PATH],
  839. [specify exact directory of log4cplus library and headers]),
  840. [log4cplus_path="$withval"])
  841. if test "${log4cplus_path}" = "no" ; then
  842. AC_MSG_ERROR([Need log4cplus])
  843. elif test "${log4cplus_path}" != "yes" ; then
  844. LOG4CPLUS_INCLUDES="-I${log4cplus_path}/include"
  845. LOG4CPLUS_LIBS="-L${log4cplus_path}/lib"
  846. else
  847. # If not specified, try some common paths.
  848. log4cplusdirs="/usr/local /usr/pkg /opt /opt/local"
  849. for d in $log4cplusdirs
  850. do
  851. if test -f $d/include/log4cplus/logger.h; then
  852. LOG4CPLUS_INCLUDES="-I$d/include"
  853. LOG4CPLUS_LIBS="-L$d/lib"
  854. break
  855. fi
  856. done
  857. fi
  858. LOG4CPLUS_LIBS="$LOG4CPLUS_LIBS -llog4cplus $MULTITHREADING_FLAG"
  859. AC_SUBST(LOG4CPLUS_LIBS)
  860. AC_SUBST(LOG4CPLUS_INCLUDES)
  861. CPPFLAGS_SAVED=$CPPFLAGS
  862. CPPFLAGS="$LOG4CPLUS_INCLUDES $CPPFLAGS"
  863. LIBS_SAVED="$LIBS"
  864. LIBS="$LOG4CPLUS_LIBS $LIBS"
  865. AC_CHECK_HEADERS([log4cplus/logger.h],,AC_MSG_ERROR([Missing required header files.]))
  866. AC_LINK_IFELSE(
  867. [AC_LANG_PROGRAM([#include <log4cplus/logger.h>
  868. ],
  869. [using namespace log4cplus;
  870. Logger logger = Logger::getInstance("main");
  871. ])],
  872. [AC_MSG_RESULT([checking for log4cplus library... yes])],
  873. [AC_MSG_RESULT([checking for log4cplus library... no])
  874. AC_MSG_ERROR([Needs log4cplus library])]
  875. )
  876. dnl Determine the log4cplus version, used mainly for config.report.
  877. AC_MSG_CHECKING([log4cplus version])
  878. cat > conftest.cpp << EOF
  879. #include <log4cplus/version.h>
  880. AUTOCONF_LOG4CPLUS_VERSION=LOG4CPLUS_VERSION_STR
  881. EOF
  882. 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`
  883. if test -z "$LOG4CPLUS_VERSION"; then
  884. LOG4CPLUS_VERSION="unknown"
  885. fi
  886. $RM -f conftest.cpp
  887. AC_MSG_RESULT([$LOG4CPLUS_VERSION])
  888. CPPFLAGS=$CPPFLAGS_SAVED
  889. LIBS=$LIBS_SAVED
  890. #
  891. # Configure Boost header path
  892. #
  893. AX_BOOST_FOR_BIND10
  894. # Boost offset_ptr is required in one library and not optional right now, so
  895. # we unconditionally fail here if it doesn't work.
  896. if test "$BOOST_OFFSET_PTR_WOULDFAIL" = "yes" -a "$werror_ok" = 1; then
  897. 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.])
  898. fi
  899. if test "$BOOST_STATIC_ASSERT_WOULDFAIL" = "yes" -a X"$werror_ok" = X1; then
  900. 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.])
  901. fi
  902. # There's a known bug in FreeBSD ports for Boost that would trigger a false
  903. # warning in build with g++ and -Werror (we exclude clang++ explicitly to
  904. # avoid unexpected false positives).
  905. if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes" -a X"$werror_ok" = X1 -a $CLANGPP = "no"; then
  906. 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.])
  907. fi
  908. use_shared_memory=yes
  909. AC_ARG_WITH(shared-memory,
  910. AC_HELP_STRING([--with-shared-memory],
  911. [Build with Boost shared memory support; for large scale authoritative DNS servers]),
  912. [use_shared_memory=$withval])
  913. if test X$use_shared_memory = Xyes -a "$BOOST_MAPPED_FILE_WOULDFAIL" = "yes" -a "$want_dns" = "yes"; then
  914. 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.])
  915. fi
  916. AM_CONDITIONAL([USE_SHARED_MEMORY], [test x$use_shared_memory = xyes])
  917. if test "x$use_shared_memory" = "xyes"; then
  918. AC_DEFINE(USE_SHARED_MEMORY, 1, [Define to 1 if shared memory support is enabled])
  919. fi
  920. AC_SUBST(BOOST_MAPPED_FILE_CXXFLAG)
  921. if test "$BOOST_OFFSET_PTR_OLD" = "yes" -a "$use_shared_memory" = "yes" -a "$want_dns" = "yes"; then
  922. AC_MSG_ERROR([You're trying to compile against boost older than 1.48 with
  923. shared memory. Older versions of boost have a bug which causes segfaults in
  924. offset_ptr implementation when compiled by GCC with optimisations enabled.
  925. See ticket no. 3025 for details.
  926. Either update boost to newer version or use --without-shared-memory.
  927. Note that most users likely don't need shared memory support.
  928. ])
  929. fi
  930. # Add some default CPP flags needed for Boost, identified by the AX macro.
  931. CPPFLAGS="$CPPFLAGS $CPPFLAGS_BOOST_THREADCONF"
  932. # I can't get some of the #include <asio.hpp> right without this
  933. # TODO: find the real cause of asio/boost wanting pthreads
  934. # (this currently only occurs for src/lib/cc/session_unittests)
  935. PTHREAD_LDFLAGS=
  936. AC_CHECK_LIB(pthread, pthread_create,[ PTHREAD_LDFLAGS=-lpthread ], [])
  937. AC_SUBST(PTHREAD_LDFLAGS)
  938. AC_SUBST(MULTITHREADING_FLAG)
  939. #
  940. # Check availability of gtest, which will be used for unit tests.
  941. #
  942. GTEST_LDFLAGS=
  943. GTEST_LDADD=
  944. DISTCHECK_GTEST_CONFIGURE_FLAG=
  945. GTEST_VERSION="unknown"
  946. if test "x$enable_gtest" = "xyes" ; then
  947. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=$gtest_path"
  948. if test -n "$with_gtest_source" ; then
  949. if test "x$GTEST_SOURCE" = "xyes" ; then
  950. AC_MSG_CHECKING([for gtest source])
  951. # If not specified, try some common paths.
  952. GTEST_SOURCE=
  953. for d in /usr/src/gtest /usr/local /usr/pkg /opt /opt/local ; do
  954. if test -f $d/src/gtest-all.cc -a $d/src/gtest_main.cc; then
  955. GTEST_SOURCE=$d
  956. AC_MSG_RESULT([$GTEST_SOURCE])
  957. break
  958. fi
  959. done
  960. if test -z $GTEST_SOURCE ; then
  961. AC_MSG_ERROR([no gtest source but it was selected])
  962. fi
  963. else
  964. AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
  965. [$GTEST_SOURCE/src/gtest_main.cc],
  966. [have_gtest_source=yes],
  967. [AC_MSG_ERROR([no gtest source at $GTEST_SOURCE])])
  968. fi
  969. have_gtest_source=yes
  970. GTEST_LDFLAGS="\$(top_builddir)/libgtest.a"
  971. DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest-source=$GTEST_SOURCE"
  972. GTEST_INCLUDES="-I$GTEST_SOURCE -I$GTEST_SOURCE/include"
  973. # See $GTEST_SOURCE/include/gtest/internal/gtest-port.h
  974. # about GTEST_HAS_PTHREAD.
  975. case "$host" in
  976. *-solaris*|*-linux*|*-hpux*)
  977. GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
  978. ;;
  979. esac
  980. fi
  981. if test "$gtest_path" != "no" ; then
  982. if test "$gtest_path" != "yes"; then
  983. GTEST_PATHS=$gtest_path
  984. if test -x "${gtest_path}/bin/gtest-config" ; then
  985. GTEST_CONFIG="${gtest_path}/bin/gtest-config"
  986. fi
  987. else
  988. AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
  989. fi
  990. if test -x "${GTEST_CONFIG}" ; then :
  991. # using cppflags instead of cxxflags
  992. GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
  993. GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
  994. GTEST_LDADD=`${GTEST_CONFIG} --libs`
  995. GTEST_VERSION=`${GTEST_CONFIG} --version`
  996. GTEST_FOUND="true"
  997. else
  998. AC_MSG_WARN([Unable to locate Google Test gtest-config.])
  999. if test -z "${GTEST_PATHS}" ; then
  1000. GTEST_PATHS="/usr /usr/local"
  1001. fi
  1002. GTEST_FOUND="false"
  1003. fi
  1004. if test "${GTEST_FOUND}" != "true"; then
  1005. GTEST_FOUND="false"
  1006. for dir in $GTEST_PATHS; do
  1007. if test -f "$dir/include/gtest/gtest.h"; then
  1008. GTEST_INCLUDES="-I$dir/include"
  1009. GTEST_LDFLAGS="-L$dir/lib"
  1010. GTEST_LDADD="-lgtest"
  1011. GTEST_FOUND="true"
  1012. # There is no gtest-config script on this
  1013. # system, which is supposed to inform us
  1014. # whether we need pthreads as well (a
  1015. # gtest compile-time option). So we still
  1016. # need to test that manually.
  1017. CPPFLAGS_SAVED="$CPPFLAGS"
  1018. CPPFLAGS="$CPPFLAGS $GTEST_INCLUDES"
  1019. LDFLAGS_SAVED="$LDFLAGS"
  1020. LDFLAGS="$LDFLAGS $GTEST_LDFLAGS"
  1021. LIBS_SAVED=$LIBS
  1022. LIBS="$LIBS $GTEST_LDADD"
  1023. AC_MSG_CHECKING([Checking whether gtest tests need pthreads])
  1024. # First try to compile without pthreads
  1025. AC_TRY_LINK([
  1026. #include <gtest/gtest.h>
  1027. ],[
  1028. int i = 0;
  1029. char* c = NULL;
  1030. ::testing::InitGoogleTest(&i, &c);
  1031. return (0);
  1032. ],
  1033. [ AC_MSG_RESULT(no) ],
  1034. [
  1035. LIBS="$SAVED_LIBS $GTEST_LDADD $PTHREAD_LDFLAGS"
  1036. # Now try to compile with pthreads
  1037. AC_TRY_LINK([
  1038. #include <gtest/gtest.h>
  1039. ],[
  1040. int i = 0;
  1041. char* c = NULL;
  1042. ::testing::InitGoogleTest(&i, &c);
  1043. return (0);
  1044. ],
  1045. [ AC_MSG_RESULT(yes)
  1046. GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
  1047. ],
  1048. # Apparently we can't compile it at all
  1049. [ AC_MSG_ERROR(unable to compile with gtest) ])
  1050. ])
  1051. CPPFLAGS=$CPPFLAGS_SAVED
  1052. LDFLAGS=$LDFLAGS_SAVED
  1053. LIBS=$LIBS_SAVED
  1054. break
  1055. fi
  1056. done
  1057. fi
  1058. if test "${GTEST_FOUND}" != "true"; then
  1059. AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
  1060. fi
  1061. fi
  1062. fi
  1063. AM_CONDITIONAL(HAVE_GTEST, test $enable_gtest != "no")
  1064. AM_CONDITIONAL(HAVE_GTEST_SOURCE, test "X$have_gtest_source" = "Xyes")
  1065. AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG)
  1066. AC_SUBST(GTEST_INCLUDES)
  1067. AC_SUBST(GTEST_LDFLAGS)
  1068. AC_SUBST(GTEST_LDADD)
  1069. AC_SUBST(GTEST_SOURCE)
  1070. dnl check for pkg-config itself
  1071. AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes, no)
  1072. if test "x$HAVE_PKG_CONFIG" = "xno" ; then
  1073. AC_MSG_ERROR(Please install pkg-config)
  1074. fi
  1075. #
  1076. # ASIO: we extensively use it as the C++ event management module.
  1077. #
  1078. # Use local ASIO headers from ext
  1079. #
  1080. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/asio"
  1081. #
  1082. # Use our 'coroutine' header from ext
  1083. CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
  1084. #
  1085. # Disable threads: Currently we don't use them.
  1086. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_THREADS=1"
  1087. # Check for functions that are not available on all platforms
  1088. AC_CHECK_FUNCS([pselect])
  1089. # /dev/poll issue: ASIO uses /dev/poll by default if it's available (generally
  1090. # the case with Solaris). Unfortunately its /dev/poll specific code would
  1091. # trigger the gcc's "missing-field-initializers" warning, which would
  1092. # subsequently make the build fail with -Werror. Further, older versions of
  1093. # gcc don't provide an option to selectively suppress this warning.
  1094. # So, for the moment, we simply disable the use of /dev/poll. Unless we
  1095. # implement recursive DNS server with randomized ports, we don't need the
  1096. # scalability that /dev/poll can provide, so this decision wouldn't affect
  1097. # run time performance. Hopefully we can find a better solution or the ASIO
  1098. # code will be updated by the time we really need it.
  1099. AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
  1100. if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
  1101. CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_DEV_POLL=1"
  1102. fi
  1103. #
  1104. # Perl is optional; it is used only by some of the system test scripts.
  1105. #
  1106. AC_PATH_PROGS(PERL, perl5 perl)
  1107. AC_SUBST(PERL)
  1108. AC_PATH_PROGS(AWK, gawk awk)
  1109. AC_SUBST(AWK)
  1110. # Kea configuration backend section
  1111. # Currently there are 2 backends available: BUNDY and JSON
  1112. # It is possible that we may extend this to accept additional backends.
  1113. AC_ARG_WITH(kea-config,
  1114. AC_HELP_STRING([--with-kea-config],
  1115. [Selects configuration backend; currently available options are: BUNDY
  1116. (Kea reads configuration and commands from Bundy framework) or JSON (default,
  1117. Kea reads configuration from a JSON file from disk)]),
  1118. [CONFIG_BACKEND="$withval"],
  1119. [CONFIG_BACKEND=JSON])
  1120. AM_CONDITIONAL(CONFIG_BACKEND_BUNDY, test "x$CONFIG_BACKEND" = "xBUNDY")
  1121. AM_CONDITIONAL(CONFIG_BACKEND_JSON, test "x$CONFIG_BACKEND" = "xJSON")
  1122. if test "x$CONFIG_BACKEND" = "xBUNDY"; then
  1123. AC_DEFINE(CONFIG_BACKEND_BUNDY, 1, [Define to 1 if Kea config was set to BUNDY])
  1124. fi
  1125. if test "x$CONFIG_BACKEND" = "xJSON"; then
  1126. AC_DEFINE(CONFIG_BACKEND_JSON, 1, [Define to 1 if Kea config was set to JSON])
  1127. fi
  1128. # Let's sanity check if the specified backend value is allowed
  1129. if test "x$CONFIG_BACKEND" != "xBUNDY" && test "x$CONFIG_BACKEND" != "xJSON"; then
  1130. AC_MSG_ERROR("Invalid configuration backend specified: $CONFIG_BACKEND. The only supported are: BUNDY JSON")
  1131. fi
  1132. AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
  1133. [regenerate documentation using Docbook [default=no]])],
  1134. enable_generate_docs=$enableval, enable_generate_docs=no)
  1135. if test "x$enable_generate_docs" != xno ; then
  1136. if test "$PYTHON" == "no" ; then
  1137. AC_MSG_ERROR("Python3 is required for enable-generate-docs")
  1138. fi
  1139. # Check for xsltproc
  1140. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1141. if test -z "$XSLTPROC"; then
  1142. AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
  1143. else
  1144. AC_MSG_CHECKING([if $XSLTPROC works])
  1145. # run xsltproc to see if works
  1146. $XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
  1147. if test $? -ne 0 ; then
  1148. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
  1149. fi
  1150. $XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
  1151. if test $? -ne 0 ; then
  1152. AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
  1153. fi
  1154. AC_MSG_RESULT(yes)
  1155. fi
  1156. AC_PATH_PROG([ELINKS], [elinks])
  1157. if test -z "$ELINKS"; then
  1158. AC_MSG_ERROR("elinks not found; it is required for --enable-generate-docs")
  1159. fi
  1160. fi
  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_CONFIG_FILES([compatcheck/Makefile
  1209. dns++.pc
  1210. doc/design/datasrc/Makefile
  1211. doc/design/Makefile
  1212. doc/guide/Makefile
  1213. doc/Makefile
  1214. doc/version.ent
  1215. ext/asio/asio/Makefile
  1216. ext/asio/Makefile
  1217. ext/Makefile
  1218. m4macros/Makefile
  1219. Makefile
  1220. src/bin/d2/Makefile
  1221. src/bin/d2/spec_config.h.pre
  1222. src/bin/d2/tests/Makefile
  1223. src/bin/d2/tests/d2_process_tests.sh
  1224. src/bin/d2/tests/test_data_files_config.h
  1225. src/bin/dhcp4/Makefile
  1226. src/bin/dhcp4/spec_config.h.pre
  1227. src/bin/dhcp4/tests/dhcp4_process_tests.sh
  1228. src/bin/dhcp4/tests/Makefile
  1229. src/bin/dhcp4/tests/marker_file.h
  1230. src/bin/dhcp4/tests/test_data_files_config.h
  1231. src/bin/dhcp4/tests/test_libraries.h
  1232. src/bin/dhcp6/Makefile
  1233. src/bin/dhcp6/spec_config.h.pre
  1234. src/bin/dhcp6/tests/dhcp6_process_tests.sh
  1235. src/bin/dhcp6/tests/Makefile
  1236. src/bin/dhcp6/tests/marker_file.h
  1237. src/bin/dhcp6/tests/test_data_files_config.h
  1238. src/bin/dhcp6/tests/test_libraries.h
  1239. src/bin/keactrl/keactrl
  1240. src/bin/keactrl/kea.conf
  1241. src/bin/keactrl/keactrl.conf
  1242. src/bin/keactrl/Makefile
  1243. src/bin/keactrl/tests/keactrl_tests.sh
  1244. src/bin/keactrl/tests/Makefile
  1245. src/bin/Makefile
  1246. src/bin/sockcreator/Makefile
  1247. src/bin/sockcreator/tests/Makefile
  1248. src/hooks/dhcp/Makefile
  1249. src/hooks/dhcp/user_chk/Makefile
  1250. src/hooks/dhcp/user_chk/tests/Makefile
  1251. src/hooks/dhcp/user_chk/tests/test_data_files_config.h
  1252. src/hooks/Makefile
  1253. src/lib/asiodns/Makefile
  1254. src/lib/asiodns/tests/Makefile
  1255. src/lib/asiolink/Makefile
  1256. src/lib/asiolink/tests/Makefile
  1257. src/lib/cc/Makefile
  1258. src/lib/cc/session_config.h.pre
  1259. src/lib/cc/tests/Makefile
  1260. src/lib/cc/tests/session_unittests_config.h
  1261. src/lib/config/Makefile
  1262. src/lib/config/tests/data_def_unittests_config.h
  1263. src/lib/config/tests/Makefile
  1264. src/lib/config/tests/testdata/Makefile
  1265. src/lib/cryptolink/Makefile
  1266. src/lib/cryptolink/tests/Makefile
  1267. src/lib/dhcp_ddns/Makefile
  1268. src/lib/dhcp_ddns/tests/Makefile
  1269. src/lib/dhcp/Makefile
  1270. src/lib/dhcpsrv/Makefile
  1271. src/lib/dhcpsrv/testutils/Makefile
  1272. src/lib/dhcpsrv/tests/Makefile
  1273. src/lib/dhcpsrv/tests/test_libraries.h
  1274. src/lib/dhcp/tests/Makefile
  1275. src/lib/dns/gen-rdatacode.py
  1276. src/lib/dns/Makefile
  1277. src/lib/dns/tests/Makefile
  1278. src/lib/dns/tests/testdata/Makefile
  1279. src/lib/exceptions/Makefile
  1280. src/lib/exceptions/tests/Makefile
  1281. src/lib/hooks/Makefile
  1282. src/lib/hooks/tests/Makefile
  1283. src/lib/hooks/tests/marker_file.h
  1284. src/lib/hooks/tests/test_libraries.h
  1285. src/lib/log/compiler/Makefile
  1286. src/lib/log/interprocess/Makefile
  1287. src/lib/log/interprocess/tests/Makefile
  1288. src/lib/log/Makefile
  1289. src/lib/log/tests/buffer_logger_test.sh
  1290. src/lib/log/tests/console_test.sh
  1291. src/lib/log/tests/destination_test.sh
  1292. src/lib/log/tests/init_logger_test.sh
  1293. src/lib/log/tests/local_file_test.sh
  1294. src/lib/log/tests/logger_lock_test.sh
  1295. src/lib/log/tests/Makefile
  1296. src/lib/log/tests/severity_test.sh
  1297. src/lib/log/tests/tempdir.h
  1298. src/lib/Makefile
  1299. src/lib/testutils/dhcp_test_lib.sh
  1300. src/lib/testutils/Makefile
  1301. src/lib/testutils/testdata/Makefile
  1302. src/lib/util/io/Makefile
  1303. src/lib/util/Makefile
  1304. src/lib/util/python/gen_wiredata.py
  1305. src/lib/util/python/Makefile
  1306. src/lib/util/tests/Makefile
  1307. src/lib/util/threads/Makefile
  1308. src/lib/util/threads/tests/Makefile
  1309. src/lib/util/unittests/Makefile
  1310. src/Makefile
  1311. tests/Makefile
  1312. tests/tools/Makefile
  1313. tests/tools/perfdhcp/Makefile
  1314. tests/tools/perfdhcp/tests/Makefile
  1315. tests/tools/perfdhcp/tests/testdata/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. ])
  1331. AC_OUTPUT
  1332. dnl Print the results
  1333. dnl
  1334. cat > config.report << END
  1335. Kea source configure results:
  1336. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1337. Package:
  1338. Name: ${PACKAGE_NAME}
  1339. Version: ${PACKAGE_VERSION}
  1340. OS Family: ${OS_TYPE}
  1341. Using GNU sed: ${GNU_SED}
  1342. C++ Compiler:
  1343. CXX: ${CXX}
  1344. CXX_VERSION: ${CXX_VERSION}
  1345. DEFS: ${DEFS}
  1346. CPPFLAGS: ${CPPFLAGS}
  1347. CXXFLAGS: ${CXXFLAGS}
  1348. LDFLAGS: ${LDFLAGS}
  1349. B10_CXXFLAGS: ${B10_CXXFLAGS}
  1350. END
  1351. if test "$PYTHON" != "no" ; then
  1352. cat >> config.report << END
  1353. Python3:
  1354. PYTHON_VERSION: ${PYTHON_VERSION}
  1355. PYTHON_INCLUDES: ${PYTHON_INCLUDES}
  1356. PYTHON_CXXFLAGS: ${PYTHON_CXXFLAGS}
  1357. PYTHON_LDFLAGS: ${PYTHON_LDFLAGS}
  1358. PYTHON_LIB: ${PYTHON_LIB}
  1359. END
  1360. else
  1361. cat >> config.report << END
  1362. Python3:
  1363. not installed
  1364. END
  1365. fi
  1366. cat >> config.report << END
  1367. Boost:
  1368. BOOST_VERSION: ${BOOST_VERSION}
  1369. BOOST_INCLUDES: ${BOOST_INCLUDES}
  1370. ${CRYPTO_NAME}:
  1371. CRYPTO_VERSION: ${CRYPTO_VERSION}
  1372. CRYPTO_CFLAGS: ${CRYPTO_CFLAGS}
  1373. CRYPTO_INCLUDES: ${CRYPTO_INCLUDES}
  1374. CRYPTO_LDFLAGS: ${CRYPTO_LDFLAGS}
  1375. CRYPTO_LIBS: ${CRYPTO_LIBS}
  1376. ${DISABLED_CRYPTO}: no
  1377. Log4cplus:
  1378. LOG4CPLUS_VERSION: ${LOG4CPLUS_VERSION}
  1379. LOG4CPLUS_INCLUDES: ${LOG4CPLUS_INCLUDES}
  1380. LOG4CPLUS_LIBS: ${LOG4CPLUS_LIBS}
  1381. Kea config backend:
  1382. CONFIG_BACKEND: ${CONFIG_BACKEND}
  1383. END
  1384. # Avoid confusion on DNS/DHCP and only mention MySQL if it
  1385. # were specified on the command line.
  1386. if test "$MYSQL_CPPFLAGS" != "" ; then
  1387. cat >> config.report << END
  1388. MySQL:
  1389. MYSQL_VERSION: ${MYSQL_VERSION}
  1390. MYSQL_CPPFLAGS: ${MYSQL_CPPFLAGS}
  1391. MYSQL_LIBS: ${MYSQL_LIBS}
  1392. END
  1393. else
  1394. cat >> config.report << END
  1395. MySQL:
  1396. no
  1397. END
  1398. fi
  1399. if test "$PGSQL_CPPFLAGS" != "" ; then
  1400. cat >> config.report << END
  1401. PostgreSQL:
  1402. PGSQL_VERSION: ${PGSQL_VERSION}
  1403. PGSQL_CPPFLAGS: ${PGSQL_CPPFLAGS}
  1404. PGSQL_LIBS: ${PGSQL_LIBS}
  1405. END
  1406. else
  1407. cat >> config.report << END
  1408. PostgreSQL:
  1409. no
  1410. END
  1411. fi
  1412. if test "$enable_gtest" != "no"; then
  1413. cat >> config.report << END
  1414. GTest:
  1415. GTEST_VERSION: ${GTEST_VERSION}
  1416. GTEST_INCLUDES: ${GTEST_INCLUDES}
  1417. GTEST_LDFLAGS: ${GTEST_LDFLAGS}
  1418. GTEST_LDADD: ${GTEST_LDADD}
  1419. GTEST_SOURCE: ${GTEST_SOURCE}
  1420. END
  1421. fi
  1422. cat >> config.report << END
  1423. Features:
  1424. $enable_features
  1425. Developer:
  1426. Enable Debugging: $debug_enabled
  1427. Google Tests: $enable_gtest
  1428. Valgrind: $found_valgrind
  1429. C++ Code Coverage: $USE_LCOV
  1430. Python Code Coverage: $USE_PYCOVERAGE
  1431. Logger checks: $enable_logger_checks
  1432. Generate Documentation: $enable_generate_docs
  1433. END
  1434. cat config.report
  1435. cat <<EOF
  1436. Now you can type "make" to build BIND 10. Note that if you intend to
  1437. run "make check", you must run "make" first as some files need to be
  1438. generated by "make" before "make check" can be run.
  1439. When running "make install" do not use any form of parallel or job
  1440. server options (such as GNU make's -j option). Doing so may cause
  1441. errors.
  1442. EOF