configure.ac 66 KB

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