blob: 690c2a1b46f11b05258c03a0aa8a3c5824e12890 [file] [log] [blame]
Artem Senichevefd5d742018-10-24 16:14:04 +03001AC_PREREQ([2.69])
2AC_INIT([phosphor-hostlogger],
3 [m4_esyscmd_s([git describe --always --dirty --long])],
4 [https://github.com/YADRO-KNS/phosphor-hostlogger], ,
5 [https://github.com/YADRO-KNS/phosphor-hostlogger])
6AC_LANG([C++])
7AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign])
8AM_SILENT_RULES([yes])
9
10# Check for programs
11AC_PROG_CXX
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14AC_PROG_MKDIR_P
15AC_HEADER_STDC
16
17# Compiler flags
18AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CFLAGS])
19AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CXXFLAGS])
20
21# Checks for external dependencies
22AC_CHECK_LIB([z], [gzopen], [], [AC_MSG_ERROR(zlib not found)])
23PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], ,
24 AC_MSG_ERROR(["systemd required but not found."]))
25PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], ,
26 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
27PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,
28 AC_MSG_ERROR(["Requires sdbusplus package."]))
29AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
30AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
31 AC_MSG_ERROR(["Requires sdbus++"]))
32
33# Configuration property: path to the ouput directory of log files
34AC_ARG_VAR([LOG_OUTPUT_PATH], [Path used to store logs.])
35AS_IF([test "x$LOG_OUTPUT_PATH" == "x"], [LOG_OUTPUT_PATH="/var/lib/obmc/hostlogs"])
36AC_DEFINE_UNQUOTED([LOG_OUTPUT_PATH], ["$LOG_OUTPUT_PATH"])
37
38# Configuration property: log storage limit (maximum number of messages to store)
39AC_ARG_VAR([LOG_STORAGE_SIZE_LIMIT], [Limit number of messages in store, default is 3000])
40AS_IF([test "x$LOG_STORAGE_SIZE_LIMIT" == "x"], [LOG_STORAGE_SIZE_LIMIT=3000])
41AC_DEFINE_UNQUOTED([LOG_STORAGE_SIZE_LIMIT], [${LOG_STORAGE_SIZE_LIMIT}])
42
43# Configuration property: log storage limit (oldest time in hours)
44AC_ARG_VAR([LOG_STORAGE_TIME_LIMIT], [Limit message store by oldest time in hours, default is 0])
45AS_IF([test "x$LOG_STORAGE_TIME_LIMIT" == "x"], [LOG_STORAGE_TIME_LIMIT=0])
46AC_DEFINE_UNQUOTED([LOG_STORAGE_TIME_LIMIT], [${LOG_STORAGE_TIME_LIMIT}])
47
48# Configuration property: flush period policy.
49AC_ARG_VAR([LOG_FLUSH_PERIOD], [Set the default flush period time, default is 0])
50AS_IF([test "x$LOG_FLUSH_PERIOD" == "x"], [LOG_FLUSH_PERIOD=0])
51AC_DEFINE_UNQUOTED([LOG_FLUSH_PERIOD], [${LOG_FLUSH_PERIOD}])
52
53# Configuration property: limit for log rotation - maximum number of files to store in the log's directory
54AC_ARG_VAR([LOG_ROTATION_LIMIT], [Limit for log rotation, default is 10])
55AS_IF([test "x$LOG_ROTATION_LIMIT" == "x"], [LOG_ROTATION_LIMIT=10])
56AC_DEFINE_UNQUOTED([LOG_ROTATION_LIMIT], [${LOG_ROTATION_LIMIT}])
57
58# Debug property
59AC_ARG_ENABLE(debug,
60 [AS_HELP_STRING([--enable-debug], [enable debugging [disabled]])],
61 [AM_CPPFLAGS="$AM_CPPFLAGS -DDEBUG -g -O0"]
62 [AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"]
63)
64
65AC_CONFIG_FILES([Makefile])
66AC_OUTPUT