Artem Senichev | efd5d74 | 2018-10-24 16:14:04 +0300 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | AC_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]) |
| 6 | AC_LANG([C++]) |
| 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign]) |
| 8 | AM_SILENT_RULES([yes]) |
| 9 | |
| 10 | # Check for programs |
| 11 | AC_PROG_CXX |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_MKDIR_P |
| 15 | AC_HEADER_STDC |
| 16 | |
| 17 | # Compiler flags |
William A. Kennington III | af11f61 | 2018-11-06 15:41:31 -0800 | [diff] [blame^] | 18 | AX_CXX_COMPILE_STDCXX([17], [noext]) |
Artem Senichev | efd5d74 | 2018-10-24 16:14:04 +0300 | [diff] [blame] | 19 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CFLAGS]) |
| 20 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CXXFLAGS]) |
| 21 | |
| 22 | # Checks for external dependencies |
| 23 | AC_CHECK_LIB([z], [gzopen], [], [AC_MSG_ERROR(zlib not found)]) |
| 24 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], , |
| 25 | AC_MSG_ERROR(["systemd required but not found."])) |
| 26 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], , |
| 27 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
| 28 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], , |
| 29 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 30 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 31 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 32 | AC_MSG_ERROR(["Requires sdbus++"])) |
| 33 | |
| 34 | # Configuration property: path to the ouput directory of log files |
| 35 | AC_ARG_VAR([LOG_OUTPUT_PATH], [Path used to store logs.]) |
| 36 | AS_IF([test "x$LOG_OUTPUT_PATH" == "x"], [LOG_OUTPUT_PATH="/var/lib/obmc/hostlogs"]) |
| 37 | AC_DEFINE_UNQUOTED([LOG_OUTPUT_PATH], ["$LOG_OUTPUT_PATH"]) |
| 38 | |
| 39 | # Configuration property: log storage limit (maximum number of messages to store) |
| 40 | AC_ARG_VAR([LOG_STORAGE_SIZE_LIMIT], [Limit number of messages in store, default is 3000]) |
| 41 | AS_IF([test "x$LOG_STORAGE_SIZE_LIMIT" == "x"], [LOG_STORAGE_SIZE_LIMIT=3000]) |
| 42 | AC_DEFINE_UNQUOTED([LOG_STORAGE_SIZE_LIMIT], [${LOG_STORAGE_SIZE_LIMIT}]) |
| 43 | |
| 44 | # Configuration property: log storage limit (oldest time in hours) |
| 45 | AC_ARG_VAR([LOG_STORAGE_TIME_LIMIT], [Limit message store by oldest time in hours, default is 0]) |
| 46 | AS_IF([test "x$LOG_STORAGE_TIME_LIMIT" == "x"], [LOG_STORAGE_TIME_LIMIT=0]) |
| 47 | AC_DEFINE_UNQUOTED([LOG_STORAGE_TIME_LIMIT], [${LOG_STORAGE_TIME_LIMIT}]) |
| 48 | |
| 49 | # Configuration property: flush period policy. |
| 50 | AC_ARG_VAR([LOG_FLUSH_PERIOD], [Set the default flush period time, default is 0]) |
| 51 | AS_IF([test "x$LOG_FLUSH_PERIOD" == "x"], [LOG_FLUSH_PERIOD=0]) |
| 52 | AC_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 |
| 55 | AC_ARG_VAR([LOG_ROTATION_LIMIT], [Limit for log rotation, default is 10]) |
| 56 | AS_IF([test "x$LOG_ROTATION_LIMIT" == "x"], [LOG_ROTATION_LIMIT=10]) |
| 57 | AC_DEFINE_UNQUOTED([LOG_ROTATION_LIMIT], [${LOG_ROTATION_LIMIT}]) |
| 58 | |
| 59 | # Debug property |
| 60 | AC_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 | |
| 66 | AC_CONFIG_FILES([Makefile]) |
| 67 | AC_OUTPUT |