configure.ac 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029
  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. [openssl],
  149. [AS_HELP_STRING([--enable-openssl], [Enable OpenSSL support @<:@default autodetect@:>@])],
  150. ,
  151. [enable_openssl="detect"]
  152. )
  153. AC_ARG_ENABLE(
  154. [lz4],
  155. [AS_HELP_STRING([--enable-lz4], [Enable LZ4 support @<:@default autodetect@:>@])],
  156. ,
  157. [enable_lz4="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. [h2o],
  203. [AS_HELP_STRING([--disable-h2o], [Disable H2O webserver @<:@default autodetect@:>@])],
  204. ,
  205. [enable_h2o="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. if test "${build_target}" = "freebsd"
  347. then
  348. AC_DEFINE([COMPILED_FOR_FREEBSD], [1], [Compiled for FreeBSD])
  349. fi
  350. AM_CONDITIONAL([MACOS], [test "${build_target}" = "macos"])
  351. if test "${build_target}" = "macos"
  352. then
  353. AC_DEFINE([COMPILED_FOR_MACOS], [1], [Compiled for MacOS])
  354. fi
  355. AM_CONDITIONAL([LINUX], [test "${build_target}" = "linux"])
  356. if test "${build_target}" = "linux"
  357. then
  358. AC_DEFINE([COMPILED_FOR_LINUX], [1], [Compiled for Linux])
  359. fi
  360. AM_CONDITIONAL([ENABLE_PLUGIN_LOCAL_LISTENERS], [test "${build_target}" = "linux"])
  361. AC_MSG_RESULT([Host OS: ${build_target}])
  362. # -----------------------------------------------------------------------------
  363. # hardening
  364. HARDENING_CFLAGS=""
  365. if ! echo "${originalCFLAGS}" | grep -q '\-fstack-protector'; then
  366. AX_CHECK_COMPILE_FLAG(
  367. [-fstack-protector-strong],
  368. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -fstack-protector-strong"],
  369. [AX_CHECK_COMPILE_FLAG(
  370. [-fstack-protector],
  371. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -fstack-protector"],
  372. ,
  373. [-Werror],
  374. )],
  375. [-Werror],
  376. )
  377. fi
  378. if ! echo "${originalCFLAGS}" | grep -q '\-fno-stack-clash-protection'; then
  379. AX_CHECK_COMPILE_FLAG(
  380. [-fstack-clash-protection],
  381. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -fstack-clash-protection"],
  382. ,
  383. [-Werror],
  384. )
  385. fi
  386. if ! echo "${originalCFLAGS}" | grep -q '\-fcf-protection'; then
  387. AX_CHECK_COMPILE_FLAG(
  388. [-fcf-protection=full],
  389. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -fcf-protection=full"],
  390. ,
  391. [-Werror],
  392. )
  393. fi
  394. if ! echo "${originalCFLAGS}" | grep -q '\-mbranch-protection'; then
  395. AX_CHECK_COMPILE_FLAG(
  396. [-mbranch-protection=standard],
  397. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -mbranch-protection=standard"],
  398. ,
  399. [-Werror],
  400. )
  401. fi
  402. if ! echo "${originalCFLAGS}" | grep -q '\-D_FORTIFY_SOURCE'; then
  403. # This complex set of checks is needed because there is no clean
  404. # way to verify _FORTIFY_SOURCE support without having to check for
  405. # the required compiler builtins.
  406. AC_CHECK_DECLS(
  407. [__builtin_constant_p, __builtin_object_size, __builtin___memcpy_chk, __builtin___memmove_chk, __builtin___mempcpy_chk,
  408. __builtin___memset_chk, __builtin___snprintf_chk, __builtin___sprintf_chk, __builtin___stpcpy_chk, __builtin___strcat_chk,
  409. __builtin___strcpy_chk, __builtin___strncat_chk, __builtin___strncpy_chk, __builtin___vsnprintf_chk, __builtin___vsprintf_chk],
  410. [HAVE_FORTIFY_SOURCE=2]
  411. )
  412. if test "x${HAVE_FORTIFY_SOURCE}" = "x2" && echo "${originalCFLAGS}" | grep -qv '\-O0'; then
  413. AC_CHECK_DECL(
  414. __builtin_dynamic_object_size,
  415. [AX_CHECK_COMPILE_FLAG(
  416. [-D_FORTIFY_SOURCE=3],
  417. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -D_FORTIFY_SOURCE=3"],
  418. ,
  419. [-Werror],
  420. )],
  421. [AX_CHECK_COMPILE_FLAG(
  422. [-D_FORTIFY_SOURCE=2],
  423. [HARDENING_CFLAGS="${HARDENING_CFLAGS} -D_FORTIFY_SOURCE=2"],
  424. ,
  425. [-Werror],
  426. )],
  427. )
  428. fi
  429. fi
  430. # -----------------------------------------------------------------------------
  431. # backtrace
  432. AC_SEARCH_LIBS([backtrace], [execinfo], [AC_DEFINE([HAVE_BACKTRACE], [1], [backtrace availability])])
  433. # -----------------------------------------------------------------------------
  434. # pthreads
  435. ACX_PTHREAD(, [AC_MSG_ERROR([Cannot initialize pthread environment])])
  436. LIBS="${PTHREAD_LIBS} ${LIBS}"
  437. CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
  438. CC="${PTHREAD_CC}"
  439. AC_CHECK_LIB(
  440. [pthread],
  441. [pthread_getname_np],
  442. [AC_DEFINE([HAVE_PTHREAD_GETNAME_NP], [1], [Is set if pthread_getname_np is available])]
  443. )
  444. # -----------------------------------------------------------------------------
  445. # libdatachannel
  446. AC_CHECK_LIB([datachannel], [rtcCreatePeerConnection],
  447. [LIBDATACHANNEL_FOUND=yes],
  448. [LIBDATACHANNEL_FOUND=no])
  449. if test "x$LIBDATACHANNEL_FOUND" = "xyes"; then
  450. AC_DEFINE([HAVE_LIBDATACHANNEL], [1], [libdatachannel usability])
  451. OPTIONAL_DATACHANNEL_LIBS="-ldatachannel"
  452. fi
  453. # -----------------------------------------------------------------------------
  454. # libm
  455. AC_ARG_VAR([MATH_CFLAGS], [C compiler flags for math])
  456. AC_ARG_VAR([MATH_LIBS], [linker flags for math])
  457. if test -z "${MATH_LIBS}"; then
  458. AC_CHECK_LIB(
  459. [m],
  460. [sin],
  461. [MATH_LIBS="-lm"]
  462. )
  463. fi
  464. test "${with_math}" = "yes" -a -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found])
  465. AC_MSG_CHECKING([if libm should be used])
  466. if test "${with_math}" != "no" -a ! -z "${MATH_LIBS}"; then
  467. with_math="yes"
  468. AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability])
  469. OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}"
  470. OPTIONAL_MATH_LIBS="${MATH_LIBS}"
  471. else
  472. with_math="no"
  473. fi
  474. AC_MSG_RESULT([${with_math}])
  475. AC_CHECK_FUNCS([isfinite])
  476. AC_CHECK_FUNCS([finite])
  477. # -----------------------------------------------------------------------------
  478. # libuv multi-platform support library with a focus on asynchronous I/O
  479. # TODO: check version, uv_fs_scandir_next only available in version >= 1.0
  480. AC_CHECK_LIB(
  481. [uv],
  482. [uv_fs_scandir_next],
  483. [UV_LIBS="-luv"]
  484. )
  485. test -z "${UV_LIBS}" && \
  486. AC_MSG_ERROR([libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.])
  487. OPTIONAL_UV_CFLAGS="${UV_CFLAGS}"
  488. OPTIONAL_UV_LIBS="${UV_LIBS}"
  489. # -----------------------------------------------------------------------------
  490. # lz4
  491. AC_CHECK_LIB(
  492. [lz4],
  493. [LZ4_initStream],
  494. [LZ4_LIBS_FAST="-llz4"]
  495. )
  496. AC_CHECK_LIB(
  497. [lz4],
  498. [LZ4_compress_default],
  499. [LZ4_LIBS="-llz4"]
  500. )
  501. # -----------------------------------------------------------------------------
  502. # zlib
  503. PKG_CHECK_MODULES(
  504. [ZLIB],
  505. [zlib],
  506. [have_zlib=yes],
  507. [have_zlib=no]
  508. )
  509. test "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
  510. # -----------------------------------------------------------------------------
  511. # libuuid
  512. PKG_CHECK_MODULES(
  513. [UUID],
  514. [uuid],
  515. [have_uuid=yes],
  516. [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])]
  517. )
  518. OPTIONAL_UUID_CFLAGS="${UUID_CFLAGS}"
  519. OPTIONAL_UUID_LIBS="${UUID_LIBS}"
  520. # -----------------------------------------------------------------------------
  521. # OpenSSL Cryptography and SSL/TLS Toolkit
  522. AC_CHECK_LIB(
  523. [crypto],
  524. [SHA256_Init],
  525. [SSL_LIBS="-lcrypto -lssl"]
  526. )
  527. AC_CHECK_LIB(
  528. [crypto],
  529. [X509_VERIFY_PARAM_set1_host],
  530. [ssl_host_validation="yes"],
  531. [ssl_host_validation="no"]
  532. )
  533. test -z "${SSL_LIBS}" || \
  534. AC_DEFINE([HAVE_CRYPTO], [1], [libcrypto availability])
  535. if test "${ssl_host_validation}" = "no"; then
  536. AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [0], [ssl host validation])
  537. AC_MSG_WARN([DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.])
  538. else
  539. AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [1], [ssl host validation])
  540. fi
  541. # -----------------------------------------------------------------------------
  542. # JSON-C library
  543. PKG_CHECK_MODULES([JSON],[json-c],AC_CHECK_LIB(
  544. [json-c],
  545. [json_object_get_type],
  546. [JSONC_LIBS="-ljson-c"]),AC_CHECK_LIB(
  547. [json],
  548. [json_object_get_type],
  549. [JSONC_LIBS="-ljson"])
  550. )
  551. OPTIONAL_JSONC_LIBS="${JSONC_LIBS}"
  552. # -----------------------------------------------------------------------------
  553. # YAML library
  554. AC_CHECK_LIB(
  555. [yaml],
  556. [yaml_parser_initialize],
  557. [YAML_LIBS="-lyaml"]
  558. )
  559. OPTIONAL_YAML_LIBS="${YAML_LIBS}"
  560. # -----------------------------------------------------------------------------
  561. # DB engine and OpenSSL
  562. test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \
  563. AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.])
  564. AC_C_BIGENDIAN([],
  565. [LIBJUDY_CFLAGS="-DJU_LITTLE_ENDIAN"],
  566. [AC_MSG_ERROR([Could not find out system endiannnes])])
  567. AC_CHECK_SIZEOF(void *)
  568. if test "$ac_cv_sizeof_void_p" = 8; then
  569. AC_MSG_RESULT(Detected 64-bit Build Environment)
  570. LIBJUDY_CFLAGS="$LIBJUDY_CFLAGS -DJU_64BIT"
  571. else
  572. AC_MSG_RESULT(Detected 32-bit Build Environment)
  573. LIBJUDY_CFLAGS="$LIBJUDY_CFLAGS -UJU_64BIT"
  574. fi
  575. AC_SUBST([LIBJUDY_CFLAGS])
  576. JUDY_CFLAGS="-I \$(abs_top_srcdir)/libnetdata/libjudy/src"
  577. test "${enable_openssl}" = "yes" -a -z "${SSL_LIBS}" && \
  578. AC_MSG_ERROR([OpenSSL required but not found. Try installing 'libssl-dev' or 'openssl-devel'.])
  579. test "${enable_dbengine}" = "yes" -a -z "${SSL_LIBS}" && \
  580. AC_MSG_ERROR([OpenSSL required for DBENGINE but not found. Try installing 'libssl-dev' or 'openssl-devel'.])
  581. AC_MSG_CHECKING([if netdata dbengine should be used])
  582. if test "${enable_dbengine}" != "no" -a "${UV_LIBS}" -a "${LZ4_LIBS}" -a "${SSL_LIBS}"; then
  583. enable_dbengine="yes"
  584. AC_DEFINE([ENABLE_DBENGINE], [1], [netdata dbengine usability])
  585. OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
  586. OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
  587. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  588. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  589. else
  590. enable_dbengine="no"
  591. fi
  592. AC_MSG_RESULT([${enable_dbengine}])
  593. AM_CONDITIONAL([ENABLE_DBENGINE], [test "${enable_dbengine}" = "yes"])
  594. AC_MSG_CHECKING([if openssl should be used])
  595. if test "${enable_openssl}" != "no" -a "${SSL_LIBS}"; then
  596. enable_openssl="yes"
  597. AC_DEFINE([ENABLE_OPENSSL], [1], [openssl usability])
  598. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  599. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  600. else
  601. enable_openssl="no"
  602. fi
  603. AC_MSG_RESULT([${enable_openssl}])
  604. AM_CONDITIONAL([ENABLE_OPENSSL], [test "${enable_openssl}" = "yes"])
  605. AC_MSG_CHECKING([if lz4 should be used])
  606. if test "${enable_lz4}" != "no"; then
  607. if test "${LZ4_LIBS_FAST}"; then
  608. LIBS_BKP="${LIBS}"
  609. LIBS="${LZ4_LIBS_FAST}"
  610. AC_TRY_LINK(
  611. [ #include <lz4.h> ],
  612. [
  613. LZ4_stream_t* stream = LZ4_initStream(NULL, 0);
  614. ],
  615. [ enable_lz4="yes"],
  616. [ enable_lz4="no" ]
  617. )
  618. LIBS="${LIBS_BKP}"
  619. if test "${enable_lz4}" == "yes"; then
  620. OPTIONAL_LZ4_LIBS="${LZ4_LIBS_FAST}"
  621. AC_DEFINE([ENABLE_LZ4], [1], [lz4 usability])
  622. fi
  623. else
  624. if test "${enable_lz4}" == "yes"; then
  625. AC_MSG_ERROR([liblz4 with version >= 1.9.0 required to enable lz4. Try installing the required version of 'liblz4-dev' or 'liblz4-devel'.])
  626. enable_lz4="no"
  627. fi
  628. enable_lz4="no"
  629. fi
  630. else
  631. enable_lz4="no"
  632. fi
  633. AC_MSG_RESULT([${enable_lz4}])
  634. AM_CONDITIONAL([ENABLE_LZ4], [test "${enable_lz4}" = "yes"])
  635. # -----------------------------------------------------------------------------
  636. # JSON-C
  637. if test "${enable_jsonc}" != "no" -a -z "${JSONC_LIBS}"; then
  638. # Try and detect manual static build presence (from netdata-installer.sh)
  639. AC_MSG_CHECKING([if statically built json-c is present])
  640. HAVE_libjson_c_a="no"
  641. if test -f "externaldeps/jsonc/libjson-c.a"; then
  642. LIBS_BKP="${LIBS}"
  643. LIBS="externaldeps/jsonc/libjson-c.a"
  644. AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/jsonc/json-c/json.h"
  645. int main (int argc, char **argv) {
  646. struct json_object *jobj;
  647. char *str = "{ \"msg-type\": \"random\" }";
  648. jobj = json_tokener_parse(str);
  649. json_object_get_type(jobj);
  650. }]])],
  651. [HAVE_libjson_c_a="yes"],
  652. [HAVE_libjson_c_a="no"])
  653. LIBS="${LIBS_BKP}"
  654. fi
  655. if test "${HAVE_libjson_c_a}" = "yes"; then
  656. AC_DEFINE([LINK_STATIC_JSONC], [1], [static json-c should be used])
  657. JSONC_LIBS="static"
  658. OPTIONAL_JSONC_STATIC_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/jsonc"
  659. fi
  660. AC_MSG_RESULT([${HAVE_libjson_c_a}])
  661. fi
  662. AM_CONDITIONAL([LINK_STATIC_JSONC], [test "${JSONC_LIBS}" = "static"])
  663. test "${enable_jsonc}" = "yes" -a -z "${JSONC_LIBS}" && \
  664. AC_MSG_ERROR([JSON-C required but not found. Try installing 'libjson-c-dev' or 'json-c'.])
  665. AC_MSG_CHECKING([if json-c should be used])
  666. if test "${enable_jsonc}" != "no" -a "${JSONC_LIBS}"; then
  667. enable_jsonc="yes"
  668. AC_DEFINE([ENABLE_JSONC], [1], [netdata json-c usability])
  669. else
  670. enable_jsonc="no"
  671. fi
  672. AC_MSG_RESULT([${enable_jsonc}])
  673. AM_CONDITIONAL([ENABLE_JSONC], [test "${enable_jsonc}" = "yes"])
  674. # -----------------------------------------------------------------------------
  675. # YAML
  676. if test -z "${YAML_LIBS}"; then
  677. # Try and detect manual static build presence (from netdata-installer.sh)
  678. AC_MSG_CHECKING([if statically built libyaml is present])
  679. HAVE_libyaml_a="no"
  680. if test -f "externaldeps/libyaml/libyaml.a"; then
  681. LIBS_BKP="${LIBS}"
  682. LIBS="externaldeps/libyaml/libyaml.a"
  683. AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/libyaml/yaml.h"
  684. int main (int argc, char **argv) {
  685. yaml_parser_t parser;
  686. yaml_parser_initialize(&parser);
  687. }]])],
  688. [HAVE_libyaml_a="yes"],
  689. [HAVE_libyaml_a="no"])
  690. LIBS="${LIBS_BKP}"
  691. fi
  692. if test "${HAVE_libyaml_a}" = "yes"; then
  693. AC_DEFINE([LINK_STATIC_YAML], [1], [static yaml should be used])
  694. YAML_LIBS="static"
  695. OPTIONAL_YAML_STATIC_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/libyaml"
  696. fi
  697. AC_MSG_RESULT([${HAVE_libyaml_a}])
  698. fi
  699. AM_CONDITIONAL([LINK_STATIC_YAML], [test "${YAML_LIBS}" = "static"])
  700. test -z "${YAML_LIBS}" && \
  701. AC_MSG_ERROR([LIBYAML required but not found. Try installing 'libyaml-dev'.])
  702. # -----------------------------------------------------------------------------
  703. # compiler options
  704. AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE])
  705. AS_CASE([$host_cpu],
  706. [i?86], [SSE_CANDIDATE="yes"]
  707. )
  708. AC_SUBST([SSE_CANDIDATE])
  709. if test "${SSE_CANDIDATE}" = "yes" -a "${enable_x86_sse}" = "yes"; then
  710. opt="-msse2 -mfpmath=sse"
  711. AX_CHECK_COMPILE_FLAG(${opt}, [CFLAGS="${CFLAGS} ${opt}"], [])
  712. fi
  713. if test "${GCC}" = "yes"; then
  714. AC_DEFINE_UNQUOTED([likely(x)], [__builtin_expect(!!(x), 1)], [gcc branch optimization])
  715. AC_DEFINE_UNQUOTED([unlikely(x)], [__builtin_expect(!!(x), 0)], [gcc branch optimization])
  716. else
  717. AC_DEFINE_UNQUOTED([likely(x)], [(x)], [gcc branch optimization])
  718. AC_DEFINE_UNQUOTED([unlikely(x)], [(x)], [gcc branch optimization])
  719. fi
  720. if test "${GCC}" = "yes"; then
  721. AC_DEFINE([__always_unused], [__attribute__((unused))], [gcc unused attribute])
  722. AC_DEFINE([__maybe_unused], [__attribute__((unused))], [gcc unused attribute])
  723. else
  724. AC_DEFINE([__always_unused], [], [dummy unused attribute])
  725. AC_DEFINE([__maybe_unused], [], [dummy unused attribute])
  726. fi
  727. if test "${enable_pedantic}" = "yes"; then
  728. enable_strict="yes"
  729. CFLAGS="${CFLAGS} -pedantic -Wall -Wextra -Wno-long-long"
  730. fi
  731. # -----------------------------------------------------------------------------
  732. # memory allocation library
  733. AC_MSG_CHECKING([for memory allocator])
  734. TS_CHECK_JEMALLOC
  735. if test "$has_jemalloc" = "1"; then
  736. AC_DEFINE([ENABLE_JEMALLOC], [1], [compile and link with jemalloc])
  737. AC_MSG_RESULT([jemalloc])
  738. else
  739. TS_CHECK_TCMALLOC
  740. if test "$has_tcmalloc" = "1"; then
  741. AC_DEFINE([ENABLE_TCMALLOC], [1], [compile and link with tcmalloc])
  742. AC_MSG_RESULT([tcmalloc])
  743. else
  744. AC_MSG_RESULT([system])
  745. AC_C_MALLOPT
  746. AC_C_MALLINFO
  747. fi
  748. fi
  749. # -----------------------------------------------------------------------------
  750. # libcap
  751. PKG_CHECK_MODULES(
  752. [LIBCAP],
  753. [libcap],
  754. [AC_CHECK_LIB([cap], [cap_get_proc, cap_set_proc],
  755. [AC_CHECK_HEADER(
  756. [sys/capability.h],
  757. [have_libcap=yes],
  758. [have_libcap=no]
  759. )],
  760. [have_libcap=no]
  761. )],
  762. [have_libcap=no]
  763. )
  764. test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.])
  765. AC_MSG_CHECKING([if libcap should be used])
  766. if test "${with_libcap}" != "no" -a "${have_libcap}" = "yes"; then
  767. with_libcap="yes"
  768. AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability])
  769. OPTIONAL_LIBCAP_CFLAGS="${LIBCAP_CFLAGS}"
  770. OPTIONAL_LIBCAP_LIBS="${LIBCAP_LIBS}"
  771. else
  772. with_libcap="no"
  773. fi
  774. AC_MSG_RESULT([${with_libcap}])
  775. AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"])
  776. # -----------------------------------------------------------------------------
  777. # H2O related
  778. can_build_h2o="no"
  779. if test "${enable_h2o}" != "no"; then
  780. can_build_h2o="yes"
  781. AC_MSG_CHECKING([can build H2O])
  782. if test -z "${UV_LIBS}"; then
  783. can_build_h2o="no"
  784. fi
  785. if test -n "${SSL_LIBS}"; then
  786. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  787. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  788. else
  789. can_build_h2o="no"
  790. fi
  791. if test "${with_zlib}" != "yes"; then
  792. can_build_h2o="no"
  793. fi
  794. AC_MSG_RESULT([${can_build_h2o}])
  795. if test "${can_build_h2o}" = "no" -a "${enable_h2o}" = "yes"; then
  796. AC_MSG_ERROR([H2O was requested but it cannot be built])
  797. fi
  798. if test "${can_build_h2o}" = "yes"; then
  799. AC_DEFINE([ENABLE_H2O], [1], [H2O web server])
  800. H2O_CFLAGS="-Wno-unused-result -Wno-misleading-indentation -Wno-format-security -Wno-format -Wno-unused-function -Wno-unused-parameter -Wno-type-limits -Wno-unused-but-set-variable -Wno-implicit-fallthrough -I\$(abs_top_srcdir)/web/server/h2o/libh2o/include -I\$(abs_top_srcdir)/web/server/h2o/libh2o/deps/picotls/include -I\$(abs_top_srcdir)/web/server/h2o/libh2o/deps/quicly/include -DH2O_USE_LIBUV=0"
  801. fi
  802. fi
  803. AM_CONDITIONAL([ENABLE_H2O], [test "${can_build_h2o}" = "yes"])
  804. # -----------------------------------------------------------------------------
  805. # ACLK
  806. bundled_proto_avail="no"
  807. if test "${with_bundled_protobuf}" != "no"; then
  808. AC_MSG_CHECKING([is bundled protobuf available])
  809. if test -f "externaldeps/protobuf/src/protoc"; then
  810. bundled_proto_avail="yes"
  811. fi
  812. AC_MSG_RESULT([${bundled_proto_avail}])
  813. if test "${with_bundled_protobuf}" == "yes" -a "${bundled_proto_avail}" != "yes"; then
  814. AC_MSG_ERROR([Bundled protobuf requested using --with-bundled-protobuf but it cannot be used/found])
  815. fi
  816. if test "${with_bundled_protobuf}" == "detect" -a "${bundled_proto_avail}" == "yes"; then
  817. with_bundled_protobuf="yes"
  818. fi
  819. fi
  820. AM_CONDITIONAL([MQTT_WSS_DEBUG], [test "${aclk_ssl_debug}" = "yes"])
  821. if test "${aclk_ssl_debug}" = "yes"; then
  822. AC_DEFINE([MQTT_WSS_DEBUG], [1], [ACLK SSL allow debugging])
  823. fi
  824. if test "${with_bundled_protobuf}" != "yes"; then
  825. PKG_CHECK_MODULES(
  826. [PROTOBUF],
  827. [protobuf >= 3],
  828. [have_libprotobuf=yes],
  829. [have_libprotobuf=no]
  830. )
  831. AC_PATH_PROG([PROTOC], [protoc], [no])
  832. AS_IF(
  833. [test x"${PROTOC}" == x"no"],
  834. [have_protoc=no],
  835. [have_protoc=yes]
  836. )
  837. else
  838. AC_MSG_NOTICE([using bundled protobuf])
  839. AC_DEFINE([BUNDLED_PROTOBUF], [1], [Using a bundled copy of protobuf])
  840. PROTOC="\$(abs_top_srcdir)/externaldeps/protobuf/src/protoc"
  841. PROTOBUF_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/protobuf/src"
  842. PROTOBUF_LIBS="\$(abs_top_srcdir)/externaldeps/protobuf/src/.libs/libprotobuf.a"
  843. have_libprotobuf="yes"
  844. have_protoc="yes"
  845. fi
  846. AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
  847. AS_IF(
  848. [test x"${CXX_BINARY}" == x"no"],
  849. [have_CXX_compiler=no],
  850. [have_CXX_compiler=yes]
  851. )
  852. if test "${have_libprotobuf}" == "yes" && test "${have_CXX_compiler}" == "yes"; then
  853. AC_DEFINE([HAVE_PROTOBUF], [1], [Protobuf is available])
  854. fi
  855. AC_MSG_CHECKING([if Cloud functionality should be enabled])
  856. AC_MSG_RESULT([${enable_cloud}])
  857. if test "$enable_cloud" != "no"; then
  858. AC_MSG_NOTICE([Checking if ACLK can be built])
  859. can_enable_ng="yes"
  860. AC_MSG_CHECKING([if git submodules present for ACLK])
  861. if test -f "mqtt_websockets/src/mqtt_wss_client.c"; then
  862. AC_MSG_RESULT([yes])
  863. else
  864. AC_MSG_RESULT([no])
  865. can_enable_ng="no"
  866. fi
  867. AC_MSG_CHECKING([if SSL available for ACLK])
  868. if test -n "${SSL_LIBS}"; then
  869. AC_MSG_RESULT([yes])
  870. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  871. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  872. else
  873. AC_MSG_RESULT([no])
  874. fi
  875. AC_MSG_CHECKING([if JSON-C available for ACLK])
  876. if test "$enable_jsonc" != "yes"; then
  877. AC_MSG_RESULT([no])
  878. can_enable_ng="no"
  879. else
  880. AC_MSG_RESULT([yes])
  881. fi
  882. AC_MSG_CHECKING([if protobuf available for ACLK New Cloud Protocol])
  883. if test "${have_libprotobuf}" != "yes"; then
  884. AC_MSG_RESULT([no])
  885. can_enable_ng="no"
  886. else
  887. AC_MSG_RESULT([yes])
  888. fi
  889. AC_MSG_CHECKING([if protoc available for ACLK New Cloud Protocol])
  890. if test "${have_protoc}" != "yes"; then
  891. AC_MSG_RESULT([no])
  892. can_enable_ng="no"
  893. else
  894. AC_MSG_RESULT([yes])
  895. fi
  896. AC_MSG_CHECKING([if C++ compiler available for ACLK New Cloud Protocol])
  897. if test "${have_CXX_compiler}" != "yes"; then
  898. AC_MSG_RESULT([no])
  899. can_enable_ng="no"
  900. else
  901. AC_MSG_RESULT([yes])
  902. fi
  903. AC_MSG_CHECKING([ACLK Next Generation can be built])
  904. AC_MSG_RESULT([${can_enable_ng}])
  905. if test "$can_enable_ng" = "no" -a "$enable_cloud" = "yes"; then
  906. AC_MSG_ERROR([You have requested --with-cloud but ACLK can't be built. See reasons in lines above])
  907. fi
  908. if test "$can_enable_ng" = "yes"; then
  909. enable_aclk="yes"
  910. AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK])
  911. 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"
  912. OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}"
  913. OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}"
  914. fi
  915. fi
  916. if test "$enable_cloud" = "yes" -a "$enable_aclk" != "yes"; then
  917. AC_MSG_ERROR([ACLK can't be built but --enable-cloud was requested])
  918. fi
  919. AC_SUBST([enable_cloud])
  920. AC_SUBST([enable_aclk])
  921. AM_CONDITIONAL([ENABLE_ACLK], [test "${enable_aclk}" = "yes"])
  922. # -----------------------------------------------------------------------------
  923. # apps.plugin
  924. AC_MSG_CHECKING([if apps.plugin should be enabled])
  925. if test "${build_target}" != "macos"; then
  926. AC_DEFINE([ENABLE_APPS_PLUGIN], [1], [apps.plugin])
  927. enable_plugin_apps="yes"
  928. else
  929. enable_plugin_apps="no"
  930. fi
  931. AC_MSG_RESULT([${enable_plugin_apps}])
  932. AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${enable_plugin_apps}" = "yes"])
  933. # -----------------------------------------------------------------------------
  934. # freeipmi.plugin - libipmimonitoring
  935. PKG_CHECK_MODULES(
  936. [IPMIMONITORING],
  937. [libipmimonitoring],
  938. [AC_CHECK_LIB([ipmimonitoring], [
  939. ipmi_monitoring_sensor_readings_by_record_id,
  940. ipmi_monitoring_sensor_readings_by_sensor_type,
  941. ipmi_monitoring_sensor_read_sensor_number,
  942. ipmi_monitoring_sensor_read_sensor_name,
  943. ipmi_monitoring_sensor_read_sensor_state,
  944. ipmi_monitoring_sensor_read_sensor_units,
  945. ipmi_monitoring_sensor_iterator_next,
  946. ipmi_monitoring_ctx_sensor_config_file,
  947. ipmi_monitoring_ctx_sdr_cache_directory,
  948. ipmi_monitoring_ctx_errormsg,
  949. ipmi_monitoring_ctx_create
  950. ],
  951. [AC_CHECK_HEADER(
  952. [ipmi_monitoring.h],
  953. [AC_CHECK_HEADER(
  954. [ipmi_monitoring_bitmasks.h],
  955. [have_ipmimonitoring=yes],
  956. [have_ipmimonitoring=no]
  957. )],
  958. [have_ipmimonitoring=no]
  959. )],
  960. [have_ipmimonitoring=no]
  961. )],
  962. [have_ipmimonitoring=no]
  963. )
  964. test "${enable_plugin_freeipmi}" = "yes" -a "${have_ipmimonitoring}" != "yes" && \
  965. AC_MSG_ERROR([ipmimonitoring required but not found. Try installing 'libipmimonitoring-dev' or 'libipmimonitoring-devel'])
  966. AC_MSG_CHECKING([if freeipmi.plugin should be enabled])
  967. if test "${enable_plugin_freeipmi}" != "no" -a "${have_ipmimonitoring}" = "yes"; then
  968. enable_plugin_freeipmi="yes"
  969. AC_DEFINE([HAVE_FREEIPMI], [1], [ipmimonitoring usability])
  970. OPTIONAL_IPMIMONITORING_CFLAGS="${IPMIMONITORING_CFLAGS}"
  971. OPTIONAL_IPMIMONITORING_LIBS="${IPMIMONITORING_LIBS}"
  972. else
  973. enable_plugin_freeipmi="no"
  974. fi
  975. AC_MSG_RESULT([${enable_plugin_freeipmi}])
  976. AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "yes"])
  977. # -----------------------------------------------------------------------------
  978. # cups.plugin - libcups
  979. # Only check most recently added method of cups
  980. AC_CHECK_LIB([cups], [httpConnect2],
  981. [AC_CHECK_HEADER(
  982. [cups/cups.h],
  983. [have_cups=yes],
  984. [have_cups=no]
  985. )],
  986. [have_cups=no]
  987. )
  988. test "${enable_plugin_cups}" = "yes" -a "${have_cups}" != "yes" && \
  989. AC_MSG_ERROR([cups required but not found. Try installing 'cups'])
  990. AC_ARG_WITH([cups-config],
  991. [AS_HELP_STRING([--with-cups-config=path], [Specify path to cups-config executable.])],
  992. [with_cups_config="$withval"],
  993. [with_cups_config=system]
  994. )
  995. AS_IF([test "x$with_cups_config" != "xsystem"], [
  996. CUPSCONFIG=$with_cups_config
  997. ], [
  998. AC_PATH_TOOL(CUPSCONFIG, [cups-config])
  999. AS_IF([test -z "$CUPSCONFIG"], [
  1000. have_cups=no
  1001. ])
  1002. ])
  1003. AC_MSG_CHECKING([if cups.plugin should be enabled])
  1004. if test "${enable_plugin_cups}" != "no" -a "${have_cups}" = "yes"; then
  1005. enable_plugin_cups="yes"
  1006. AC_DEFINE([HAVE_CUPS], [1], [cups usability])
  1007. CUPS_CFLAGS="${CUPS_CFLAGS} `$CUPSCONFIG --cflags`"
  1008. CUPS_LIBS="${CUPS_LIBS} `$CUPSCONFIG --libs`"
  1009. OPTIONAL_CUPS_CFLAGS="${CUPS_CFLAGS}"
  1010. OPTIONAL_CUPS_LIBS="${CUPS_LIBS}"
  1011. else
  1012. enable_plugin_cups="no"
  1013. fi
  1014. AC_MSG_RESULT([${enable_plugin_cups}])
  1015. AM_CONDITIONAL([ENABLE_PLUGIN_CUPS], [test "${enable_plugin_cups}" = "yes"])
  1016. # -----------------------------------------------------------------------------
  1017. # nfacct.plugin - libmnl, libnetfilter_acct
  1018. AC_CHECK_HEADER(
  1019. [linux/netfilter/nfnetlink_conntrack.h],
  1020. [AC_CHECK_DECL(
  1021. [CTA_STATS_MAX],
  1022. [have_nfnetlink_conntrack=yes],
  1023. [have_nfnetlink_conntrack=no],
  1024. [#include <linux/netfilter/nfnetlink_conntrack.h>]
  1025. )],
  1026. [have_nfnetlink_conntrack=no]
  1027. )
  1028. LIBS_BAK="${LIBS}"
  1029. LIBS="${LIBS} -lmnl"
  1030. PKG_CHECK_MODULES(
  1031. [LIBMNL],
  1032. [libmnl],
  1033. [AC_CHECK_LIB(
  1034. [mnl],
  1035. [mnl_socket_open],
  1036. [have_libmnl=yes],
  1037. [have_libmnl=no]
  1038. )],
  1039. [have_libmnl=no]
  1040. )
  1041. LIBS="${LIBS}"
  1042. PKG_CHECK_MODULES(
  1043. [NFACCT],
  1044. [libnetfilter_acct],
  1045. AC_SEARCH_LIBS(
  1046. [nfacct_alloc],
  1047. [netfilter_acct libnetfilter_acct],
  1048. [have_libnetfilter_acct=yes],
  1049. [have_libnetfilter_acct=no],
  1050. [${LIBS} -L/libnetfilter-acct-static/lib/libnetfilter_acct.a]
  1051. )],
  1052. [have_libnetfilter_acct=no]
  1053. )
  1054. LIBS="${LIBS_BAK}"
  1055. test "${enable_plugin_nfacct}" = "yes" -a "${have_nfnetlink_conntrack}" != "yes" && \
  1056. AC_MSG_ERROR([nfnetlink_conntrack.h required but not found or too old])
  1057. test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
  1058. AC_MSG_ERROR([netfilter_acct required but not found])
  1059. test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \
  1060. AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
  1061. AC_MSG_CHECKING([if nfacct.plugin should be enabled])
  1062. if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" \
  1063. -a "${have_libmnl}" = "yes" \
  1064. -a "${have_nfnetlink_conntrack}" = "yes"; then
  1065. enable_plugin_nfacct="yes"
  1066. AC_DEFINE([HAVE_NFACCT], [1], [netfilter accounting usability])
  1067. OPTIONAL_NFACCT_CFLAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}"
  1068. OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}"
  1069. else
  1070. enable_plugin_nfacct="no"
  1071. fi
  1072. AC_MSG_RESULT([${enable_plugin_nfacct}])
  1073. AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"])
  1074. # -----------------------------------------------------------------------------
  1075. # xenstat.plugin - libxenstat
  1076. PKG_CHECK_MODULES(
  1077. [YAJL],
  1078. [yajl],
  1079. [AC_CHECK_LIB(
  1080. [yajl],
  1081. [yajl_tree_get],
  1082. [have_libyajl=yes],
  1083. [have_libyajl=no]
  1084. )],
  1085. [have_libyajl=no]
  1086. )
  1087. AC_CHECK_LIB(
  1088. [xenstat],
  1089. [xenstat_init],
  1090. [AC_CHECK_HEADER(
  1091. [xenstat.h],
  1092. [have_libxenstat=yes],
  1093. [have_libxenstat=no]
  1094. )],
  1095. [have_libxenstat=no],
  1096. [-lyajl]
  1097. )
  1098. PKG_CHECK_MODULES(
  1099. [XENLIGHT],
  1100. [xenlight],
  1101. [AC_CHECK_LIB(
  1102. [xenlight],
  1103. [libxl_domain_info],
  1104. [AC_CHECK_HEADER(
  1105. [libxl.h],
  1106. [have_libxenlight=yes],
  1107. [have_libxenlight=no]
  1108. )],
  1109. [have_libxenlight=no]
  1110. )],
  1111. [have_libxenlight=no]
  1112. )
  1113. test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenstat}" != "yes" && \
  1114. AC_MSG_ERROR([libxenstat required but not found. try installing 'xen-dom0-libs-devel'])
  1115. test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenlight}" != "yes" && \
  1116. AC_MSG_ERROR([libxenlight required but not found. try installing 'xen-dom0-libs-devel'])
  1117. test "${enable_plugin_xenstat}" = "yes" -a "${have_libyajl}" != "yes" && \
  1118. AC_MSG_ERROR([libyajl required but not found. Try installing 'yajl-devel'])
  1119. AC_MSG_CHECKING([if xenstat.plugin should be enabled])
  1120. if test "${enable_plugin_xenstat}" != "no" -a "${have_libxenstat}" = "yes" -a "${have_libxenlight}" = "yes" -a "${have_libyajl}" = "yes"; then
  1121. enable_plugin_xenstat="yes"
  1122. AC_DEFINE([HAVE_LIBXENSTAT], [1], [libxenstat usability])
  1123. OPTIONAL_XENSTAT_CFLAGS="${XENLIGHT_CFLAGS} ${YAJL_CFLAGS}"
  1124. OPTIONAL_XENSTAT_LIBS="-lxenstat ${XENLIGHT_LIBS} ${YAJL_LIBS}"
  1125. else
  1126. enable_plugin_xenstat="no"
  1127. fi
  1128. AC_MSG_RESULT([${enable_plugin_xenstat}])
  1129. AM_CONDITIONAL([ENABLE_PLUGIN_XENSTAT], [test "${enable_plugin_xenstat}" = "yes"])
  1130. if test "${enable_plugin_xenstat}" == "yes"; then
  1131. AC_MSG_CHECKING([for xenstat_vbd_error in -lxenstat])
  1132. AC_TRY_LINK(
  1133. [ #include <xenstat.h> ],
  1134. [
  1135. xenstat_vbd * vbd;
  1136. int out = xenstat_vbd_error(vbd);
  1137. ],
  1138. [
  1139. have_xenstat_vbd_error=yes
  1140. AC_DEFINE([HAVE_XENSTAT_VBD_ERROR], [1], [xenstat_vbd_error usability])
  1141. ],
  1142. [ have_xenstat_vbd_error=no ]
  1143. )
  1144. AC_MSG_RESULT([${have_xenstat_vbd_error}])
  1145. fi
  1146. # -----------------------------------------------------------------------------
  1147. # perf.plugin
  1148. AC_CHECK_HEADER(
  1149. [linux/perf_event.h],
  1150. [AC_CHECK_DECL(
  1151. [PERF_COUNT_HW_REF_CPU_CYCLES],
  1152. [have_perf_event=yes],
  1153. [have_perf_event=no],
  1154. [#include <linux/perf_event.h>]
  1155. )],
  1156. [have_perf_event=no]
  1157. )
  1158. AC_MSG_CHECKING([if perf.plugin should be enabled])
  1159. if test "${build_target}" == "linux" -a "${have_perf_event}" = "yes"; then
  1160. AC_DEFINE([ENABLE_PERF_PLUGIN], [1], [perf.plugin])
  1161. enable_plugin_perf="yes"
  1162. else
  1163. enable_plugin_perf="no"
  1164. fi
  1165. AC_MSG_RESULT([${enable_plugin_perf}])
  1166. AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"])
  1167. # -----------------------------------------------------------------------------
  1168. # gtest/gmock
  1169. AC_MSG_CHECKING([if gtest and gmock can be found])
  1170. PKG_CHECK_MODULES([GTEST], [gtest], [have_gtest=yes], [have_gtest=no])
  1171. PKG_CHECK_MODULES([GMOCK], [gmock], [have_gmock=yes], [have_gmock=no])
  1172. if test "${have_gtest}" = "yes" -a "${have_gmock}" = "yes"; then
  1173. OPTIONAL_GTEST_CFLAGS="${GTEST_CFLAGS} ${GMOCK_CFLAGS}"
  1174. OPTIONAL_GTEST_LIBS="${GTEST_LIBS} ${GMOCK_LIBS}"
  1175. have_gtest="yes"
  1176. else
  1177. have_gtest="no"
  1178. fi
  1179. # -----------------------------------------------------------------------------
  1180. # ml - anomaly detection
  1181. # Check if uuid is available. Fail if ML was explicitly requested.
  1182. if test "${enable_ml}" = "yes" -a "${have_uuid}" != "yes"; then
  1183. AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but libuuid can not be found.])
  1184. fi
  1185. # Check if submodules have not been fetched. Fail if ML was explicitly requested.
  1186. AC_MSG_CHECKING([if git submodules are present for machine learning functionality])
  1187. if test -f "ml/dlib/dlib/all/source.cpp"; then
  1188. AC_MSG_RESULT([yes])
  1189. have_ml_submodules="yes"
  1190. AC_DEFINE([HAVE_DLIB], [1], [dlib availability])
  1191. else
  1192. AC_MSG_RESULT([no])
  1193. have_ml_submodules="no"
  1194. fi
  1195. if test "${enable_ml}" = "yes" -a "${have_ml_submodules}" = "no"; then
  1196. AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but it cannot be built because the required git submodules are missing.])
  1197. fi
  1198. if test "${enable_ml}" = "yes" -a "${have_cxx11}" = "no"; then
  1199. AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but it cannot be built without a C++11 toolchain.])
  1200. fi
  1201. # Decide if we should build ML
  1202. if test "${enable_ml}" != "no" -a "${have_ml_submodules}" = "yes" -a "${have_cxx11}" = "yes" -a "${have_uuid}" = "yes"; then
  1203. build_ml="yes"
  1204. else
  1205. build_ml="no"
  1206. fi
  1207. AM_CONDITIONAL([ENABLE_ML], [test "${build_ml}" = "yes"])
  1208. if test "${build_ml}" = "yes"; then
  1209. AC_DEFINE([ENABLE_ML], [1], [anomaly detection usability])
  1210. OPTIONAL_ML_CFLAGS="-DDLIB_NO_GUI_SUPPORT -I \$(abs_top_srcdir)/ml/dlib"
  1211. OPTIONAL_ML_LIBS=""
  1212. fi
  1213. # -----------------------------------------------------------------------------
  1214. # debugfs.plugin
  1215. if test "${build_target}" = "linux"; then
  1216. AC_DEFINE([ENABLE_DEBUGFS_PLUGIN], [1], [debugfs.plugin])
  1217. enable_plugin_debugfs="yes"
  1218. else
  1219. enable_plugin_debugfs="no"
  1220. fi
  1221. AC_MSG_CHECKING([if debugfs.plugin should be enabled])
  1222. AC_MSG_RESULT([${enable_plugin_debugfs}])
  1223. AM_CONDITIONAL([ENABLE_PLUGIN_DEBUGFS], [test "${enable_plugin_debugfs}" = "yes"])
  1224. # -----------------------------------------------------------------------------
  1225. # ebpf.plugin
  1226. if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then
  1227. PKG_CHECK_MODULES(
  1228. [LIBELF],
  1229. [libelf],
  1230. [have_libelf=yes],
  1231. [have_libelf=no]
  1232. )
  1233. AC_CHECK_TYPE(
  1234. [struct bpf_prog_info],
  1235. [have_bpf=yes],
  1236. [have_bpf=no],
  1237. [#include <linux/bpf.h>]
  1238. )
  1239. AC_CHECK_FILE(
  1240. externaldeps/libbpf/libbpf.a,
  1241. [have_libbpf=yes],
  1242. [have_libbpf=no]
  1243. )
  1244. if test "${have_libelf}" = "yes" -a \
  1245. "${have_bpf}" = "yes" -a \
  1246. "${have_libbpf}" = "yes"; then
  1247. OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I \$(abs_top_srcdir)/externaldeps/libbpf/include -I \$(abs_top_srcdir)/externaldeps/libbpf/include/uapi"
  1248. OPTIONAL_BPF_LIBS="\$(abs_top_srcdir)/externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
  1249. AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
  1250. enable_ebpf="yes"
  1251. else
  1252. enable_ebpf="no"
  1253. fi
  1254. else
  1255. enable_ebpf="no"
  1256. fi
  1257. AC_MSG_CHECKING([if ebpf.plugin should be enabled])
  1258. AC_MSG_RESULT([${enable_ebpf}])
  1259. AM_CONDITIONAL([ENABLE_PLUGIN_EBPF], [test "${enable_ebpf}" = "yes"])
  1260. # -----------------------------------------------------------------------------
  1261. # slabinfo.plugin
  1262. AC_MSG_CHECKING([if slabinfo.plugin should be enabled])
  1263. if test "${build_target}" == "linux"; then
  1264. AC_DEFINE([ENABLE_SLABINFO], [1], [slabinfo plugin])
  1265. enable_plugin_slabinfo="yes"
  1266. else
  1267. enable_plugin_slabinfo="no"
  1268. fi
  1269. AC_MSG_RESULT([${enable_plugin_slabinfo}])
  1270. AM_CONDITIONAL([ENABLE_PLUGIN_SLABINFO], [test "${enable_plugin_slabinfo}" = "yes"])
  1271. # -----------------------------------------------------------------------------
  1272. # AWS Kinesis exporting connector - libaws-cpp-sdk-kinesis, libaws-cpp-sdk-core, libssl, libcrypto, libcurl
  1273. PKG_CHECK_MODULES(
  1274. [LIBCRYPTO],
  1275. [libcrypto],
  1276. [AC_CHECK_LIB(
  1277. [crypto],
  1278. [CRYPTO_new_ex_data],
  1279. [have_libcrypto=yes],
  1280. [have_libcrypto=no]
  1281. )],
  1282. [have_libcrypto=no]
  1283. )
  1284. PKG_CHECK_MODULES(
  1285. [LIBSSL],
  1286. [libssl],
  1287. [AC_CHECK_LIB(
  1288. [ssl],
  1289. [SSL_connect],
  1290. [have_libssl=yes],
  1291. [have_libssl=no]
  1292. )],
  1293. [have_libssl=no]
  1294. )
  1295. PKG_CHECK_MODULES(
  1296. [LIBCURL],
  1297. [libcurl],
  1298. [AC_CHECK_LIB(
  1299. [curl],
  1300. [curl_easy_init],
  1301. [have_libcurl=yes],
  1302. [have_libcurl=no]
  1303. )],
  1304. [have_libcurl=no]
  1305. )
  1306. PKG_CHECK_MODULES(
  1307. [AWS_CPP_SDK_CORE],
  1308. [aws-cpp-sdk-core],
  1309. [have_libaws_cpp_sdk_core=yes],
  1310. [have_libaws_cpp_sdk_core=no]
  1311. )
  1312. PKG_CHECK_MODULES(
  1313. [AWS_CPP_SDK_KINESIS],
  1314. [aws-cpp-sdk-kinesis],
  1315. [have_libaws_cpp_sdk_kinesis=yes],
  1316. [have_libaws_cpp_sdk_kinesis=no]
  1317. )
  1318. test "${enable_exporting_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_kinesis}" != "yes" && \
  1319. AC_MSG_ERROR([libaws-cpp-sdk-kinesis required but not found. try installing AWS C++ SDK])
  1320. test "${enable_exporting_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" != "yes" && \
  1321. AC_MSG_ERROR([libaws-cpp-sdk-core required but not found. try installing AWS C++ SDK])
  1322. test "${enable_exporting_kinesis}" = "yes" -a "${have_libcurl}" != "yes" && \
  1323. AC_MSG_ERROR([libcurl required but not found])
  1324. test "${enable_exporting_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \
  1325. AC_MSG_ERROR([libssl required but not found])
  1326. test "${enable_exporting_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \
  1327. AC_MSG_ERROR([libcrypto required but not found])
  1328. AC_MSG_CHECKING([if kinesis exporting connector should be enabled])
  1329. if test "${enable_exporting_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}" = "yes" \
  1330. -a "${have_libaws_cpp_sdk_core}" = "yes" \
  1331. -a "${have_libcurl}" = "yes" \
  1332. -a "${have_libssl}" = "yes" \
  1333. -a "${have_libcrypto}" = "yes"; then
  1334. enable_exporting_kinesis="yes"
  1335. AC_DEFINE([HAVE_KINESIS], [1], [libaws-cpp-sdk-kinesis usability])
  1336. OPTIONAL_KINESIS_CFLAGS="${LIBCRYPTO_CFLAGS} ${LIBSSL_CFLAGS} ${LIBCURL_CFLAGS}"
  1337. OPTIONAL_KINESIS_CXXFLAGS="${AWS_CPP_SDK_KINESIS_CFLAGS} ${AWS_CPP_SDK_CORE_CFLAGS}"
  1338. OPTIONAL_KINESIS_LIBS="${AWS_CPP_SDK_KINESIS_LIBS} ${AWS_CPP_SDK_CORE_LIBS} \
  1339. ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}"
  1340. else
  1341. enable_exporting_kinesis="no"
  1342. fi
  1343. AC_MSG_RESULT([${enable_exporting_kinesis}])
  1344. AM_CONDITIONAL([ENABLE_EXPORTING_KINESIS], [test "${enable_exporting_kinesis}" = "yes"])
  1345. # -----------------------------------------------------------------------------
  1346. # Pub/Sub exporting connector - googleapis
  1347. PKG_CHECK_MODULES(
  1348. [GRPC],
  1349. [grpc],
  1350. [have_libgrpc=yes],
  1351. [have_libgrpc=no]
  1352. )
  1353. if test "${enable_exporting_pubsub}" != "no"; then
  1354. PKG_CHECK_MODULES(
  1355. [PUBSUB],
  1356. [google_cloud_cpp_pubsub_protos],
  1357. [have_pubsub_protos=yes],
  1358. [have_pubsub_protos=no]
  1359. )
  1360. fi
  1361. AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
  1362. AS_IF(
  1363. [test x"${CXX_BINARY}" == x"no"],
  1364. [have_CXX_compiler=no],
  1365. [have_CXX_compiler=yes]
  1366. )
  1367. test "${enable_pubsub}" = "yes" -a "${have_grpc}" != "yes" && \
  1368. AC_MSG_ERROR([libgrpc required but not found. try installing grpc])
  1369. test "${enable_pubsub}" = "yes" -a "${have_pubsub_protos}" != "yes" && \
  1370. AC_MSG_ERROR([libgoogleapis_cpp_pubsub_protos required but not found. try installing googleapis])
  1371. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \
  1372. AC_MSG_ERROR([C++ compiler required but not found. try installing g++])
  1373. AC_MSG_CHECKING([if pubsub exporting connector should be enabled])
  1374. if test "${enable_exporting_pubsub}" != "no" -a "${have_pubsub_protos}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
  1375. enable_exporting_pubsub="yes"
  1376. AC_DEFINE([ENABLE_EXPORTING_PUBSUB], [1], [Pub/Sub API usability])
  1377. OPTIONAL_PUBSUB_CFLAGS="${GRPC_CFLAGS} ${PUBSUB_CFLAGS}"
  1378. OPTIONAL_PUBSUB_LIBS="${GRPC_LIBS} ${PUBSUB_LIBS}"
  1379. else
  1380. enable_pubsub="no"
  1381. fi
  1382. AC_MSG_RESULT([${enable_exporting_pubsub}])
  1383. AM_CONDITIONAL([ENABLE_EXPORTING_PUBSUB], [test "${enable_exporting_pubsub}" = "yes"])
  1384. # -----------------------------------------------------------------------------
  1385. # Prometheus remote write exporting connector - libprotobuf, libsnappy, protoc
  1386. AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy])
  1387. AC_LANG_SAVE
  1388. AC_LANG_CPLUSPLUS
  1389. save_LIBS="${LIBS}"
  1390. LIBS="-lsnappy"
  1391. save_CXXFLAGS="${CXXFLAGS}"
  1392. CXXFLAGS="${CXXFLAGS} ${CPP_STD_FLAG}"
  1393. AC_TRY_LINK(
  1394. [
  1395. #include <stdlib.h>
  1396. #include <snappy.h>
  1397. ],
  1398. [
  1399. const char *input = "test";
  1400. size_t compressed_length;
  1401. char *buffer = (char *)malloc(5 * sizeof(char));
  1402. snappy::RawCompress(input, 4, buffer, &compressed_length);
  1403. free(buffer);
  1404. ],
  1405. [
  1406. have_libsnappy=yes
  1407. SNAPPY_CFLAGS=""
  1408. SNAPPY_LIBS="-lsnappy"
  1409. ],
  1410. [have_libsnappy=no]
  1411. )
  1412. LIBS="${save_LIBS}"
  1413. CXXFLAGS="${save_CXXFLAGS}"
  1414. AC_LANG_RESTORE
  1415. AC_MSG_RESULT([${have_libsnappy}])
  1416. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_libprotobuf}" != "yes" && \
  1417. AC_MSG_ERROR([libprotobuf required but not found. try installing protobuf])
  1418. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_libsnappy}" != "yes" && \
  1419. AC_MSG_ERROR([libsnappy required but not found. try installing snappy])
  1420. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_protoc}" != "yes" && \
  1421. AC_MSG_ERROR([protoc compiler required but not found. try installing protobuf])
  1422. test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \
  1423. AC_MSG_ERROR([C++ compiler required but not found. try installing g++])
  1424. AC_MSG_CHECKING([if prometheus remote write exporting connector should be enabled])
  1425. if test "${enable_exporting_prometheus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \
  1426. -a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
  1427. enable_exporting_prometheus_remote_write="yes"
  1428. AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
  1429. OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${SNAPPY_CFLAGS} -I \$(abs_top_srcdir)/exporting/prometheus/remote_write"
  1430. OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${SNAPPY_LIBS}"
  1431. OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}"
  1432. OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}"
  1433. else
  1434. enable_exporting_prometheus_remote_write="no"
  1435. fi
  1436. AC_MSG_RESULT([${enable_exporting_prometheus_remote_write}])
  1437. AM_CONDITIONAL([ENABLE_EXPORTING_PROMETHEUS_REMOTE_WRITE], [test "${enable_exporting_prometheus_remote_write}" = "yes"])
  1438. # -----------------------------------------------------------------------------
  1439. # MongoDB exporting connector - libmongoc
  1440. PKG_CHECK_MODULES(
  1441. [LIBMONGOC],
  1442. [libmongoc-1.0 >= 1.7],
  1443. [have_libmongoc=yes],
  1444. [have_libmongoc=no]
  1445. )
  1446. test "${enable_exporting_mongodb}" = "yes" -a "${have_libmongoc}" != "yes" && \
  1447. AC_MSG_ERROR([libmongoc required but not found. Try installing `mongoc`.])
  1448. AC_MSG_CHECKING([if mongodb exporting connector should be enabled])
  1449. if test "${enable_exporting_mongodb}" != "no" -a "${have_libmongoc}" = "yes"; then
  1450. enable_exporting_mongodb="yes"
  1451. AC_DEFINE([HAVE_MONGOC], [1], [libmongoc usability])
  1452. OPTIONAL_MONGOC_CFLAGS="${LIBMONGOC_CFLAGS}"
  1453. OPTIONAL_MONGOC_LIBS="${LIBMONGOC_LIBS}"
  1454. else
  1455. enable_exporting_mongodb="no"
  1456. fi
  1457. AC_MSG_RESULT([${enable_exporting_mongodb}])
  1458. AM_CONDITIONAL([ENABLE_EXPORTING_MONGODB], [test "${enable_exporting_mongodb}" = "yes"])
  1459. # -----------------------------------------------------------------------------
  1460. # check for setns() - cgroup-network
  1461. AC_CHECK_FUNC([setns])
  1462. AC_MSG_CHECKING([if cgroup-network can be enabled])
  1463. if test "$ac_cv_func_setns" = "yes" ; then
  1464. have_setns="yes"
  1465. AC_DEFINE([HAVE_SETNS], [1], [Define 1 if you have setns() function])
  1466. else
  1467. have_setns="no"
  1468. fi
  1469. AC_MSG_RESULT([${have_setns}])
  1470. AM_CONDITIONAL([ENABLE_PLUGIN_CGROUP_NETWORK], [test "${have_setns}" = "yes"])
  1471. # -----------------------------------------------------------------------------
  1472. # Link-Time-Optimization
  1473. if test "${enable_lto}" != "no"; then
  1474. opt="-flto"
  1475. AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no])
  1476. fi
  1477. if test "${have_lto}" = "yes"; then
  1478. oCFLAGS="${CFLAGS}"
  1479. CFLAGS="${CFLAGS} -flto"
  1480. ac_cv_c_lto_cross_compile="${enable_lto}"
  1481. test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no"
  1482. AC_C_LTO
  1483. CFLAGS="${oCFLAGS}"
  1484. test "${ac_cv_c_lto}" != "yes" && have_lto="no"
  1485. fi
  1486. test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
  1487. AC_MSG_ERROR([LTO is required but is not available.])
  1488. AC_MSG_CHECKING([if LTO should be enabled])
  1489. if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then
  1490. enable_lto="yes"
  1491. OPTIONAL_LTO_CFLAGS="-flto"
  1492. else
  1493. enable_lto="no"
  1494. fi
  1495. AC_MSG_RESULT([${enable_lto}])
  1496. # -----------------------------------------------------------------------------
  1497. # Try to unconditionally link with -latomic. If the compiler can satisfy
  1498. # all the atomic ops with builtins then, the library will be left unused.
  1499. # Otherwise, some ops will be covered by the compiler's intrinsics and some
  1500. # will be picked up by the linker from -latomic. In the later case, if
  1501. # -latomic is not available there will be a build failure, which would
  1502. # have happened either way before this change.
  1503. AC_LANG_PUSH([C++])
  1504. AC_MSG_CHECKING(whether we can use -latomic)
  1505. OLD_LIBS="${LIBS}"
  1506. LIBS="-latomic"
  1507. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  1508. #include <atomic>
  1509. #include <cstdint>
  1510. std::atomic<std::int64_t> v;
  1511. int main() {
  1512. return v;
  1513. }
  1514. ]])], CAN_USE_LIBATOMIC=yes, CAN_USE_LIBATOMIC=no)
  1515. LIBS="${OLD_LIBS}"
  1516. AC_MSG_RESULT($CAN_USE_LIBATOMIC)
  1517. if test "x$CAN_USE_LIBATOMIC" = xyes; then
  1518. OPTIONAL_ATOMIC_LIBS="-latomic"
  1519. fi
  1520. AC_SUBST([OPTIONAL_ATOMIC_LIBS])
  1521. AC_LANG_POP([C++])
  1522. # -----------------------------------------------------------------------------
  1523. AC_MSG_CHECKING(whether we can use dlsym)
  1524. OLD_LIBS="${LIBS}"
  1525. LIBS="-ldl"
  1526. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  1527. #include <dlfcn.h>
  1528. static void *(*libc_malloc)(size_t);
  1529. int main() {
  1530. libc_malloc = dlsym(RTLD_NEXT, "malloc");
  1531. }
  1532. ]])], CAN_USE_DLSYM=yes, CAN_USE_DLSYM=no)
  1533. LIBS="${OLD_LIBS}"
  1534. AC_MSG_RESULT($CAN_USE_DLSYM)
  1535. if test "x$CAN_USE_DLSYM" = xyes; then
  1536. AC_DEFINE([HAVE_DLSYM], [1], [dlsym usability])
  1537. OPTIONAL_DL_LIBS="-ldl"
  1538. fi
  1539. AC_SUBST([OPTIONAL_DL_LIBS])
  1540. # -----------------------------------------------------------------------------
  1541. AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged])
  1542. varlibdir="${localstatedir}/lib/netdata"
  1543. registrydir="${localstatedir}/lib/netdata/registry"
  1544. cachedir="${localstatedir}/cache/netdata"
  1545. chartsdir="${libexecdir}/netdata/charts.d"
  1546. pythondir="${libexecdir}/netdata/python.d"
  1547. configdir="${sysconfdir}/netdata"
  1548. libconfigdir="${libdir}/netdata/conf.d"
  1549. logdir="${localstatedir}/log/netdata"
  1550. pluginsdir="${libexecdir}/netdata/plugins.d"
  1551. netdata_user="${with_user}"
  1552. libsysdir="${libdir}/netdata/system"
  1553. AC_SUBST([varlibdir])
  1554. AC_SUBST([registrydir])
  1555. AC_SUBST([cachedir])
  1556. AC_SUBST([chartsdir])
  1557. AC_SUBST([pythondir])
  1558. AC_SUBST([configdir])
  1559. AC_SUBST([libconfigdir])
  1560. AC_SUBST([logdir])
  1561. AC_SUBST([pluginsdir])
  1562. AC_SUBST([webdir])
  1563. AC_SUBST([netdata_user])
  1564. AC_SUBST([libsysdir])
  1565. CFLAGS="${originalCFLAGS} ${OPTIONAL_LTO_CFLAGS} ${OPTIONAL_PROTOBUF_CFLAGS} ${OPTIONAL_MATH_CFLAGS} ${OPTIONAL_NFACCT_CFLAGS} \
  1566. ${ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} \
  1567. ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CFLAGS} ${OPTIONAL_XENSTAT_FLAGS} \
  1568. ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PUBSUB_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} \
  1569. ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_YAML_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${JUDY_CFLAGS} \
  1570. ${OPTIONAL_ACLK_CFLAGS} ${OPTIONAL_ML_CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS} ${H2O_CFLAGS} ${HARDENING_CFLAGS}"
  1571. CXXFLAGS="${CFLAGS} ${OPTIONAL_KINESIS_CXXFLAGS} ${CPP_STD_FLAG}"
  1572. CPPFLAGS="\
  1573. -DVARLIB_DIR=\"\\\"${varlibdir}\\\"\" \
  1574. -DCACHE_DIR=\"\\\"${cachedir}\\\"\" \
  1575. -DCONFIG_DIR=\"\\\"${configdir}\\\"\" \
  1576. -DLIBCONFIG_DIR=\"\\\"${libconfigdir}\\\"\" \
  1577. -DLOG_DIR=\"\\\"${logdir}\\\"\" \
  1578. -DPLUGINS_DIR=\"\\\"${pluginsdir}\\\"\" \
  1579. -DRUN_DIR=\"\\\"${localstatedir}/run/netdata\\\"\" \
  1580. -DWEB_DIR=\"\\\"${webdir}\\\"\" \
  1581. "
  1582. AC_SUBST([OPTIONAL_MATH_CFLAGS])
  1583. AC_SUBST([OPTIONAL_MATH_LIBS])
  1584. AC_SUBST([OPTIONAL_DATACHANNEL_LIBS])
  1585. AC_SUBST([OPTIONAL_UV_LIBS])
  1586. AC_SUBST([OPTIONAL_LZ4_LIBS])
  1587. AC_SUBST([OPTIONAL_SSL_LIBS])
  1588. AC_SUBST([OPTIONAL_JSONC_LIBS])
  1589. AC_SUBST([OPTIONAL_YAML_LIBS])
  1590. AC_SUBST([OPTIONAL_NFACCT_CFLAGS])
  1591. AC_SUBST([OPTIONAL_NFACCT_LIBS])
  1592. AC_SUBST([ZLIB_CFLAGS])
  1593. AC_SUBST([ZLIB_LIBS])
  1594. AC_SUBST([OPTIONAL_UUID_CFLAGS])
  1595. AC_SUBST([OPTIONAL_UUID_LIBS])
  1596. AC_SUBST([OPTIONAL_BPF_CFLAGS])
  1597. AC_SUBST([OPTIONAL_BPF_LIBS])
  1598. AC_SUBST([OPTIONAL_MQTT_LIBS])
  1599. AC_SUBST([OPTIONAL_LIBCAP_CFLAGS])
  1600. AC_SUBST([OPTIONAL_LIBCAP_LIBS])
  1601. AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS])
  1602. AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS])
  1603. AC_SUBST([OPTIONAL_CUPS_CFLAGS])
  1604. AC_SUBST([OPTIONAL_CUPS_LIBS])
  1605. AC_SUBST([OPTIONAL_XENSTAT_CFLAGS])
  1606. AC_SUBST([OPTIONAL_XENSTAT_LIBS])
  1607. AC_SUBST([OPTIONAL_KINESIS_CFLAGS])
  1608. AC_SUBST([OPTIONAL_KINESIS_LIBS])
  1609. AC_SUBST([OPTIONAL_PUBSUB_CFLAGS])
  1610. AC_SUBST([OPTIONAL_PUBSUB_LIBS])
  1611. AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS])
  1612. AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS])
  1613. AC_SUBST([OPTIONAL_MONGOC_CFLAGS])
  1614. AC_SUBST([OPTIONAL_MONGOC_LIBS])
  1615. AC_SUBST([OPTIONAL_LWS_LIBS])
  1616. AC_SUBST([OPTIONAL_ACLK_CFLAGS])
  1617. AC_SUBST([OPTIONAL_PROTOBUF_CFLAGS])
  1618. AC_SUBST([OPTIONAL_PROTOBUF_LIBS])
  1619. AC_SUBST([OPTIONAL_GTEST_CFLAGS])
  1620. AC_SUBST([OPTIONAL_GTEST_LIBS])
  1621. AC_SUBST([OPTIONAL_ML_CFLAGS])
  1622. AC_SUBST([OPTIONAL_ML_LIBS])
  1623. # -----------------------------------------------------------------------------
  1624. # Check if cmocka is available - needed for unit testing
  1625. AC_ARG_ENABLE(
  1626. [unit-tests],
  1627. [AS_HELP_STRING([--disable-unit-tests],
  1628. [Disables building and running the unit tests suite])],
  1629. [],
  1630. [enable_unit_tests="yes"]
  1631. )
  1632. PKG_CHECK_MODULES(
  1633. [CMOCKA],
  1634. [cmocka],
  1635. [have_cmocka="yes"],
  1636. [AC_MSG_NOTICE([CMocka not found on the system. Unit tests disabled])]
  1637. )
  1638. AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ])
  1639. AC_SUBST([ENABLE_UNITTESTS])
  1640. TEST_CFLAGS="${CFLAGS} ${CMOCKA_CFLAGS}"
  1641. TEST_LIBS="${CMOCKA_LIBS}"
  1642. AC_SUBST([TEST_CFLAGS])
  1643. AC_SUBST([TEST_LIBS])
  1644. # -----------------------------------------------------------------------------
  1645. # save configure options for build info
  1646. AC_DEFINE_UNQUOTED(
  1647. [CONFIGURE_COMMAND],
  1648. ["$ac_configure_args"],
  1649. [options passed to configure script]
  1650. )
  1651. AC_CONFIG_FILES([
  1652. Makefile
  1653. netdata.spec
  1654. collectors/Makefile
  1655. collectors/apps.plugin/Makefile
  1656. collectors/cgroups.plugin/Makefile
  1657. collectors/charts.d.plugin/Makefile
  1658. collectors/debugfs.plugin/Makefile
  1659. collectors/diskspace.plugin/Makefile
  1660. collectors/timex.plugin/Makefile
  1661. collectors/ioping.plugin/Makefile
  1662. collectors/freebsd.plugin/Makefile
  1663. collectors/freeipmi.plugin/Makefile
  1664. collectors/cups.plugin/Makefile
  1665. collectors/idlejitter.plugin/Makefile
  1666. collectors/macos.plugin/Makefile
  1667. collectors/nfacct.plugin/Makefile
  1668. collectors/plugins.d/Makefile
  1669. collectors/proc.plugin/Makefile
  1670. collectors/python.d.plugin/Makefile
  1671. collectors/slabinfo.plugin/Makefile
  1672. collectors/statsd.plugin/Makefile
  1673. collectors/ebpf.plugin/Makefile
  1674. collectors/tc.plugin/Makefile
  1675. collectors/xenstat.plugin/Makefile
  1676. collectors/perf.plugin/Makefile
  1677. daemon/Makefile
  1678. database/Makefile
  1679. database/contexts/Makefile
  1680. database/engine/Makefile
  1681. database/ram/Makefile
  1682. database/sqlite/Makefile
  1683. diagrams/Makefile
  1684. exporting/Makefile
  1685. exporting/graphite/Makefile
  1686. exporting/json/Makefile
  1687. exporting/opentsdb/Makefile
  1688. exporting/prometheus/Makefile
  1689. exporting/prometheus/remote_write/Makefile
  1690. exporting/aws_kinesis/Makefile
  1691. exporting/pubsub/Makefile
  1692. exporting/mongodb/Makefile
  1693. exporting/tests/Makefile
  1694. health/Makefile
  1695. health/notifications/Makefile
  1696. libnetdata/Makefile
  1697. libnetdata/tests/Makefile
  1698. libnetdata/adaptive_resortable_list/Makefile
  1699. libnetdata/aral/Makefile
  1700. libnetdata/avl/Makefile
  1701. libnetdata/buffer/Makefile
  1702. libnetdata/clocks/Makefile
  1703. libnetdata/completion/Makefile
  1704. libnetdata/config/Makefile
  1705. libnetdata/dictionary/Makefile
  1706. libnetdata/ebpf/Makefile
  1707. libnetdata/eval/Makefile
  1708. libnetdata/july/Makefile
  1709. libnetdata/locks/Makefile
  1710. libnetdata/log/Makefile
  1711. libnetdata/onewayalloc/Makefile
  1712. libnetdata/popen/Makefile
  1713. libnetdata/procfile/Makefile
  1714. libnetdata/simple_pattern/Makefile
  1715. libnetdata/socket/Makefile
  1716. libnetdata/statistical/Makefile
  1717. libnetdata/string/Makefile
  1718. libnetdata/storage_number/Makefile
  1719. libnetdata/storage_number/tests/Makefile
  1720. libnetdata/threads/Makefile
  1721. libnetdata/url/Makefile
  1722. libnetdata/json/Makefile
  1723. libnetdata/health/Makefile
  1724. libnetdata/worker_utilization/Makefile
  1725. registry/Makefile
  1726. streaming/Makefile
  1727. system/Makefile
  1728. tests/Makefile
  1729. web/Makefile
  1730. web/api/Makefile
  1731. web/api/badges/Makefile
  1732. web/api/exporters/Makefile
  1733. web/api/exporters/shell/Makefile
  1734. web/api/exporters/prometheus/Makefile
  1735. web/api/formatters/Makefile
  1736. web/api/formatters/csv/Makefile
  1737. web/api/formatters/json/Makefile
  1738. web/api/formatters/ssv/Makefile
  1739. web/api/formatters/value/Makefile
  1740. web/api/queries/Makefile
  1741. web/api/queries/average/Makefile
  1742. web/api/queries/countif/Makefile
  1743. web/api/queries/des/Makefile
  1744. web/api/queries/incremental_sum/Makefile
  1745. web/api/queries/max/Makefile
  1746. web/api/queries/median/Makefile
  1747. web/api/queries/min/Makefile
  1748. web/api/queries/percentile/Makefile
  1749. web/api/queries/ses/Makefile
  1750. web/api/queries/stddev/Makefile
  1751. web/api/queries/sum/Makefile
  1752. web/api/queries/trimmed_mean/Makefile
  1753. web/api/health/Makefile
  1754. web/gui/Makefile
  1755. web/gui/v1/Makefile
  1756. web/gui/v2/Makefile
  1757. web/rtc/Makefile
  1758. web/server/Makefile
  1759. web/server/static/Makefile
  1760. claim/Makefile
  1761. spawn/Makefile
  1762. ])
  1763. AC_OUTPUT
  1764. test "${with_math}" != "yes" && AC_MSG_WARN([You are building without math. math allows accurate calculations. It should be enabled.]) || :