blob: 7369b454a3011f1938517acdb56006f2e7fde6d2 [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)
32AC_CHECK_HEADER(
33 experimental/filesystem,
34 [],
35 [AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs developement package required])]
36)
37AC_CHECK_HEADER(
38 [host-ipmid],
39 [AC_MSG_ERROR(["phosphor-host-ipmid required and not found."])]
40)
Patrick Venture4d49ae62018-09-17 11:35:32 -070041
42# Checks for library functions.
43LT_INIT # Required for systemd linking
44
Patrick Venturef9a19b82018-09-18 10:03:24 -070045PKG_PROG_PKG_CONFIG
46AC_ARG_WITH([systemdsystemunitdir],
47 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
48 [with_systemdsystemunitdir=auto])
49AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
50 def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
51
52 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
53 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
54 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
55 with_systemdsystemunitdir=no],
56 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
57AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
58 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
59AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
60
Patrick Venture4d49ae62018-09-17 11:35:32 -070061# Create configured output
62AC_CONFIG_FILES([Makefile])
63AC_OUTPUT