configure.ac 69 KB

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