blob: 26e89569790ed2b054d69fa068dd42b2477ccad3 [file] [log] [blame]
Patrick Venture4d49ae62018-09-17 11:35:32 -07001# Initialization
2AC_PREREQ([2.69])
Patrick Venture23ef59b2018-11-26 09:15:35 -08003AC_INIT([sys-ipmi], [0.1], [https://www.github.com/google-ipmi-sys/issues])
Patrick Venture4d49ae62018-09-17 11:35:32 -07004AC_LANG([C++])
5AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CXX
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14
15# Checks for typedefs, structures, and compiler characteristics.
Patrick Venturec25a3df2018-09-17 12:11:19 -070016AX_CXX_COMPILE_STDCXX_17([noext])
Patrick Venture4d49ae62018-09-17 11:35:32 -070017AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
18
19# Checks for libraries.
Patrick Venturec6624652019-02-13 07:35:07 -080020PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
21PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
William A. Kennington III2c9e1622019-02-07 15:45:19 -080022PKG_CHECK_MODULES(
23 [LIBIPMID],
24 [libipmid],
25 [],
26 [AC_MSG_ERROR([Could not find libipmid...openbmc/phosphor-host-ipmid package required])]
27)
Patrick Venture3c7037a2018-11-21 21:40:50 -080028AC_CHECK_HEADER(
Patrick Venture575a55a2019-02-12 07:32:06 -080029 nlohmann/json.hpp,
30 [],
31 [AC_MSG_ERROR([Could not find nlohmann/json.hpp])]
32)
Patrick Venture4d49ae62018-09-17 11:35:32 -070033
34# Checks for library functions.
35LT_INIT # Required for systemd linking
36
Patrick Venturef9a19b82018-09-18 10:03:24 -070037PKG_PROG_PKG_CONFIG
38AC_ARG_WITH([systemdsystemunitdir],
39 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
40 [with_systemdsystemunitdir=auto])
41AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
42 def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
43
44 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
45 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
46 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
47 with_systemdsystemunitdir=no],
48 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
49AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
50 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
51AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
52
Patrick Venture4d49ae62018-09-17 11:35:32 -070053# Create configured output
54AC_CONFIG_FILES([Makefile])
55AC_OUTPUT