configure.ac 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934
  1. #
  2. # Copyright (C) 2015 Alon Bar-Lev <alon.barlev@gmail.com>
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. #
  5. AC_PREREQ(2.60)
  6. # We do not use m4_esyscmd_s to support older autoconf.
  7. define([VERSION_STRING], m4_esyscmd([git describe 2>/dev/null | tr -d '\n']))
  8. define([VERSION_FROM_FILE], m4_esyscmd([cat packaging/version | tr -d '\n']))
  9. m4_ifval(VERSION_STRING, [], [define([VERSION_STRING], VERSION_FROM_FILE)])
  10. AC_INIT([netdata], VERSION_STRING[])
  11. AM_MAINTAINER_MODE([disable])
  12. if test x"$USE_MAINTAINER_MODE" = xyes; then
  13. AC_MSG_NOTICE(***************** MAINTAINER MODE *****************)
  14. fi
  15. PACKAGE_RPM_VERSION="VERSION_STRING"
  16. AC_SUBST([PACKAGE_RPM_VERSION])
  17. # -----------------------------------------------------------------------------
  18. # autoconf initialization
  19. AC_CONFIG_AUX_DIR([.])
  20. AC_CONFIG_HEADERS([config.h])
  21. AC_CONFIG_MACRO_DIR([build/m4])
  22. AC_CONFIG_SRCDIR([daemon/main.c])
  23. define([AUTOMATE_INIT_OPTIONS], [tar-pax subdir-objects])
  24. m4_ifdef([AM_SILENT_RULES], [
  25. define([AUTOMATE_INIT_OPTIONS], [tar-pax silent-rules subdir-objects])
  26. ])
  27. AM_INIT_AUTOMAKE(AUTOMATE_INIT_OPTIONS)
  28. m4_ifdef([AM_SILENT_RULES], [
  29. AM_SILENT_RULES([yes])
  30. ])
  31. AC_CANONICAL_HOST
  32. AC_PROG_CC
  33. AC_PROG_CC_C99
  34. AM_PROG_CC_C_O
  35. AC_PROG_CXX
  36. AC_PROG_INSTALL
  37. PKG_PROG_PKG_CONFIG
  38. AC_USE_SYSTEM_EXTENSIONS
  39. AC_LANG_PUSH([C])
  40. AX_COMPILER_VENDOR
  41. AC_LANG_POP([C])
  42. if test "$ax_cv_c_compiler_vendor" = "clang"; then
  43. AC_CHECK_PROG([AR], [llvm-ar], [llvm-ar], [ar])
  44. AC_CHECK_PROG([RANLIB], [llvm-ranlib], [llvm-ranlib], [ranlib])
  45. else
  46. AC_CHECK_TOOL([RANLIB], [ranlib])
  47. AC_CHECK_TOOL([AR], [ar])
  48. fi
  49. # -----------------------------------------------------------------------------
  50. # configurable options
  51. AC_ARG_ENABLE(
  52. [plugin-nfacct],
  53. [AS_HELP_STRING([--enable-plugin-nfacct], [enable nfacct plugin @<:@default autodetect@:>@])],
  54. ,
  55. [enable_plugin_nfacct="detect"]
  56. )
  57. AC_ARG_ENABLE(
  58. [plugin-freeipmi],
  59. [AS_HELP_STRING([--enable-plugin-freeipmi], [enable freeipmi plugin @<:@default autodetect@:>@])],
  60. ,
  61. [enable_plugin_freeipmi="detect"]
  62. )
  63. AC_ARG_ENABLE(
  64. [plugin-cups],
  65. [AS_HELP_STRING([--enable-plugin-cups], [enable cups plugin @<:@default autodetect@:>@])],
  66. ,
  67. [enable_plugin_cups="detect"]
  68. )
  69. AC_ARG_ENABLE(
  70. [plugin-xenstat],
  71. [AS_HELP_STRING([--enable-plugin-xenstat], [enable xenstat plugin @<:@default autodetect@:>@])],
  72. ,
  73. [enable_plugin_xenstat="detect"]
  74. )
  75. AC_ARG_ENABLE(
  76. [exporting-kinesis],
  77. [AS_HELP_STRING([--enable-exporting-kinesis], [enable kinesis exporting connector @<:@default autodetect@:>@])],
  78. ,
  79. [enable_exporting_kinesis="detect"]
  80. )
  81. AC_ARG_ENABLE(
  82. [exporting-pubsub],
  83. [AS_HELP_STRING([--enable-exporting-pubsub], [enable pubsub exporting connector @<:@default autodetect@:>@])],
  84. ,
  85. [enable_exporting_pubsub="detect"]
  86. )
  87. AC_ARG_ENABLE(
  88. [exporting-prometheus-remote-write],
  89. [AS_HELP_STRING([--enable-exporting-prometheus-remote-write], [enable prometheus remote write exporting connector @<:@default autodetect@:>@])],
  90. ,
  91. [enable_exporting_prometheus_remote_write="detect"]
  92. )
  93. AC_ARG_ENABLE(
  94. [exporting-mongodb],
  95. [AS_HELP_STRING([--enable-exporting-mongodb], [enable mongodb exporting @<:@default autodetect@:>@])],
  96. ,
  97. [enable_exporting_mongodb="detect"]
  98. )
  99. AC_ARG_ENABLE(
  100. [pedantic],
  101. [AS_HELP_STRING([--enable-pedantic], [enable pedantic compiler warnings @<:@default disabled@:>@])],
  102. ,
  103. [enable_pedantic="no"]
  104. )
  105. AC_ARG_ENABLE(
  106. [accept4],
  107. [AS_HELP_STRING([--disable-accept4], [System does not have accept4 @<:@default autodetect@:>@])],
  108. ,
  109. [enable_accept4="detect"]
  110. )
  111. AC_ARG_WITH(
  112. [webdir],
  113. [AS_HELP_STRING([--with-webdir], [location of webdir @<:@PKGDATADIR/web@:>@])],
  114. [webdir="${withval}"],
  115. [webdir="\$(pkgdatadir)/web"]
  116. )
  117. AC_ARG_WITH(
  118. [libcap],
  119. [AS_HELP_STRING([--with-libcap], [build with libcap @<:@default autodetect@:>@])],
  120. ,
  121. [with_libcap="detect"]
  122. )
  123. AC_ARG_WITH(
  124. [math],
  125. [AS_HELP_STRING([--without-math], [build without math @<:@default enabled@:>@])],
  126. ,
  127. [with_math="yes"]
  128. )
  129. AC_ARG_WITH(
  130. [user],
  131. [AS_HELP_STRING([--with-user], [use this user to drop privilege @<:@default nobody@:>@])],
  132. ,
  133. [with_user="nobody"]
  134. )
  135. AC_ARG_ENABLE(
  136. [x86-sse],
  137. [AS_HELP_STRING([--disable-x86-sse], [SSE/SS2 optimizations on x86 @<:@default enabled@:>@])],
  138. ,
  139. [enable_x86_sse="yes"]
  140. )
  141. AC_ARG_ENABLE(
  142. [lto],
  143. [AS_HELP_STRING([--enable-lto], [Link Time Optimizations @<:@default disabled@:>@])],
  144. ,
  145. [enable_lto="no"]
  146. )
  147. AC_ARG_ENABLE(
  148. [https],
  149. [AS_HELP_STRING([--enable-https], [Enable SSL support @<:@default autodetect@:>@])],
  150. ,
  151. [enable_https="detect"]
  152. )
  153. AC_ARG_ENABLE(
  154. [compression],
  155. [AS_HELP_STRING([--enable-compression], [Enable LZ4 compression support @<:@default autodetect@:>@])],
  156. ,
  157. [enable_compression="detect"]
  158. )
  159. AC_ARG_ENABLE(
  160. [dbengine],
  161. [AS_HELP_STRING([--disable-dbengine], [disable netdata dbengine @<:@default autodetect@:>@])],
  162. ,
  163. [enable_dbengine="detect"]
  164. )
  165. AC_ARG_ENABLE(
  166. [jsonc],
  167. [AS_HELP_STRING([--enable-jsonc], [Enable JSON-C support @<:@default autodetect@:>@])],
  168. ,
  169. [enable_jsonc="detect"]
  170. )
  171. AC_ARG_ENABLE(
  172. [ebpf],
  173. [AS_HELP_STRING([--disable-ebpf], [Disable eBPF support @<:@default autodetect@:>@])],
  174. ,
  175. [enable_ebpf="detect"]
  176. )
  177. AC_ARG_WITH(
  178. [bundled-lws],
  179. [AS_HELP_STRING([--with-bundled-lws], [Use the bundled version of libwebsockets library @<:@default use system library@:>@])],
  180. [with_bundled_lws="yes"], [with_bundled_lws="no"]
  181. )
  182. AC_ARG_WITH(
  183. [bundled-protobuf],
  184. [AS_HELP_STRING([--with-bundled-protobuf],
  185. [Uses the bundled version of Google Protocol Buffers @<:@default bundled if present@:>@])],
  186. [with_bundled_protobuf="$withval"],
  187. [with_bundled_protobuf="detect"]
  188. )
  189. AC_ARG_ENABLE(
  190. [ml],
  191. [AS_HELP_STRING([--enable-ml], [Enable anomaly detection @<:@default autodetect@:>@])],
  192. ,
  193. [enable_ml="detect"]
  194. )
  195. AC_ARG_ENABLE(
  196. [aclk_ssl_debug],
  197. [AS_HELP_STRING([--enable-aclk-ssl-debug], [Enables possibility for SSL key logging @<:@default no@:>@])],
  198. [aclk_ssl_debug="yes"],
  199. [aclk_ssl_debug="no"]
  200. )
  201. AC_ARG_ENABLE(
  202. [httpd],
  203. [AS_HELP_STRING([--disable-httpd], [Disable webserver (h2o based) @<:@default autodetect@:>@])],
  204. ,
  205. [enable_httpd="detect"]
  206. )
  207. # -----------------------------------------------------------------------------
  208. # Enforce building with C99, bail early if we can't.
  209. test "${ac_cv_prog_cc_c99}" = "no" && AC_MSG_ERROR([Netdata requires a compiler that supports C99 to build])
  210. # -----------------------------------------------------------------------------
  211. # Check if cloud is enabled and if the functionality is available
  212. AC_ARG_ENABLE(
  213. [cloud],
  214. [AS_HELP_STRING([--disable-cloud],
  215. [Disables all cloud functionality])],
  216. [ enable_cloud="$enableval" ],
  217. [ enable_cloud="detect" ]
  218. )
  219. if test "${enable_cloud}" = "no"; then
  220. AC_DEFINE([DISABLE_CLOUD], [1], [disable netdata cloud functionality])
  221. fi
  222. # -----------------------------------------------------------------------------
  223. # C++ version check
  224. # Check for C++17 support (optional)
  225. # AX_CXX_COMPILE_STDCXX(17, noext, optional)
  226. if test "x$HAVE_CXX17" != "x1"; then
  227. # Check for C++11 support (optional)
  228. AX_CXX_COMPILE_STDCXX(11, noext, optional)
  229. fi
  230. AC_MSG_CHECKING([c++ standard to use])
  231. if test "x$HAVE_CXX17" = "x1"; then
  232. have_cxx17="yes"
  233. have_cxx11="yes"
  234. CPP_STD_FLAG="-std=c++17"
  235. cpp_std_to_use="c++17"
  236. AM_CONDITIONAL([HAVE_CXX17], [true])
  237. AM_CONDITIONAL([HAVE_CXX11], [true])
  238. elif test "x$HAVE_CXX11" = "x1"; then
  239. have_cxx17="no"
  240. have_cxx11="yes"
  241. CPP_STD_FLAG="-std=c++11"
  242. cpp_std_to_use="c++11"
  243. AM_CONDITIONAL([HAVE_CXX17], [false])
  244. AM_CONDITIONAL([HAVE_CXX11], [true])
  245. else
  246. have_cxx17="no"
  247. have_cxx11="no"
  248. CPP_STD_FLAG=""
  249. cpp_std_to_use="no c++"
  250. AM_CONDITIONAL([HAVE_CXX17], [false])
  251. AM_CONDITIONAL([HAVE_CXX11], [false])
  252. fi
  253. # PPC64LE needs -std=gnu++11 in order to build dlib. However, the rest of
  254. # the agent's components use and have been tested only with -std=c++11.
  255. # Skip ML compilation on that CPU until we reorganize and test the C++ flags.
  256. if test "${host_cpu}" = "powerpc64le"; then
  257. have_cxx17="no"
  258. have_cxx11="no"
  259. CPP_STD_FLAG=""
  260. cpp_std_to_use="no c++ on powerpc64le"
  261. AM_CONDITIONAL([HAVE_CXX17], [false])
  262. AM_CONDITIONAL([HAVE_CXX11], [false])
  263. fi
  264. AC_MSG_RESULT([${cpp_std_to_use}])
  265. # -----------------------------------------------------------------------------
  266. # netdata required checks
  267. # fails on centos6
  268. #AX_CHECK_ENABLE_DEBUG()
  269. AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
  270. AX_GCC_FUNC_ATTRIBUTE([malloc])
  271. AX_GCC_FUNC_ATTRIBUTE([noreturn])
  272. AX_GCC_FUNC_ATTRIBUTE([noinline])
  273. AX_GCC_FUNC_ATTRIBUTE([format])
  274. AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
  275. AC_CHECK_TYPES([struct timespec, clockid_t], [], [], [[#include <time.h>]])
  276. AC_SEARCH_LIBS([clock_gettime], [rt posix4])
  277. AC_CHECK_FUNCS([clock_gettime])
  278. AC_CHECK_FUNCS([sched_setscheduler sched_getscheduler sched_getparam sched_get_priority_min sched_get_priority_max getpriority setpriority nice])
  279. AC_CHECK_FUNCS([recvmmsg])
  280. AC_CHECK_FUNCS([close_range])
  281. AC_TYPE_INT8_T
  282. AC_TYPE_INT16_T
  283. AC_TYPE_INT32_T
  284. AC_TYPE_INT64_T
  285. AC_TYPE_UINT8_T
  286. AC_TYPE_UINT16_T
  287. AC_TYPE_UINT32_T
  288. AC_TYPE_UINT64_T
  289. AC_C_INLINE
  290. AC_FUNC_STRERROR_R
  291. AC_C__GENERIC
  292. # AC_C_STMT_EXPR
  293. AC_CANONICAL_HOST
  294. AC_HEADER_MAJOR
  295. AC_HEADER_RESOLV
  296. AC_CHECK_HEADERS_ONCE([sys/prctl.h])
  297. AC_CHECK_HEADERS_ONCE([sys/vfs.h])
  298. AC_CHECK_HEADERS_ONCE([sys/statfs.h])
  299. AC_CHECK_HEADERS_ONCE([linux/magic.h])
  300. AC_CHECK_HEADERS_ONCE([sys/statvfs.h])
  301. AC_CHECK_HEADERS_ONCE([sys/mount.h])
  302. if test "${enable_accept4}" != "no"; then
  303. AC_CHECK_FUNCS_ONCE(accept4)
  304. fi
  305. AC_CHECK_FUNCS_ONCE(malloc_usable_size)
  306. # -----------------------------------------------------------------------------
  307. # operating system detection
  308. originalCFLAGS="${CFLAGS}"
  309. AC_MSG_CHECKING([operating system])
  310. case "$host_os" in
  311. freebsd*)
  312. build_target=freebsd
  313. OPTIONAL_OS_DEP_CFLAGS="-I/usr/local/include"
  314. CFLAGS="${CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS}"
  315. LDFLAGS="${LDFLAGS} -L/usr/local/lib"
  316. ;;
  317. darwin*)
  318. build_target=macos
  319. LDFLAGS="${LDFLAGS} -framework CoreFoundation -framework IOKit"
  320. # -----------------------------------------------------------------------------
  321. # Pull in OpenSSL properly if on macOS
  322. if brew --prefix > /dev/null 2>&1; then
  323. if brew --prefix --installed openssl > /dev/null 2>&1; then
  324. HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl)
  325. elif brew --prefix --installed openssl@3 > /dev/null 2>&1; then
  326. HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl@3)
  327. elif brew --prefix --installed openssl@1.1 > /dev/null 2>&1; then
  328. HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl@1.1)
  329. fi
  330. if test -n "${HOMEBREW_OPENSSL_PREFIX}"; then
  331. OPTIONAL_OS_DEP_CFLAGS="-I${HOMEBREW_OPENSSL_PREFIX}/include"
  332. CFLAGS="${CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS}"
  333. LDFLAGS="${LDFLAGS} -L${HOMEBREW_OPENSSL_PREFIX}/lib"
  334. fi
  335. HOMEBREW_PREFIX=$(brew --prefix)
  336. OPTIONAL_OS_DEP_CFLAGS="${OPTIONAL_OS_DEP_CFLAGS} -I${HOMEBREW_PREFIX}/include"
  337. CFLAGS="${CFLAGS} -I${HOMEBREW_PREFIX}/include"
  338. LDFLAGS="${LDFLAGS} -L${HOMEBREW_PREFIX}/lib"
  339. fi
  340. ;;
  341. *)
  342. build_target=linux
  343. ;;
  344. esac
  345. AM_CONDITIONAL([FREEBSD], [test "${build_target}" = "freebsd"])
  346. AM_CONDITIONAL([MACOS], [test "${build_target}" = "macos"])
  347. AM_CONDITIONAL([LINUX], [test "${build_target}" = "linux"])
  348. AC_MSG_RESULT([Host OS: ${build_target}])
  349. # -----------------------------------------------------------------------------
  350. # backtrace
  351. AC_SEARCH_LIBS([backtrace], [execinfo], [AC_DEFINE([HAVE_BACKTRACE], [1], [backtrace availability])])
  352. # -----------------------------------------------------------------------------
  353. # pthreads
  354. ACX_PTHREAD(, [AC_MSG_ERROR([Cannot initialize pthread environment])])
  355. LIBS="${PTHREAD_LIBS} ${LIBS}"
  356. CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
  357. CC="${PTHREAD_CC}"
  358. AC_CHECK_LIB(
  359. [pthread],
  360. [pthread_getname_np],
  361. [AC_DEFINE([HAVE_PTHREAD_GETNAME_NP], [1], [Is set if pthread_getname_np is available])]
  362. )
  363. # -----------------------------------------------------------------------------
  364. # libdatachannel
  365. AC_CHECK_LIB([datachannel], [rtcCreatePeerConnection],
  366. [LIBDATACHANNEL_FOUND=yes],
  367. [LIBDATACHANNEL_FOUND=no])
  368. if test "x$LIBDATACHANNEL_FOUND" = "xyes"; then
  369. AC_DEFINE([HAVE_LIBDATACHANNEL], [1], [libdatachannel usability])
  370. OPTIONAL_DATACHANNEL_LIBS="-ldatachannel"
  371. fi
  372. # -----------------------------------------------------------------------------
  373. # libm
  374. AC_ARG_VAR([MATH_CFLAGS], [C compiler flags for math])
  375. AC_ARG_VAR([MATH_LIBS], [linker flags for math])
  376. if test -z "${MATH_LIBS}"; then
  377. AC_CHECK_LIB(
  378. [m],
  379. [sin],
  380. [MATH_LIBS="-lm"]
  381. )
  382. fi
  383. test "${with_math}" = "yes" -a -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found])
  384. AC_MSG_CHECKING([if libm should be used])
  385. if test "${with_math}" != "no" -a ! -z "${MATH_LIBS}"; then
  386. with_math="yes"
  387. AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability])
  388. OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}"
  389. OPTIONAL_MATH_LIBS="${MATH_LIBS}"
  390. else
  391. with_math="no"
  392. fi
  393. AC_MSG_RESULT([${with_math}])
  394. AC_CHECK_FUNCS([isfinite])
  395. AC_CHECK_FUNCS([finite])
  396. # -----------------------------------------------------------------------------
  397. # libuv multi-platform support library with a focus on asynchronous I/O
  398. # TODO: check version, uv_fs_scandir_next only available in version >= 1.0
  399. AC_CHECK_LIB(
  400. [uv],
  401. [uv_fs_scandir_next],
  402. [UV_LIBS="-luv"]
  403. )
  404. test -z "${UV_LIBS}" && \
  405. AC_MSG_ERROR([libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.])
  406. OPTIONAL_UV_CFLAGS="${UV_CFLAGS}"
  407. OPTIONAL_UV_LIBS="${UV_LIBS}"
  408. # -----------------------------------------------------------------------------
  409. # lz4 Extremely Fast Compression algorithm
  410. AC_CHECK_LIB(
  411. [lz4],
  412. [LZ4_initStream],
  413. [LZ4_LIBS_FAST="-llz4"]
  414. )
  415. AC_CHECK_LIB(
  416. [lz4],
  417. [LZ4_compress_default],
  418. [LZ4_LIBS="-llz4"]
  419. )
  420. # -----------------------------------------------------------------------------
  421. # zlib
  422. PKG_CHECK_MODULES(
  423. [ZLIB],
  424. [zlib],
  425. [have_zlib=yes],
  426. [have_zlib=no]
  427. )
  428. test "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
  429. # -----------------------------------------------------------------------------
  430. # libuuid
  431. PKG_CHECK_MODULES(
  432. [UUID],
  433. [uuid],
  434. [have_uuid=yes],
  435. [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])]
  436. )
  437. OPTIONAL_UUID_CFLAGS="${UUID_CFLAGS}"
  438. OPTIONAL_UUID_LIBS="${UUID_LIBS}"
  439. # -----------------------------------------------------------------------------
  440. # OpenSSL Cryptography and SSL/TLS Toolkit
  441. AC_CHECK_LIB(
  442. [crypto],
  443. [SHA256_Init],
  444. [SSL_LIBS="-lcrypto -lssl"]
  445. )
  446. AC_CHECK_LIB(
  447. [crypto],
  448. [X509_VERIFY_PARAM_set1_host],
  449. [ssl_host_validation="yes"],
  450. [ssl_host_validation="no"]
  451. )
  452. test -z "${SSL_LIBS}" || \
  453. AC_DEFINE([HAVE_CRYPTO], [1], [libcrypto availability])
  454. if test "${ssl_host_validation}" = "no"; then
  455. AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [0], [ssl host validation])
  456. AC_MSG_WARN([DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.])
  457. else
  458. AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [1], [ssl host validation])
  459. fi
  460. # -----------------------------------------------------------------------------
  461. # JSON-C library
  462. PKG_CHECK_MODULES([JSON],[json-c],AC_CHECK_LIB(
  463. [json-c],
  464. [json_object_get_type],
  465. [JSONC_LIBS="-ljson-c"]),AC_CHECK_LIB(
  466. [json],
  467. [json_object_get_type],
  468. [JSONC_LIBS="-ljson"])
  469. )
  470. OPTIONAL_JSONC_LIBS="${JSONC_LIBS}"
  471. # -----------------------------------------------------------------------------
  472. # YAML library
  473. AC_CHECK_LIB(
  474. [yaml],
  475. [yaml_parser_initialize],
  476. [YAML_LIBS="-lyaml"]
  477. )
  478. OPTIONAL_YAML_LIBS="${YAML_LIBS}"
  479. # -----------------------------------------------------------------------------
  480. # DB engine and HTTPS
  481. test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \
  482. AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.])
  483. AC_C_BIGENDIAN([],
  484. [LIBJUDY_CFLAGS="-DJU_LITTLE_ENDIAN"],
  485. [AC_MSG_ERROR([Could not find out system endiannnes])])
  486. AC_CHECK_SIZEOF(void *)
  487. if test "$ac_cv_sizeof_void_p" = 8; then
  488. AC_MSG_RESULT(Detected 64-bit Build Environment)
  489. LIBJUDY_CFLAGS="$LIBJUDY_CFLAGS -DJU_64BIT"
  490. else
  491. AC_MSG_RESULT(Detected 32-bit Build Environment)
  492. LIBJUDY_CFLAGS="$LIBJUDY_CFLAGS -UJU_64BIT"
  493. fi
  494. AC_SUBST([LIBJUDY_CFLAGS])
  495. JUDY_CFLAGS="-I \$(abs_top_srcdir)/libnetdata/libjudy/src"
  496. test "${enable_https}" = "yes" -a -z "${SSL_LIBS}" && \
  497. AC_MSG_ERROR([OpenSSL required for HTTPS but not found. Try installing 'libssl-dev' or 'openssl-devel'.])
  498. test "${enable_dbengine}" = "yes" -a -z "${SSL_LIBS}" && \
  499. AC_MSG_ERROR([OpenSSL required for DBENGINE but not found. Try installing 'libssl-dev' or 'openssl-devel'.])
  500. AC_MSG_CHECKING([if netdata dbengine should be used])
  501. if test "${enable_dbengine}" != "no" -a "${UV_LIBS}" -a "${LZ4_LIBS}" -a "${SSL_LIBS}"; then
  502. enable_dbengine="yes"
  503. AC_DEFINE([ENABLE_DBENGINE], [1], [netdata dbengine usability])
  504. OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
  505. OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
  506. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  507. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  508. else
  509. enable_dbengine="no"
  510. fi
  511. AC_MSG_RESULT([${enable_dbengine}])
  512. AM_CONDITIONAL([ENABLE_DBENGINE], [test "${enable_dbengine}" = "yes"])
  513. AC_MSG_CHECKING([if netdata https should be used])
  514. if test "${enable_https}" != "no" -a "${SSL_LIBS}"; then
  515. enable_https="yes"
  516. AC_DEFINE([ENABLE_HTTPS], [1], [netdata HTTPS usability])
  517. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  518. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  519. else
  520. enable_https="no"
  521. fi
  522. AC_MSG_RESULT([${enable_https}])
  523. AM_CONDITIONAL([ENABLE_HTTPS], [test "${enable_https}" = "yes"])
  524. AC_MSG_CHECKING([if netdata compression should be used])
  525. if test "${enable_compression}" != "no"; then
  526. if test "${LZ4_LIBS_FAST}"; then
  527. LIBS_BKP="${LIBS}"
  528. LIBS="${LZ4_LIBS_FAST}"
  529. AC_TRY_LINK(
  530. [ #include <lz4.h> ],
  531. [
  532. LZ4_stream_t* stream = LZ4_initStream(NULL, 0);
  533. ],
  534. [ enable_compression="yes"],
  535. [ enable_compression="no" ]
  536. )
  537. LIBS="${LIBS_BKP}"
  538. if test "${enable_compression}" == "yes"; then
  539. OPTIONAL_LZ4_LIBS="${LZ4_LIBS_FAST}"
  540. AC_DEFINE([ENABLE_COMPRESSION], [1], [netdata compression usability])
  541. fi
  542. else
  543. if test "${enable_compression}" == "yes"; then
  544. AC_MSG_ERROR([liblz4 with version >= 1.9.0 required to enable_compression. Try installing the required version of 'liblz4-dev' or 'liblz4-devel'.])
  545. enable_compression="no"
  546. fi
  547. enable_compression="no"
  548. fi
  549. else
  550. enable_compression="no"
  551. fi
  552. AC_MSG_RESULT([${enable_compression}])
  553. AM_CONDITIONAL([ENABLE_COMPRESSION], [test "${enable_compression}" = "yes"])
  554. # -----------------------------------------------------------------------------
  555. # JSON-C
  556. if test "${enable_jsonc}" != "no" -a -z "${JSONC_LIBS}"; then
  557. # Try and detect manual static build presence (from netdata-installer.sh)
  558. AC_MSG_CHECKING([if statically built json-c is present])
  559. HAVE_libjson_c_a="no"
  560. if test -f "externaldeps/jsonc/libjson-c.a"; then
  561. LIBS_BKP="${LIBS}"
  562. LIBS="externaldeps/jsonc/libjson-c.a"
  563. AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/jsonc/json-c/json.h"
  564. int main (int argc, char **argv) {
  565. struct json_object *jobj;
  566. char *str = "{ \"msg-type\": \"random\" }";
  567. jobj = json_tokener_parse(str);
  568. json_object_get_type(jobj);
  569. }]])],
  570. [HAVE_libjson_c_a="yes"],
  571. [HAVE_libjson_c_a="no"])
  572. LIBS="${LIBS_BKP}"
  573. fi
  574. if test "${HAVE_libjson_c_a}" = "yes"; then
  575. AC_DEFINE([LINK_STATIC_JSONC], [1], [static json-c should be used])
  576. JSONC_LIBS="static"
  577. OPTIONAL_JSONC_STATIC_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/jsonc"
  578. fi
  579. AC_MSG_RESULT([${HAVE_libjson_c_a}])
  580. fi
  581. AM_CONDITIONAL([LINK_STATIC_JSONC], [test "${JSONC_LIBS}" = "static"])
  582. test "${enable_jsonc}" = "yes" -a -z "${JSONC_LIBS}" && \
  583. AC_MSG_ERROR([JSON-C required but not found. Try installing 'libjson-c-dev' or 'json-c'.])
  584. AC_MSG_CHECKING([if json-c should be used])
  585. if test "${enable_jsonc}" != "no" -a "${JSONC_LIBS}"; then
  586. enable_jsonc="yes"
  587. AC_DEFINE([ENABLE_JSONC], [1], [netdata json-c usability])
  588. else
  589. enable_jsonc="no"
  590. fi
  591. AC_MSG_RESULT([${enable_jsonc}])
  592. AM_CONDITIONAL([ENABLE_JSONC], [test "${enable_jsonc}" = "yes"])
  593. # -----------------------------------------------------------------------------
  594. # YAML
  595. if test -z "${YAML_LIBS}"; then
  596. # Try and detect manual static build presence (from netdata-installer.sh)
  597. AC_MSG_CHECKING([if statically built libyaml is present])
  598. HAVE_libyaml_a="no"
  599. if test -f "externaldeps/libyaml/libyaml.a"; then
  600. LIBS_BKP="${LIBS}"
  601. LIBS="externaldeps/libyaml/libyaml.a"
  602. AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/libyaml/yaml.h"
  603. int main (int argc, char **argv) {
  604. yaml_parser_t parser;
  605. yaml_parser_initialize(&parser);
  606. }]])],
  607. [HAVE_libyaml_a="yes"],
  608. [HAVE_libyaml_a="no"])
  609. LIBS="${LIBS_BKP}"
  610. fi
  611. if test "${HAVE_libyaml_a}" = "yes"; then
  612. AC_DEFINE([LINK_STATIC_YAML], [1], [static yaml should be used])
  613. YAML_LIBS="static"
  614. OPTIONAL_YAML_STATIC_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/libyaml"
  615. fi
  616. AC_MSG_RESULT([${HAVE_libyaml_a}])
  617. fi
  618. AM_CONDITIONAL([LINK_STATIC_YAML], [test "${YAML_LIBS}" = "static"])
  619. test -z "${YAML_LIBS}" && \
  620. AC_MSG_ERROR([LIBYAML required but not found. Try installing 'libyaml-dev'.])
  621. # -----------------------------------------------------------------------------
  622. # compiler options
  623. AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE])
  624. AS_CASE([$host_cpu],
  625. [i?86], [SSE_CANDIDATE="yes"]
  626. )
  627. AC_SUBST([SSE_CANDIDATE])
  628. if test "${SSE_CANDIDATE}" = "yes" -a "${enable_x86_sse}" = "yes"; then
  629. opt="-msse2 -mfpmath=sse"
  630. AX_CHECK_COMPILE_FLAG(${opt}, [CFLAGS="${CFLAGS} ${opt}"], [])
  631. fi
  632. if test "${GCC}" = "yes"; then
  633. AC_DEFINE_UNQUOTED([likely(x)], [__builtin_expect(!!(x), 1)], [gcc branch optimization])
  634. AC_DEFINE_UNQUOTED([unlikely(x)], [__builtin_expect(!!(x), 0)], [gcc branch optimization])
  635. else
  636. AC_DEFINE_UNQUOTED([likely(x)], [(x)], [gcc branch optimization])
  637. AC_DEFINE_UNQUOTED([unlikely(x)], [(x)], [gcc branch optimization])
  638. fi
  639. if test "${GCC}" = "yes"; then
  640. AC_DEFINE([__always_unused], [__attribute__((unused))], [gcc unused attribute])
  641. AC_DEFINE([__maybe_unused], [__attribute__((unused))], [gcc unused attribute])
  642. else
  643. AC_DEFINE([__always_unused], [], [dummy unused attribute])
  644. AC_DEFINE([__maybe_unused], [], [dummy unused attribute])
  645. fi
  646. if test "${enable_pedantic}" = "yes"; then
  647. enable_strict="yes"
  648. CFLAGS="${CFLAGS} -pedantic -Wall -Wextra -Wno-long-long"
  649. fi
  650. # -----------------------------------------------------------------------------
  651. # memory allocation library
  652. AC_MSG_CHECKING([for memory allocator])
  653. TS_CHECK_JEMALLOC
  654. if test "$has_jemalloc" = "1"; then
  655. AC_DEFINE([ENABLE_JEMALLOC], [1], [compile and link with jemalloc])
  656. AC_MSG_RESULT([jemalloc])
  657. else
  658. TS_CHECK_TCMALLOC
  659. if test "$has_tcmalloc" = "1"; then
  660. AC_DEFINE([ENABLE_TCMALLOC], [1], [compile and link with tcmalloc])
  661. AC_MSG_RESULT([tcmalloc])
  662. else
  663. AC_MSG_RESULT([system])
  664. AC_C_MALLOPT
  665. AC_C_MALLINFO
  666. fi
  667. fi
  668. # -----------------------------------------------------------------------------
  669. # libcap
  670. PKG_CHECK_MODULES(
  671. [LIBCAP],
  672. [libcap],
  673. [AC_CHECK_LIB([cap], [cap_get_proc, cap_set_proc],
  674. [AC_CHECK_HEADER(
  675. [sys/capability.h],
  676. [have_libcap=yes],
  677. [have_libcap=no]
  678. )],
  679. [have_libcap=no]
  680. )],
  681. [have_libcap=no]
  682. )
  683. test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.])
  684. AC_MSG_CHECKING([if libcap should be used])
  685. if test "${with_libcap}" != "no" -a "${have_libcap}" = "yes"; then
  686. with_libcap="yes"
  687. AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability])
  688. OPTIONAL_LIBCAP_CFLAGS="${LIBCAP_CFLAGS}"
  689. OPTIONAL_LIBCAP_LIBS="${LIBCAP_LIBS}"
  690. else
  691. with_libcap="no"
  692. fi
  693. AC_MSG_RESULT([${with_libcap}])
  694. AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"])
  695. # -----------------------------------------------------------------------------
  696. # HTTPD and h2o related
  697. can_build_httpd="no"
  698. if test "${enable_httpd}" != "no"; then
  699. can_build_httpd="yes"
  700. AC_MSG_CHECKING([can build HTTPD])
  701. if test -z "${UV_LIBS}"; then
  702. can_build_httpd="no"
  703. fi
  704. if test -n "${SSL_LIBS}"; then
  705. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  706. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  707. else
  708. can_build_httpd="no"
  709. fi
  710. if test "${with_zlib}" != "yes"; then
  711. can_build_httpd="no"
  712. fi
  713. AC_MSG_RESULT([${can_build_httpd}])
  714. if test "${can_build_httpd}" = "no" -a "${enable_httpd}" = "yes"; then
  715. AC_MSG_ERROR([HTTPD was requested but it cannot be built])
  716. fi
  717. if test "${can_build_httpd}" = "yes"; then
  718. AC_DEFINE([ENABLE_HTTPD], [1], [HTTPD (h2o based web server)])
  719. HTTPD_CFLAGS="-I\$(abs_top_srcdir)/httpd/h2o/include -I\$(abs_top_srcdir)/httpd/h2o/deps/picotls/include -I\$(abs_top_srcdir)/httpd/h2o/deps/quicly/include -DH2O_USE_LIBUV=0"
  720. fi
  721. fi
  722. AM_CONDITIONAL([ENABLE_HTTPD], [test "${can_build_httpd}" = "yes"])
  723. # -----------------------------------------------------------------------------
  724. # ACLK
  725. bundled_proto_avail="no"
  726. if test "${with_bundled_protobuf}" != "no"; then
  727. AC_MSG_CHECKING([is bundled protobuf available])
  728. if test -f "externaldeps/protobuf/src/protoc"; then
  729. bundled_proto_avail="yes"
  730. fi
  731. AC_MSG_RESULT([${bundled_proto_avail}])
  732. if test "${with_bundled_protobuf}" == "yes" -a "${bundled_proto_avail}" != "yes"; then
  733. AC_MSG_ERROR([Bundled protobuf requested using --with-bundled-protobuf but it cannot be used/found])
  734. fi
  735. if test "${with_bundled_protobuf}" == "detect" -a "${bundled_proto_avail}" == "yes"; then
  736. with_bundled_protobuf="yes"
  737. fi
  738. fi
  739. AM_CONDITIONAL([MQTT_WSS_DEBUG], [test "${aclk_ssl_debug}" = "yes"])
  740. if test "${aclk_ssl_debug}" = "yes"; then
  741. AC_DEFINE([MQTT_WSS_DEBUG], [1], [ACLK SSL allow debugging])
  742. fi
  743. if test "${with_bundled_protobuf}" != "yes"; then
  744. PKG_CHECK_MODULES(
  745. [PROTOBUF],
  746. [protobuf >= 3],
  747. [have_libprotobuf=yes],
  748. [have_libprotobuf=no]
  749. )
  750. AC_PATH_PROG([PROTOC], [protoc], [no])
  751. AS_IF(
  752. [test x"${PROTOC}" == x"no"],
  753. [have_protoc=no],
  754. [have_protoc=yes]
  755. )
  756. else
  757. AC_MSG_NOTICE([using bundled protobuf])
  758. AC_DEFINE([BUNDLED_PROTOBUF], [1], [Using a bundled copy of protobuf])
  759. PROTOC="\$(abs_top_srcdir)/externaldeps/protobuf/src/protoc"
  760. PROTOBUF_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/protobuf/src"
  761. PROTOBUF_LIBS="\$(abs_top_srcdir)/externaldeps/protobuf/src/.libs/libprotobuf.a"
  762. have_libprotobuf="yes"
  763. have_protoc="yes"
  764. fi
  765. AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
  766. AS_IF(
  767. [test x"${CXX_BINARY}" == x"no"],
  768. [have_CXX_compiler=no],
  769. [have_CXX_compiler=yes]
  770. )
  771. if test "${have_libprotobuf}" == "yes" && test "${have_CXX_compiler}" == "yes"; then
  772. AC_DEFINE([HAVE_PROTOBUF], [1], [Protobuf is available])
  773. fi
  774. AC_MSG_CHECKING([if Cloud functionality should be enabled])
  775. AC_MSG_RESULT([${enable_cloud}])
  776. if test "$enable_cloud" != "no"; then
  777. AC_MSG_NOTICE([Checking if ACLK can be built])
  778. can_enable_ng="yes"
  779. AC_MSG_CHECKING([if git submodules present for ACLK])
  780. if test -f "mqtt_websockets/src/mqtt_wss_client.c"; then
  781. AC_MSG_RESULT([yes])
  782. else
  783. AC_MSG_RESULT([no])
  784. can_enable_ng="no"
  785. fi
  786. AC_MSG_CHECKING([if SSL available for ACLK])
  787. if test -n "${SSL_LIBS}"; then
  788. AC_MSG_RESULT([yes])
  789. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  790. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  791. else
  792. AC_MSG_RESULT([no])
  793. fi
  794. AC_MSG_CHECKING([if JSON-C available for ACLK])
  795. if test "$enable_jsonc" != "yes"; then
  796. AC_MSG_RESULT([no])
  797. can_enable_ng="no"
  798. else
  799. AC_MSG_RESULT([yes])
  800. fi
  801. AC_MSG_CHECKING([if protobuf available for ACLK New Cloud Protocol])
  802. if test "${have_libprotobuf}" != "yes"; then
  803. AC_MSG_RESULT([no])
  804. can_enable_ng="no"
  805. else
  806. AC_MSG_RESULT([yes])
  807. fi
  808. AC_MSG_CHECKING([if protoc available for ACLK New Cloud Protocol])
  809. if test "${have_protoc}" != "yes"; then
  810. AC_MSG_RESULT([no])
  811. can_enable_ng="no"
  812. else
  813. AC_MSG_RESULT([yes])
  814. fi
  815. AC_MSG_CHECKING([if C++ compiler available for ACLK New Cloud Protocol])
  816. if test "${have_CXX_compiler}" != "yes"; then
  817. AC_MSG_RESULT([no])
  818. can_enable_ng="no"
  819. else
  820. AC_MSG_RESULT([yes])
  821. fi
  822. AC_MSG_CHECKING([ACLK Next Generation can be built])
  823. AC_MSG_RESULT([${can_enable_ng}])
  824. if test "$can_enable_ng" = "no" -a "$enable_cloud" = "yes"; then
  825. AC_MSG_ERROR([You have requested --with-cloud but ACLK can't be built. See reasons in lines above])
  826. fi
  827. if test "$can_enable_ng" = "yes"; then
  828. enable_aclk="yes"
  829. AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK])
  830. OPTIONAL_ACLK_CFLAGS="-I \$(abs_top_srcdir)/mqtt_websockets/src/include -I \$(abs_top_srcdir)/mqtt_websockets/c-rbuf/include -I \$(abs_top_srcdir)/aclk/aclk-schemas"
  831. OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}"
  832. OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}"
  833. fi
  834. fi
  835. if test "$enable_cloud" = "yes" -a "$enable_aclk" != "yes"; then
  836. AC_MSG_ERROR([ACLK can't be built but --enable-cloud was requested])
  837. fi
  838. AC_SUBST([enable_cloud])
  839. AC_SUBST([enable_aclk])
  840. AM_CONDITIONAL([ENABLE_ACLK], [test "${enable_aclk}" = "yes"])
  841. # -----------------------------------------------------------------------------
  842. # apps.plugin
  843. AC_MSG_CHECKING([if apps.plugin should be enabled])
  844. if test "${build_target}" != "macos"; then
  845. AC_DEFINE([ENABLE_APPS_PLUGIN], [1], [apps.plugin])
  846. enable_plugin_apps="yes"
  847. else
  848. enable_plugin_apps="no"
  849. fi
  850. AC_MSG_RESULT([${enable_plugin_apps}])
  851. AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${enable_plugin_apps}" = "yes"])
  852. # -----------------------------------------------------------------------------
  853. # freeipmi.plugin - libipmimonitoring
  854. PKG_CHECK_MODULES(
  855. [IPMIMONITORING],
  856. [libipmimonitoring],
  857. [AC_CHECK_LIB([ipmimonitoring], [
  858. ipmi_monitoring_sensor_readings_by_record_id,
  859. ipmi_monitoring_sensor_readings_by_sensor_type,
  860. ipmi_monitoring_sensor_read_sensor_number,
  861. ipmi_monitoring_sensor_read_sensor_name,
  862. ipmi_monitoring_sensor_read_sensor_state,
  863. ipmi_monitoring_sensor_read_sensor_units,
  864. ipmi_monitoring_sensor_iterator_next,
  865. ipmi_monitoring_ctx_sensor_config_file,
  866. ipmi_monitoring_ctx_sdr_cache_directory,
  867. ipmi_monitoring_ctx_errormsg,
  868. ipmi_monitoring_ctx_create
  869. ],
  870. [AC_CHECK_HEADER(
  871. [ipmi_monitoring.h],
  872. [AC_CHECK_HEADER(
  873. [ipmi_monitoring_bitmasks.h],
  874. [have_ipmimonitoring=yes],
  875. [have_ipmimonitoring=no]
  876. )],
  877. [have_ipmimonitoring=no]
  878. )],
  879. [have_ipmimonitoring=no]
  880. )],
  881. [have_ipmimonitoring=no]
  882. )
  883. test "${enable_plugin_freeipmi}" = "yes" -a "${have_ipmimonitoring}" != "yes" && \
  884. AC_MSG_ERROR([ipmimonitoring required but not found. Try installing 'libipmimonitoring-dev' or 'libipmimonitoring-devel'])
  885. AC_MSG_CHECKING([if freeipmi.plugin should be enabled])
  886. if test "${enable_plugin_freeipmi}" != "no" -a "${have_ipmimonitoring}" = "yes"; then
  887. enable_plugin_freeipmi="yes"
  888. AC_DEFINE([HAVE_FREEIPMI], [1], [ipmimonitoring usability])
  889. OPTIONAL_IPMIMONITORING_CFLAGS="${IPMIMONITORING_CFLAGS}"
  890. OPTIONAL_IPMIMONITORING_LIBS="${IPMIMONITORING_LIBS}"
  891. else
  892. enable_plugin_freeipmi="no"
  893. fi
  894. AC_MSG_RESULT([${enable_plugin_freeipmi}])
  895. AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "yes"])
  896. # -----------------------------------------------------------------------------
  897. # cups.plugin - libcups
  898. # Only check most recently added method of cups
  899. AC_CHECK_LIB([cups], [httpConnect2],
  900. [AC_CHECK_HEADER(
  901. [cups/cups.h],
  902. [have_cups=yes],
  903. [have_cups=no]
  904. )],
  905. [have_cups=no]
  906. )
  907. test "${enable_plugin_cups}" = "yes" -a "${have_cups}" != "yes" && \
  908. AC_MSG_ERROR([cups required but not found. Try installing 'cups'])
  909. AC_ARG_WITH([cups-config],
  910. [AS_HELP_STRING([--with-cups-config=path], [Specify path to cups-config executable.])],
  911. [with_cups_config="$withval"],
  912. [with_cups_config=system]
  913. )
  914. AS_IF([test "x$with_cups_config" != "xsystem"], [
  915. CUPSCONFIG=$with_cups_config
  916. ], [
  917. AC_PATH_TOOL(CUPSCONFIG, [cups-config])
  918. AS_IF([test -z "$CUPSCONFIG"], [
  919. have_cups=no
  920. ])
  921. ])
  922. AC_MSG_CHECKING([if cups.plugin should be enabled])
  923. if test "${enable_plugin_cups}" != "no" -a "${have_cups}" = "yes"; then
  924. enable_plugin_cups="yes"
  925. AC_DEFINE([HAVE_CUPS], [1], [cups usability])
  926. CUPS_CFLAGS="${CUPS_CFLAGS} `$CUPSCONFIG --cflags`"
  927. CUPS_LIBS="${CUPS_LIBS} `$CUPSCONFIG --libs`"
  928. OPTIONAL_CUPS_CFLAGS="${CUPS_CFLAGS}"
  929. OPTIONAL_CUPS_LIBS="${CUPS_LIBS}"
  930. else
  931. enable_plugin_cups="no"
  932. fi
  933. AC_MSG_RESULT([${enable_plugin_cups}])
  934. AM_CONDITIONAL([ENABLE_PLUGIN_CUPS], [test "${enable_plugin_cups}" = "yes"])
  935. # -----------------------------------------------------------------------------
  936. # nfacct.plugin - libmnl, libnetfilter_acct
  937. AC_CHECK_HEADER(
  938. [linux/netfilter/nfnetlink_conntrack.h],
  939. [AC_CHECK_DECL(
  940. [CTA_STATS_MAX],
  941. [have_nfnetlink_conntrack=yes],
  942. [have_nfnetlink_conntrack=no],
  943. [#include <linux/netfilter/nfnetlink_conntrack.h>]
  944. )],
  945. [have_nfnetlink_conntrack=no]
  946. )
  947. LIBS_BAK="${LIBS}"
  948. LIBS="${LIBS} -lmnl"
  949. PKG_CHECK_MODULES(
  950. [LIBMNL],
  951. [libmnl],
  952. [AC_CHECK_LIB(
  953. [mnl],
  954. [mnl_socket_open],
  955. [have_libmnl=yes],
  956. [have_libmnl=no]
  957. )],
  958. [have_libmnl=no]
  959. )
  960. LIBS="${LIBS}"
  961. PKG_CHECK_MODULES(
  962. [NFACCT],
  963. [libnetfilter_acct],
  964. AC_SEARCH_LIBS(
  965. [nfacct_alloc],
  966. [netfilter_acct libnetfilter_acct],
  967. [have_libnetfilter_acct=yes],
  968. [have_libnetfilter_acct=no],
  969. [${LIBS} -L/libnetfilter-acct-static/lib/libnetfilter_acct.a]
  970. )],
  971. [have_libnetfilter_acct=no]
  972. )
  973. LIBS="${LIBS_BAK}"
  974. test "${enable_plugin_nfacct}" = "yes" -a "${have_nfnetlink_conntrack}" != "yes" && \
  975. AC_MSG_ERROR([nfnetlink_conntrack.h required but not found or too old])
  976. test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
  977. AC_MSG_ERROR([netfilter_acct required but not found])
  978. test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \
  979. AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
  980. AC_MSG_CHECKING([if nfacct.plugin should be enabled])
  981. if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" \
  982. -a "${have_libmnl}" = "yes" \
  983. -a "${have_nfnetlink_conntrack}" = "yes"; then
  984. enable_plugin_nfacct="yes"
  985. AC_DEFINE([HAVE_NFACCT], [1], [netfilter accounting usability])
  986. OPTIONAL_NFACCT_CFLAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}"
  987. OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}"
  988. else
  989. enable_plugin_nfacct="no"
  990. fi
  991. AC_MSG_RESULT([${enable_plugin_nfacct}])
  992. AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"])
  993. # -----------------------------------------------------------------------------
  994. # xenstat.plugin - libxenstat
  995. PKG_CHECK_MODULES(
  996. [YAJL],
  997. [yajl],
  998. [AC_CHECK_LIB(
  999. [yajl],
  1000. [yajl_tree_get],
  1001. [have_libyajl=yes],
  1002. [have_libyajl=no]
  1003. )],
  1004. [have_libyajl=no]
  1005. )
  1006. AC_CHECK_LIB(
  1007. [xenstat],
  1008. [xenstat_init],
  1009. [AC_CHECK_HEADER(
  1010. [xenstat.h],
  1011. [have_libxenstat=yes],
  1012. [have_libxenstat=no]
  1013. )],
  1014. [have_libxenstat=no],
  1015. [-lyajl]
  1016. )
  1017. PKG_CHECK_MODULES(
  1018. [XENLIGHT],
  1019. [xenlight],
  1020. [AC_CHECK_LIB(
  1021. [xenlight],
  1022. [libxl_domain_info],
  1023. [AC_CHECK_HEADER(
  1024. [libxl.h],
  1025. [have_libxenlight=yes],
  1026. [have_libxenlight=no]
  1027. )],
  1028. [have_libxenlight=no]
  1029. )],
  1030. [have_libxenlight=no]
  1031. )
  1032. test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenstat}" != "yes" && \
  1033. AC_MSG_ERROR([libxenstat required but not found. try installing 'xen-dom0-libs-devel'])
  1034. test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenlight}" != "yes" && \
  1035. AC_MSG_ERROR([libxenlight required but not found. try installing 'xen-dom0-libs-devel'])
  1036. test "${enable_plugin_xenstat}" = "yes" -a "${have_libyajl}" != "yes" && \
  1037. AC_MSG_ERROR([libyajl required but not found. Try installing 'yajl-devel'])
  1038. AC_MSG_CHECKING([if xenstat.plugin should be enabled])
  1039. if test "${enable_plugin_xenstat}" != "no" -a "${have_libxenstat}" = "yes" -a "${have_libxenlight}" = "yes" -a "${have_libyajl}" = "yes"; then
  1040. enable_plugin_xenstat="yes"
  1041. AC_DEFINE([HAVE_LIBXENSTAT], [1], [libxenstat usability])
  1042. OPTIONAL_XENSTAT_CFLAGS="${XENLIGHT_CFLAGS} ${YAJL_CFLAGS}"
  1043. OPTIONAL_XENSTAT_LIBS="-lxenstat ${XENLIGHT_LIBS} ${YAJL_LIBS}"
  1044. else
  1045. enable_plugin_xenstat="no"
  1046. fi
  1047. AC_MSG_RESULT([${enable_plugin_xenstat}])
  1048. AM_CONDITIONAL([ENABLE_PLUGIN_XENSTAT], [test "${enable_plugin_xenstat}" = "yes"])
  1049. if test "${enable_plugin_xenstat}" == "yes"; then
  1050. AC_MSG_CHECKING([for xenstat_vbd_error in -lxenstat])
  1051. AC_TRY_LINK(
  1052. [ #include <xenstat.h> ],
  1053. [
  1054. xenstat_vbd * vbd;
  1055. int out = xenstat_vbd_error(vbd);
  1056. ],
  1057. [
  1058. have_xenstat_vbd_error=yes
  1059. AC_DEFINE([HAVE_XENSTAT_VBD_ERROR], [1], [xenstat_vbd_error usability])
  1060. ],
  1061. [ have_xenstat_vbd_error=no ]
  1062. )
  1063. AC_MSG_RESULT([${have_xenstat_vbd_error}])
  1064. fi
  1065. # -----------------------------------------------------------------------------
  1066. # perf.plugin
  1067. AC_CHECK_HEADER(
  1068. [linux/perf_event.h],
  1069. [AC_CHECK_DECL(
  1070. [PERF_COUNT_HW_REF_CPU_CYCLES],
  1071. [have_perf_event=yes],
  1072. [have_perf_event=no],
  1073. [#include <linux/perf_event.h>]
  1074. )],
  1075. [have_perf_event=no]
  1076. )
  1077. AC_MSG_CHECKING([if perf.plugin should be enabled])
  1078. if test "${build_target}" == "linux" -a "${have_perf_event}" = "yes"; then
  1079. AC_DEFINE([ENABLE_PERF_PLUGIN], [1], [perf.plugin])
  1080. enable_plugin_perf="yes"
  1081. else
  1082. enable_plugin_perf="no"
  1083. fi
  1084. AC_MSG_RESULT([${enable_plugin_perf}])
  1085. AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"])
  1086. # -----------------------------------------------------------------------------
  1087. # gtest/gmock
  1088. AC_MSG_CHECKING([if gtest and gmock can be found])
  1089. PKG_CHECK_MODULES([GTEST], [gtest], [have_gtest=yes], [have_gtest=no])
  1090. PKG_CHECK_MODULES([GMOCK], [gmock], [have_gmock=yes], [have_gmock=no])
  1091. if test "${have_gtest}" = "yes" -a "${have_gmock}" = "yes"; then
  1092. OPTIONAL_GTEST_CFLAGS="${GTEST_CFLAGS} ${GMOCK_CFLAGS}"
  1093. OPTIONAL_GTEST_LIBS="${GTEST_LIBS} ${GMOCK_LIBS}"
  1094. have_gtest="yes"
  1095. else
  1096. have_gtest="no"
  1097. fi
  1098. # -----------------------------------------------------------------------------
  1099. # ml - anomaly detection
  1100. # Check if uuid is available. Fail if ML was explicitly requested.
  1101. if test "${enable_ml}" = "yes" -a "${have_uuid}" != "yes"; then
  1102. AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but libuuid can not be found.])
  1103. fi
  1104. # Check if submodules have not been fetched. Fail if ML was explicitly requested.
  1105. AC_MSG_CHECKING([if git submodules are present for machine learning functionality])
  1106. if test -f "ml/dlib/dlib/all/source.cpp"; then
  1107. AC_MSG_RESULT([yes])
  1108. have_ml_submodules="yes"
  1109. else
  1110. AC_MSG_RESULT([no])
  1111. have_ml_submodules="no"
  1112. fi
  1113. if test "${enable_ml}" = "yes" -a "${have_ml_submodules}" = "no"; then
  1114. AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but it cannot be built because the required git submodules are missing.])
  1115. fi
  1116. if test "${enable_ml}" = "yes" -a "${have_cxx11}" = "no"; then
  1117. AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but it cannot be built without a C++11 toolchain.])
  1118. fi
  1119. # Decide if we should build ML
  1120. if test "${enable_ml}" != "no" -a "${have_ml_submodules}" = "yes" -a "${have_cxx11}" = "yes" -a "${have_uuid}" = "yes"; then
  1121. build_ml="yes"
  1122. else
  1123. build_ml="no"
  1124. fi
  1125. AM_CONDITIONAL([ENABLE_ML], [test "${build_ml}" = "yes"])
  1126. if test "${build_ml}" = "yes"; then
  1127. AC_DEFINE([ENABLE_ML], [1], [anomaly detection usability])
  1128. OPTIONAL_ML_CFLAGS="-DDLIB_NO_GUI_SUPPORT -I \$(abs_top_srcdir)/ml/dlib"
  1129. OPTIONAL_ML_LIBS=""
  1130. fi
  1131. # -----------------------------------------------------------------------------
  1132. # debugfs.plugin
  1133. if test "${build_target}" = "linux"; then
  1134. AC_DEFINE([ENABLE_DEBUGFS_PLUGIN], [1], [debugfs.plugin])
  1135. enable_plugin_debugfs="yes"
  1136. else
  1137. enable_plugin_debugfs="no"
  1138. fi
  1139. AC_MSG_CHECKING([if debugfs.plugin should be enabled])
  1140. AC_MSG_RESULT([${enable_plugin_debugfs}])
  1141. AM_CONDITIONAL([ENABLE_PLUGIN_DEBUGFS], [test "${enable_plugin_debugfs}" = "yes"])
  1142. # -----------------------------------------------------------------------------
  1143. # ebpf.plugin
  1144. if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then
  1145. PKG_CHECK_MODULES(
  1146. [LIBELF],
  1147. [libelf],
  1148. [have_libelf=yes],
  1149. [have_libelf=no]
  1150. )
  1151. AC_CHECK_TYPE(
  1152. [struct bpf_prog_info],
  1153. [have_bpf=yes],
  1154. [have_bpf=no],
  1155. [#include <linux/bpf.h>]
  1156. )
  1157. AC_CHECK_FILE(
  1158. externaldeps/libbpf/libbpf.a,
  1159. [have_libbpf=yes],
  1160. [have_libbpf=no]
  1161. )
  1162. if test "${have_libelf}" = "yes" -a \
  1163. "${have_bpf}" = "yes" -a \
  1164. "${have_libbpf}" = "yes"; then
  1165. OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I \$(abs_top_srcdir)/externaldeps/libbpf/include -I \$(abs_top_srcdir)/externaldeps/libbpf/include/uapi"
  1166. OPTIONAL_BPF_LIBS="\$(abs_top_srcdir)/externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
  1167. AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
  1168. enable_ebpf="yes"
  1169. else
  1170. enable_ebpf="no"
  1171. fi
  1172. else
  1173. enable_ebpf="no"
  1174. fi
  1175. AC_MSG_CHECKING([if ebpf.plugin should be enabled])
  1176. AC_MSG_RESULT([${enable_ebpf}])
  1177. AM_CONDITIONAL([ENABLE_PLUGIN_EBPF], [test "${enable_ebpf}" = "yes"])
  1178. # -----------------------------------------------------------------------------
  1179. # slabinfo.plugin
  1180. AC_MSG_CHECKING([if slabinfo.plugin should be enabled])
  1181. if test "${build_target}" == "linux"; then
  1182. AC_DEFINE([ENABLE_SLABINFO], [1], [slabinfo plugin])
  1183. enable_plugin_slabinfo="yes"
  1184. else
  1185. enable_plugin_slabinfo="no"
  1186. fi
  1187. AC_MSG_RESULT([${enable_plugin_slabinfo}])
  1188. AM_CONDITIONAL([ENABLE_PLUGIN_SLABINFO], [test "${enable_plugin_slabinfo}" = "yes"])
  1189. # -----------------------------------------------------------------------------
  1190. # AWS Kinesis exporting connector - libaws-cpp-sdk-kinesis, libaws-cpp-sdk-core, libssl, libcrypto, libcurl
  1191. PKG_CHECK_MODULES(
  1192. [LIBCRYPTO],
  1193. [libcrypto],
  1194. [AC_CHECK_LIB(
  1195. [crypto],
  1196. [CRYPTO_new_ex_data],
  1197. [have_libcrypto=yes],
  1198. [have_libcrypto=no]
  1199. )],
  1200. [have_libcrypto=no]
  1201. )
  1202. PKG_CHECK_MODULES(
  1203. [LIBSSL],
  1204. [libssl],
  1205. [AC_CHECK_LIB(
  1206. [ssl],
  1207. [SSL_connect],
  1208. [have_libssl=yes],
  1209. [have_libssl=no]
  1210. )],
  1211. [have_libssl=no]
  1212. )
  1213. PKG_CHECK_MODULES(
  1214. [LIBCURL],
  1215. [libcurl],
  1216. [AC_CHECK_LIB(
  1217. [curl],
  1218. [curl_easy_init],
  1219. [have_libcurl=yes],
  1220. [have_libcurl=no]
  1221. )],
  1222. [have_libcurl=no]
  1223. )
  1224. PKG_CHECK_MODULES(
  1225. [AWS_CPP_SDK_CORE],
  1226. [aws-cpp-sdk-core],
  1227. [have_libaws_cpp_sdk_core=yes],
  1228. [have_libaws_cpp_sdk_core=no]
  1229. )
  1230. PKG_CHECK_MODULES(
  1231. [AWS_CPP_SDK_KINESIS],
  1232. [aws-cpp-sdk-kinesis],
  1233. [have_libaws_cpp_sdk_kinesis=yes],
  1234. [have_libaws_cpp_sdk_kinesis=no]
  1235. )
  1236. test "${enable_exporting_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_kinesis}" != "yes" && \
  1237. AC_MSG_ERROR([libaws-cpp-sdk-kinesis required but not found. try installing AWS C++ SDK])
  1238. test "${enable_exporting_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" != "yes" && \
  1239. AC_MSG_ERROR([libaws-cpp-sdk-core required but not found. try installing AWS C++ SDK])
  1240. test "${enable_exporting_kinesis}" = "yes" -a "${have_libcurl}" != "yes" && \
  1241. AC_MSG_ERROR([libcurl required but not found])
  1242. test "${enable_exporting_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \
  1243. AC_MSG_ERROR([libssl required but not found])
  1244. test "${enable_exporting_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \
  1245. AC_MSG_ERROR([libcrypto required but not found])
  1246. AC_MSG_CHECKING([if kinesis exporting connector should be enabled])
  1247. if test "${enable_exporting_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}" = "yes" \
  1248. -a "${have_libaws_cpp_sdk_core}" = "yes" \
  1249. -a "${have_libcurl}" = "yes" \
  1250. -a "${have_libssl}" = "yes" \
  1251. -a "${have_libcrypto}" = "yes"; then
  1252. enable_exporting_kinesis="yes"
  1253. AC_DEFINE([HAVE_KINESIS], [1], [libaws-cpp-sdk-kinesis usability])
  1254. OPTIONAL_KINESIS_CFLAGS="${LIBCRYPTO_CFLAGS} ${LIBSSL_CFLAGS} ${LIBCURL_CFLAGS}"
  1255. OPTIONAL_KINESIS_CXXFLAGS="${AWS_CPP_SDK_KINESIS_CFLAGS} ${AWS_CPP_SDK_CORE_CFLAGS}"
  1256. OPTIONAL_KINESIS_LIBS="${AWS_CPP_SDK_KINESIS_LIBS} ${AWS_CPP_SDK_CORE_LIBS} \
  1257. ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}"
  1258. else
  1259. enable_exporting_kinesis="no"
  1260. fi
  1261. AC_MSG_RESULT([${enable_exporting_kinesis}])
  1262. AM_CONDITIONAL([ENABLE_EXPORTING_KINESIS], [test "${enable_exporting_kinesis}" = "yes"])
  1263. # -----------------------------------------------------------------------------
  1264. # Pub/Sub exporting connector - googleapis
  1265. PKG_CHECK_MODULES(
  1266. [GRPC],
  1267. [grpc],
  1268. [have_libgrpc=yes],
  1269. [have_libgrpc=no]
  1270. )
  1271. if test "${enable_exporting_pubsub}" != "no"; then
  1272. PKG_CHECK_MODULES(
  1273. [PUBSUB],
  1274. [google_cloud_cpp_pubsub_protos],
  1275. [have_pubsub_protos=yes],
  1276. [have_pubsub_protos=no]
  1277. )
  1278. fi
  1279. AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
  1280. AS_IF(
  1281. [test x"${CXX_BINARY}" == x"no"],
  1282. [have_CXX_compiler=no],
  1283. [have_CXX_compiler=yes]
  1284. )
  1285. test "${enable_pubsub}" = "yes" -a "${have_grpc}" != "yes" && \
  1286. AC_MSG_ERROR([libgrpc required but not found. try installing grpc])
  1287. test "${enable_pubsub}" = "yes" -a "${have_pubsub_protos}" != "yes" && \
  1288. AC_MSG_ERROR([libgoogleapis_cpp_pubsub_protos required but not found. try installing googleapis])
  1289. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \
  1290. AC_MSG_ERROR([C++ compiler required but not found. try installing g++])
  1291. AC_MSG_CHECKING([if pubsub exporting connector should be enabled])
  1292. if test "${enable_exporting_pubsub}" != "no" -a "${have_pubsub_protos}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
  1293. enable_exporting_pubsub="yes"
  1294. AC_DEFINE([ENABLE_EXPORTING_PUBSUB], [1], [Pub/Sub API usability])
  1295. OPTIONAL_PUBSUB_CFLAGS="${GRPC_CFLAGS} ${PUBSUB_CFLAGS}"
  1296. OPTIONAL_PUBSUB_LIBS="${GRPC_LIBS} ${PUBSUB_LIBS}"
  1297. else
  1298. enable_pubsub="no"
  1299. fi
  1300. AC_MSG_RESULT([${enable_exporting_pubsub}])
  1301. AM_CONDITIONAL([ENABLE_EXPORTING_PUBSUB], [test "${enable_exporting_pubsub}" = "yes"])
  1302. # -----------------------------------------------------------------------------
  1303. # Prometheus remote write exporting connector - libprotobuf, libsnappy, protoc
  1304. AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy])
  1305. AC_LANG_SAVE
  1306. AC_LANG_CPLUSPLUS
  1307. save_LIBS="${LIBS}"
  1308. LIBS="-lsnappy"
  1309. save_CXXFLAGS="${CXXFLAGS}"
  1310. CXXFLAGS="${CXXFLAGS} ${CPP_STD_FLAG}"
  1311. AC_TRY_LINK(
  1312. [
  1313. #include <stdlib.h>
  1314. #include <snappy.h>
  1315. ],
  1316. [
  1317. const char *input = "test";
  1318. size_t compressed_length;
  1319. char *buffer = (char *)malloc(5 * sizeof(char));
  1320. snappy::RawCompress(input, 4, buffer, &compressed_length);
  1321. free(buffer);
  1322. ],
  1323. [
  1324. have_libsnappy=yes
  1325. SNAPPY_CFLAGS=""
  1326. SNAPPY_LIBS="-lsnappy"
  1327. ],
  1328. [have_libsnappy=no]
  1329. )
  1330. LIBS="${save_LIBS}"
  1331. CXXFLAGS="${save_CXXFLAGS}"
  1332. AC_LANG_RESTORE
  1333. AC_MSG_RESULT([${have_libsnappy}])
  1334. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_libprotobuf}" != "yes" && \
  1335. AC_MSG_ERROR([libprotobuf required but not found. try installing protobuf])
  1336. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_libsnappy}" != "yes" && \
  1337. AC_MSG_ERROR([libsnappy required but not found. try installing snappy])
  1338. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_protoc}" != "yes" && \
  1339. AC_MSG_ERROR([protoc compiler required but not found. try installing protobuf])
  1340. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \
  1341. AC_MSG_ERROR([C++ compiler required but not found. try installing g++])
  1342. AC_MSG_CHECKING([if prometheus remote write exporting connector should be enabled])
  1343. if test "${enable_exporting_prometheus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \
  1344. -a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
  1345. enable_exporting_prometheus_remote_write="yes"
  1346. AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
  1347. OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${SNAPPY_CFLAGS} -I \$(abs_top_srcdir)/exporting/prometheus/remote_write"
  1348. OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${SNAPPY_LIBS}"
  1349. OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}"
  1350. OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}"
  1351. else
  1352. enable_exporting_prometheus_remote_write="no"
  1353. fi
  1354. AC_MSG_RESULT([${enable_exporting_prometheus_remote_write}])
  1355. AM_CONDITIONAL([ENABLE_EXPORTING_PROMETHEUS_REMOTE_WRITE], [test "${enable_exporting_prometheus_remote_write}" = "yes"])
  1356. # -----------------------------------------------------------------------------
  1357. # MongoDB exporting connector - libmongoc
  1358. PKG_CHECK_MODULES(
  1359. [LIBMONGOC],
  1360. [libmongoc-1.0 >= 1.7],
  1361. [have_libmongoc=yes],
  1362. [have_libmongoc=no]
  1363. )
  1364. test "${enable_exporting_mongodb}" = "yes" -a "${have_libmongoc}" != "yes" && \
  1365. AC_MSG_ERROR([libmongoc required but not found. Try installing `mongoc`.])
  1366. AC_MSG_CHECKING([if mongodb exporting connector should be enabled])
  1367. if test "${enable_exporting_mongodb}" != "no" -a "${have_libmongoc}" = "yes"; then
  1368. enable_exporting_mongodb="yes"
  1369. AC_DEFINE([HAVE_MONGOC], [1], [libmongoc usability])
  1370. OPTIONAL_MONGOC_CFLAGS="${LIBMONGOC_CFLAGS}"
  1371. OPTIONAL_MONGOC_LIBS="${LIBMONGOC_LIBS}"
  1372. else
  1373. enable_exporting_mongodb="no"
  1374. fi
  1375. AC_MSG_RESULT([${enable_exporting_mongodb}])
  1376. AM_CONDITIONAL([ENABLE_EXPORTING_MONGODB], [test "${enable_exporting_mongodb}" = "yes"])
  1377. # -----------------------------------------------------------------------------
  1378. # check for setns() - cgroup-network
  1379. AC_CHECK_FUNC([setns])
  1380. AC_MSG_CHECKING([if cgroup-network can be enabled])
  1381. if test "$ac_cv_func_setns" = "yes" ; then
  1382. have_setns="yes"
  1383. AC_DEFINE([HAVE_SETNS], [1], [Define 1 if you have setns() function])
  1384. else
  1385. have_setns="no"
  1386. fi
  1387. AC_MSG_RESULT([${have_setns}])
  1388. AM_CONDITIONAL([ENABLE_PLUGIN_CGROUP_NETWORK], [test "${have_setns}" = "yes"])
  1389. # -----------------------------------------------------------------------------
  1390. # Link-Time-Optimization
  1391. if test "${enable_lto}" != "no"; then
  1392. opt="-flto"
  1393. AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no])
  1394. fi
  1395. if test "${have_lto}" = "yes"; then
  1396. oCFLAGS="${CFLAGS}"
  1397. CFLAGS="${CFLAGS} -flto"
  1398. ac_cv_c_lto_cross_compile="${enable_lto}"
  1399. test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no"
  1400. AC_C_LTO
  1401. CFLAGS="${oCFLAGS}"
  1402. test "${ac_cv_c_lto}" != "yes" && have_lto="no"
  1403. fi
  1404. test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
  1405. AC_MSG_ERROR([LTO is required but is not available.])
  1406. AC_MSG_CHECKING([if LTO should be enabled])
  1407. if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then
  1408. enable_lto="yes"
  1409. OPTIONAL_LTO_CFLAGS="-flto"
  1410. else
  1411. enable_lto="no"
  1412. fi
  1413. AC_MSG_RESULT([${enable_lto}])
  1414. # -----------------------------------------------------------------------------
  1415. # Try to unconditionally link with -latomic. If the compiler can satisfy
  1416. # all the atomic ops with builtins then, the library will be left unused.
  1417. # Otherwise, some ops will be covered by the compiler's intrinsics and some
  1418. # will be picked up by the linker from -latomic. In the later case, if
  1419. # -latomic is not available there will be a build failure, which would
  1420. # have happened either way before this change.
  1421. AC_LANG_PUSH([C++])
  1422. AC_MSG_CHECKING(whether we can use -latomic)
  1423. OLD_LIBS="${LIBS}"
  1424. LIBS="-latomic"
  1425. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  1426. #include <atomic>
  1427. #include <cstdint>
  1428. std::atomic<std::int64_t> v;
  1429. int main() {
  1430. return v;
  1431. }
  1432. ]])], CAN_USE_LIBATOMIC=yes, CAN_USE_LIBATOMIC=no)
  1433. LIBS="${OLD_LIBS}"
  1434. AC_MSG_RESULT($CAN_USE_LIBATOMIC)
  1435. if test "x$CAN_USE_LIBATOMIC" = xyes; then
  1436. OPTIONAL_ATOMIC_LIBS="-latomic"
  1437. fi
  1438. AC_SUBST([OPTIONAL_ATOMIC_LIBS])
  1439. AC_LANG_POP([C++])
  1440. # -----------------------------------------------------------------------------
  1441. AC_MSG_CHECKING(whether we can use dlsym)
  1442. OLD_LIBS="${LIBS}"
  1443. LIBS="-ldl"
  1444. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  1445. #include <dlfcn.h>
  1446. static void *(*libc_malloc)(size_t);
  1447. int main() {
  1448. libc_malloc = dlsym(RTLD_NEXT, "malloc");
  1449. }
  1450. ]])], CAN_USE_DLSYM=yes, CAN_USE_DLSYM=no)
  1451. LIBS="${OLD_LIBS}"
  1452. AC_MSG_RESULT($CAN_USE_DLSYM)
  1453. if test "x$CAN_USE_DLSYM" = xyes; then
  1454. AC_DEFINE([HAVE_DLSYM], [1], [dlsym usability])
  1455. OPTIONAL_DL_LIBS="-ldl"
  1456. fi
  1457. AC_SUBST([OPTIONAL_DL_LIBS])
  1458. # -----------------------------------------------------------------------------
  1459. AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged])
  1460. varlibdir="${localstatedir}/lib/netdata"
  1461. registrydir="${localstatedir}/lib/netdata/registry"
  1462. cachedir="${localstatedir}/cache/netdata"
  1463. chartsdir="${libexecdir}/netdata/charts.d"
  1464. pythondir="${libexecdir}/netdata/python.d"
  1465. configdir="${sysconfdir}/netdata"
  1466. libconfigdir="${libdir}/netdata/conf.d"
  1467. logdir="${localstatedir}/log/netdata"
  1468. pluginsdir="${libexecdir}/netdata/plugins.d"
  1469. netdata_user="${with_user}"
  1470. libsysdir="${libdir}/netdata/system"
  1471. AC_SUBST([varlibdir])
  1472. AC_SUBST([registrydir])
  1473. AC_SUBST([cachedir])
  1474. AC_SUBST([chartsdir])
  1475. AC_SUBST([pythondir])
  1476. AC_SUBST([configdir])
  1477. AC_SUBST([libconfigdir])
  1478. AC_SUBST([logdir])
  1479. AC_SUBST([pluginsdir])
  1480. AC_SUBST([webdir])
  1481. AC_SUBST([netdata_user])
  1482. AC_SUBST([libsysdir])
  1483. CFLAGS="${originalCFLAGS} ${OPTIONAL_LTO_CFLAGS} ${OPTIONAL_PROTOBUF_CFLAGS} ${OPTIONAL_MATH_CFLAGS} ${OPTIONAL_NFACCT_CFLAGS} \
  1484. ${ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} \
  1485. ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CFLAGS} ${OPTIONAL_XENSTAT_FLAGS} \
  1486. ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PUBSUB_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} \
  1487. ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_YAML_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${JUDY_CFLAGS} \
  1488. ${OPTIONAL_ACLK_CFLAGS} ${OPTIONAL_ML_CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS} ${HTTPD_CFLAGS}"
  1489. CXXFLAGS="${CFLAGS} ${OPTIONAL_KINESIS_CXXFLAGS} ${CPP_STD_FLAG}"
  1490. CPPFLAGS="\
  1491. -DVARLIB_DIR=\"\\\"${varlibdir}\\\"\" \
  1492. -DCACHE_DIR=\"\\\"${cachedir}\\\"\" \
  1493. -DCONFIG_DIR=\"\\\"${configdir}\\\"\" \
  1494. -DLIBCONFIG_DIR=\"\\\"${libconfigdir}\\\"\" \
  1495. -DLOG_DIR=\"\\\"${logdir}\\\"\" \
  1496. -DPLUGINS_DIR=\"\\\"${pluginsdir}\\\"\" \
  1497. -DRUN_DIR=\"\\\"${localstatedir}/run/netdata\\\"\" \
  1498. -DWEB_DIR=\"\\\"${webdir}\\\"\" \
  1499. "
  1500. AC_SUBST([OPTIONAL_MATH_CFLAGS])
  1501. AC_SUBST([OPTIONAL_MATH_LIBS])
  1502. AC_SUBST([OPTIONAL_DATACHANNEL_LIBS])
  1503. AC_SUBST([OPTIONAL_UV_LIBS])
  1504. AC_SUBST([OPTIONAL_LZ4_LIBS])
  1505. AC_SUBST([OPTIONAL_SSL_LIBS])
  1506. AC_SUBST([OPTIONAL_JSONC_LIBS])
  1507. AC_SUBST([OPTIONAL_YAML_LIBS])
  1508. AC_SUBST([OPTIONAL_NFACCT_CFLAGS])
  1509. AC_SUBST([OPTIONAL_NFACCT_LIBS])
  1510. AC_SUBST([ZLIB_CFLAGS])
  1511. AC_SUBST([ZLIB_LIBS])
  1512. AC_SUBST([OPTIONAL_UUID_CFLAGS])
  1513. AC_SUBST([OPTIONAL_UUID_LIBS])
  1514. AC_SUBST([OPTIONAL_BPF_CFLAGS])
  1515. AC_SUBST([OPTIONAL_BPF_LIBS])
  1516. AC_SUBST([OPTIONAL_MQTT_LIBS])
  1517. AC_SUBST([OPTIONAL_LIBCAP_CFLAGS])
  1518. AC_SUBST([OPTIONAL_LIBCAP_LIBS])
  1519. AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS])
  1520. AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS])
  1521. AC_SUBST([OPTIONAL_CUPS_CFLAGS])
  1522. AC_SUBST([OPTIONAL_CUPS_LIBS])
  1523. AC_SUBST([OPTIONAL_XENSTAT_CFLAGS])
  1524. AC_SUBST([OPTIONAL_XENSTAT_LIBS])
  1525. AC_SUBST([OPTIONAL_KINESIS_CFLAGS])
  1526. AC_SUBST([OPTIONAL_KINESIS_LIBS])
  1527. AC_SUBST([OPTIONAL_PUBSUB_CFLAGS])
  1528. AC_SUBST([OPTIONAL_PUBSUB_LIBS])
  1529. AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS])
  1530. AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS])
  1531. AC_SUBST([OPTIONAL_MONGOC_CFLAGS])
  1532. AC_SUBST([OPTIONAL_MONGOC_LIBS])
  1533. AC_SUBST([OPTIONAL_LWS_LIBS])
  1534. AC_SUBST([OPTIONAL_ACLK_CFLAGS])
  1535. AC_SUBST([OPTIONAL_PROTOBUF_CFLAGS])
  1536. AC_SUBST([OPTIONAL_PROTOBUF_LIBS])
  1537. AC_SUBST([OPTIONAL_GTEST_CFLAGS])
  1538. AC_SUBST([OPTIONAL_GTEST_LIBS])
  1539. AC_SUBST([OPTIONAL_ML_CFLAGS])
  1540. AC_SUBST([OPTIONAL_ML_LIBS])
  1541. # -----------------------------------------------------------------------------
  1542. # Check if cmocka is available - needed for unit testing
  1543. AC_ARG_ENABLE(
  1544. [unit-tests],
  1545. [AS_HELP_STRING([--disable-unit-tests],
  1546. [Disables building and running the unit tests suite])],
  1547. [],
  1548. [enable_unit_tests="yes"]
  1549. )
  1550. PKG_CHECK_MODULES(
  1551. [CMOCKA],
  1552. [cmocka],
  1553. [have_cmocka="yes"],
  1554. [AC_MSG_NOTICE([CMocka not found on the system. Unit tests disabled])]
  1555. )
  1556. AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ])
  1557. AC_SUBST([ENABLE_UNITTESTS])
  1558. TEST_CFLAGS="${CFLAGS} ${CMOCKA_CFLAGS}"
  1559. TEST_LIBS="${CMOCKA_LIBS}"
  1560. AC_SUBST([TEST_CFLAGS])
  1561. AC_SUBST([TEST_LIBS])
  1562. # -----------------------------------------------------------------------------
  1563. # save configure options for build info
  1564. AC_DEFINE_UNQUOTED(
  1565. [CONFIGURE_COMMAND],
  1566. ["$ac_configure_args"],
  1567. [options passed to configure script]
  1568. )
  1569. AC_CONFIG_FILES([
  1570. Makefile
  1571. netdata.spec
  1572. collectors/Makefile
  1573. collectors/apps.plugin/Makefile
  1574. collectors/cgroups.plugin/Makefile
  1575. collectors/charts.d.plugin/Makefile
  1576. collectors/debugfs.plugin/Makefile
  1577. collectors/diskspace.plugin/Makefile
  1578. collectors/timex.plugin/Makefile
  1579. collectors/ioping.plugin/Makefile
  1580. collectors/freebsd.plugin/Makefile
  1581. collectors/freeipmi.plugin/Makefile
  1582. collectors/cups.plugin/Makefile
  1583. collectors/idlejitter.plugin/Makefile
  1584. collectors/macos.plugin/Makefile
  1585. collectors/nfacct.plugin/Makefile
  1586. collectors/plugins.d/Makefile
  1587. collectors/proc.plugin/Makefile
  1588. collectors/python.d.plugin/Makefile
  1589. collectors/slabinfo.plugin/Makefile
  1590. collectors/statsd.plugin/Makefile
  1591. collectors/ebpf.plugin/Makefile
  1592. collectors/tc.plugin/Makefile
  1593. collectors/xenstat.plugin/Makefile
  1594. collectors/perf.plugin/Makefile
  1595. daemon/Makefile
  1596. database/Makefile
  1597. database/contexts/Makefile
  1598. database/engine/Makefile
  1599. database/ram/Makefile
  1600. database/sqlite/Makefile
  1601. diagrams/Makefile
  1602. exporting/Makefile
  1603. exporting/graphite/Makefile
  1604. exporting/json/Makefile
  1605. exporting/opentsdb/Makefile
  1606. exporting/prometheus/Makefile
  1607. exporting/prometheus/remote_write/Makefile
  1608. exporting/aws_kinesis/Makefile
  1609. exporting/pubsub/Makefile
  1610. exporting/mongodb/Makefile
  1611. exporting/tests/Makefile
  1612. health/Makefile
  1613. health/notifications/Makefile
  1614. libnetdata/Makefile
  1615. libnetdata/tests/Makefile
  1616. libnetdata/adaptive_resortable_list/Makefile
  1617. libnetdata/aral/Makefile
  1618. libnetdata/avl/Makefile
  1619. libnetdata/buffer/Makefile
  1620. libnetdata/clocks/Makefile
  1621. libnetdata/completion/Makefile
  1622. libnetdata/config/Makefile
  1623. libnetdata/dictionary/Makefile
  1624. libnetdata/ebpf/Makefile
  1625. libnetdata/eval/Makefile
  1626. libnetdata/july/Makefile
  1627. libnetdata/locks/Makefile
  1628. libnetdata/log/Makefile
  1629. libnetdata/onewayalloc/Makefile
  1630. libnetdata/parser/Makefile
  1631. libnetdata/popen/Makefile
  1632. libnetdata/procfile/Makefile
  1633. libnetdata/simple_pattern/Makefile
  1634. libnetdata/socket/Makefile
  1635. libnetdata/statistical/Makefile
  1636. libnetdata/string/Makefile
  1637. libnetdata/storage_number/Makefile
  1638. libnetdata/storage_number/tests/Makefile
  1639. libnetdata/threads/Makefile
  1640. libnetdata/url/Makefile
  1641. libnetdata/json/Makefile
  1642. libnetdata/health/Makefile
  1643. libnetdata/worker_utilization/Makefile
  1644. registry/Makefile
  1645. streaming/Makefile
  1646. system/Makefile
  1647. tests/Makefile
  1648. web/Makefile
  1649. web/api/Makefile
  1650. web/api/badges/Makefile
  1651. web/api/exporters/Makefile
  1652. web/api/exporters/shell/Makefile
  1653. web/api/exporters/prometheus/Makefile
  1654. web/api/formatters/Makefile
  1655. web/api/formatters/csv/Makefile
  1656. web/api/formatters/json/Makefile
  1657. web/api/formatters/ssv/Makefile
  1658. web/api/formatters/value/Makefile
  1659. web/api/queries/Makefile
  1660. web/api/queries/average/Makefile
  1661. web/api/queries/countif/Makefile
  1662. web/api/queries/des/Makefile
  1663. web/api/queries/incremental_sum/Makefile
  1664. web/api/queries/max/Makefile
  1665. web/api/queries/median/Makefile
  1666. web/api/queries/min/Makefile
  1667. web/api/queries/percentile/Makefile
  1668. web/api/queries/ses/Makefile
  1669. web/api/queries/stddev/Makefile
  1670. web/api/queries/sum/Makefile
  1671. web/api/queries/trimmed_mean/Makefile
  1672. web/api/health/Makefile
  1673. web/gui/Makefile
  1674. web/gui/dashboard/Makefile
  1675. web/rtc/Makefile
  1676. web/server/Makefile
  1677. web/server/static/Makefile
  1678. claim/Makefile
  1679. spawn/Makefile
  1680. ])
  1681. AC_OUTPUT
  1682. test "${with_math}" != "yes" && AC_MSG_WARN([You are building without math. math allows accurate calculations. It should be enabled.]) || :