blob: caf360a1f8b3e9481edccb18f233b4b0d5043d63 [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
William A. Kennington IIIaf11f612018-11-06 15:41:31 -080018AX_CXX_COMPILE_STDCXX([17], [noext])
Artem Senichevefd5d742018-10-24 16:14:04 +030019AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CFLAGS])
20AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CXXFLAGS])
21
22# Checks for external dependencies
23AC_CHECK_LIB([z], [gzopen], [], [AC_MSG_ERROR(zlib not found)])
24PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], ,
25 AC_MSG_ERROR(["systemd required but not found."]))
26PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], ,
27 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
28PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,
29 AC_MSG_ERROR(["Requires sdbusplus package."]))
30AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
31AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
32 AC_MSG_ERROR(["Requires sdbus++"]))
33
34# Configuration property: path to the ouput directory of log files
35AC_ARG_VAR([LOG_OUTPUT_PATH], [Path used to store logs.])
36AS_IF([test "x$LOG_OUTPUT_PATH" == "x"], [LOG_OUTPUT_PATH="/var/lib/obmc/hostlogs"])
37AC_DEFINE_UNQUOTED([LOG_OUTPUT_PATH], ["$LOG_OUTPUT_PATH"])
38
39# Configuration property: log storage limit (maximum number of messages to store)
40AC_ARG_VAR([LOG_STORAGE_SIZE_LIMIT], [Limit number of messages in store, default is 3000])
41AS_IF([test "x$LOG_STORAGE_SIZE_LIMIT" == "x"], [LOG_STORAGE_SIZE_LIMIT=3000])
42AC_DEFINE_UNQUOTED([LOG_STORAGE_SIZE_LIMIT], [${LOG_STORAGE_SIZE_LIMIT}])
43
44# Configuration property: log storage limit (oldest time in hours)
45AC_ARG_VAR([LOG_STORAGE_TIME_LIMIT], [Limit message store by oldest time in hours, default is 0])
46AS_IF([test "x$LOG_STORAGE_TIME_LIMIT" == "x"], [LOG_STORAGE_TIME_LIMIT=0])
47AC_DEFINE_UNQUOTED([LOG_STORAGE_TIME_LIMIT], [${LOG_STORAGE_TIME_LIMIT}])
48
49# Configuration property: flush period policy.
50AC_ARG_VAR([LOG_FLUSH_PERIOD], [Set the default flush period time, default is 0])
51AS_IF([test "x$LOG_FLUSH_PERIOD" == "x"], [LOG_FLUSH_PERIOD=0])
52AC_DEFINE_UNQUOTED([LOG_FLUSH_PERIOD], [${LOG_FLUSH_PERIOD}])
53
54# Configuration property: limit for log rotation - maximum number of files to store in the log's directory
55AC_ARG_VAR([LOG_ROTATION_LIMIT], [Limit for log rotation, default is 10])
56AS_IF([test "x$LOG_ROTATION_LIMIT" == "x"], [LOG_ROTATION_LIMIT=10])
57AC_DEFINE_UNQUOTED([LOG_ROTATION_LIMIT], [${LOG_ROTATION_LIMIT}])
58
59# Debug property
60AC_ARG_ENABLE(debug,
61 [AS_HELP_STRING([--enable-debug], [enable debugging [disabled]])],
62 [AM_CPPFLAGS="$AM_CPPFLAGS -DDEBUG -g -O0"]
63 [AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"]
64)
65
66AC_CONFIG_FILES([Makefile])
67AC_OUTPUT