blob: 47931f2520b9ecbd40f0f467fbbc90eb0c6c5ca2 [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 Venture3c7037a2018-11-21 21:40:50 -080020PKG_CHECK_MODULES(
21 [SDBUSPLUS],
22 [sdbusplus],
23 [],
24 [AC_MSG_ERROR([The openbmc/sdbusplus package is required])]
25)
26PKG_CHECK_MODULES(
27 [PHOSPHOR_LOGGING],
28 [phosphor-logging],
29 [],
30 [AC_MSG_ERROR([The openbmc/phosphor-logging package is required])]
31)
William A. Kennington III2c9e1622019-02-07 15:45:19 -080032PKG_CHECK_MODULES(
33 [LIBIPMID],
34 [libipmid],
35 [],
36 [AC_MSG_ERROR([Could not find libipmid...openbmc/phosphor-host-ipmid package required])]
37)
Patrick Venture3c7037a2018-11-21 21:40:50 -080038AC_CHECK_HEADER(
39 experimental/filesystem,
40 [],
41 [AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs developement package required])]
42)
43AC_CHECK_HEADER(
Patrick Venture575a55a2019-02-12 07:32:06 -080044 nlohmann/json.hpp,
45 [],
46 [AC_MSG_ERROR([Could not find nlohmann/json.hpp])]
47)
Patrick Venture4d49ae62018-09-17 11:35:32 -070048
49# Checks for library functions.
50LT_INIT # Required for systemd linking
51
Patrick Venturef9a19b82018-09-18 10:03:24 -070052PKG_PROG_PKG_CONFIG
53AC_ARG_WITH([systemdsystemunitdir],
54 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
55 [with_systemdsystemunitdir=auto])
56AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
57 def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
58
59 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
60 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
61 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
62 with_systemdsystemunitdir=no],
63 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
64AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
65 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
66AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
67
Patrick Venture4d49ae62018-09-17 11:35:32 -070068# Create configured output
69AC_CONFIG_FILES([Makefile])
70AC_OUTPUT