blob: 6e4aa162e0a3333e04f2cc663d35d718127b0c25 [file] [log] [blame]
Patrick Venture4d49ae62018-09-17 11:35:32 -07001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([sys-ipmi], [1.0], [https://www.github.com/google-ipmi-sys/issues])
4AC_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 Venture4d49ae62018-09-17 11:35:32 -070020PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,[AC_MSG_ERROR([The openbmc/sdbusplus package is required])])
21PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], ,[AC_MSG_ERROR([The openbmc/phosphor-logging package is required])])
Patrick Ventureef450052018-09-21 14:50:47 -070022AC_CHECK_HEADER(experimental/filesystem, ,[AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs developement package required])])
Patrick Venture4d49ae62018-09-17 11:35:32 -070023AC_CHECK_HEADER([host-ipmid], [AC_MSG_ERROR(["phosphor-host-ipmid required and not found."])])
24
25# Checks for library functions.
26LT_INIT # Required for systemd linking
27
Patrick Venturef9a19b82018-09-18 10:03:24 -070028PKG_PROG_PKG_CONFIG
29AC_ARG_WITH([systemdsystemunitdir],
30 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
31 [with_systemdsystemunitdir=auto])
32AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
33 def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
34
35 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
36 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
37 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
38 with_systemdsystemunitdir=no],
39 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
40AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
41 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
42AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
43
Patrick Venture4d49ae62018-09-17 11:35:32 -070044# Create configured output
45AC_CONFIG_FILES([Makefile])
46AC_OUTPUT