configure.ac 66 KB

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