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 |
| 18 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CFLAGS]) |
| 19 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CXXFLAGS]) |
| 20 | |
| 21 | # Checks for external dependencies |
| 22 | AC_CHECK_LIB([z], [gzopen], [], [AC_MSG_ERROR(zlib not found)]) |
| 23 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], , |
| 24 | AC_MSG_ERROR(["systemd required but not found."])) |
| 25 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], , |
| 26 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
| 27 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], , |
| 28 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 29 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 30 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 31 | AC_MSG_ERROR(["Requires sdbus++"])) |
| 32 | |
| 33 | # Configuration property: path to the ouput directory of log files |
| 34 | AC_ARG_VAR([LOG_OUTPUT_PATH], [Path used to store logs.]) |
| 35 | AS_IF([test "x$LOG_OUTPUT_PATH" == "x"], [LOG_OUTPUT_PATH="/var/lib/obmc/hostlogs"]) |
| 36 | AC_DEFINE_UNQUOTED([LOG_OUTPUT_PATH], ["$LOG_OUTPUT_PATH"]) |
| 37 | |
| 38 | # Configuration property: log storage limit (maximum number of messages to store) |
| 39 | AC_ARG_VAR([LOG_STORAGE_SIZE_LIMIT], [Limit number of messages in store, default is 3000]) |
| 40 | AS_IF([test "x$LOG_STORAGE_SIZE_LIMIT" == "x"], [LOG_STORAGE_SIZE_LIMIT=3000]) |
| 41 | AC_DEFINE_UNQUOTED([LOG_STORAGE_SIZE_LIMIT], [${LOG_STORAGE_SIZE_LIMIT}]) |
| 42 | |
| 43 | # Configuration property: log storage limit (oldest time in hours) |
| 44 | AC_ARG_VAR([LOG_STORAGE_TIME_LIMIT], [Limit message store by oldest time in hours, default is 0]) |
| 45 | AS_IF([test "x$LOG_STORAGE_TIME_LIMIT" == "x"], [LOG_STORAGE_TIME_LIMIT=0]) |
| 46 | AC_DEFINE_UNQUOTED([LOG_STORAGE_TIME_LIMIT], [${LOG_STORAGE_TIME_LIMIT}]) |
| 47 | |
| 48 | # Configuration property: flush period policy. |
| 49 | AC_ARG_VAR([LOG_FLUSH_PERIOD], [Set the default flush period time, default is 0]) |
| 50 | AS_IF([test "x$LOG_FLUSH_PERIOD" == "x"], [LOG_FLUSH_PERIOD=0]) |
| 51 | AC_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 |
| 54 | AC_ARG_VAR([LOG_ROTATION_LIMIT], [Limit for log rotation, default is 10]) |
| 55 | AS_IF([test "x$LOG_ROTATION_LIMIT" == "x"], [LOG_ROTATION_LIMIT=10]) |
| 56 | AC_DEFINE_UNQUOTED([LOG_ROTATION_LIMIT], [${LOG_ROTATION_LIMIT}]) |
| 57 | |
| 58 | # Debug property |
| 59 | AC_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 | |
| 65 | AC_CONFIG_FILES([Makefile]) |
| 66 | AC_OUTPUT |