configure.ac 58 KB

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