configure.ac 65 KB

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