configure.ac 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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. define([VERSION_MAJOR], [1])
  7. define([VERSION_MINOR], [11])
  8. define([VERSION_FIX], [1])
  9. define([VERSION_NUMBER], VERSION_MAJOR[.]VERSION_MINOR[.]VERSION_FIX)
  10. # We do not use m4_esyscmd_s to support older autoconf.
  11. define([VERSION_STRING], m4_esyscmd(git describe 2>/dev/null | sed 's/^v//' | tr -d '\n'))
  12. m4_ifval(VERSION_STRING, [], [define([VERSION_STRING], VERSION_NUMBER)])
  13. AC_INIT([netdata], VERSION_STRING[])
  14. AM_MAINTAINER_MODE([disable])
  15. if test x"$USE_MAINTAINER_MODE" = xyes; then
  16. AC_MSG_NOTICE(***************** MAINTAINER MODE *****************)
  17. PACKAGE_BUILT_DATE=$(date '+%d %b %Y')
  18. fi
  19. PACKAGE_RPM_VERSION="VERSION_NUMBER"
  20. AC_SUBST([PACKAGE_RPM_VERSION])
  21. # -----------------------------------------------------------------------------
  22. # autoconf initialization
  23. AC_CONFIG_AUX_DIR([.])
  24. AC_CONFIG_HEADERS([config.h])
  25. AC_CONFIG_MACRO_DIR([build/m4])
  26. AC_CONFIG_SRCDIR([daemon/main.c])
  27. define([AUTOMATE_INIT_OPTIONS], [tar-pax subdir-objects])
  28. m4_ifdef([AM_SILENT_RULES], [
  29. define([AUTOMATE_INIT_OPTIONS], [tar-pax silent-rules subdir-objects])
  30. ])
  31. AM_INIT_AUTOMAKE(AUTOMATE_INIT_OPTIONS)
  32. m4_ifdef([AM_SILENT_RULES], [
  33. AM_SILENT_RULES([yes])
  34. ])
  35. AC_CANONICAL_HOST
  36. AC_PROG_CC
  37. AM_PROG_CC_C_O
  38. AC_PROG_INSTALL
  39. PKG_PROG_PKG_CONFIG
  40. AC_USE_SYSTEM_EXTENSIONS
  41. # -----------------------------------------------------------------------------
  42. # configurable options
  43. AC_ARG_ENABLE(
  44. [plugin-nfacct],
  45. [AS_HELP_STRING([--enable-plugin-nfacct], [enable nfacct plugin, requires running netdata as root @<:@default disabled@:>@])],
  46. ,
  47. [enable_plugin_nfacct="no"]
  48. )
  49. AC_ARG_ENABLE(
  50. [plugin-freeipmi],
  51. [AS_HELP_STRING([--enable-plugin-freeipmi], [enable freeipmi plugin @<:@default autodetect@:>@])],
  52. ,
  53. [enable_plugin_freeipmi="detect"]
  54. )
  55. AC_ARG_ENABLE(
  56. [pedantic],
  57. [AS_HELP_STRING([--enable-pedantic], [enable pedantic compiler warnings @<:@default disabled@:>@])],
  58. ,
  59. [enable_pedantic="no"]
  60. )
  61. AC_ARG_ENABLE(
  62. [accept4],
  63. [AS_HELP_STRING([--disable-accept4], [System does not have accept4 @<:@default autodetect@:>@])],
  64. ,
  65. [enable_accept4="detect"]
  66. )
  67. AC_ARG_WITH(
  68. [webdir],
  69. [AS_HELP_STRING([--with-webdir], [location of webdir @<:@PKGDATADIR/web@:>@])],
  70. [webdir="${withval}"],
  71. [webdir="\$(pkgdatadir)/web"]
  72. )
  73. AC_ARG_WITH(
  74. [libcap],
  75. [AS_HELP_STRING([--with-libcap], [build with libcap @<:@default autodetect@:>@])],
  76. ,
  77. [with_libcap="detect"]
  78. )
  79. AC_ARG_WITH(
  80. [zlib],
  81. [AS_HELP_STRING([--without-zlib], [build without zlib @<:@default enabled@:>@])],
  82. ,
  83. [with_zlib="yes"]
  84. )
  85. AC_ARG_WITH(
  86. [math],
  87. [AS_HELP_STRING([--without-math], [build without math @<:@default enabled@:>@])],
  88. ,
  89. [with_math="yes"]
  90. )
  91. AC_ARG_WITH(
  92. [user],
  93. [AS_HELP_STRING([--with-user], [use this user to drop privilege @<:@default nobody@:>@])],
  94. ,
  95. [with_user="nobody"]
  96. )
  97. AC_ARG_ENABLE(
  98. [x86-sse],
  99. [AS_HELP_STRING([--disable-x86-sse], [SSE/SS2 optimizations on x86 @<:@default enabled@:>@])],
  100. ,
  101. [enable_x86_sse="yes"]
  102. )
  103. AC_ARG_ENABLE(
  104. [lto],
  105. [AS_HELP_STRING([--disable-lto], [Link Time Optimizations @<:@default autodetect@:>@])],
  106. ,
  107. [enable_lto="detect"]
  108. )
  109. # -----------------------------------------------------------------------------
  110. # netdata required checks
  111. # fails on centos6
  112. #AX_CHECK_ENABLE_DEBUG()
  113. AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
  114. AX_GCC_FUNC_ATTRIBUTE([malloc])
  115. AX_GCC_FUNC_ATTRIBUTE([noreturn])
  116. AX_GCC_FUNC_ATTRIBUTE([noinline])
  117. AX_GCC_FUNC_ATTRIBUTE([format])
  118. AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
  119. AC_CHECK_TYPES([struct timespec, clockid_t], [], [], [[#include <time.h>]])
  120. AC_SEARCH_LIBS([clock_gettime], [rt posix4])
  121. AC_CHECK_FUNCS([clock_gettime])
  122. AC_CHECK_FUNCS([sched_setscheduler sched_getscheduler sched_getparam sched_get_priority_min sched_get_priority_max getpriority setpriority nice])
  123. AC_CHECK_FUNCS([recvmmsg])
  124. AC_TYPE_INT8_T
  125. AC_TYPE_INT16_T
  126. AC_TYPE_INT32_T
  127. AC_TYPE_INT64_T
  128. AC_TYPE_UINT8_T
  129. AC_TYPE_UINT16_T
  130. AC_TYPE_UINT32_T
  131. AC_TYPE_UINT64_T
  132. AC_C_INLINE
  133. AC_FUNC_STRERROR_R
  134. AC_C__GENERIC
  135. AC_C___ATOMIC
  136. # AC_C_STMT_EXPR
  137. AC_CHECK_SIZEOF([void *])
  138. AC_CANONICAL_HOST
  139. AC_HEADER_MAJOR
  140. AC_HEADER_RESOLV
  141. AC_CHECK_HEADERS_ONCE([sys/prctl.h])
  142. AC_CHECK_HEADERS_ONCE([sys/vfs.h])
  143. AC_CHECK_HEADERS_ONCE([sys/statfs.h])
  144. AC_CHECK_HEADERS_ONCE([sys/statvfs.h])
  145. AC_CHECK_HEADERS_ONCE([sys/mount.h])
  146. if test "${enable_accept4}" != "no"; then
  147. AC_CHECK_FUNCS_ONCE(accept4)
  148. fi
  149. # -----------------------------------------------------------------------------
  150. # operating system detection
  151. AC_MSG_CHECKING([operating system])
  152. case "$host_os" in
  153. freebsd*)
  154. build_target=freebsd
  155. build_target_id=2
  156. CFLAGS="${CFLAGS} -I/usr/local/include"
  157. ;;
  158. darwin*)
  159. build_target=macos
  160. build_target_id=3
  161. LDFLAGS="${LDFLAGS} -framework CoreFoundation -framework IOKit"
  162. ;;
  163. *)
  164. build_target=linux
  165. build_target_id=1
  166. ;;
  167. esac
  168. AM_CONDITIONAL([FREEBSD], [test "${build_target}" = "freebsd"])
  169. AM_CONDITIONAL([MACOS], [test "${build_target}" = "macos"])
  170. AM_CONDITIONAL([LINUX], [test "${build_target}" = "linux"])
  171. AC_MSG_RESULT([${build_target} with id ${build_target_id}])
  172. # -----------------------------------------------------------------------------
  173. # pthreads
  174. ACX_PTHREAD(, [AC_MSG_ERROR([Cannot initialize pthread environment])])
  175. LIBS="${PTHREAD_LIBS} ${LIBS}"
  176. CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
  177. CC="${PTHREAD_CC}"
  178. # -----------------------------------------------------------------------------
  179. # libm
  180. AC_ARG_VAR([MATH_CFLAGS], [C compiler flags for math])
  181. AC_ARG_VAR([MATH_LIBS], [linker flags for math])
  182. if test -z "${MATH_LIBS}"; then
  183. AC_CHECK_LIB(
  184. [m],
  185. [sin],
  186. [MATH_LIBS="-lm"]
  187. )
  188. fi
  189. test "${with_math}" = "yes" -a -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found])
  190. AC_MSG_CHECKING([if libm should be used])
  191. if test "${with_math}" != "no" -a ! -z "${MATH_LIBS}"; then
  192. with_math="yes"
  193. AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability])
  194. OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}"
  195. OPTIONAL_MATH_LIBS="${MATH_LIBS}"
  196. else
  197. with_math="no"
  198. fi
  199. AC_MSG_RESULT([${with_math}])
  200. # -----------------------------------------------------------------------------
  201. # zlib
  202. PKG_CHECK_MODULES(
  203. [ZLIB],
  204. [zlib],
  205. [have_zlib=yes],
  206. [have_zlib=no]
  207. )
  208. test "${with_zlib}" = "yes" -a "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
  209. AC_MSG_CHECKING([if zlib should be used])
  210. if test "${with_zlib}" != "no" -a "${have_zlib}" = "yes"; then
  211. with_zlib="yes"
  212. AC_DEFINE([NETDATA_WITH_ZLIB], [1], [zlib usability])
  213. OPTIONAL_ZLIB_CLFAGS="${ZLIB_CFLAGS}"
  214. OPTIONAL_ZLIB_LIBS="${ZLIB_LIBS}"
  215. else
  216. with_zlib="no"
  217. fi
  218. AC_MSG_RESULT([${with_zlib}])
  219. # -----------------------------------------------------------------------------
  220. # libuuid
  221. PKG_CHECK_MODULES(
  222. [UUID],
  223. [uuid],
  224. [have_uuid=yes],
  225. [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])]
  226. )
  227. AC_DEFINE([NETDATA_WITH_UUID], [1], [uuid usability])
  228. OPTIONAL_UUID_CLFAGS="${UUID_CFLAGS}"
  229. OPTIONAL_UUID_LIBS="${UUID_LIBS}"
  230. # -----------------------------------------------------------------------------
  231. # compiler options
  232. AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE])
  233. AS_CASE([$host_cpu],
  234. [i?86], [SSE_CANDIDATE="yes"]
  235. )
  236. AC_SUBST([SSE_CANDIDATE])
  237. if test "${SSE_CANDIDATE}" = "yes" -a "${enable_x86_sse}" = "yes"; then
  238. opt="-msse2 -mfpmath=sse"
  239. AX_CHECK_COMPILE_FLAG(${opt}, [CFLAGS="${CFLAGS} ${opt}"], [])
  240. fi
  241. if test "${GCC}" = "yes"; then
  242. AC_DEFINE_UNQUOTED([likely(x)], [__builtin_expect(!!(x), 1)], [gcc branch optimization])
  243. AC_DEFINE_UNQUOTED([unlikely(x)], [__builtin_expect(!!(x), 0)], [gcc branch optimization])
  244. else
  245. AC_DEFINE_UNQUOTED([likely(x)], [(x)], [gcc branch optimization])
  246. AC_DEFINE_UNQUOTED([unlikely(x)], [(x)], [gcc branch optimization])
  247. fi
  248. if test "${enable_pedantic}" = "yes"; then
  249. enable_strict="yes"
  250. CFLAGS="${CFLAGS} -pedantic -Wall -Wextra -Wno-long-long"
  251. fi
  252. # -----------------------------------------------------------------------------
  253. # memory allocation library
  254. AC_MSG_CHECKING([for memory allocator])
  255. TS_CHECK_JEMALLOC
  256. if test "$has_jemalloc" = "1"; then
  257. AC_DEFINE([ENABLE_JEMALLOC], [1], [compile and link with jemalloc])
  258. AC_MSG_RESULT([jemalloc])
  259. else
  260. TS_CHECK_TCMALLOC
  261. if test "$has_tcmalloc" = "1"; then
  262. AC_DEFINE([ENABLE_TCMALLOC], [1], [compile and link with tcmalloc])
  263. AC_MSG_RESULT([tcmalloc])
  264. else
  265. AC_MSG_RESULT([system])
  266. AC_C_MALLOPT
  267. AC_C_MALLINFO
  268. fi
  269. fi
  270. # -----------------------------------------------------------------------------
  271. # libcap
  272. PKG_CHECK_MODULES(
  273. [LIBCAP],
  274. [libcap],
  275. [AC_CHECK_LIB([cap], [cap_get_proc, cap_set_proc],
  276. [AC_CHECK_HEADER(
  277. [sys/capability.h],
  278. [have_libcap=yes],
  279. [have_libcap=no]
  280. )],
  281. [have_libcap=no]
  282. )],
  283. [have_libcap=no]
  284. )
  285. test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.])
  286. AC_MSG_CHECKING([if libcap should be used])
  287. if test "${with_libcap}" != "no" -a "${have_libcap}" = "yes"; then
  288. with_libcap="yes"
  289. AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability])
  290. OPTIONAL_LIBCAP_CLFAGS="${LIBCAP_CFLAGS}"
  291. OPTIONAL_LIBCAP_LIBS="${LIBCAP_LIBS}"
  292. else
  293. with_libcap="no"
  294. fi
  295. AC_MSG_RESULT([${with_libcap}])
  296. AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"])
  297. # -----------------------------------------------------------------------------
  298. # apps.plugin
  299. AC_MSG_CHECKING([if apps.plugin should be enabled])
  300. if test "${build_target}" != "macos"; then
  301. enable_plugin_apps="yes"
  302. else
  303. enable_plugin_apps="no"
  304. fi
  305. AC_MSG_RESULT([${enable_plugin_apps}])
  306. AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${enable_plugin_apps}" = "yes"])
  307. # -----------------------------------------------------------------------------
  308. # freeipmi.plugin - libipmimonitoring
  309. PKG_CHECK_MODULES(
  310. [IPMIMONITORING],
  311. [libipmimonitoring],
  312. [AC_CHECK_LIB([ipmimonitoring], [
  313. ipmi_monitoring_sensor_readings_by_record_id,
  314. ipmi_monitoring_sensor_readings_by_sensor_type,
  315. ipmi_monitoring_sensor_read_sensor_number,
  316. ipmi_monitoring_sensor_read_sensor_name,
  317. ipmi_monitoring_sensor_read_sensor_state,
  318. ipmi_monitoring_sensor_read_sensor_units,
  319. ipmi_monitoring_sensor_iterator_next,
  320. ipmi_monitoring_ctx_sensor_config_file,
  321. ipmi_monitoring_ctx_sdr_cache_directory,
  322. ipmi_monitoring_ctx_errormsg,
  323. ipmi_monitoring_ctx_create
  324. ],
  325. [AC_CHECK_HEADER(
  326. [ipmi_monitoring.h],
  327. [AC_CHECK_HEADER(
  328. [ipmi_monitoring_bitmasks.h],
  329. [have_ipmimonitoring=yes],
  330. [have_ipmimonitoring=no]
  331. )],
  332. [have_ipmimonitoring=no]
  333. )],
  334. [have_ipmimonitoring=no]
  335. )],
  336. [have_ipmimonitoring=no]
  337. )
  338. test "${enable_plugin_freeipmi}" = "yes" -a "${have_ipmimonitoring}" != "yes" && \
  339. AC_MSG_ERROR([ipmimonitoring required but not found. Try installing 'libipmimonitoring-dev' or 'libipmimonitoring-devel'])
  340. AC_MSG_CHECKING([if freeipmi.plugin should be enabled])
  341. if test "${enable_plugin_freeipmi}" != "no" -a "${have_ipmimonitoring}" = "yes"; then
  342. enable_plugin_freeipmi="yes"
  343. AC_DEFINE([HAVE_FREEIPMI], [1], [ipmimonitoring usability])
  344. OPTIONAL_IPMIMONITORING_CLFAGS="${IPMIMONITORING_CFLAGS}"
  345. OPTIONAL_IPMIMONITORING_LIBS="${IPMIMONITORING_LIBS}"
  346. else
  347. enable_plugin_freeipmi="no"
  348. fi
  349. AC_MSG_RESULT([${enable_plugin_freeipmi}])
  350. AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "yes"])
  351. # -----------------------------------------------------------------------------
  352. # nfacct.plugin - libmnl, libnetfilter_acct
  353. AC_CHECK_HEADERS_ONCE([linux/netfilter/nfnetlink_conntrack.h])
  354. PKG_CHECK_MODULES(
  355. [NFACCT],
  356. [libnetfilter_acct],
  357. [have_libnetfilter_acct=yes],
  358. [have_libnetfilter_acct=no]
  359. )
  360. PKG_CHECK_MODULES(
  361. [LIBMNL],
  362. [libmnl],
  363. [have_libmnl=yes],
  364. [have_libmnl=no]
  365. )
  366. test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
  367. AC_MSG_ERROR([netfilter_acct required but not found])
  368. test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \
  369. AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
  370. AC_MSG_CHECKING([if nfacct.plugin should be enabled])
  371. if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" -a "${have_libmnl}" = "yes"; then
  372. enable_plugin_nfacct="yes"
  373. AC_DEFINE([HAVE_LIBMNL], [1], [libmnl usability])
  374. AC_DEFINE([HAVE_LIBNETFILTER_ACCT], [1], [libnetfilter_acct usability])
  375. AC_DEFINE([INTERNAL_PLUGIN_NFACCT], [1], [nfacct plugin usability])
  376. OPTIONAL_NFACCT_CLFAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}"
  377. OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}"
  378. else
  379. enable_plugin_nfacct="no"
  380. fi
  381. AC_MSG_RESULT([${enable_plugin_nfacct}])
  382. AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"])
  383. # -----------------------------------------------------------------------------
  384. # check for setns() - cgroup-network
  385. AC_CHECK_FUNC([setns])
  386. AC_MSG_CHECKING([if cgroup-network can be enabled])
  387. if test "$ac_cv_func_setns" = "yes" ; then
  388. have_setns="yes"
  389. AC_DEFINE([HAVE_SETNS], [1], [Define 1 if you have setns() function])
  390. else
  391. have_setns="no"
  392. fi
  393. AC_MSG_RESULT([${have_setns}])
  394. AM_CONDITIONAL([ENABLE_PLUGIN_CGROUP_NETWORK], [test "${have_setns}" = "yes"])
  395. # -----------------------------------------------------------------------------
  396. # Link-Time-Optimization
  397. if test "${enable_lto}" != "no"; then
  398. opt="-flto"
  399. AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no])
  400. fi
  401. if test "${have_lto}" = "yes"; then
  402. oCFLAGS="${CFLAGS}"
  403. CFLAGS="${CFLAGS} -flto ${OPTIONAL_MATH_CLFAGS} ${OPTIONAL_NFACCT_CLFAGS} ${OPTIONAL_ZLIB_CLFAGS} ${OPTIONAL_UUID_CLFAGS} ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS}"
  404. ac_cv_c_lto_cross_compile="${enable_lto}"
  405. test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no"
  406. AC_C_LTO
  407. CFLAGS="${oCFLAGS}"
  408. test "${ac_cv_c_lto}" != "yes" && have_lto="no"
  409. fi
  410. test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
  411. AC_MSG_ERROR([LTO is required but is not available.])
  412. AC_MSG_CHECKING([if LTO should be enabled])
  413. if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then
  414. enable_lto="yes"
  415. CFLAGS="${CFLAGS} -flto"
  416. else
  417. enable_lto="no"
  418. fi
  419. AC_MSG_RESULT([${enable_lto}])
  420. # -----------------------------------------------------------------------------
  421. AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged])
  422. varlibdir="${localstatedir}/lib/netdata"
  423. registrydir="${localstatedir}/lib/netdata/registry"
  424. cachedir="${localstatedir}/cache/netdata"
  425. chartsdir="${libexecdir}/netdata/charts.d"
  426. nodedir="${libexecdir}/netdata/node.d"
  427. pythondir="${libexecdir}/netdata/python.d"
  428. configdir="${sysconfdir}/netdata"
  429. libconfigdir="${libdir}/netdata/conf.d"
  430. logdir="${localstatedir}/log/netdata"
  431. pluginsdir="${libexecdir}/netdata/plugins.d"
  432. AC_SUBST([build_target])
  433. AC_SUBST([varlibdir])
  434. AC_SUBST([registrydir])
  435. AC_SUBST([cachedir])
  436. AC_SUBST([chartsdir])
  437. AC_SUBST([nodedir])
  438. AC_SUBST([pythondir])
  439. AC_SUBST([configdir])
  440. AC_SUBST([libconfigdir])
  441. AC_SUBST([logdir])
  442. AC_SUBST([pluginsdir])
  443. AC_SUBST([webdir])
  444. CPPFLAGS="\
  445. -DTARGET_OS=${build_target_id} \
  446. -DVARLIB_DIR=\"\\\"${varlibdir}\\\"\" \
  447. -DCACHE_DIR=\"\\\"${cachedir}\\\"\" \
  448. -DCONFIG_DIR=\"\\\"${configdir}\\\"\" \
  449. -DLIBCONFIG_DIR=\"\\\"${libconfigdir}\\\"\" \
  450. -DLOG_DIR=\"\\\"${logdir}\\\"\" \
  451. -DPLUGINS_DIR=\"\\\"${pluginsdir}\\\"\" \
  452. -DRUN_DIR=\"\\\"${localstatedir}/run/netdata\\\"\" \
  453. -DWEB_DIR=\"\\\"${webdir}\\\"\" \
  454. "
  455. AC_SUBST([OPTIONAL_MATH_CLFAGS])
  456. AC_SUBST([OPTIONAL_MATH_LIBS])
  457. AC_SUBST([OPTIONAL_NFACCT_CLFAGS])
  458. AC_SUBST([OPTIONAL_NFACCT_LIBS])
  459. AC_SUBST([OPTIONAL_ZLIB_CLFAGS])
  460. AC_SUBST([OPTIONAL_ZLIB_LIBS])
  461. AC_SUBST([OPTIONAL_UUID_CLFAGS])
  462. AC_SUBST([OPTIONAL_UUID_LIBS])
  463. AC_SUBST([OPTIONAL_LIBCAP_CFLAGS])
  464. AC_SUBST([OPTIONAL_LIBCAP_LIBS])
  465. AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS])
  466. AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS])
  467. AC_CONFIG_FILES([
  468. Makefile
  469. netdata.spec
  470. backends/graphite/Makefile
  471. backends/json/Makefile
  472. backends/Makefile
  473. backends/opentsdb/Makefile
  474. backends/prometheus/Makefile
  475. collectors/Makefile
  476. collectors/apps.plugin/Makefile
  477. collectors/cgroups.plugin/Makefile
  478. collectors/charts.d.plugin/Makefile
  479. collectors/checks.plugin/Makefile
  480. collectors/diskspace.plugin/Makefile
  481. collectors/fping.plugin/Makefile
  482. collectors/freebsd.plugin/Makefile
  483. collectors/freeipmi.plugin/Makefile
  484. collectors/idlejitter.plugin/Makefile
  485. collectors/macos.plugin/Makefile
  486. collectors/nfacct.plugin/Makefile
  487. collectors/node.d.plugin/Makefile
  488. collectors/plugins.d/Makefile
  489. collectors/proc.plugin/Makefile
  490. collectors/python.d.plugin/Makefile
  491. collectors/statsd.plugin/Makefile
  492. collectors/tc.plugin/Makefile
  493. contrib/Makefile
  494. daemon/Makefile
  495. database/Makefile
  496. diagrams/Makefile
  497. health/Makefile
  498. health/notifications/Makefile
  499. libnetdata/Makefile
  500. libnetdata/adaptive_resortable_list/Makefile
  501. libnetdata/avl/Makefile
  502. libnetdata/buffer/Makefile
  503. libnetdata/clocks/Makefile
  504. libnetdata/config/Makefile
  505. libnetdata/dictionary/Makefile
  506. libnetdata/eval/Makefile
  507. libnetdata/locks/Makefile
  508. libnetdata/log/Makefile
  509. libnetdata/popen/Makefile
  510. libnetdata/procfile/Makefile
  511. libnetdata/simple_pattern/Makefile
  512. libnetdata/socket/Makefile
  513. libnetdata/statistical/Makefile
  514. libnetdata/storage_number/Makefile
  515. libnetdata/threads/Makefile
  516. libnetdata/url/Makefile
  517. makeself/Makefile
  518. registry/Makefile
  519. streaming/Makefile
  520. system/Makefile
  521. tests/Makefile
  522. web/Makefile
  523. web/api/Makefile
  524. web/api/badges/Makefile
  525. web/api/exporters/Makefile
  526. web/api/exporters/shell/Makefile
  527. web/api/exporters/prometheus/Makefile
  528. web/api/formatters/Makefile
  529. web/api/formatters/csv/Makefile
  530. web/api/formatters/json/Makefile
  531. web/api/formatters/ssv/Makefile
  532. web/api/formatters/value/Makefile
  533. web/api/queries/Makefile
  534. web/api/queries/average/Makefile
  535. web/api/queries/des/Makefile
  536. web/api/queries/incremental_sum/Makefile
  537. web/api/queries/max/Makefile
  538. web/api/queries/median/Makefile
  539. web/api/queries/min/Makefile
  540. web/api/queries/ses/Makefile
  541. web/api/queries/stddev/Makefile
  542. web/api/queries/sum/Makefile
  543. web/gui/Makefile
  544. web/server/Makefile
  545. web/server/single/Makefile
  546. web/server/multi/Makefile
  547. web/server/static/Makefile
  548. ])
  549. AC_OUTPUT
  550. test "${with_math}" != "yes" && AC_MSG_WARN([You are building without math. math allows accurate calculations. It should be enabled.]) || :
  551. 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.]) || :