configure.ac 18 KB

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