configure.ac 65 KB

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