blob: ff8e787c1f7a1a2388938d9247577cbd55009ace [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(
29 experimental/filesystem,
30 [],
31 [AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs developement package required])]
32)
33AC_CHECK_HEADER(
Patrick Venture575a55a2019-02-12 07:32:06 -080034 nlohmann/json.hpp,
35 [],
36 [AC_MSG_ERROR([Could not find nlohmann/json.hpp])]
37)
Patrick Venture4d49ae62018-09-17 11:35:32 -070038
39# Checks for library functions.
40LT_INIT # Required for systemd linking
41
Patrick Venturef9a19b82018-09-18 10:03:24 -070042PKG_PROG_PKG_CONFIG
43AC_ARG_WITH([systemdsystemunitdir],
44 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
45 [with_systemdsystemunitdir=auto])
46AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
47 def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
48
49 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
50 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
51 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
52 with_systemdsystemunitdir=no],
53 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
54AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
55 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
56AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
57
Patrick Venture4d49ae62018-09-17 11:35:32 -070058# Create configured output
59AC_CONFIG_FILES([Makefile])
60AC_OUTPUT