configure.ac 63 KB

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