blob: 3423f65fc8de7fe6d439a1d89f6af11252db6ade [file] [log] [blame]
Jayanth Othayoth224882b2017-05-04 05:46:45 -05001AC_PREREQ([2.69])
2AC_INIT([phosphor-debug-collector], [1.0], [https://github.com/openbmc/phosphor-debug-collector/issues])
3AC_LANG([C++])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
7
8# Checks for programs
9AC_PROG_CXX
10AC_PROG_INSTALL #Checks/sets the install variable to be used
11AC_PROG_MAKE_SET
Jayanth Othayoth23ebc262017-05-25 07:22:03 -050012AC_PROG_MKDIR_P
13AC_CHECK_PROG([DIRNAME], dirname, dirname)
Jayanth Othayoth224882b2017-05-04 05:46:45 -050014
15# Check for libraries
Jayanth Othayoth1756c062017-05-23 22:48:11 -050016PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221],,\
17 AC_MSG_ERROR(["systemd required and not found."]))
Jayanth Othayoth224882b2017-05-04 05:46:45 -050018PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
19 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
Jayanth Othayoth23ebc262017-05-25 07:22:03 -050020PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
Jayanth Othayoth224882b2017-05-04 05:46:45 -050021 AC_MSG_ERROR(["Requires sdbusplus package."]))
Jayanth Othayoth1756c062017-05-23 22:48:11 -050022PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
23 AC_MSG_ERROR(["Requires phosphor-logging package."]))
24
25# Check for sdbus++
26AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
27AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
28 AC_MSG_ERROR(["Requires sdbus++"]))
Jayanth Othayoth224882b2017-05-04 05:46:45 -050029
Jayanth Othayoth23ebc262017-05-25 07:22:03 -050030# Check for sdbus++
31AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
32AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
33 AC_MSG_ERROR(["Requires sdbus++"]))
34
Jayanth Othayoth224882b2017-05-04 05:46:45 -050035# Checks for library functions
36LT_INIT # Required for systemd linking
37
38# Checks for typedefs, structures, and compiler characteristics.
39AX_CXX_COMPILE_STDCXX_14([noext])
40AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
41
42AC_ARG_VAR(DUMP_BUSNAME, [The Dbus busname to own])
Jayanth Othayoth065afc22017-06-12 11:54:14 -050043AS_IF([test "x$DUMP_BUSNAME" == "x"], [DUMP_BUSNAME="xyz.openbmc_project.Dump.Manager"])
Jayanth Othayoth224882b2017-05-04 05:46:45 -050044AC_DEFINE_UNQUOTED([DUMP_BUSNAME], ["$DUMP_BUSNAME"], [The DBus busname to own])
45
46AC_ARG_VAR(DUMP_OBJPATH, [The Dump manager Dbus root])
47AS_IF([test "x$DUMP_OBJPATH" == "x"], [DUMP_OBJPATH="/xyz/openbmc_project/dump"])
48AC_DEFINE_UNQUOTED([DUMP_OBJPATH], ["$DUMP_OBJPATH"], [The dump manager Dbus root])
49
Jayanth Othayoth1756c062017-05-23 22:48:11 -050050AC_ARG_VAR(CORE_FILE_DIR, [Directory where core dumps are placed])
51AS_IF([test "x$CORE_FILE_DIR" == "x"], [CORE_FILE_DIR="/var/lib/systemd/coredump"])
52AC_DEFINE_UNQUOTED([CORE_FILE_DIR], ["$CORE_FILE_DIR"], [Directory where core dumps are placed])
53
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050054AC_ARG_VAR(OBJ_INTERNAL, [Internal Dump manager Dbus object path])
55AS_IF([test "x$OBJ_INTERNAL" == "x"], [OBJ_INTERNAL="/xyz/openbmc_project/dump/internal/manager"])
56AC_DEFINE_UNQUOTED([OBJ_INTERNAL], ["$OBJ_INTERNAL"], [Internal Dump manager Dbus object path])
57
58AC_ARG_VAR(OBJ_ENTRY, [The dump entry DBus object path.])
59AS_IF([test "x$OBJ_ENTRY" == "x"], [OBJ_ENTRY="/xyz/openbmc_project/dump/entry"])
60AC_DEFINE_UNQUOTED([OBJ_ENTRY], ["$OBJ_ENTRY"], [The dump entry DBus object path])
61
Jayanth Othayoth2dccfe42017-07-12 18:20:40 -050062AC_ARG_VAR(BMC_DUMP_PATH, [Directory where bmc dumps are placed])
Jayanth Othayothd7b95d52017-08-26 03:13:37 -050063AS_IF([test "x$BMC_DUMP_PATH" == "x"], [BMC_DUMP_PATH="/var/lib/phosphor-debug-collector/dumps/"])
Jayanth Othayoth2dccfe42017-07-12 18:20:40 -050064AC_DEFINE_UNQUOTED([BMC_DUMP_PATH], ["$BMC_DUMP_PATH"], [Directory where bmc dumps are placed])
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050065
Jayanth Othayothab7f9202017-08-02 06:24:58 -050066AC_ARG_VAR(BMC_DUMP_MAX_SIZE, [Maximum size of one bmc dump in kilo bytes])
67AS_IF([test x$BMC_DUMP_MAX_SIZE == x], [BMC_DUMP_MAX_SIZE=200])
68AC_DEFINE_UNQUOTED([BMC_DUMP_MAX_SIZE], [$BMC_DUMP_MAX_SIZE], [Maximum size of one bmc dump in kilo bytes])
69
Jayanth Othayoth104f57c2017-08-09 06:19:32 -050070AC_ARG_VAR(BMC_DUMP_MIN_SPACE_REQD, [Minimum space required for one bmc dump in kilo bytes])
71AS_IF([test x$BMC_DUMP_MIN_SPACE_REQD == x], [BMC_DUMP_MIN_SPACE_REQD=20])
72AC_DEFINE_UNQUOTED([BMC_DUMP_MIN_SPACE_REQD], [$BMC_DUMP_MIN_SPACE_REQD], [Minimum space required for one bmc dump in kilo bytes])
73
Jayanth Othayothab7f9202017-08-02 06:24:58 -050074AC_ARG_VAR(BMC_DUMP_TOTAL_SIZE, [Total size of the bmc dump in kilo bytes])
75AS_IF([test x$BMC_DUMP_TOTAL_SIZE == x], [BMC_DUMP_TOTAL_SIZE=1024])
76AC_DEFINE_UNQUOTED([BMC_DUMP_TOTAL_SIZE], [$BMC_DUMP_TOTAL_SIZE], [Total size of the dump in kilo bytes])
77
Jayanth Othayoth224882b2017-05-04 05:46:45 -050078AC_CONFIG_FILES([Makefile])
79AC_OUTPUT