configure.ac 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  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. AM_PROG_CC_C_O
  34. AC_PROG_CXX
  35. AC_PROG_INSTALL
  36. PKG_PROG_PKG_CONFIG
  37. AC_USE_SYSTEM_EXTENSIONS
  38. # -----------------------------------------------------------------------------
  39. # configurable options
  40. AC_ARG_ENABLE(
  41. [plugin-nfacct],
  42. [AS_HELP_STRING([--enable-plugin-nfacct], [enable nfacct plugin @<:@default autodetect@:>@])],
  43. ,
  44. [enable_plugin_nfacct="detect"]
  45. )
  46. AC_ARG_ENABLE(
  47. [plugin-freeipmi],
  48. [AS_HELP_STRING([--enable-plugin-freeipmi], [enable freeipmi plugin @<:@default autodetect@:>@])],
  49. ,
  50. [enable_plugin_freeipmi="detect"]
  51. )
  52. AC_ARG_ENABLE(
  53. [plugin-cups],
  54. [AS_HELP_STRING([--enable-plugin-cups], [enable cups plugin @<:@default autodetect@:>@])],
  55. ,
  56. [enable_plugin_cups="detect"]
  57. )
  58. AC_ARG_ENABLE(
  59. [plugin-xenstat],
  60. [AS_HELP_STRING([--enable-plugin-xenstat], [enable xenstat plugin @<:@default autodetect@:>@])],
  61. ,
  62. [enable_plugin_xenstat="detect"]
  63. )
  64. AC_ARG_ENABLE(
  65. [backend-kinesis],
  66. [AS_HELP_STRING([--enable-backend-kinesis], [enable kinesis backend @<:@default autodetect@:>@])],
  67. ,
  68. [enable_backend_kinesis="detect"]
  69. )
  70. AC_ARG_ENABLE(
  71. [backend-prometheus-remote-write],
  72. [AS_HELP_STRING([--enable-backend-prometheus-remote-write], [enable prometheus remote write backend @<:@default autodetect@:>@])],
  73. ,
  74. [enable_backend_prometheus_remote_write="detect"]
  75. )
  76. AC_ARG_ENABLE(
  77. [pedantic],
  78. [AS_HELP_STRING([--enable-pedantic], [enable pedantic compiler warnings @<:@default disabled@:>@])],
  79. ,
  80. [enable_pedantic="no"]
  81. )
  82. AC_ARG_ENABLE(
  83. [accept4],
  84. [AS_HELP_STRING([--disable-accept4], [System does not have accept4 @<:@default autodetect@:>@])],
  85. ,
  86. [enable_accept4="detect"]
  87. )
  88. AC_ARG_WITH(
  89. [webdir],
  90. [AS_HELP_STRING([--with-webdir], [location of webdir @<:@PKGDATADIR/web@:>@])],
  91. [webdir="${withval}"],
  92. [webdir="\$(pkgdatadir)/web"]
  93. )
  94. AC_ARG_WITH(
  95. [libcap],
  96. [AS_HELP_STRING([--with-libcap], [build with libcap @<:@default autodetect@:>@])],
  97. ,
  98. [with_libcap="detect"]
  99. )
  100. AC_ARG_WITH(
  101. [zlib],
  102. [AS_HELP_STRING([--without-zlib], [build without zlib @<:@default enabled@:>@])],
  103. ,
  104. [with_zlib="yes"]
  105. )
  106. AC_ARG_WITH(
  107. [math],
  108. [AS_HELP_STRING([--without-math], [build without math @<:@default enabled@:>@])],
  109. ,
  110. [with_math="yes"]
  111. )
  112. AC_ARG_WITH(
  113. [user],
  114. [AS_HELP_STRING([--with-user], [use this user to drop privilege @<:@default nobody@:>@])],
  115. ,
  116. [with_user="nobody"]
  117. )
  118. AC_ARG_ENABLE(
  119. [x86-sse],
  120. [AS_HELP_STRING([--disable-x86-sse], [SSE/SS2 optimizations on x86 @<:@default enabled@:>@])],
  121. ,
  122. [enable_x86_sse="yes"]
  123. )
  124. AC_ARG_ENABLE(
  125. [lto],
  126. [AS_HELP_STRING([--disable-lto], [Link Time Optimizations @<:@default autodetect@:>@])],
  127. ,
  128. [enable_lto="detect"]
  129. )
  130. AC_ARG_ENABLE(
  131. [https],
  132. [AS_HELP_STRING([--enable-https], [Enable SSL support @<:@default autodetect@:>@])],
  133. ,
  134. [enable_https="detect"]
  135. )
  136. AC_ARG_ENABLE(
  137. [dbengine],
  138. [AS_HELP_STRING([--disable-dbengine], [disable netdata dbengine @<:@default autodetect@:>@])],
  139. ,
  140. [enable_dbengine="detect"]
  141. )
  142. AC_ARG_ENABLE(
  143. [jsonc],
  144. [AS_HELP_STRING([--enable-jsonc], [Enable JSON-C support @<:@default autodetect@:>@])],
  145. ,
  146. [enable_jsonc="detect"]
  147. )
  148. # -----------------------------------------------------------------------------
  149. # netdata required checks
  150. # fails on centos6
  151. #AX_CHECK_ENABLE_DEBUG()
  152. AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
  153. AX_GCC_FUNC_ATTRIBUTE([malloc])
  154. AX_GCC_FUNC_ATTRIBUTE([noreturn])
  155. AX_GCC_FUNC_ATTRIBUTE([noinline])
  156. AX_GCC_FUNC_ATTRIBUTE([format])
  157. AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
  158. AC_CHECK_TYPES([struct timespec, clockid_t], [], [], [[#include <time.h>]])
  159. AC_SEARCH_LIBS([clock_gettime], [rt posix4])
  160. AC_CHECK_FUNCS([clock_gettime])
  161. AC_CHECK_FUNCS([sched_setscheduler sched_getscheduler sched_getparam sched_get_priority_min sched_get_priority_max getpriority setpriority nice])
  162. AC_CHECK_FUNCS([recvmmsg])
  163. AC_TYPE_INT8_T
  164. AC_TYPE_INT16_T
  165. AC_TYPE_INT32_T
  166. AC_TYPE_INT64_T
  167. AC_TYPE_UINT8_T
  168. AC_TYPE_UINT16_T
  169. AC_TYPE_UINT32_T
  170. AC_TYPE_UINT64_T
  171. AC_C_INLINE
  172. AC_FUNC_STRERROR_R
  173. AC_C__GENERIC
  174. AC_C___ATOMIC
  175. # AC_C_STMT_EXPR
  176. AC_CHECK_SIZEOF([void *])
  177. AC_CANONICAL_HOST
  178. AC_HEADER_MAJOR
  179. AC_HEADER_RESOLV
  180. AC_CHECK_HEADERS_ONCE([sys/prctl.h])
  181. AC_CHECK_HEADERS_ONCE([sys/vfs.h])
  182. AC_CHECK_HEADERS_ONCE([sys/statfs.h])
  183. AC_CHECK_HEADERS_ONCE([sys/statvfs.h])
  184. AC_CHECK_HEADERS_ONCE([sys/mount.h])
  185. if test "${enable_accept4}" != "no"; then
  186. AC_CHECK_FUNCS_ONCE(accept4)
  187. fi
  188. # -----------------------------------------------------------------------------
  189. # operating system detection
  190. AC_MSG_CHECKING([operating system])
  191. case "$host_os" in
  192. freebsd*)
  193. build_target=freebsd
  194. build_target_id=2
  195. CFLAGS="${CFLAGS} -I/usr/local/include -L/usr/local/lib"
  196. ;;
  197. darwin*)
  198. build_target=macos
  199. build_target_id=3
  200. LDFLAGS="${LDFLAGS} -framework CoreFoundation -framework IOKit"
  201. ;;
  202. *)
  203. build_target=linux
  204. build_target_id=1
  205. ;;
  206. esac
  207. AM_CONDITIONAL([FREEBSD], [test "${build_target}" = "freebsd"])
  208. AM_CONDITIONAL([MACOS], [test "${build_target}" = "macos"])
  209. AM_CONDITIONAL([LINUX], [test "${build_target}" = "linux"])
  210. AC_MSG_RESULT([${build_target} with id ${build_target_id}])
  211. # -----------------------------------------------------------------------------
  212. # pthreads
  213. ACX_PTHREAD(, [AC_MSG_ERROR([Cannot initialize pthread environment])])
  214. LIBS="${PTHREAD_LIBS} ${LIBS}"
  215. CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
  216. CC="${PTHREAD_CC}"
  217. # -----------------------------------------------------------------------------
  218. # libm
  219. AC_ARG_VAR([MATH_CFLAGS], [C compiler flags for math])
  220. AC_ARG_VAR([MATH_LIBS], [linker flags for math])
  221. if test -z "${MATH_LIBS}"; then
  222. AC_CHECK_LIB(
  223. [m],
  224. [sin],
  225. [MATH_LIBS="-lm"]
  226. )
  227. fi
  228. test "${with_math}" = "yes" -a -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found])
  229. AC_MSG_CHECKING([if libm should be used])
  230. if test "${with_math}" != "no" -a ! -z "${MATH_LIBS}"; then
  231. with_math="yes"
  232. AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability])
  233. OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}"
  234. OPTIONAL_MATH_LIBS="${MATH_LIBS}"
  235. else
  236. with_math="no"
  237. fi
  238. AC_MSG_RESULT([${with_math}])
  239. # -----------------------------------------------------------------------------
  240. # libuv multi-platform support library with a focus on asynchronous I/O
  241. # TODO: check version, uv_fs_scandir_next only available in version >= 1.0
  242. AC_CHECK_LIB(
  243. [uv],
  244. [uv_fs_scandir_next],
  245. [UV_LIBS="-luv"]
  246. )
  247. OPTIONAL_UV_CFLAGS="${UV_CFLAGS}"
  248. OPTIONAL_UV_LIBS="${UV_LIBS}"
  249. # -----------------------------------------------------------------------------
  250. # lz4 Extremely Fast Compression algorithm
  251. AC_CHECK_LIB(
  252. [lz4],
  253. [LZ4_decompress_safe],
  254. [LZ4_LIBS="-llz4"]
  255. )
  256. OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
  257. OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
  258. # -----------------------------------------------------------------------------
  259. # Judy General purpose dynamic array
  260. AC_CHECK_LIB(
  261. [Judy],
  262. [JudyLIns],
  263. [JUDY_LIBS="-lJudy"]
  264. )
  265. OPTIONAL_JUDY_CFLAGS="${JUDY_CFLAGS}"
  266. OPTIONAL_JUDY_LIBS="${JUDY_LIBS}"
  267. # -----------------------------------------------------------------------------
  268. # zlib
  269. PKG_CHECK_MODULES(
  270. [ZLIB],
  271. [zlib],
  272. [have_zlib=yes],
  273. [have_zlib=no]
  274. )
  275. test "${with_zlib}" = "yes" -a "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
  276. AC_MSG_CHECKING([if zlib should be used])
  277. if test "${with_zlib}" != "no" -a "${have_zlib}" = "yes"; then
  278. with_zlib="yes"
  279. AC_DEFINE([NETDATA_WITH_ZLIB], [1], [zlib usability])
  280. OPTIONAL_ZLIB_CFLAGS="${ZLIB_CFLAGS}"
  281. OPTIONAL_ZLIB_LIBS="${ZLIB_LIBS}"
  282. else
  283. with_zlib="no"
  284. fi
  285. AC_MSG_RESULT([${with_zlib}])
  286. # -----------------------------------------------------------------------------
  287. # libuuid
  288. PKG_CHECK_MODULES(
  289. [UUID],
  290. [uuid],
  291. [have_uuid=yes],
  292. [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])]
  293. )
  294. AC_DEFINE([NETDATA_WITH_UUID], [1], [uuid usability])
  295. OPTIONAL_UUID_CFLAGS="${UUID_CFLAGS}"
  296. OPTIONAL_UUID_LIBS="${UUID_LIBS}"
  297. # -----------------------------------------------------------------------------
  298. # OpenSSL Cryptography and SSL/TLS Toolkit
  299. AC_CHECK_LIB(
  300. [crypto],
  301. [SHA256_Init],
  302. [SSL_LIBS="-lcrypto -lssl"]
  303. )
  304. OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
  305. OPTIONAL_SSL_LIBS="${SSL_LIBS}"
  306. # -----------------------------------------------------------------------------
  307. # JSON-C library
  308. PKG_CHECK_MODULES([JSON],[json-c],AC_CHECK_LIB(
  309. [json-c],
  310. [json_object_get_type],
  311. [JSONC_LIBS="-ljson-c"]),AC_CHECK_LIB(
  312. [json],
  313. [json_object_get_type],
  314. [JSONC_LIBS="-ljson"])
  315. )
  316. OPTIONAL_JSONC_LIBS="${JSONC_LIBS}"
  317. # -----------------------------------------------------------------------------
  318. # DB engine and HTTPS
  319. test "${enable_dbengine}" = "yes" -a -z "${UV_LIBS}" && \
  320. AC_MSG_ERROR([libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.])
  321. test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \
  322. AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.])
  323. test "${enable_dbengine}" = "yes" -a -z "${JUDY_LIBS}" && \
  324. AC_MSG_ERROR([libJudy required but not found. Try installing 'libjudy-dev' or 'Judy-devel'.])
  325. test "${enable_dbengine}" = "yes" -o "${enable_https}" = "yes" -a -z "${SSL_LIBS}" && \
  326. AC_MSG_ERROR([OpenSSL required but not found. Try installing 'libssl-dev' or 'openssl-devel'.])
  327. AC_MSG_CHECKING([if netdata dbengine should be used])
  328. if test "${enable_dbengine}" != "no" -a "${UV_LIBS}" -a "${LZ4_LIBS}" -a "${JUDY_LIBS}" -a "${SSL_LIBS}"; then
  329. enable_dbengine="yes"
  330. AC_DEFINE([ENABLE_DBENGINE], [1], [netdata dbengine usability])
  331. else
  332. enable_dbengine="no"
  333. fi
  334. AC_MSG_RESULT([${enable_dbengine}])
  335. AM_CONDITIONAL([ENABLE_DBENGINE], [test "${enable_dbengine}" = "yes"])
  336. AC_MSG_CHECKING([if netdata https should be used])
  337. if test "${enable_https}" != "no" -a "${SSL_LIBS}"; then
  338. enable_https="yes"
  339. AC_DEFINE([ENABLE_HTTPS], [1], [netdata HTTPS usability])
  340. else
  341. enable_https="no"
  342. fi
  343. AC_MSG_RESULT([${enable_https}])
  344. AM_CONDITIONAL([ENABLE_HTTPS], [test "${enable_https}" = "yes"])
  345. # -----------------------------------------------------------------------------
  346. # JSON-C
  347. test "${enable_jsonc}" = "yes" -a -z "${JSONC_LIBS}" && \
  348. AC_MSG_ERROR([JSON-C required but not found. Try installing 'libjson-c-dev' or 'json-c'.])
  349. AC_MSG_CHECKING([if json-c should be used])
  350. if test "${enable_jsonc}" != "no" -a "${JSONC_LIBS}"; then
  351. enable_jsonc="yes"
  352. AC_DEFINE([ENABLE_JSONC], [1], [netdata json-c usability])
  353. else
  354. enable_jsonc="no"
  355. fi
  356. AC_MSG_RESULT([${enable_jsonc}])
  357. AM_CONDITIONAL([ENABLE_JSONC], [test "${enable_jsonc}" = "yes"])
  358. # -----------------------------------------------------------------------------
  359. # compiler options
  360. AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE])
  361. AS_CASE([$host_cpu],
  362. [i?86], [SSE_CANDIDATE="yes"]
  363. )
  364. AC_SUBST([SSE_CANDIDATE])
  365. if test "${SSE_CANDIDATE}" = "yes" -a "${enable_x86_sse}" = "yes"; then
  366. opt="-msse2 -mfpmath=sse"
  367. AX_CHECK_COMPILE_FLAG(${opt}, [CFLAGS="${CFLAGS} ${opt}"], [])
  368. fi
  369. if test "${GCC}" = "yes"; then
  370. AC_DEFINE_UNQUOTED([likely(x)], [__builtin_expect(!!(x), 1)], [gcc branch optimization])
  371. AC_DEFINE_UNQUOTED([unlikely(x)], [__builtin_expect(!!(x), 0)], [gcc branch optimization])
  372. else
  373. AC_DEFINE_UNQUOTED([likely(x)], [(x)], [gcc branch optimization])
  374. AC_DEFINE_UNQUOTED([unlikely(x)], [(x)], [gcc branch optimization])
  375. fi
  376. if test "${enable_pedantic}" = "yes"; then
  377. enable_strict="yes"
  378. CFLAGS="${CFLAGS} -pedantic -Wall -Wextra -Wno-long-long"
  379. fi
  380. # -----------------------------------------------------------------------------
  381. # memory allocation library
  382. AC_MSG_CHECKING([for memory allocator])
  383. TS_CHECK_JEMALLOC
  384. if test "$has_jemalloc" = "1"; then
  385. AC_DEFINE([ENABLE_JEMALLOC], [1], [compile and link with jemalloc])
  386. AC_MSG_RESULT([jemalloc])
  387. else
  388. TS_CHECK_TCMALLOC
  389. if test "$has_tcmalloc" = "1"; then
  390. AC_DEFINE([ENABLE_TCMALLOC], [1], [compile and link with tcmalloc])
  391. AC_MSG_RESULT([tcmalloc])
  392. else
  393. AC_MSG_RESULT([system])
  394. AC_C_MALLOPT
  395. AC_C_MALLINFO
  396. fi
  397. fi
  398. # -----------------------------------------------------------------------------
  399. # libcap
  400. PKG_CHECK_MODULES(
  401. [LIBCAP],
  402. [libcap],
  403. [AC_CHECK_LIB([cap], [cap_get_proc, cap_set_proc],
  404. [AC_CHECK_HEADER(
  405. [sys/capability.h],
  406. [have_libcap=yes],
  407. [have_libcap=no]
  408. )],
  409. [have_libcap=no]
  410. )],
  411. [have_libcap=no]
  412. )
  413. test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.])
  414. AC_MSG_CHECKING([if libcap should be used])
  415. if test "${with_libcap}" != "no" -a "${have_libcap}" = "yes"; then
  416. with_libcap="yes"
  417. AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability])
  418. OPTIONAL_LIBCAP_CFLAGS="${LIBCAP_CFLAGS}"
  419. OPTIONAL_LIBCAP_LIBS="${LIBCAP_LIBS}"
  420. else
  421. with_libcap="no"
  422. fi
  423. AC_MSG_RESULT([${with_libcap}])
  424. AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"])
  425. # -----------------------------------------------------------------------------
  426. # apps.plugin
  427. AC_MSG_CHECKING([if apps.plugin should be enabled])
  428. if test "${build_target}" != "macos"; then
  429. enable_plugin_apps="yes"
  430. else
  431. enable_plugin_apps="no"
  432. fi
  433. AC_MSG_RESULT([${enable_plugin_apps}])
  434. AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${enable_plugin_apps}" = "yes"])
  435. # -----------------------------------------------------------------------------
  436. # freeipmi.plugin - libipmimonitoring
  437. PKG_CHECK_MODULES(
  438. [IPMIMONITORING],
  439. [libipmimonitoring],
  440. [AC_CHECK_LIB([ipmimonitoring], [
  441. ipmi_monitoring_sensor_readings_by_record_id,
  442. ipmi_monitoring_sensor_readings_by_sensor_type,
  443. ipmi_monitoring_sensor_read_sensor_number,
  444. ipmi_monitoring_sensor_read_sensor_name,
  445. ipmi_monitoring_sensor_read_sensor_state,
  446. ipmi_monitoring_sensor_read_sensor_units,
  447. ipmi_monitoring_sensor_iterator_next,
  448. ipmi_monitoring_ctx_sensor_config_file,
  449. ipmi_monitoring_ctx_sdr_cache_directory,
  450. ipmi_monitoring_ctx_errormsg,
  451. ipmi_monitoring_ctx_create
  452. ],
  453. [AC_CHECK_HEADER(
  454. [ipmi_monitoring.h],
  455. [AC_CHECK_HEADER(
  456. [ipmi_monitoring_bitmasks.h],
  457. [have_ipmimonitoring=yes],
  458. [have_ipmimonitoring=no]
  459. )],
  460. [have_ipmimonitoring=no]
  461. )],
  462. [have_ipmimonitoring=no]
  463. )],
  464. [have_ipmimonitoring=no]
  465. )
  466. test "${enable_plugin_freeipmi}" = "yes" -a "${have_ipmimonitoring}" != "yes" && \
  467. AC_MSG_ERROR([ipmimonitoring required but not found. Try installing 'libipmimonitoring-dev' or 'libipmimonitoring-devel'])
  468. AC_MSG_CHECKING([if freeipmi.plugin should be enabled])
  469. if test "${enable_plugin_freeipmi}" != "no" -a "${have_ipmimonitoring}" = "yes"; then
  470. enable_plugin_freeipmi="yes"
  471. AC_DEFINE([HAVE_FREEIPMI], [1], [ipmimonitoring usability])
  472. OPTIONAL_IPMIMONITORING_CFLAGS="${IPMIMONITORING_CFLAGS}"
  473. OPTIONAL_IPMIMONITORING_LIBS="${IPMIMONITORING_LIBS}"
  474. else
  475. enable_plugin_freeipmi="no"
  476. fi
  477. AC_MSG_RESULT([${enable_plugin_freeipmi}])
  478. AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "yes"])
  479. # -----------------------------------------------------------------------------
  480. # cups.plugin - libcups
  481. # Only check most recently added method of cups
  482. AC_CHECK_LIB([cups], [httpConnect2],
  483. [AC_CHECK_HEADER(
  484. [cups/cups.h],
  485. [have_cups=yes],
  486. [have_cups=no]
  487. )],
  488. [have_cups=no]
  489. )
  490. test "${enable_plugin_cups}" = "yes" -a "${have_cups}" != "yes" && \
  491. AC_MSG_ERROR([cups required but not found. Try installing 'cups'])
  492. AC_ARG_WITH([cups-config],
  493. [AS_HELP_STRING([--with-cups-config=path], [Specify path to cups-config executable.])],
  494. [with_cups_config="$withval"],
  495. [with_cups_config=system]
  496. )
  497. AS_IF([test "x$with_cups_config" != "xsystem"], [
  498. CUPSCONFIG=$with_cups_config
  499. ], [
  500. AC_PATH_TOOL(CUPSCONFIG, [cups-config])
  501. AS_IF([test -z "$CUPSCONFIG"], [
  502. have_cups=no
  503. ])
  504. ])
  505. AC_MSG_CHECKING([if cups.plugin should be enabled])
  506. if test "${enable_plugin_cups}" != "no" -a "${have_cups}" = "yes"; then
  507. enable_plugin_cups="yes"
  508. AC_DEFINE([HAVE_CUPS], [1], [cups usability])
  509. CUPS_CFLAGS="${CUPS_CFLAGS} `$CUPSCONFIG --cflags`"
  510. CUPS_LIBS="${CUPS_LIBS} `$CUPSCONFIG --libs`"
  511. OPTIONAL_CUPS_CFLAGS="${CUPS_CFLAGS}"
  512. OPTIONAL_CUPS_LIBS="${CUPS_LIBS}"
  513. else
  514. enable_plugin_cups="no"
  515. fi
  516. AC_MSG_RESULT([${enable_plugin_cups}])
  517. AM_CONDITIONAL([ENABLE_PLUGIN_CUPS], [test "${enable_plugin_cups}" = "yes"])
  518. # -----------------------------------------------------------------------------
  519. # nfacct.plugin - libmnl, libnetfilter_acct
  520. AC_CHECK_HEADER(
  521. [linux/netfilter/nfnetlink_conntrack.h],
  522. [AC_CHECK_DECL(
  523. [CTA_STATS_MAX],
  524. [have_nfnetlink_conntrack=yes],
  525. [have_nfnetlink_conntrack=no],
  526. [#include <linux/netfilter/nfnetlink_conntrack.h>]
  527. )],
  528. [have_nfnetlink_conntrack=no]
  529. )
  530. PKG_CHECK_MODULES(
  531. [NFACCT],
  532. [libnetfilter_acct],
  533. [AC_CHECK_LIB(
  534. [netfilter_acct],
  535. [nfacct_alloc],
  536. [have_libnetfilter_acct=yes],
  537. [have_libnetfilter_acct=no]
  538. )],
  539. [have_libnetfilter_acct=no]
  540. )
  541. PKG_CHECK_MODULES(
  542. [LIBMNL],
  543. [libmnl],
  544. [AC_CHECK_LIB(
  545. [mnl],
  546. [mnl_socket_open],
  547. [have_libmnl=yes],
  548. [have_libmnl=no]
  549. )],
  550. [have_libmnl=no]
  551. )
  552. test "${enable_plugin_nfacct}" = "yes" -a "${have_nfnetlink_conntrack}" != "yes" && \
  553. AC_MSG_ERROR([nfnetlink_conntrack.h required but not found or too old])
  554. test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
  555. AC_MSG_ERROR([netfilter_acct required but not found])
  556. test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \
  557. AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
  558. AC_MSG_CHECKING([if nfacct.plugin should be enabled])
  559. if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" \
  560. -a "${have_libmnl}" = "yes" \
  561. -a "${have_nfnetlink_conntrack}" = "yes"; then
  562. enable_plugin_nfacct="yes"
  563. AC_DEFINE([HAVE_LIBMNL], [1], [libmnl usability])
  564. AC_DEFINE([HAVE_LIBNETFILTER_ACCT], [1], [libnetfilter_acct usability])
  565. OPTIONAL_NFACCT_CFLAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}"
  566. OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}"
  567. else
  568. enable_plugin_nfacct="no"
  569. fi
  570. AC_MSG_RESULT([${enable_plugin_nfacct}])
  571. AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"])
  572. # -----------------------------------------------------------------------------
  573. # xenstat.plugin - libxenstat
  574. PKG_CHECK_MODULES(
  575. [YAJL],
  576. [yajl],
  577. [AC_CHECK_LIB(
  578. [yajl],
  579. [yajl_tree_get],
  580. [have_libyajl=yes],
  581. [have_libyajl=no]
  582. )],
  583. [have_libyajl=no]
  584. )
  585. AC_CHECK_LIB(
  586. [xenstat],
  587. [xenstat_init],
  588. [AC_CHECK_HEADER(
  589. [xenstat.h],
  590. [have_libxenstat=yes],
  591. [have_libxenstat=no]
  592. )],
  593. [have_libxenstat=no],
  594. [-lyajl]
  595. )
  596. PKG_CHECK_MODULES(
  597. [XENLIGHT],
  598. [xenlight],
  599. [AC_CHECK_LIB(
  600. [xenlight],
  601. [libxl_domain_info],
  602. [AC_CHECK_HEADER(
  603. [libxl.h],
  604. [have_libxenlight=yes],
  605. [have_libxenlight=no]
  606. )],
  607. [have_libxenlight=no]
  608. )],
  609. [have_libxenlight=no]
  610. )
  611. test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenstat}" != "yes" && \
  612. AC_MSG_ERROR([libxenstat required but not found. try installing 'xen-dom0-libs-devel'])
  613. test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenlight}" != "yes" && \
  614. AC_MSG_ERROR([libxenlight required but not found. try installing 'xen-dom0-libs-devel'])
  615. test "${enable_plugin_xenstat}" = "yes" -a "${have_libyajl}" != "yes" && \
  616. AC_MSG_ERROR([libyajl required but not found. Try installing 'yajl-devel'])
  617. AC_MSG_CHECKING([if xenstat.plugin should be enabled])
  618. if test "${enable_plugin_xenstat}" != "no" -a "${have_libxenstat}" = "yes" -a "${have_libxenlight}" = "yes" -a "${have_libyajl}" = "yes"; then
  619. enable_plugin_xenstat="yes"
  620. AC_DEFINE([HAVE_LIBXENSTAT], [1], [libxenstat usability])
  621. AC_DEFINE([HAVE_LIBXENLIGHT], [1], [libxenlight usability])
  622. AC_DEFINE([HAVE_LIBYAJL], [1], [libyajl usability])
  623. OPTIONAL_XENSTAT_CFLAGS="${XENLIGHT_CFLAGS} ${YAJL_CFLAGS}"
  624. OPTIONAL_XENSTAT_LIBS="-lxenstat ${XENLIGHT_LIBS} ${YAJL_LIBS}"
  625. else
  626. enable_plugin_xenstat="no"
  627. fi
  628. AC_MSG_RESULT([${enable_plugin_xenstat}])
  629. AM_CONDITIONAL([ENABLE_PLUGIN_XENSTAT], [test "${enable_plugin_xenstat}" = "yes"])
  630. # -----------------------------------------------------------------------------
  631. # perf.plugin
  632. AC_CHECK_HEADER(
  633. [linux/perf_event.h],
  634. [AC_CHECK_DECL(
  635. [PERF_COUNT_HW_REF_CPU_CYCLES],
  636. [have_perf_event=yes],
  637. [have_perf_event=no],
  638. [#include <linux/perf_event.h>]
  639. )],
  640. [have_perf_event=no]
  641. )
  642. AC_MSG_CHECKING([if perf.plugin should be enabled])
  643. if test "${build_target}" == "linux" -a "${have_perf_event}" = "yes"; then
  644. enable_plugin_perf="yes"
  645. else
  646. enable_plugin_perf="no"
  647. fi
  648. AC_MSG_RESULT([${enable_plugin_perf}])
  649. AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"])
  650. # -----------------------------------------------------------------------------
  651. # AWS Kinesis backend - libaws-cpp-sdk-kinesis, libaws-cpp-sdk-core, libssl, libcrypto, libcurl
  652. PKG_CHECK_MODULES(
  653. [LIBCRYPTO],
  654. [libcrypto],
  655. [AC_CHECK_LIB(
  656. [crypto],
  657. [CRYPTO_new_ex_data],
  658. [have_libcrypto=yes],
  659. [have_libcrypto=no]
  660. )],
  661. [have_libcrypto=no]
  662. )
  663. PKG_CHECK_MODULES(
  664. [LIBSSL],
  665. [libssl],
  666. [AC_CHECK_LIB(
  667. [ssl],
  668. [SSL_connect],
  669. [have_libssl=yes],
  670. [have_libssl=no]
  671. )],
  672. [have_libssl=no]
  673. )
  674. PKG_CHECK_MODULES(
  675. [LIBCURL],
  676. [libcurl],
  677. [AC_CHECK_LIB(
  678. [curl],
  679. [curl_easy_init],
  680. [have_libcurl=yes],
  681. [have_libcurl=no]
  682. )],
  683. [have_libcurl=no]
  684. )
  685. AC_CHECK_LIB(
  686. [aws-cpp-sdk-core],
  687. [cJSON_free],
  688. [have_libaws_cpp_sdk_core=yes],
  689. [have_libaws_cpp_sdk_core=no],
  690. [${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}]
  691. )
  692. AC_MSG_CHECKING([for Aws::Kinesis::Model::PutRecordRequest in -laws-cpp-sdk-kinesis])
  693. if test "${have_libaws_cpp_sdk_core}" = "yes" -a "${have_libcrypto}" = "yes" -a "${have_libssl}" = "yes" -a "${have_libcurl}" = "yes"; then
  694. AC_LANG_SAVE
  695. AC_LANG_CPLUSPLUS
  696. save_LIBS="${LIBS}"
  697. LIBS="-laws-cpp-sdk-kinesis -laws-cpp-sdk-core ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}"
  698. save_CXXFLAGS="${CXXFLAGS}"
  699. CXXFLAGS="${CXXFLAGS} -std=c++11"
  700. AC_TRY_LINK(
  701. [
  702. #include <aws/core/Aws.h>
  703. #include <aws/core/client/ClientConfiguration.h>
  704. #include <aws/core/auth/AWSCredentials.h>
  705. #include <aws/core/utils/Outcome.h>
  706. #include <aws/kinesis/KinesisClient.h>
  707. #include <aws/kinesis/model/PutRecordRequest.h>
  708. ],
  709. [Aws::Kinesis::Model::PutRecordRequest request;],
  710. [have_libaws_cpp_sdk_kinesis=yes],
  711. [have_libaws_cpp_sdk_kinesis=no]
  712. )
  713. LIBS="${save_LIBS}"
  714. CXXFLAGS="${save_CXXFLAGS}"
  715. AC_LANG_RESTORE
  716. else
  717. have_libaws_cpp_sdk_kinesis=no
  718. fi
  719. AC_MSG_RESULT([${have_libaws_cpp_sdk_kinesis}])
  720. test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_kinesis}" != "yes" && \
  721. AC_MSG_ERROR([libaws-cpp-sdk-kinesis required but not found. try installing AWS C++ SDK])
  722. test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" != "yes" && \
  723. AC_MSG_ERROR([libaws-cpp-sdk-core required but not found. try installing AWS C++ SDK])
  724. test "${enable_backend_kinesis}" = "yes" -a "${have_libcurl}" != "yes" && \
  725. AC_MSG_ERROR([libcurl required but not found])
  726. test "${enable_backend_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \
  727. AC_MSG_ERROR([libssl required but not found])
  728. test "${enable_backend_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \
  729. AC_MSG_ERROR([libcrypto required but not found])
  730. AC_MSG_CHECKING([if kinesis backend should be enabled])
  731. if test "${enable_backend_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" = "yes" \
  732. -a "${have_libcurl}" = "yes" -a "${have_libssl}" = "yes" -a "${have_libcrypto}" = "yes"; then
  733. enable_backend_kinesis="yes"
  734. AC_DEFINE([HAVE_KINESIS], [1], [libaws-cpp-sdk-kinesis usability])
  735. OPTIONAL_KINESIS_CFLAGS="${LIBCRYPTO_CFLAGS} ${LIBSSL_CFLAGS} ${LIBCURL_CFLAGS}"
  736. CXX11FLAG="-std=c++11"
  737. OPTIONAL_KINESIS_LIBS="-laws-cpp-sdk-kinesis -laws-cpp-sdk-core ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}"
  738. else
  739. enable_backend_kinesis="no"
  740. fi
  741. AC_MSG_RESULT([${enable_backend_kinesis}])
  742. AM_CONDITIONAL([ENABLE_BACKEND_KINESIS], [test "${enable_backend_kinesis}" = "yes"])
  743. # -----------------------------------------------------------------------------
  744. # Prometheus remote write backend - libprotobuf, libsnappy, protoc
  745. PKG_CHECK_MODULES(
  746. [PROTOBUF],
  747. [protobuf],
  748. [have_libprotobuf=yes],
  749. [have_libprotobuf=no]
  750. )
  751. PKG_CHECK_MODULES(
  752. [SNAPPY],
  753. [snappy],
  754. [have_libsnappy=yes],
  755. [have_libsnappy=no]
  756. )
  757. AC_PATH_PROG([PROTOC], [protoc], [no])
  758. AS_IF(
  759. [test x"${PROTOC}" == x"no"],
  760. [have_protoc=no],
  761. [have_protoc=yes]
  762. )
  763. AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
  764. AS_IF(
  765. [test x"${CXX_BINARY}" == x"no"],
  766. [have_CXX_compiler=no],
  767. [have_CXX_compiler=yes]
  768. )
  769. test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_libprotobuf}" != "yes" && \
  770. AC_MSG_ERROR([libprotobuf required but not found. try installing protobuf])
  771. test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_libsnappy}" != "yes" && \
  772. AC_MSG_ERROR([libsnappy required but not found. try installing snappy])
  773. test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_protoc}" != "yes" && \
  774. AC_MSG_ERROR([protoc compiler required but not found. try installing protobuf])
  775. test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \
  776. AC_MSG_ERROR([C++ compiler required but not found. try installing g++])
  777. AC_MSG_CHECKING([if prometheus remote write backend should be enabled])
  778. if test "${enable_backend_prometeus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \
  779. -a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
  780. enable_backend_prometheus_remote_write="yes"
  781. AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
  782. OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS}"
  783. CXX11FLAG="-std=c++11"
  784. OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS} "
  785. else
  786. enable_backend_prometheus_remote_write="no"
  787. fi
  788. AC_MSG_RESULT([${enable_backend_prometheus_remote_write}])
  789. AM_CONDITIONAL([ENABLE_BACKEND_PROMETHEUS_REMOTE_WRITE], [test "${enable_backend_prometheus_remote_write}" = "yes"])
  790. # -----------------------------------------------------------------------------
  791. # check for setns() - cgroup-network
  792. AC_CHECK_FUNC([setns])
  793. AC_MSG_CHECKING([if cgroup-network can be enabled])
  794. if test "$ac_cv_func_setns" = "yes" ; then
  795. have_setns="yes"
  796. AC_DEFINE([HAVE_SETNS], [1], [Define 1 if you have setns() function])
  797. else
  798. have_setns="no"
  799. fi
  800. AC_MSG_RESULT([${have_setns}])
  801. AM_CONDITIONAL([ENABLE_PLUGIN_CGROUP_NETWORK], [test "${have_setns}" = "yes"])
  802. # -----------------------------------------------------------------------------
  803. # Link-Time-Optimization
  804. if test "${enable_lto}" != "no"; then
  805. opt="-flto"
  806. AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no])
  807. fi
  808. if test "${have_lto}" = "yes"; then
  809. oCFLAGS="${CFLAGS}"
  810. CFLAGS="${CFLAGS} -flto ${OPTIONAL_MATH_CFLAGS} ${OPTIONAL_NFACCT_CFLAGS} ${OPTIONAL_ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CFLAGS} ${OPTIONAL_XENSTAT_FLAGS} ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS}"
  811. ac_cv_c_lto_cross_compile="${enable_lto}"
  812. test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no"
  813. AC_C_LTO
  814. CFLAGS="${oCFLAGS}"
  815. test "${ac_cv_c_lto}" != "yes" && have_lto="no"
  816. fi
  817. test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
  818. AC_MSG_ERROR([LTO is required but is not available.])
  819. AC_MSG_CHECKING([if LTO should be enabled])
  820. if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then
  821. enable_lto="yes"
  822. CFLAGS="${CFLAGS} -flto"
  823. else
  824. enable_lto="no"
  825. fi
  826. AC_MSG_RESULT([${enable_lto}])
  827. # -----------------------------------------------------------------------------
  828. AM_CONDITIONAL([ENABLE_CXX_LINKER], [test "${enable_backend_kinesis}" = "yes" -o "${enable_backend_prometheus_remote_write}" = "yes"])
  829. AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged])
  830. varlibdir="${localstatedir}/lib/netdata"
  831. registrydir="${localstatedir}/lib/netdata/registry"
  832. cachedir="${localstatedir}/cache/netdata"
  833. chartsdir="${libexecdir}/netdata/charts.d"
  834. nodedir="${libexecdir}/netdata/node.d"
  835. pythondir="${libexecdir}/netdata/python.d"
  836. configdir="${sysconfdir}/netdata"
  837. libconfigdir="${libdir}/netdata/conf.d"
  838. logdir="${localstatedir}/log/netdata"
  839. pluginsdir="${libexecdir}/netdata/plugins.d"
  840. AC_SUBST([build_target])
  841. AC_SUBST([varlibdir])
  842. AC_SUBST([registrydir])
  843. AC_SUBST([cachedir])
  844. AC_SUBST([chartsdir])
  845. AC_SUBST([nodedir])
  846. AC_SUBST([pythondir])
  847. AC_SUBST([configdir])
  848. AC_SUBST([libconfigdir])
  849. AC_SUBST([logdir])
  850. AC_SUBST([pluginsdir])
  851. AC_SUBST([webdir])
  852. CXXFLAGS="${CFLAGS} ${CXX11FLAG}"
  853. CPPFLAGS="\
  854. -DTARGET_OS=${build_target_id} \
  855. -DVARLIB_DIR=\"\\\"${varlibdir}\\\"\" \
  856. -DCACHE_DIR=\"\\\"${cachedir}\\\"\" \
  857. -DCONFIG_DIR=\"\\\"${configdir}\\\"\" \
  858. -DLIBCONFIG_DIR=\"\\\"${libconfigdir}\\\"\" \
  859. -DLOG_DIR=\"\\\"${logdir}\\\"\" \
  860. -DPLUGINS_DIR=\"\\\"${pluginsdir}\\\"\" \
  861. -DRUN_DIR=\"\\\"${localstatedir}/run/netdata\\\"\" \
  862. -DWEB_DIR=\"\\\"${webdir}\\\"\" \
  863. "
  864. AC_SUBST([OPTIONAL_MATH_CFLAGS])
  865. AC_SUBST([OPTIONAL_MATH_LIBS])
  866. AC_SUBST([OPTIONAL_UV_LIBS])
  867. AC_SUBST([OPTIONAL_LZ4_LIBS])
  868. AC_SUBST([OPTIONAL_JUDY_LIBS])
  869. AC_SUBST([OPTIONAL_SSL_LIBS])
  870. AC_SUBST([OPTIONAL_JSONC_LIBS])
  871. AC_SUBST([OPTIONAL_NFACCT_CFLAGS])
  872. AC_SUBST([OPTIONAL_NFACCT_LIBS])
  873. AC_SUBST([OPTIONAL_ZLIB_CFLAGS])
  874. AC_SUBST([OPTIONAL_ZLIB_LIBS])
  875. AC_SUBST([OPTIONAL_UUID_CFLAGS])
  876. AC_SUBST([OPTIONAL_UUID_LIBS])
  877. AC_SUBST([OPTIONAL_LIBCAP_CFLAGS])
  878. AC_SUBST([OPTIONAL_LIBCAP_LIBS])
  879. AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS])
  880. AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS])
  881. AC_SUBST([OPTIONAL_CUPS_CFLAGS])
  882. AC_SUBST([OPTIONAL_CUPS_LIBS])
  883. AC_SUBST([OPTIONAL_XENSTAT_CFLAGS])
  884. AC_SUBST([OPTIONAL_XENSTAT_LIBS])
  885. AC_SUBST([OPTIONAL_KINESIS_CFLAGS])
  886. AC_SUBST([OPTIONAL_KINESIS_LIBS])
  887. AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS])
  888. AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS])
  889. AC_CONFIG_FILES([
  890. Makefile
  891. netdata.spec
  892. backends/graphite/Makefile
  893. backends/json/Makefile
  894. backends/Makefile
  895. backends/opentsdb/Makefile
  896. backends/prometheus/Makefile
  897. backends/prometheus/remote_write/Makefile
  898. backends/aws_kinesis/Makefile
  899. collectors/Makefile
  900. collectors/apps.plugin/Makefile
  901. collectors/cgroups.plugin/Makefile
  902. collectors/charts.d.plugin/Makefile
  903. collectors/checks.plugin/Makefile
  904. collectors/diskspace.plugin/Makefile
  905. collectors/fping.plugin/Makefile
  906. collectors/ioping.plugin/Makefile
  907. collectors/freebsd.plugin/Makefile
  908. collectors/freeipmi.plugin/Makefile
  909. collectors/cups.plugin/Makefile
  910. collectors/idlejitter.plugin/Makefile
  911. collectors/macos.plugin/Makefile
  912. collectors/nfacct.plugin/Makefile
  913. collectors/node.d.plugin/Makefile
  914. collectors/plugins.d/Makefile
  915. collectors/proc.plugin/Makefile
  916. collectors/python.d.plugin/Makefile
  917. collectors/statsd.plugin/Makefile
  918. collectors/tc.plugin/Makefile
  919. collectors/xenstat.plugin/Makefile
  920. collectors/perf.plugin/Makefile
  921. daemon/Makefile
  922. database/Makefile
  923. database/engine/Makefile
  924. diagrams/Makefile
  925. health/Makefile
  926. health/notifications/Makefile
  927. libnetdata/Makefile
  928. libnetdata/adaptive_resortable_list/Makefile
  929. libnetdata/avl/Makefile
  930. libnetdata/buffer/Makefile
  931. libnetdata/clocks/Makefile
  932. libnetdata/config/Makefile
  933. libnetdata/dictionary/Makefile
  934. libnetdata/eval/Makefile
  935. libnetdata/locks/Makefile
  936. libnetdata/log/Makefile
  937. libnetdata/popen/Makefile
  938. libnetdata/procfile/Makefile
  939. libnetdata/simple_pattern/Makefile
  940. libnetdata/socket/Makefile
  941. libnetdata/statistical/Makefile
  942. libnetdata/storage_number/Makefile
  943. libnetdata/threads/Makefile
  944. libnetdata/url/Makefile
  945. libnetdata/json/Makefile
  946. libnetdata/health/Makefile
  947. registry/Makefile
  948. streaming/Makefile
  949. system/Makefile
  950. tests/Makefile
  951. web/Makefile
  952. web/api/Makefile
  953. web/api/badges/Makefile
  954. web/api/exporters/Makefile
  955. web/api/exporters/shell/Makefile
  956. web/api/exporters/prometheus/Makefile
  957. web/api/formatters/Makefile
  958. web/api/formatters/csv/Makefile
  959. web/api/formatters/json/Makefile
  960. web/api/formatters/ssv/Makefile
  961. web/api/formatters/value/Makefile
  962. web/api/queries/Makefile
  963. web/api/queries/average/Makefile
  964. web/api/queries/des/Makefile
  965. web/api/queries/incremental_sum/Makefile
  966. web/api/queries/max/Makefile
  967. web/api/queries/median/Makefile
  968. web/api/queries/min/Makefile
  969. web/api/queries/ses/Makefile
  970. web/api/queries/stddev/Makefile
  971. web/api/queries/sum/Makefile
  972. web/api/health/Makefile
  973. web/gui/Makefile
  974. web/server/Makefile
  975. web/server/static/Makefile
  976. ])
  977. AC_OUTPUT
  978. test "${with_math}" != "yes" && AC_MSG_WARN([You are building without math. math allows accurate calculations. It should be enabled.]) || :
  979. 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.]) || :